CSS writing format

A, CSS writing format:
    1, inline style:
        can be written directly to the CSS code label which began:

    <Div style = "color: red"> inline style </ div>


    2, inline styles:
        you can write on a pair of a pair of head style label tag, and then write CSS code in the style tag:

 <head>
        <style type="text/css">
             div{
                 color:red;
             }
         </style>
</head>            

   

 3, the chain style:
        single .css a new file, the file is written to the css code, and then by the link tag associated with the document file and .html <link rel = "stylesheet" type = "text / css" href = "file_name.css">
    
    

 4, importing styles:
        single .css create a file, this file is written css code, then the document and the associated document by @import .html

  <style type="text/css">
      @import "file_name.css";
  </style>

 

Second, business development, often used outside the chain style to write CSS code, so that the structure and style of separating

three, outside the chain pattern and the difference between imported styles:
    1, the chain pattern by the link tag is associated, and importing styles by @ import association, and @import is CSS2.1 introduced, compatibility issues
    2, when the chain style display interface, it will be loaded CSS styles, reloading architectural style, so the user interface must have been set up to see the style
      and importing style display interface when the structure will be loaded, and then load the style, the user interface does not necessarily see the style has been set

Guess you like

Origin www.cnblogs.com/AsVR-Sharemju/p/12032213.html