Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the main rules of css abbreviation

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces what are the main rules of css abbreviation. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

The main rules for css abbreviations are as follows:

Color

A hexadecimal color value that can be abbreviated by half if every two bits are the same, for example:

# 000000 can be abbreviated to # 000 position 336699 or abbreviated to # 369

Note: do not interlace full and abbreviated color configurations in the same CSS configuration section, which will cause browser rendering to fail when system resources are extremely low.

Box size

There are usually four ways to write:

Property:value1; means that all edges are one value value1

Property:value1 value2; indicates that the values of top and bottom are value1,right and left are value2

Property:value1 value2 value3; indicates that the value of top is value1,right and the value of left is value2,bottom. The value is value3.

The four values of property:value1 value2 value3 value4; represent top,right,bottom,left in turn.

The convenient way to remember is clockwise, up, right, down, and left. Examples of specific applications in margin and padding are as follows:

Margin:1em 0 2em 0.5em

Border (border)

The properties of the border are as follows:

Border-width:1px

Border-style:solid

Border-color:#000

Can be abbreviated to one sentence: border:1px solid # 000000

The syntax is border:width style color

Background (Backgrounds)

The properties of the background are as follows:

Background-color:#f00

Background-image:url (background.gif)

Background-repeat:no-repeat

Background-attachment:fixed

Background-position:0 0

It can be abbreviated to one sentence: background:#f00 url (background.gif) no-repeat fixed 00

The syntax is background:color image repeat attachment position

You can omit one or more of the property values. If omitted, the property value will use the browser default value, which is:

Color: transparent

Image: none

Repeat: repeat

Attachment: scroll

Position: 0%

Font (fonts)

The properties of the font are as follows:

Font-style:italic

Font-variant:small-caps

Font-weight:bold

Font-size:1em

Line-height:140%

Font-family: "Lucida Grande", sans-serif

It can be abbreviated to one sentence: font:italic small-caps bold 1emcompany140% "Lucida Grande", sans-serif

Note that if you abbreviate the font definition, you should define at least two values, font-size and font-family.

List (lists)

Cancel the default dot and sequence number to write list-style:none like this

The attributes of list are:

List-style-type:square

List-style-position:inside

List-style-image:url (image.gif)

Can be abbreviated to one sentence: list-style:square inside url (image.gif)

These are all the contents of the article "what are the main rules of css abbreviations". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report