Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS style problem

    Any help is greatly appreciated. I am trying to have multiple link styles on my page but it won't allow me too. Here is the CSS code for this:

    .style61 {

    color: #F5F5F5;

    font-weight: bold;

    font-size: 20px;

    font-family: "Comic Sans MS",
    cursive;

    }

    a.style61:link {color: #F5F5F5;
    font-size: 20px;
    font-weight: bold;
    font-family: "Comic Sans MS",
    cursive;
    }

    a.style61:hover {text-decoration: underline;}

    a:link {
    color : #00336F;
    text-decoration: none;
    }

    a:visited{
    color : #00336F;
    text-decoration: none;
    }
    a:hover{
    color : #00336F;
    text-decoration: underline;
    }


    And some example text I am using (just for testing) is: <p><span class="style61"><a href="html">html</a></span></p>

    The text won't show up with the class=style61 css link styles. Please help with this

  • #2
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Hi fightonusc61,

    Try to put the class within the a element instead
    Code:
    <p><a class="style61" href="html">html</a></p>
    Class names are not inherited by child elements. On the other hand, many css properties are inherited by child elements.

  • #3
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the suggestion koyama, but sadly it didn't change it.

    What is strange is that the link will accept all of the other properties from the style EXCEPT the color. The color comes up as #00336F, which I need all the other links to be, but this is just for the navigation, and I need that color to be #F5F5F5. But it won't recognize this color

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Post your current html.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Post your current html.
    The css is above and the current html is <p><a class="style61" href="html">html</a></p> for example text.

    As mentioned above, it will recognize the other properties from the style61 css code EXCEPT the color. But I need the color to be different

  • #6
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    It is working for me...

    You maybe have some styles that are overriding previously assigned ones. As Aero says, we need to see a live example.

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,739
    Thanks
    22
    Thanked 1,837 Times in 1,821 Posts
    Hello fightonusc61,
    Look at my example here:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    .style61 {
    	color: #00FF00;
    	font-weight: bold;
    	font-size: 20px;
    	font-family: "Comic Sans MS",cursive;
    }
    a.style61:link {
    	color: #F5F5F5; 
    	font-size: 20px; 
    	font-weight: bold; 
    	font-family: "Comic Sans MS",cursive;
    }
    a.style61:hover {
    	text-decoration: underline;
    }
    a:link {
    	color : #00336F;
    	text-decoration: none;
    }
    a:visited{
    	color : #00336F;
    	text-decoration: none;
    }
    a:hover{
    	color : #00336F;
    	text-decoration: underline;
    }
    </style>
    </head>
    <body>
    <p class="style61"><a href="http://www.nopeople.com">html</a></p>
    <p><a href="http://www.nopeople.com"><span class="style61">html</span></a></p>
    <p class="style61">Web Design by <a href="http://www.nopeople.com">nopeople.com</a></p>
    </body>
    </html>

    You can see that the actual link, "html" in your example, is not styled yet.
    In my second example, enclosing "html" with the span tag is not really the way to do it. Instead, style the link now with something like this:

    Code:
    .style61 a:link, .style61 a:visited, .style61 a:active {
    	color: #CCCCCC;
    }
    .style61 a:hover {
    	color: #FFFFFF
    }
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #8
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, something is overriding it and I'm not sure what or why.

    The page is here: http://www.colorado.edu/AFROTC/

    Notice on the homepage the link comes up as blue

    (ignore how the other links looksfor now, the current way they are set up is hard to edit so that is why I am doing this)

    However, click on the "Links" page and the font color comes up fine. This is weird. Why does it work on the links page and some other pages but not on the home page and some other pages?

  • #9
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,739
    Thanks
    22
    Thanked 1,837 Times in 1,821 Posts
    Maybe I'm not understanding the problem completely but look at this:
    Code:
    <p><a class="style61" href="html">html</a></p>
          <p><span class="style17"><span class="style16"><a href="http://www.colorado.edu/AFROTC">
            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="60" height="19">
              <param name="BGCOLOR" value="#00336F" />
              <param name="BGCOLOR" value="#00336F" />
    
              <param name="BGCOLOR" value="#00336F" />
              <param name="movie" value="http://www.colorado.edu/AFROTC/Templates/home.swf" />
              <param name="quality" value="high" />
              <embed src="http://www.colorado.edu/AFROTC/Templates/home.swf" width="60" height="19" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#00336F" ></embed>
            </object>
          </a></span></span></p>
          <p class="style16"><span class="style12"><span class="style19"><a href="http://www.colorado.edu/AFROTC/prospective_cadets/index.htm">
            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash
    I only mention this because I'm dyslexic, the two style names are so close and all the other links are displayed right.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #10
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,739
    Thanks
    22
    Thanked 1,837 Times in 1,821 Posts
    Some other problems your having and are probably not aware of yet.

    It doesn't validate
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #11
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I fixed the problem. I deleted ALL of the coding, both the html and the CSS, related to the sidebar and redid it from scratch using some of the recommendations made here. Problem is fixed. Whatever the conflict was it is gone now. Whoever originally coded it just had too many different things in different places and I just whiped it clean and started over. Works fine.


  •  

    Posting Permissions

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