How to use two css files in an html

3

How can I use two CSS files in an HTML file, but one of the CSS files is only used in div .

I have a CSS file to style the page, but I needed another CSS file to be able to style a div in the middle of the page.

Because I'm testing to use, and I put the CSS file I need only for div first, and everything until that div gets deformatted.

And if you put second, everything after that div gets deformed. I wonder if this is possible or not, and if yes like.

    
asked by anonymous 26.11.2015 / 18:37

1 answer

5

Just add both in <head> of your HTML:

...
<head>
    ...
    <link rel="stylesheet" href="/css/css1.css" type="text/css" media="screen">
    <link rel="stylesheet" href="/css/css2.css" type="text/css" media="screen">
    ...
</head>
...

If both files apply to the same element, the second file may end up determining the style, but this will also depend on the precedence rules of the CSS .

    
26.11.2015 / 18:40