Html css style sheets and htmlcss Style Sheets

Source: Internet
Author: User

Html css style sheets and htmlcss Style Sheets

CSS (Cascading Style Sheet) is used to beautify HTML webpages.

/* Comment area */This is the comment syntax

I. Style Sheets

(1) classification of Style Sheets

1. inline Style Sheets

Combined display with HTML, precise control, but poor reusability, more redundancy.

Example: <p> inline style sheet </p>

2. Embedded Style Sheets

As an independent area embedded in the web page, it must be written in the head label.

<Style type = "text/css">

P // The format takes effect on the p tag.





3. External Style Sheets

Create a new CSS file to place the style sheet. To call a style sheet in an HTML file, right-click the style sheet in the HTML file, select CSS style sheet, and append the style sheet. Link connection is generally used.

Some labels have default margins. Generally, the style sheet code is removed first (other styles can be set), as shown below:




(2) Selector

1. Tag selector. Use the tag name as the selector.



2. class selector. All begin.



3. ID selector. It must start.

<Div id = "style name">



4. Compound Selector

(1) separated by commas (,), indicating the parallel operation.



(2) Use spaces to separate the child.



(3) filter ".".



Ii. style attributes

(1) Background and prospects

1. Background:



2. Foreground Font:



(2) border and border

Border (Table border, style, etc.) and margin (outer table spacing ). Padding (content and cell spacing ).



(3) List and square

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


Link style:

A: The status before the link hyperlink is clicked

A: status after clicking the visited hyperlink

A: When hover is hovering over a hyperlink

A: When a hyperlink is clicked on the active node

When defining these States, there is an order of l v h


Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.