css div style sheet 1_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:33:10
Original
1105 people have browsed it

Categories of selectors

HTML tags

are widely used. Pay attention to the application of inheritance, composition and association (P119).

User-defined class selector

A class can be named by any name.

All elements in can define "classes".

The syntax is as follows:

selector.classname{property1:value1; property2:value2;…}

.classname{property1:value1; property2:value2;…}

1. What is the difference between the two definition forms?

2. How to use class selector style in tags?

ID selector

The application form is basically similar to the class selector. Use "#" instead of "." when defining.

Therefore, one of them is generally selected when applying. See example on page 120.

Virtual classes and virtual elements

There is no such attribute in HTML page elements, so it is called a virtual class. Only browser versions above IE5.0 support virtual class selection. symbol.

The syntax is as follows:

Page element name: element virtual attribute name {style sheet content}

a:link {color: #000000}

a :visited {color: #cccccc}

a:hover {color: #000000; font-style:italic}

a:active {color: #aaaaaa}

:link {color: #000000}

:visited {color: #cccccc}

:hover {color: #000000; font-style:italic}

:active {color: #aaaaaa}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template