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 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    92
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Class not being recognized

    The first two display the attributes of their designated class . . . the third doesn't.

    Code:
    <font class="male" style="font-weight: bold; font-size: 14px;">
      Guy's Game Night <br> <br>
    </font>
    Code:
    <font class="female" style="font-weight: bold; font-size: 14px;">
      Pizza and a Movie <br> <br>
    </font>
    Code:
    <font class="general" style="font-weight: bold; font-size: 14px;">
      Special Olympics <br> <br>
    </font>

    Here's the CSS of the classes themselves and surrounding classes:

    Code:
    .tbd_event {font-family: verdana, sans-seriff; font-size: 10px; color: #FFFFFF;}
    .general {color: #528800;}
    .male {color: #2952A3;}
    .female {color: #B1365F;}
    
    /* LINKS */
    a.general:link {font-family: verdana, sans-seriff; font-size: 10px; color: #528800; text-decoration: none; }
    Can you guys tell what's up?
    Last edited by Styles2304; 06-11-2009 at 03:01 PM.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,700
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Except the font element (which is deprecated and not allowed anymore, I’d suggest you use span) there’s nothing wrong with that code which, once again, proves that code snippets don’t tell us anything. We need your entire code to find the error because most of the time they are caused in a different place than where they appear.

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Never use the depreciated <font> tag anymore! Use <span> instead in your case.
    Code:
    <font class="general" style="font-weight: bold; font-size: 14px;">
      Special Olympics <br> <br>
    </font>
    a.general:link
    Any clues?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #4
    Regular Coder
    Join Date
    Mar 2008
    Posts
    235
    Thanks
    6
    Thanked 21 Times in 20 Posts
    First rule, don't use inline.
    Second rule, don't use font tags.

    Changing it to the following code will work, assuming you're referencing your CSS in your head somewhere.

    Code:
    <div class="male">
      Guy's Game Night <br> <br>
    </div>
    Code:
    <div class="female">
      Pizza and a Movie <br> <br>
    </div>
    Code:
    <div class="general">
      Special Olympics <br> <br>
    </div>

    Here's the CSS of the classes themselves and surrounding classes:

    Code:
    .tbd_event {font-family: verdana, sans-seriff; font-size: 10px; color: #FFFFFF;}
    .general {color: #528800;font-weight: bold; font-size: 14px;}
    .male {color: #2952A3;font-weight: bold; font-size: 14px;}
    .female {color: #B1365F;font-weight: bold; font-size: 14px;}
    
    /* LINKS */
    a.general:link {font-family: verdana, sans-seriff; font-size: 10px; color: #528800; text-decoration: none; }
    The above won't work if you haven't given us the entire contents of your CSS/HTML structure.

    Remember inline styling over-writes stylesheets.
    Andrew Sharman
    Web designer, developer and programmer.

    If you found my post helpful, why not give thanks! :)

  • #5
    New Coder
    Join Date
    Jul 2005
    Posts
    92
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Alright . . . I suppose I trudge through the code and remove the font tags and the little bit of inline styling that actually exists and see if that doesn't get rid of my problems.

    Thanks for the help and advice.

  • #6
    New Coder
    Join Date
    Jul 2005
    Posts
    92
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Alright, I updated everything . . . got rid of all but a few lines of necessary inline styling, got rid of all the font tags . . . replaced with span or div depending on the situation. And whatdya know, problem solved.

    Still . . . any idea why it wasn't working the first way?


  •  

    Posting Permissions

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