www.webdeveloper.com
Results 1 to 5 of 5

Thread: three year search

  1. #1
    Join Date
    Sep 2005
    Posts
    6

    three year search

    I have a menu that has to be white text on a black background. I've been getting by, setting up psuedo-classes for any links in the content area. I've been looking to find a way to get the css for the menu to lay-off the text in the content area. It's just a pain in the neck when I cut-and-paste, all the links disappear, it's white text on a white background.

    I set up a css menu, now I've got li's and ul's that have a black background, and a specific width. Now I can't use li's or ul's in the content area.

    The menu's in a div. I'm trying to use a linked style sheet.

    Here's my css-
    http://www.bmdca.org/my_css.htm

    Sample page-
    http://www.bmdca.org/health/bloat.php

    I'd really appreciate it if someone could help me find a way to limit the css to that one div.

    Thank you for your time and attention.

    Hugh

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,617
    If you want something to only apply to elements within a DIV which has an ID (such as <div id="my_id">), then simply use that ID as a parent designator within your CSS selector for the child element:
    Code:
    #my_id a {
    /* only applies to A elements within the #my_id element */
      color: white;
      background-color: black;
    }
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Sep 2005
    Posts
    6

    tried maybe I did something wrong.

    Thanks Dog -

    I tried the id as selector method, but I thought I was still having a problem with li - ul width.

    When I tested the id as selector I stuck a link into one of the lines to be sure that that I was getting black text on a white background.

    I went back, made some of the lines in my experimental list longer. Display was fine.

    Now it looks like I was totally wrong about what was causing my problem.

    It looks like the links in the list are the problem. I'm getting a line break before and after any links I put into a list.

    http://www.bmdca.org/health/bloat2.php
    http://www.bmdca.org/my_css2.htm

    More research!

    Thanks again,
    Hugh

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,617
    This line in the CSS...
    Code:
    #nav ul,li,a {display:block; margin:0; padding:0; border:0;}
    ...is setting all LI and A elements to display as block type elements. I think what you want here is...
    Code:
    #nav ul, #nav li, #nav a {display:block; margin:0; padding:0; border:0;}
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Sep 2005
    Posts
    6
    Thanks Dog,

    You sent me in the right direction.

    I needed one more line

    #nav ul ul ul, #nav li:hover ul ul ul { display:none; }

    Thanks again!

    Hugh

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles