HTML CSS stylesheet

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

CSS(Cascading Style Sheet, cascading style sheet) is used to beautifyHTMLweb pages.

/*Comment area*/This is the comment syntax

1. Style sheet

(1) Classification of style sheets

1.Inline style sheet

andHTMLare 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 theheadtag.

3.

External style sheet

Create a newCSSfile to place the style sheet. If you want to call the style sheet in theHTML

file, you need to right-click→CSSStyle Sheetin theHTMLfile to attach the style sheet. Generally uselinkto 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.

Linkedstyle:

a:linkThe state before the hyperlink is clicked

a:visitedStatus after clicking the hyperlink

a:hoverWhen hovering over a hyperlink

a:activeWhen a hyperlink is clicked

When defining these states, there is an orderl 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!