HTML CSS

CSS (Cascading Style Sheets) Styles used to render HTML element tags. For example, what we learned earlier is to add a background color to . Change the color of the text in the

tag. These are all done with CSS


##How to use CSS

CSS was started in HTML 4 and was introduced for better rendering of HTML elements.

CSS can be added to HTML in the following ways Medium:

  • Inline style- Use the "style" attribute in HTML elements

  • # #Internal style sheet

    - Use the

    我的颜色是在 head 标签里面定义的

    我的颜色是在 head 标签里面定义的

    我的颜色是在 head 标签里面定义的

    ## Code running results:

    1.png


    #External style sheets

    When styles need to be applied to many pages, external style sheets will be the ideal choice.

    An external style sheet uses the tag to introduce an external css file.Using an external style sheet, you can change the appearance of the entire site by changing one file.

    For exampleA css file is defined to change the background color of to yellow,

    title to red,

    ; turns blue, the css file is as follows

    body{background-color:yellow;} p{color: blue;} h1{color: red;}

    Use to introduce the css file into the HTML file

        php.cn  
    

    外部样式表

    我的颜色是用外部样式表定义的

    我的颜色是用外部样式表定义的

    Program running result:

    6.png


    ##HTML style tag


    #Example

    The link tag we learned earlier is underlined. We use css style to remove the underline.

    Program running result:

    4.png

    ##


    Visit our CSS tutorials to learn more about styling.


    ||
    php.cn

    我是内联样式

    submit Reset Code
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!
    Continuing Learning
    Tag Description