Solved

questions about CSS Style sheets

Posted on 2013-12-08
5
344 Views
Last Modified: 2013-12-08
I am trying to modify a web page which references an external CSS style sheet.

I am trying to change the color and located the classes that seem to be refrencing the css.

However, I dont under this this.  Are these links, active etc using the parameters from the visited section or some other place in the CSS


body.LeftMenu08 .sectionentity08 a,
body.LeftMenu08 .sectionentity08 a:link,
body.LeftMenu08 .sectionentity08 a:active,
body.LeftMenu08 .sectionentity08 a:visited
{
      display:block;
      padding:3px 10px 3px 15px;       
      color:#666;
      background:#fff1c4;
      width:100%;
      text-decoration:none;
}
0
Comment
Question by:red_75116
5 Comments
 
LVL 9

Expert Comment

by:QuinnDex
ID: 39704831
they are links or anchor tags, the reference is the link relevant to other classes within the css

the style wouldn't apply to all links on the page only links that feel within the hierarchy body.LeftMenu08 .sectionentity08 a
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 250 total points
ID: 39704925
It is applying the same class to the link, visited and active state.   If you want to use different colors you would use:

body.LeftMenu08 .sectionentity08 a:link

{
      display:block;
      padding:3px 10px 3px 15px;       
      color:black;
      background:#fff1c4;
      width:100%;
      text-decoration:none;
}
body.LeftMenu08 .sectionentity08 a:hover

{
    
      color:red;

}
body.LeftMenu08 .sectionentity08 a:visited

{
      
      color:blue;

}

Open in new window


Notice you only need the details for the a:link and for hover, visited etc, you only need to change the color or the background or both.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 250 total points
ID: 39704941
However with that said there is still no guarantee that those are the styles that actually get applied.  If there are other rules declared with more specificity; the same level of specificity at a later point in the listing order; inline; or generated overrides from scripting, then the actual application of rules cannot be determined without looking at the whole page.

All you have there is a fragment, that might or might not even apply to the page you are looking at.  CSS is extremely dynamic and out of context a declaration is really no more relevant than a single word in a 200 page book.

Cd&
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39704979
I agree, I would name the styles a little better.  These look like they were from a theme or automated html creator.  

Better to have a style that is global like below

 a:link
{
      display:block;
      padding:3px 10px 3px 15px;       
      color:black;
      background:#fff1c4;
      width:100%;
      text-decoration:none;
}
 a:hover
{
      color:red;
}
 a:visited
{
      color:blue;
}

Open in new window

Then for something special, create some unique styles
.special a:link
{
      display:block;
      padding:3px 10px 3px 15px;       
      color:red;
      background:#fff1c4;
      width:100%;
      text-decoration:none;
}
.special a:hover
{
      color:blue;
}
 .special a:visited
{
      color:green;
}

Open in new window

0
 

Author Comment

by:red_75116
ID: 39704985
Thanks for your replies.  I agree the format is confusing.  There is one style sheet for each theme for the entire site.  I was having trouble following it, but your comments helped me sort it out.
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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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.
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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