Yahoo Web Search

Search results

  1. Top results related to border:none; padding:0;

  2. May 8, 2015 · Use common sense instead of !important. Simply placing the rule after the body... rule is sufficient. While !important will work, it's better to be a bit more specific (if possible) in your class definition. body ul will be enough in this case. !important should be avoided when possible.

    Code sample

    ul{
      padding: 10px !important;
    }
    • Overview
    • Mappings for margins, borders, and padding
    • Margin examples
    • Padding examples
    • Border examples
    • Indicating logical values for the 4-value shorthand syntax

    The Logical Properties and Values specification defines flow-relative mappings for the various margin, border, and padding properties and their shorthands. In this guide, we take a look at these.

    If you have looked at the main page for the CSS logical properties and values module, you will see there are a huge number of properties listed. This is mostly because there are four longhand values each for margin, border, and padding side, plus all the shorthand values.

    The specification details mappings for each logical value to a physical counterpart. In the table below I have given these mapped values assuming that the writing-mode in use is horizontal-tb — with a left to right direction. The inline direction therefore runs horizontally — left to right — and margin-inline-start would be equivalent to margin-left.

    If you were using a horizontal-tb writing mode with a right-to-left text direction then margin-inline-start would be the same as margin-right, and in a vertical writing mode it would be the same as using margin-top.

    The mapped margin properties of margin-inline-start, margin-inline-end, margin-block-start, and margin-inline-end can be used instead of their physical counterparts.

    In the example below I have created two boxes and added different sized margins to each edge. I have added an extra container with a border to make the margin more obvious to see.

    One box uses physical properties and the other logical properties. Try changing the direction property to rtl to cause the boxes to display in a right-to-left direction, the margins on the first box will stay in the same place, while the margins on the inline dimension of the second box will switch.

    You can also try changing the writing-mode from horizontal-tb to vertical-rl. Again, notice how the margins stay in the same place for the first box, but switch around to follow the text direction in the second.

    The mapped padding properties of padding-inline-start, padding-inline-end, padding-block-start, and padding-inline-end can be used instead of their physical counterparts.

    In the example below I have two boxes, one of which is using physical padding properties and the other logical padding properties. With a writing-mode of horizontal-tb, both boxes should appear the same.

    Try changing the direction property to rtl to cause the boxes to display in a right-to-left direction. The padding on the first box will stay in the same place, whereas the padding on the inline dimension of the second box will switch.

    You can also try changing the writing-mode from horizontal-tb to vertical-rl. Again, notice how the padding stays in the same place for the first box, but switches around to follow the text direction in the second.

    The border properties are the main reason that Logical Properties and Values seems to have so many properties, as we have the longhands for the color, width, and style of the border on each side of a box, along with the shorthand to set all three at once for each side. As with margin and padding we have a mapped version of each physical property.

    The demo below uses some longhands and three shorthand values. As with the other demos try changing the direction property to rtl to cause the boxes to display in a right-to-left direction, or changing the writing-mode from horizontal-tb to vertical-rl.

    The specification makes a suggestion for the four-value shorthands such as the margin property, however the final decision on how this should be indicated is as yet unresolved, and is discussed in this issue.

    Using any four-value shorthand such as margin, padding, or border will currently use the physical versions, so if following the flow of the document is important, use the longhand properties for the time being.

  3. Jul 20, 2020 · The padding property is a style we commonly give to buttons or containers. For example many "box containers" in websites use paddings so that the contents (text, images) are not stuck to the top or sides of the container and also have some breathing room from the container "walls".

  4. Sep 30, 2007 · margin: 0; padding: 0; } This is part of the “CSS Reset” theory which helps keep your designs consistent across browsers, a very good thing. This technique works on all browsers, so I never really considered any negatives. That is, until I read this post by Christian Montoya who points out:

  5. Jul 10, 2007 · Reset all Margins & Padding. margin: 0; padding: 0; This has become a very popular technique lately, and for good reason. It removes all default margin and padding for every object on the page, no holds barred, regardless of browser.

  6. May 9, 2024 · For basic border removal, border: none or border: 0 are the best options. Employ box-sizing: border-box when you need precise control over element dimensions with padding and borders. Avoid overflow: hidden for border removal due to potential issues.

  7. People also ask

  8. Dec 9, 2023 · Border. The border wraps the content and padding. It can be styled in various ways using CSS properties, including border-style, border-width, and border-color. The border's width is added to the...