Home > Web Front-end > HTML Tutorial > HTML CSS stylesheet

HTML CSS stylesheet

WBOY
Release: 2016-09-11 11:19:49
Original
2125 people have browsed it

CSS (Cascading Style Sheet, cascading style sheet) is used to beautify HTML web pages.

/*Comment area*/​ This is the comment syntax

1. Style sheet

(1) Classification of style sheets

1.Inline style sheet

and HTML are jointly displayed, with precise control, but poor reusability and more redundancy.

Example:

Inline style sheet

2.Embedded style sheet

is embedded in the web page as an independent area and must be written in the head tag.

3.

External style sheet

Create a new CSS file to place the style sheet. If you want to call the style sheet in the HTML

file, you need to right-click →CSSStyle Sheet in the HTML file to attach the style sheet. Generally use link to connect. Some tags have default margins, which are generally removed when writing style sheet code (other styles can also be set), as follows:

(2) Selector

1.Tag selector. Use tag name as selector.

2.class

Selector. They all start with

“.”

.

3.ID

Selector. Start with

"#"

.

style name">

4.

Composite Selector

(1) is separated by "

, ", indicating juxtaposition.

(2) are separated by spaces to indicate descendants.

(3) Filter ".".

2. Style attributes

(1) Background and foreground

1.Background:

2.Foreground font:

(2) Borders and borders

border (table border, style, etc.), margin (outside table spacing). padding (content and cell spacing).

(3) Lists and Blocks

width, height, (top, bottom, left, right) are only useful in absolute coordinates.

Linked style:

a:link The state before the hyperlink is clicked

a:visited Status after clicking the hyperlink

a:hover When hovering over a hyperlink

a:active When a hyperlink is clicked

When defining these states, there is an order l v h a

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