开发者

Using more than one css file in a single website

开发者 https://www.devze.com 2023-02-17 17:08 出处:网络
I am working now on a website and of course I am using one general CSS template for the whole website. Now, I am adopting one ready-design (sign up) from the internet, but the problem with it has its

I am working now on a website and of course I am using one general CSS template for the whole website. Now, I am adopting one ready-design (sign up) from the internet, but the problem with it has its own CSS template, so when I tried to add it to my website with its own asset开发者_开发知识库s including images and CSS, it messed the general the appearance of my website. I tried to modify or include the secondary CSS inside the website's CSS file but I failed.

So what is the proper solution to this problem? How can I fix it?

Thanks, matrix388


If the foreign CSS is placed before yours in the page, then yours will take precedence in the case of duplicate tags.


If you have two conflicting definitions, you can force one to override the other with the !important keyword. For example

my.css

body {
    font-family: Arial !important;
}

their.css

body {
    font-family: Times;
}

Your Arial will override their Times. To identify which styles are being overridden, you can use the Firebug Plugin for firefox. For any given element, it will show not only the current style, but also the files and definitions that were overridden (or did the overriding).

0

精彩评论

暂无评论...
验证码 换一张
取 消