之前没有开通好博客,笔记都记录在有道云,今天全部转过来!!!
1、当同一个html元素不止一个样式定义时,内联样式(在html元素内部)拥有最高的优先权;其他如内部样式表(位于
标签内部),外部样式,浏览器缺省设置次之;
2、css规则由两个主要部分构成:选择器以及一条或多条声明
例如:h1{color:red;font-size:16px} h1为选择器,{}内的为声明
3、几个选择器可共享声明,中间用逗号隔开,
例如:h1,h2,h3,h4,h5,h6{color:red;}
4、派生选择器是通过元素在其位置的上下文关系的来决定,
例如 li strong{font-style:italic;font-weight-normal}
能按上面样式显示的代码为
下面代码不能显示上面的样式
不可以显示上面的样式
5、id选择器可以为标有特定id的html的元素指定特定的样式
id选择器以“#”来定义 ,例如#red{color:red}
id选择器常常被用来建立派生选择器,例如:
#sidebar p{font-style:italic;text-align:right;margin-top:50px}
6、类选择器以一个点号显示,例如:.center{text-align:center}
和id选择器一样,class也常常被用来做派生选择器
例如: .fancy td{color:red;background: yellow}
元素也可基于他们的类被选择
例如:td .fancy{color:red;background:yellow}
7、属性选择是对带有指定属性的html元素设置样式
例如[tital]{color:red}
可以显示
不可以显示
8、属性和值选择器
[tital~=hello]{color:red}解释为只要tital含有hello的元素都可以被执行
例如:
hello word
可以被执行
student hello
可以被执行属性选择器可为不带有id或class的表单设置样式
例如;input[type="text"]{width:50px;background:yellow;margin-bottom:10px;front-famliy:宋体;}
9、链接外部样式表需要用到标签,例如:

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

Dreamweaver CS6
Visual web development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
