HTML style (HTML CSS)

Source: Internet
Author: User

Styles in HTML

<HTML><Head><styletype= "Text/css">H1{Color:Red}P{Color:Blue}</style></Head><Body><H1>Header 1</H1><P>A paragraph.</P><!two lines can also be><P>A paragraph.</P></Body></HTML>
<HTML><Head><styletype= "Text/css">H1{Color:Red}P{Color:Blue}</style></Head><Body><H1>I am the title of the red</H1><P>I am the blue text</P></Body></HTML>

1. The meta tag that is commonly referred to is an important HTML tag in the source code of the HTML page. Meta is used to describe the properties of an HTML page document, such as author, date and time, page description, keywords, page refresh, and so on. Is one of the important tags in the head area in the HTML language of the Web. 2.Http-equiv is similar to the HTTP header protocol, it responds to the browser some useful information, common HTTP-EQUIV types are: Content-type and content-language (display character set settings, encoding type and language). 3.charset: Character Set encoding (gb2312 refers to Simplified Chinese). 4.ZH-CN: Simplified Chinese. 5.text-decoration:none indicates that the CSS text decoration is none and is generally used to clear the underline of the link.

<HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=gb2312" /><Metahttp-equiv= "Content-language"content= "ZH-CN" /></Head><Body><ahref= "Http://www.baidu.com"style= "Text-decoration:none">This is a no underline link! </a></Body></HTML>

Connecting an external style sheet

An external style sheet is an ideal choice when the style needs to be applied to many pages. With an external style sheet, you can change the appearance of the entire site by changing a file.

An internal style sheet can be used when a particular style is required for a single file. You can define an internal style sheet in the head section through the <style> tag.

Inline style: You can use inline styles when special styles need to be applied to individual elements. The way to use inline styles is to use style attributes in related tags. Style properties can contain any CSS properties. The following example shows how to change the color and left margin of a paragraph.

<HTML><Head><Linkrel= "stylesheet"type= "Text/css"href= "/html/csstest1.css" ></Head><Body><H1>I format it through an external style sheet.</H1><P>Me too!</P></Body></HTML>

HTML style (HTML CSS)

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.