help? css? dreamweaver 8

Discussion in 'Web Design and Development' started by powerlily, Mar 17, 2007.

  1. powerlily macrumors newbie

    Joined:
    Jan 15, 2007
    #1
    hello! I am at the pathetic first attempt to make a web site and I got stuck at what has probably a very simple answer

    I want the text in the page to have a different link colour than the text in the menu
    I set the page properties
    and I put class=menu in the code of what I want to be the menu, to follow menu properties that I have set

    it doesn't work

    what can I do?
    ((I am working with layers, not tables))
    thank you for any suggestion
    :confused:
     
  2. rogersmj macrumors 68020

    rogersmj

    Joined:
    Sep 10, 2006
    Location:
    Indianapolis, IN
    #2
    I suggest you read some CSS articles. This is asked here a lot and is covered in any decent tutorial. As I posted here a week or so ago:

    For example, if you have links in two different parts of your page:

    Code:
    <div id="header">
      <a href="#">Link in header</a>
    </div>
    
    <div class="navigation">
     <a href="#">Nav link</a>
    </div>
    
    Then to give them two different colors you would have something like this in your CSS file:

    Code:
    #header a {
       color: #990000; /* red */
    }
    
    .navigation a {
       color: #000099; /* blue */
    }
    
    What you're seeing there is very basic CSS selectors. Having "#header a" as the selector says "For any <a> tag inside of something with an ID of 'header', the following applies." Same deal with navigation, except I used a class instead of an ID.

    You can take this idea further and define their hover behaviors differently:

    Code:
    #header a {
       color: #990000; /* red */
       text-decoration: none;
    }
    #header a:hover {
       text-decoration: underline;
    }
    
    .navigation a {
       color: #000099; /* blue */
    }
    
    That addition removes the default underline on the links in the #header div only, but applies the underline when you hover over them. The behavior of other links on the page remains unchanged.
     
  3. powerlily thread starter macrumors newbie

    Joined:
    Jan 15, 2007
    #3
    thanks a lot guys! it worked indeed - the problem also was that I wrote "font" instead of "font-family", now fixed :)
     
  4. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN

Share This Page