1、css的概念:(CascadingStyleSheet级联样式表)
优点:1.内容与表现分离。(用网页的内容xhtml就可以与表象分开)
2.表象统一
3.丰富的样式
4.减少网页代码
5.运用独立于网页的css
2.选择器
1.标签选择器
标签名{属性:属性值;}
2.类选择器
.类名{属性:属性值;}
标签内容标签名>
3、id选择器
#ID名称{属性:属性值;}
4.并集选择器
标签名,.类名,#ID名称{属性:属性值;}
5.后代选择器
后代选择器的写法是把外层的标签写在前面,内层的标签写在后面,之间用空格分开。当标签发生嵌套时,内层的标签就成为外层标签的后代。
P span{ 属性:属性值;}
标签内嵌套标签。
标签的后代,两者之间用空格隔开 6.交集选择器(注意:交集选择器之间没有空格)这种可以确定是某一个标签 标签名.类名{} 7.全局选择器 *{样式;} Css中的注释只能是 /* 注释 */形式; 3.在HTML中引入css样式的方法 1.行内式,
2.嵌入式,
将样式写在head中
H1{font-size:18px;}
3.导入式与链接式,(外部css样式)
链接式:
导入式:
两者的区别是:链接是先加载样式后加载页面,导入是反之
4.样式的优先级
基本选择器之间:ID选择器>类选择器>标签选择器
样式表之间:行内样式>内嵌样式>外部样式
Css样式之间:在同一个选择器中,两条相同的声明,后一条声明会覆盖前一条声明,
5、盒子模型
盒子模型总尺寸=border-width-padding+margin+内容尺寸(宽度或高度)
6、浮动属性
Float:值(left,right,none,inherit(IE不支持不推荐使用))
与float属性结合使用的另一个属性clear,用于确定元素的那一侧不允许其他浮动元素,clear属性的值有5个,如下所示:
Left在左侧不允许浮动元素
Right:在右侧不允许浮动元素
Both:在左右侧均不允许浮动元素
None默认值,允许浮动元素出现在两侧
Inherit:规定应该从父元素继承clear属性的值,IE浏览器不支持,不推推荐使用。一般用于清除浮动时,使用both属性值的情况较多,即:
Clear:both;
7、定位属性:
1.绝对定位
position:absolute; z-index:2;(堆叠次序)
background-color:背景色。Transparent表示透明的背景色
background-attachment:确定背景图片是否跟随类容滚动,设置为fixed为固定的,scroll为滚动;
2.相对定位:position:relative;
8、控制元素显示方式
1.显示方式 display:值
2.处理盒子中的溢出:overflow:值
3.设置光标的形状:cursor:pointer(小手)
4.超链接样式:
a:link{color:#ff0000;} //未访问的链接
a:visited{color:#00CC00}//已访问的链接
a:hover{color:#000FF}//鼠标指针移动到链接上
a:active{color:#FF00FF}//选定的链接
定义样式必须是:linkàvisitedàhoveràactive
经验:内联标签可以包含于块级标签中,成为它的子元素,而反过来则不成立。
display:block;转换为块级元素;

HTMLtagsareessentialforstructuringwebpages,enhancingaccessibility,SEO,andperformance.1)Theyareenclosedinanglebracketsandusedinpairstocreateahierarchicalstructure.2)SemantictagslikeandimproveuserexperienceandSEO.3)Creativetagslikeenabledynamicgraphics

Self-closingtagsinHTMLandXMLaretagsthatclosethemselveswithoutneedingaseparateclosingtag,simplifyingmarkupstructureandenhancingcodingefficiency.1)TheyareessentialinXMLforelementswithoutcontent,ensuringwell-formeddocuments.2)InHTML5,usageisflexiblebutr

To build a website with powerful functions and good user experience, HTML alone is not enough. The following technology is also required: JavaScript gives web page dynamic and interactiveness, and real-time changes are achieved by operating DOM. CSS is responsible for the style and layout of the web page to improve aesthetics and user experience. Modern frameworks and libraries such as React, Vue.js and Angular improve development efficiency and code organization structure.

Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

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.


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

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

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.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download
The most popular open source editor

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