Reputation: 19425
I'm having problems using font-face
on my website. I can get it working when testing it on a html file with it's own styling, but not if I include other style sheets.
I've tried overriding stles, placing style sheets in different order and so on, but nothing works.
So I'm wondering, is it possible to exclude all CSS and only use css from one css file for a specific div container?
(Without using iframe
)
Upvotes: 5
Views: 7731
Reputation: 201588
No, you cannot. There is no such exclusion mechanism in CSS or in HTML.
You real problem is probably solvable, though, but you did not describe it. You should describe, in a new question, what you want, what you have tried, and how it fails. With real code and/or URL.
Upvotes: 0
Reputation: 1440
Unfortunately no, it's not possible to just clear or reset the styles for a specific container from the css it's inherited. You have to override each style that you want manually.
What you can do is you could namespace your classes and all you'd have to worry about would be element styles that you could define with defaults at the beginning of your style sheet. For example, something like:
div,table,span,img,p{
margin: 0;
padding: 0;
border: 0;
font-weight: normal;
font-style: normal;
font-size: 100%;
line-height: 1;
font-family: inherit;
text-align: left;
}
You can of course add !important to ones that you need and add more elements to the list. If you can't trust or don't know the other styles that are going to be loaded and applied to your page, I find it's best to just start with an empty slate.
Upvotes: 4