SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot bemmott's Avatar
    Join Date
    Mar 2007
    Location
    NY, USA
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a.link colors not as css?

    Okay, looks like I need a hand again before I pull my remaining hair out. The story is this - I am cleaning up my website and moving all the style sheets to external linked. Yes, I know I should have done this at the outset, but I had made some slight changes to the main css for many pages and "forgot" what changes I'd made, and therefore could not use a single external style sheet. My bad.

    The issue now is, since linking to the external style sheets, my a.link colors are wrong, and I can't figure out WHY. Here is the code for the links:
    Code:
    a:link { color: #FF9900}
    a:visited { color: #CCCCCC}
    a:hover { font-weight : normal; background-color : #FF9900; color: #FFFFFF }
    a:active { color: #FF9900}
    The text color of the a.link should be - and was prior to this change - ORANGE. Now it's blue and almost lost against my background color. The visited link color is correct, and the hover colors are correct. Yet - the other is not.

    The most obvious page to see this is towards the bottom of my sound files page here: http://sunrisersalumni.org/sound.htm, though it is also present on my index page. Other pages have not yet been adjusted to external style sheets and thus are not affected.

    What am I missing here? Anyone? Beuhler?
    Bruce ...

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,352
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Remove the html from your css file

    A CSS file can only contain CSS and CSS comments. It should not contain html or html comments.

    You have included the html style tags and html comments in your stylesheet.

    Code:
    <style type="text/css">
    <-- 
    css ....
    
    -->
    </style>
    If you remove them the stylesheet will start working properly

  3. #3
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I have not searched for the exact cause of the problem, but something in your stylesheet is overwriting it.

    If you place your a:link at the very bottom of your css it will overwrite whatever has overwritten it
    a:link { color: #FF9900}

  4. #4
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Paul beat me to it with the correct answer, should have double checked before posting

  5. #5
    SitePoint Zealot bemmott's Avatar
    Join Date
    Mar 2007
    Location
    NY, USA
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    Hi,

    Remove the html from your css file

    A CSS file can only contain CSS and CSS comments. It should not contain html or html comments.

    You have included the html style tags and html comments in your stylesheet.

    Code:
    <style type="text/css">
    <-- 
    css ....
    
    -->
    </style>
    If you remove them the stylesheet will start working properly
    Oh, for .... (hides head in embarrassment and shuffles off...)

    Thanks, Paul.
    Last edited by bemmott; Aug 4, 2008 at 17:01.
    Bruce ...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •