Four CSS styles

Source: Internet
Author: User
I. Internal inline styles

<HTML>
<Head>
<Title> inline CSS style </title>
</Head>
<Body>

Inline CSS style: directly write the style in a tag (as the style attribute)
<Br/>
<H1 style = "color: orange; font-family: Impact"> stylesheets: the tool of the web design gods </Body>
</Html>

 

Ii. Internal embedded Style

<HTML>
<Head>
<Title> embedded CSS styles </title>

<Style type = "text/CSS">
H1 {color: green; font-family: Impact}
</Style>

</Head>

<Body>

Embedded CSS style: defines the style in the <H1> hello, CSS! </H1>
<H1> stylesheets: the tool of the web design gods

<H2> stylesheets: the tool of the web design gods </H2>
</Body>
</Html>

 

3. External link Style

<HTML>
<Head>
<Title> external link CSS style </title>

<LINK rel = "stylesheet" href = "mystyles.css" type = "text/CSS">
 
</Style>
</Head>

<Body>
<H1> hello, CSS! </H1>
<H1> stylesheets: the tool of the web design gods

<H2> stylesheets: the tool of the web design gods </H2>
</Body>
</Html>

-----------------------
Mystyles.css ------------------------------------------------------------------

H1 {color: green; font-family: Impact}

-----------------------
Mystyles.css ------------------------------------------------------------------

 

 

 

Iv. External import styles

<HTML>
<Head>
<Title> external import CSS styles </title>
 
<Style type = "text/CSS">
<! --
/* The imported CSS style actually exists in the internal style */
@ Import URL (CSS/mystyles.css );
@ Import URL (CSS/mystyles2.css );

H1 {color: orange; font-family: Impact}
-->
</Style>
</Head>

<Body>
<H1> hello, CSS! </H1>
<H1> stylesheets: the tool of the web design gods

<H2> stylesheets: the tool of the web design gods </H2>
</Body>
</Html>

 

Summary:

Internal style:

1. inline style (intra-row style)

2. Embedded Style

External style:

1. Link Style

2. Import a style

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.