user2087707
user2087707

Reputation: 85

Using more than one css file in a single website

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 assets 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

Upvotes: 0

Views: 500

Answers (2)

Pete Wilson
Pete Wilson

Reputation: 8694

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

Upvotes: 2

jbrookover
jbrookover

Reputation: 5150

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).

Upvotes: 0

Related Questions