Solved

Disable CSS style?

Posted on 2006-11-18
2
8,848 Views
Last Modified: 2010-05-18
We're using Rainbow Portal which automatically imports CSS files for the entire portal.  I've created a new .ASPX page and have it css styled exactly the way i want it within FF and IE using strict doctype.  However when portal's css information is applied to the page everything is a mess.  The portal's css is overriding base elements such as TD and TABLE and so my page is being drastically altered.  I've tried to add more specificty to my elements but for the most part this has been frustrating.

Unfortunately Im cant simply remove the portal's css file (it is required for a nav menu added to my page).  Is there a way i can disable all the portal css styles for a particular area within the body?  FOr instance I need to simply disable the settings on TD, TABLE, and TR so that it can take on my default properties within the page.

I';ve already tried using:
body, p, div,img, input, table,thead,tr,th,td,textarea,ol,ul
{
      font-family: inherit;
      padding:inherit;
      font-size: inherit;
      margin: inherit;
      background-color: inherit;
      border:inherit;
}      

but no luck.  Again I've tried to add more specificity and it has worked here and there but still many elements are taking on some other style.  If theres a simpler way to simply disable the offending portal css styles for an area i'd rather opt for that.

Thanks
0
Comment
Question by:aniston
2 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 50 total points
ID: 17972942
Well, the direct answer is: no.  You can't add styles to the page and then say, "Just kidding; I didn't want those."

Couldn't you just take out the styles you actually want from that stylesheet manually, add it to your own, and then disable the other stylesheet?


Otherwise, you should be able to increase specificity with rules like
html#something body#com-example-www div#main-content p { }

... though that's clearly cumbersome.


You can also add !important after rules:

p { font-size: 10em !important; }
0
 

Author Comment

by:aniston
ID: 17973479
Yes thats what i suspected. I was hoping for something possibly missed.  thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
erros on link  checking 2 43
Image Orientation On Website 6 44
Basic CSS issues 6 20
Bootstrap more than 12 columns in row 3 0
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now