#1
  1. No Profile Picture
    Just Another Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Middle America
    Posts
    41
    Rep Power
    13

    Another CSS Question


    In the top of my document, using PHP, I included a php file that contains a style sheet.
    The style sheet is the following:

    <style type="text/css">
    a:link {text-decoration:none;color:#ffffff;}
    a:visited {text-decoration:none;color:#ffffff;}
    a:hover {text-decoration:underline;color:#ff0000;}
    </style>

    This should make all of my links white with no underlines, the visited ones are white with no underlines, and when the cursor hovers over the link it should be red and underlined.

    This works great. My problem is, there is an area of the website that has a white background. This poses a problem if there is a hyperlink on the page, because it would be impossible to see the white hyperlink on a white background.

    To get around this problem, I have added this declaration to any link on that white background:

    <p style=font-size: 10pt; color: black>

    This too, works great, except that because it is a <p> break, it moved my link down to the next line, which is annoying.

    Example:

    This is my sample <a href=link.htm><p style=font-size: 7pt; color: black>link</p></a>

    Gives the result:

    This is my sample
    link

    I would much rather it all be on the same line. Do you follow? Is that confusing enough?

    Any help?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    New York
    Posts
    122
    Rep Power
    14
    Create a new style definition, either of the following would do:

    The following class can be applied to any element:
    .special {color:#000000;text-decoration:none;}
    This one can only be applied to <a> elements:
    a.special {color:#000000;text-decoration:none;}

    Then assign the class to your <a> tags:

    <a class="special">....</a>


    Another alternative would be to use <span> tags rather than <p> tags.

    Yet another alternative would be to add the inline style def. to your <a> tag rather than a <p> tag:
    <a href="#" style="color:#000000;text-decoration:none;">.....</a>

    Whatever you do, check it across different browsers and platforms as compliance with the css specification is sketchy.
  4. #3
  5. CORNHOLIO!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Posts
    51
    Rep Power
    14

    UHH


    But classes wont work for NS, or am I wrong?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    New York
    Posts
    122
    Rep Power
    14
    Classes work in netscape, unless you're talking about some 3.x version. Granted, they sometimes behave oddly, but they work.

    Check out http://www.webreview.com/style/css1/...stergrid.shtml for support details.

IMN logo majestic logo threadwatch logo seochat tools logo