First write CSS + HTML, first csshtml

Source: Internet
Author: User

First write CSS + HTML, first csshtml

The first time I wrote CSS + HTML, it was quite entertaining,

The itinerary for D, G, Z, J, and S.



How to Write css in html? What is the format?

Style Syntax: Selector {property: value}
How to add a style sheet to Your webpage:
You can add a style sheet to Your webpage in the following three ways. The higher the style definition priority that is closest to the target. The high-priority style inherits the non-overlapping definition of the low-priority style but overwrites the overlapping definition. For exceptions, see! Important Declaration.

Inline Styles
Inline definition is to use the style attribute Definition of the object within the object tag to apply its style table attribute.

Sample Code:

<P style = "color: # f00"> the font color of this line is red. </p> the internal Style Block object Embedding a style Block
You can insert a <style> block object in the
Sample Code:

<Style>
Body {background: # fff; color: #000 ;}
P {font-size: 14px ;}
</Style> external Style Sheet Linking to a style Sheet
You can first create an external style sheet file *. css and then use the link object of HTML.

Sample Code:

<Link rel = "stylesheet" href = "*. css"/>

How to write this html code? (Use css)

<Style type = "text/css">
H1 {font-size: 14px; color: red; font-family: "文 "; text-algin: center ;}
P {text-indent: 25px; ling-height: 25pt; letter-spacing: 03pt ;}
P span {color: green; font-family: "", "italic ";}
A: link {color: red; text-decoration: none ;}
A: hover {color: blue ;}
</Style>
<H1> Level 1 title
<P> <span> two Chinese characters are indented at the beginning of the text section, and the spacing </span> is indented at the beginning of the text section. </p>
<A href = #> link </a>

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.