How do you refer to more than one .css file in html?

后端 未结 5 436
臣服心动
臣服心动 2020-12-24 08:44

I have a homepage.html and it refers to styles.css(makes a table). But I also want homepage.html to refer to styles12.css because in styles12.css I have the css for taps.

相关标签:
5条回答
  • 2020-12-24 08:57

    Yes, and the order of precedence for rules will follow the basic CSS precedence ruleset, and later rules overwrite earlier rules if they specify the same attributes.

    You might want to read this article on specificity.

    0 讨论(0)
  • 2020-12-24 08:58

    Yes, just add the second bit as you mentioned:

    <link rel="stylesheet" type="text/css" href="style12.css" />
    
    0 讨论(0)
  • 2020-12-24 08:58

    could you not just do

    <link href="style.css" rel="stylesheet" type="text.class"> 
    

    would this work for linking more than 1 css page for each web page

    <link href="about.css" rel="stylesheet" type="text.class>
    
    0 讨论(0)
  • 2020-12-24 08:59

    you can also use @import inside other style sheets.

    @import url("site.css");
    
    0 讨论(0)
  • 2020-12-24 09:11

    Yes. Just use multiple link elements.

    Note, however, that it isn't very efficient and it is generally better to combine all your stylesheets into a single file.

    0 讨论(0)
提交回复
热议问题