42 users online (2 members and 40 guests)  

Thread: CSS question


  Results 1 to 6 of 6

Related

  1. css question    Forum: CSS Forum
    Replies: 2
  2. Yet another question?    Forum: HTML Forum
    Replies: 3
  3. AnOtHeR QuEsTiOn    Forum: HTML Forum
    Replies: 1
  4. Question    Forum: HTML Forum
    Replies: 2
  5. another question...    Forum: HTML Forum
    Replies: 6
  1. #1
    Zorath's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2003
    Posts
    16

    CSS question

    I have started to recode my site from HTML into CSS, and since I'm new to CSS, I have run in a few problems.

    You can find a page from my site here:
    http://personal.inet.fi/koti/meklund/images/maxck.html

    And the CSS file here:
    http://personal.inet.fi/koti/meklund/images/css.css

    - -

    Here's the code for the logo and menu at the top of the page.

    Code:
    <P CLASS=header><NOBR>
    <IMAGE SRC="images/maxkeen.gif"><BR>
    News | <A HREF="projects.html">Projects</A> | <A HREF="mods.html">Mods</A> | <A HREF="links.html">Links</A> | <A HREF="contact.html">Contact</A>
    </NOBR></P>
    ...and the code from the CSS file:
    Code:
    P.header {
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    }
    I should want to have another 'visited link' color for just this part of the page. Is it possible to do? I should want the code to go into the CSS file.
    Another thing: I use <NOBR> so the menu won't change even if the window is resized -- can this be done with CSS instead?

    - -

    I had some more questions, but I forgot what they were about -- I'll ask them later if I can figure out what they were.
    Last edited by Zorath; 07-17-2003 at 02:46 PM.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya,
    Its possible to control any amount of different elements of a webpage differently by using classes. My tutorial covers these -

    http://css.somepeople.net/

    As to the css replacement for NOBR, its a property called white-space, check out its useage here -

    http://css.somepeople.net/cssref/
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Zorath's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2003
    Posts
    16

    ^

    Thanks for the fast answear, Dean!

    Using white-space worked fine, but I'm still quite confused with how the link colors work (I already read throught your site before I posted the first time).

    Code:
    a:link {
    font-weight: bold;
    text-decoration: none;
    color: #008080;
    }
    
    a:active {
    font-weight: bold;
    text-decoration: none;
    color: #FFD910;
    }
    
    a:visited {
    font-weight: bold;
    text-decoration: none;
    color: #005050;
    }
    
    a:hover {
    font-weight: bold;
    text-decoration: none;
    color: #FD0909;
    }
    
    .header {
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    white-space: normal;
    }
    ^ What shall I add to the .header class to have a new visited link color for it?

    Edit: Seems like there's something wrong with the coding of the message board, the text after the CODE tags becomes smaller than the text before.
    Last edited by Zorath; 07-17-2003 at 04:03 PM.

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya,

    To create a class, you use -

    Code:
    a.className:visited 
    {
    color: black;
    }
    
    
    <a href="whatever.html" class="className">w00t!</a>
    Or you can use contectual selectors , these are applied not from what the element is, but from where it is -

    Code:
    div.toasty a
    {
    color: black;
    }
    
    <div class="toasty">
    <a href="whatever.html">w00t!</a>
    </div>
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    sorry about the font, I knew there was a problem but with all on my mind I could not pinpoint it to the code tag.

    I recently upgraded to the newest software, which you can probably tell is still in beta, I will see what I can do.

    Dave

  6. #6
    Zorath's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2003
    Posts
    16

    Talking

    Thanks, that worked just like I wanted it to!



Tags for this Thread