When I was playing csdn a while ago, I thought it was amazing to add QQ and Weibo to the web page. After learning brisket, I have begun my true journey of learning B/S.
At the beginning, I didn’t know what
Overall, CSS includes a variety of style attributes for controlling fonts, colors, alignment and margins. These are just some aspects of web page style
. CSS style properties are divided into two categories.
Layout attributes: It consists of attributes that affect the position of elements on the web page (such as margins, padding, etc.).
Formatting attributes, consisting of attributes that affect the visual display of elements in the website (such as font type, size, color, etc.).
Cascading of CSS
Cascading in a css style sheet represents the way the style sheet rules are applied to the elements of the HTML document , that is, the styles in the CSS style sheet form a hierarchical structure, and more specific styles cover general styles. The priority of style rules is determined by the hierarchical structure of CSS to achieve the leveling effect. It can also be seen as a relationship similar to inheritance, where the subclass inherits the characteristics of the parent class. Basic style rules apply to the entire stylesheet, but can be overridden by more specific style rules.
Let’s take a look at a simple example. Can you guess the color of the text below?
<span style="font-family:KaiTi_GB2312;font-size:18px;"><div style="color:green"> this text is green. <p style="color:blue"> this text is blue.</p> <p> this text is stil green.</p></div></span>
Therefore, the
tag is a child of the
in
. However, the first
tag overrides the color style, changing it to blue. The final result is that the first text is blue, and the second text is green.
DIV CSS
. These blocks are used to place elements that are not connected to the Internet. This introduces the "box model" where every element in HTML is considered a "box", whether the element is a paragraph,
It is for data, not for laying out web pages.
The display of the page is extremely disadvantageous, because a table will not be displayed until it is completely read. It takes time to read a large table
very slowly, users usually tell you "Don't make me wait".
The biggest advantage of DIV CSS layout is the changeability of web page layout. If you want to change the web page layout one day, you only need to change your CSS file
, and there is no need to re-compile a web page layout with large tables and nested tables as before.
The above is some understanding of HTML content. BS is just getting started.