em
1em = the font-size value set by the element itself or inherited from the parent element
1 <h1 id="left-margin-small-px-small">left margin = <small>24px</small></h1>2 <h2 id="left-margin-small-px-small">left margin = <small>18px</small></h2>3 <p>left margin = <small>12px</small></p>
1 h1{font-size:24px;}2 h2{font-size:18px;}3 p{font-size:12px;}4 h1,h2,p{margin-left:1em;}
font-weight
The value 100~900 does not have a fixed boldness. It is generally equivalent to a certain deformation name. 400 corresponds to normal, 700 corresponds to bold, and the others depend on the keywords. .
Times hypothetical bold designation
字体 | 指定关键字 | 指定数字 |
TimesRegular | normal | 100,200,300,400 |
TimesBold | bold | 500,600,700,800,900 |
bolder bold according to the parent element
1 p{font-weight:normal;}/*400,更粗是bold对应700,其中最小值为700*/2 p em{font-weight:bolder;}/*700*/3 4 h1{font-weight:bold;}/*700,更粗假设没有关键字,则设置为下一个更大的数字,最大为900*/5 h1 b{font-weight:bolder;}/*800*/
font-size
No specified number, initial value is medium . Larger is similar to bolder and moves up by the scaling factor based on the parent element, but has no absolute size range (900) limit.
The percentage is also calculated based on the size inherited from the parent element.
These inheritances are level-by-level, and the deeper they are nested, the more they accumulate.
Using px gives a fixed value to the font. This has a hidden danger that users cannot adjust the text size before IE6, so it would be better to use keywords and percentages for the font size.
text-indent
Text-indent Jin will also inherit.
1 <style type="text/css">2 #demo{text-indent:3%;}3 </style>
1 <div id="demo">2 This is the first line.3 <p>This is the second line while this will also <br>get the text indent style.</p>4 </div>
line-height
1 <style type="text/css"> 2 body{font-size:10px;line-height:10px;} 3 /*由于大多数浏览器默认font-size最小值为12px,所以此处body设置的字体大小其实为12px*/ 4 5 .paragraphA{line-height:1em;}/*继承字体大小为12px,line-height为12*1=12px*/ 6 .paragraphA p{font-size:18px;}/*line-height为继承的12px*/ 7 8 .paragraphB{line-height:1;}/*使用缩放因子,运用于该元素和所有子元素,各元素根据自己字体大小值计算line-height为12*1=12px*/ 9 .paragraphB p{font-size:14px;}/*自身大小值*缩放因子:line-height为14*1=14px*/10 11 .paragraphC p{font-size:12px;line-height:150%;}/*根据自身指定字体大小计算line-height为12*150%=18px*/12 </style>
1 <div class="paragraphA">2 <p>This is paragraph A which gets a line-height equals 12px.</p>3 </div>4 <div class="paragraphB">5 <p>This is paragraph B which gets a line-height equals 14px.</p>6 </div>7 <div class="paragraphC">8 <p>This is paragraph C which gets a line-height equals 18px.</p>9 </div>
vertical-align
The default value is baseline, aligned with the text baseline (letters such as "g", The small tail is below the baseline).
Text-bottom: Align with the bottom line of the text (the "bottom tangent line" of the text, the tangent line at the bottom of the small tail).
Bottom: Align the bottom of the line box (when the line height is greater than the font size, there is a certain distance below the small tail at the bottom of the space occupied by the line height).
The percentage is to increase or decrease the specified amount relative to the baseline (row height) of the parent element.
px: Positive values will increase, negative values will decrease.
Note that vertical-align can only be used for inline elements or table cell elements.
References
"Css Definitive Guide" Chapter 4~6

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)