Get the App
SLTechnology News&Howtos  ›  Development  › 

Do not leave a space between attribute values and units in css

Shulou Source: shulou.com Published: 2022-06-01 10:29:14 10月02日 Update

This article mainly introduces that there is no space between the attribute value and the unit in css. The introduction in this article is very detailed and has certain reference value. Interested friends must read it!

Do not leave a space between the attribute value and the cell. If you use "margin-left: 20px" instead of "margin-left: 20px", it only works in IE 6, but it doesn't work in Mozilla/Firefox or Netscape.

Internal pattern table

When a single document requires a special pattern, an external pattern table should be used. You can use tags to define internal pattern tables in the head of the document, like what:

Hr {color: sienna;} p {margin-left: 20px;} body {background-image: url ("images/back40.gif");} inline style

Inline fancy can damage many of the advantages of getting fancy tables because of the need to combine exposure with content. Use this method with caution, for example, when the trick needs to be applied only once to one element.

To use the inline format, you need to use the style attribute within the relevant tag. The Style attribute can include any CSS attribute. This example shows how to change the hue and left margin of a paragraph:

This is a paragraph

The above is all the contents of the article "Don't leave spaces between attribute values and units in css". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Attributes between spaces content patterns units documents tags articles valid special important value elements interests individual unit head boy buddy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Apple MySQL MariaDB Microsoft