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

Example Analysis of the Application of individual attributes in Css

2025-03-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you the application of individual attributes of Css example analysis, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!

Inheritance of CSS

The CSS inner element inherits the style of the outer element, and the style of multiple outer elements is superimposed on the inner element. Element is the largest tag in a web page, and the styles in it will be inherited by other child elements.

Which CSS properties are inherited: color, font-size, font-weight, font-style, line-height, text-indent, letter-spacing, word-spacing, text-align, etc.

CSS background Properties

Background-color: background color

Background-image: background image, for example: background-image:url (images/bg.gif)

Background-repeat: background tiling. Values: no-repeat (not tiled), repeat (tiling), repeat-x (x direction), repeat-y (y direction)

Background-position: background positioning, value: fixed value or percentage

Format: background-position: horizontal and vertical

Locate with a fixed value: background-position:100px 0px; / / distance left 100px, distance above 0px

Use the percentage to locate: background-position:50% 50%; / / Center horizontally and vertically

Use the word to locate: background-postion:left | center | right top | center | one of the three values of bottom;

Background-attachment: additional information. Value: scroll (scrolling), fixed (fixed)

Abbreviated form: background:url (images/bg.gif) repeat-x 100px 0px; / / multiple attribute values are separated by "spaces"

3.CSS floating and clearing

Float: element float. Value: left or right.

Clear: clear floats. Value: left or right or both

The CSS floating element will float from left to right

Floating can be called "gone with the Wind"

Floating element until it encounters the border of the parent element or the border of the previous floating element

A floating element is a block element box, no matter what element it used to be (inline element)

Floating elements no longer take up space, break away from the normal document stream, and are at a higher level than ordinary elements.

Clear float

When the floating property is cleared, other elements after clearing the element will revert to the default typesetting

When the floating feature is cleared, the surrounding element visually seems to surround the floating element

4.CSS Border Properties

Border: set the properties of four borders at the same time

Border-left: setting the properties of the left border

Border-right: setting the properties of the right border

Border-top: setting the properties of the top border

Border-bottom: setting the properties of the bottom border

Format: border-bottom: thick and thin linetype color

For example: the bottom line of border-bottom:2px solid # FF0000; / / element is the thick solid line of 2px, and the color is red

Linetype values: none (borderless), solid (solid), dashed (dashed), dotted (dotted), double (double)

The above is all the contents of the article "sample Analysis of individual attribute applications of Css". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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