Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

questions about CSS Style sheets

Posted on 2013-12-08
5
Medium Priority
?
357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 53

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 1000 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 1000 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 53

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

715 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