Solved

questions about CSS Style sheets

Posted on 2013-12-08
5
353 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 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 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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
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.
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

630 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