The inline element produces a margin effect when the horizontal direction is set padding-left、padding-right、margin-left、margin-right
, but the vertical direction does not result in a margin padding-top、padding-bottom、margin-top、margin-bottom
effect.
Block-level elements can be set to a wide height, but the actual width of its height is itself wide and high +padding. The block element has a separate row. Inline elements are not exclusive to a single line, and it is useless to set a wide height for him.
Length Unit emem
is the relative length unit, relative to the font size () of the text within the current object font-size
. For example: The text size of the Web page body
in the user browser default rendering is 16px
, so, at this time 1em = 16px
;
InchInches (Inches). Absolute length units.
1in = 2.54cm = 25.4 mm = 72pt = 6pc = 96px
PtPoint (Points). Absolute length units.
1in = 2.54cm = 25.4 mm = 72pt = 6pc = 96px
Small<small>
The label renders a small font effect.
<strong>
,<em>
And<b>
,<i>
Label`<strong>` 标签和 `<em>` 标签一样,用于强调文本,但它强调的程度更强一些。`em` 是 斜体强调标签,更强烈强调,表示内容的强调点。相当于html元素中的 `<i>...</i>`;`< b > < i >` 是视觉要素,分别表示无意义的加粗,无意义的斜体。em 和 strong 是表达要素(phrase elements)。
Difference between B-label and I-label b 元素现在描述为在普通文章中仅从文体上突出的不包含任何额外的重要性的一段文本。 例如:文档概要中的关键字,评论中的产品名。或者代表强调的排版方式。 i 元素现在描述为在普通文章中突出不同意见或语气或其他的一段文本, 例如:一个分类名称,一个技术术语,一个外语中的谚语,一个想法等。或者代表斜体的排版方式。
Angle Unit degDegrees (degress). A circle total 360 degrees
90deg = 100grad = 0.25turn
GragGradient (Gradians). A circle total of 400 gradients
90deg = 100grad = 0.25turn
TurnTurn, Circle (Turns). A circle total of 1 laps
90deg = 100grad = 0.25turn
RadRadians (Radians). A circle total of 2 π radians
90deg = 100grad = 0.25turn
CSS Multi-Class SelectorA class
value may contain a list of words, separated by a space between the words. For example, if you want to mark a particular element as both important (important) and warning (warning), you can write:
class="important warning">This paragraph is a very important warning.</p>
For the ID, it can't be written like this.
CSS transparency under all browsersElement transparency is often an annoying problem, and the following is a way to achieve the transparency settings under all browsers:
.transparent { zoom: 1; filter: alpha(opacity=50); opacity: 0.5;}
Zoom
Properties are the exclusive property of IE browser and are not supported by browsers such as Firefox. It can set or retrieve the scale of an object. In addition, it has some other small functions, such as triggering the hasLayout
properties of IE, clear floating, clear margin
overlap and so on.
When the attribute value of an element hasLayout
is true, we say that the element has a layout
CSS Float PropertyDefinition and usage
float
The property defines in which direction the element floats. Historically this attribute has always been applied to the image, so that the text surrounds the image, but in CSS
, any element can float. A floating element generates a block-level box, regardless of its own element.
If floating non-replacement elements, specify a definite width; otherwise, they will be as narrow as possible.
Note: If there is only a small amount of space above a row for floating elements, then this element jumps to the next line, which continues until a row has enough space.
The great collapseOne of the more puzzling things about using float (float) is how they affect the parent element that contains them. If the parent element contains only floating elements, its height collapses to zero. If the parent element does not contain any visible backgrounds, this problem can be difficult to notice
The visual opposite of collapse is worse, look at the following situation:
Clear floatingIf you know exactly what the next element will be, you can use it clear:both
to clear the float. This method is good, it does not need hack
, does not add the extra element also makes it has the good semantics.
Use the CSS pseudo-selector (: After) to clear the float:
.clearfix:after { content: "."; visibility: hidden; display: block; height: 0; clear: both; }
Progressive enhancement and graceful downgrade conceptsAn elegant downgrade and progressive enhancement impression is css3
a concept that comes with the flow. Because the low-level browser does not support css3
, but css3
the effect is too good to give up, so in the advanced browsing css3
and low-level browser only guarantee the most basic functions. At first glance, the two concepts are similar, focusing on different experiences under different browsers, and the key difference is the content they focus on, and the difference in workflow that results from this difference.
Progressive enhancement progressive enhancement
: Build pages for low-version browsers, ensure the most basic functionality, and then improve and append features such as effects and interactivity for advanced browsers to achieve a better user experience.
Graceful downgrade graceful degradation
: Build the full functionality from the start and then be compatible with the low-version browser.
DifferenceGraceful demotion begins with a complex situation and attempts to reduce the supply of user experience, while the incremental enhancement begins with a very basic, workable version and is continuously expanded to suit the needs of the future environment. Downgrading (functional decay) means looking back, while progressive enhancement means looking forward while keeping its roots in a safe zone.
Visibility:hidden and Display:nonedisplay:none 隐藏对应的元素,在文档布局中不再给它分配空间,它各边的元素会合拢,就当他从来不存在。visibility:hidden 隐藏对应的元素,但是在文档布局中仍保留原来的空间。
After using a CSS display:none
property, various property values, such as the width and height of the HTML element (object), are "lost", and visibility:hidden
when the attribute is used, the HTML element (object) is simply visually invisible (completely transparent), and the space it occupies remains there.
Text Literal Property Text-indenttext-indent
The Indent property specifies the indentation of the first line of text in the block.
Note: Negative values are allowed. If a negative value is used, the first row is indented to the left. If you indent with a large negative value, the text will be hidden, as in-9999em
Letter-spacing and Word-spacingletter-spacing
word-spacing
the difference between attributes is that the former is the interval for modifying letters, which is the interval between modifying a word or a single text
Text-transformtext-transform
Property handles the case of text. This property has a value of 4:
noneuppercase:所有的单词都大写lowercase:所有的单词都小写capitalize:只对每个单词的首字母大写
Text-decorationtext-decoration
There are 5 values:
noneunderline:下划线overline:上划线line-through:在文本中间画一个贯穿线blink:让文本闪烁
White-spacepre-line 合并空白符序列,但保留换行符 normal nowrap 防止元素中的文本换行pre 空白符不会被忽略pre-wrap 保留空白符序列
CSS Learning Summary (a) turn