How to insert CSS in HTML? Four ways to insert CSS into HTML (with code)

Source: Internet
Author: User
Tags set background

What this article brings you is about how to insert CSS in HTML? CSS Insert HTML Four ways to introduce (with code), there is a certain reference value, the need for friends can refer to, I hope to help you.

1. Notes:
(1). Comments for HTML:
(2). Comments for CSS:/* *

Ways to insert CSS (cascading style sheets) in 2.HTML
(1). inline style (write style directly behind the label)

<!doctype html>

(2) embedded (separate the style and HTML language)

<!doctype html>

3. External style (linked: CSS and HTML are written separately)!!! Most commonly used
First.html

<!doctype html>

First.css

p{    text-decoration:underline;/* Plus underline */    text-transform:lowercase;/* Capital Letter All lowercase */    text-align:center;/* Center *    /font-size:23px;/* Font size *    /font-family: blackbody;/* Set font */    font-style:italic;/* set Word tilt */    text-indent : 3px;/* Set First line indent */    color:red;/* Set Font color *    /background-color: #ddd;/* Set Background color */    letter-spacing:4px;}

4. Import type
First.html

<!doctype html>

First.css

p{    text-decoration:underline;/* Plus underline */    text-transform:lowercase;/* Capital Letter All lowercase */    text-align:center;/* Center *    /font-size:33px;/* Font size *    /font-family: blackbody;/* Set font */    font-style:italic;/* set Word tilt *    / text-indent:3px;/* Set First Line indent *    /color:red;/* Set Font color *    /background-color: #ddd;/* Set Background color */    letter-spacing : 4px;}
Related Article

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.