CSS style, css

Source: Internet
Author: User

CSS style, css

CSS basic style

  • Inline Style: Directly use the HTML-tagged style attribute in the page file. For example:
<P> <style type = "text/css"> h1 {font-family: ""; font-size: 12px ;}# fromid {font-family: ""; font-size: 12px ;}. classid {font-family: ""; font-size: 12px ;}</style>
  • Embed an external style sheet in the page file:Syntax:
<Style type = "text/css"> @ import url ("external CSS style file name"); <! -- The external file name is a CSS file with the extension .css. If the file is in the same directory as the current page, the file name is used directly. If the file is not in the same directory, the relative path is given. -> </Style>
  • Link external style sheet:Syntax:
<link type="text/css" rel="stylesheet" type="text/css" href="css/index.css"/>

CSS annotation Syntax:The CSS annotation statement is located
/* */
Statement content between tags

CSS Selector
  • HTML TagSyntax:
H1 {font-family: ""; font-size: 12px;}/* in the HTML document, all text protected by this tag has a defined CSS style */
  • CLASS SelectorSyntax:
. Classid {font-family: ""; font-size: 12px;}/* in the HTML document, all tags marked with such names have defined tags */
  • ID SelectorSyntax:
# Fromid {font-family: ""; font-size: 12px;}/* in the HTML document, all tags specified as this ID have defined tags */
CSS style priority



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.