Solved

Help overriding CSS stylesheet style

Posted on 2014-11-06
1
156 Views
Last Modified: 2014-11-06
Greetings.  I am adding one section onto a website that is already in existence.  I do not want to modify any of the .CSS sheets that are in the main site, but I have linked to them so that I can benefit from the same styles.

However, in some situations I want to override these .css styles from the root site.   For instance, I want the text size (defined in the p tag on the main site) to be 12, but in the main root site, the size is 14.  No matter what I try, I can't seem to override this style.  I have a stylesheet used only in my section of the site, and when I try and redefine the <p> tag in this sheet, it continues to be overruled by the main sheet.  

Are there ideas of how I can best overrule the style?  At this point, I'm not concerned with best practices, but simply want this to work.  Thank you.
0
Comment
Question by:victoria franklin
1 Comment
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 40427112
Create a stylesheet for your specific page.  Then duplicate the rule declaration for the styles you have to override and put in the properties you need, then list the local stylesheet as the last one in the page.  The CSS parser overrides previous values for duplicate declarations and processes in source listing order.

This is not a best practice.  You should be consolidating the CSS; but it is a relatively risk-free hack.

Cd&
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Host asp.net pages 5 25
Why is this panel heading creating extra space 2 34
Error on link 14 37
How can i create a customized Login page based on Wordpress ? 8 27
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

911 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

17 Experts available now in Live!

Get 1:1 Help Now