Java Foundation--css

Source: Internet
Author: User

CSS: Cascading style sheets (cascading style Sheets)-improve display, define styles

HTML provides div and span, just to encapsulate text data, Div is a row of data, and span is the data within the row.

  • How CSS and HTML are combined:
    • Use the Style property in the HTML tag: <div style= "Color:red;font:.; Size:24px;background-color:blue; " >...</div>
      • Use the style tag to improve code reusability:
        • <style> div{style; ...} </style>
        • or <style type= "text/css" > @import url (...); </style>
        • or <link rel= "stylesheet" href "... css file" type= "Text/css" >
  • Selector:
    • HTML Tag name selector: Specifies the label to load the style div{...} (a category of labels).
    • Classes Class Property Selector: Uses the class attribute in the tag to provide the properties of the action specifically for the CSS:
      • For label <div class= "haha" >...</div>, you can modify the following:
        • <style type= "Text/css" >
        • Div.haha{...}
        • </style>
      • For labels with the same class, such as <span class= "haha" >...</span>, you can also use the following statement:
        • <style type= "Text/css" >
        • . haha{...}
        • </style>
    • ID selector: Using the id attribute in the tag, such as div#qq{...}. In general, the ID attribute in an HTML tag is unique, and both CSS and JavaScript often use the id attribute.
  • Extended selector:
    • Association selector: The DIV contains a span tag, then it is written as: Div span{...}.
    • Combo selector: Multiple choices, such as. Haha.span, #qq,. xixi{...} Multiple selections use the same style, separated by commas.
    • Pseudo-Element selector: such as the four states of the hyperlink, no access, click, hover, Access, that is, link,hover,active,visited four kinds, you can use a:link{...} To specify a style for a particular type. The general declaration order is link----visited---hover active
  • Text-to-Picture: Image tag #imgtxt{float:right;}, absolute layout is used.

Java Foundation--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.