tags: HTML\CSS



/ / Contain a set of statements contained in braces called a declaration block
// The declaration block has a selector
// Selector and declaration block constitute a rule set
body {
// Each line is called a statement. Composed of attributes and values
color: black;
font-family: Helvetica;
}
// In HTML, HREF is an attribute of a label
<a href = "/">
!importantThe highest priority)<h1>Until<h6>) And paragraphs (<p>Add up and downward margins, for list (<ol>with<ul>Add the inner margins of the left side, add a color to the link, set various default fonts for the element.

!importantHowever, if the inline style is also marked as!importantIt is not possible to overwrite it. It is best just in the style sheet!important。
Priority accurate rules:
input[type="text"]
{
width:150px;
display:block;
margin-bottom:10px;
background-color:yellow;
font-family: Verdana, Arial;
}
input[type="button"]
{
width:120px;
margin-left:35px;
display:block;
font-family: Verdana, Arial;
}
Priority tag:

Thoughts on priority:
How to override the selector that contains an ID selector, a tag selector?【#main-nav a】
!important!importantIt will bring more!important。ImproveFor class selectors:
reduceFor class selectors: will#main-navChange to.nav





Element spacing in the container Add two social buttons to the sidebar Set the size, font, and color of the sidebar buttons At this time, they are stacked directly on top of each other without margins...
4.3 Unexpected "floating trap" The third box appeared on the right, causing a very large blank space under the first box. This is because the browser will place the floating element as high ...
5.1 Principles of Flexbox Add to the elementdisplay:flex, The element becomes aFlexible container(Flex container), its direct child element becomesElastic sub-element(flex item) The height of the elas...
Custom attributes Declare a variable, assign a value to it, and then refer to this value elsewhere in the style sheet, which can reduce duplication in the style sheet example: Define a custom attribut...
If an attribute of an element does not have a cascading value, it may inherit the value of an ancestor element Properties that can be inherited Text-related attributes color, font, font-family, font-s...
2.3 Stop pixel thinking Inverse mode: global reset font-size is 10px (from the default font size 16px to 10px, easy to calculate the value of the REM) Disadvantages: Need to write a lot of repetition ...
Some records: 2.2 Disk IO working mechanism You can compare the reference:Five IO models (detailed explanation + image example explanation) 2.2.1 Several ways to access files 1. Standard file access m...
As a front-end still can't find a working chicken, decided to learn CSS well, so I took this CSS in Depth to read it, and recorded the notes to supervise myself, but the English looks really uncomfort...
Chapter One 1. The difference between declarations and definitions Statement multiple times, only once defined, allocated memory is defined at the same time. 2.static Modifying variables: Static globa...
4.1 The original intention of floating design Floating can pull an element (usually an image) to the side of the container so that the document flow can surround it. If multiple elements float to the ...