www.webdeveloper.com
Results 1 to 4 of 4

Thread: How to define font for all UL and its a?

  1. #1
    Join Date
    Sep 2005
    Posts
    1,630

    Question How to define font for all UL and its a?

    How to define font for all particular UL and its links as it seems there can be sourunded DIV element but it will not work font size and even add to UL will not work. Just LI with defined fonts will work as they have also links.

    If I define ID within div it will not work font within UL as it has LI and sometimes links.

    Is possible to avoid this and put simple one time font.

    See sample UL:

    PHP Code:
    <div>
          <
    ul>
            <
    li><a href="...">Home</a></li>
            <
    li><a href="...">Services</a></li>
            <
    li><a href="...">Blog</a></li>
            <
    li><a href="...">Forum</a></li>
            <
    li><a href="...">About Us</a></li>
            </
    ul>
    </
    div

    It will not work font size BUT only defined for LI a not all content within UL (links or not links).

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Not very clear what exactly you want, but I guess you may use a wildcard *
    Code:
    #mydiv ul, #mydiv ul *{
    color:#CC0000;
    }

  3. #3
    Join Date
    Sep 2005
    Posts
    1,630
    you see at LI can be link or without
    Within div can be link or without

    So, issue is how to define the same font in all specifications within DIV.
    Is * compliant to all browsers?

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by toplisek View Post
    you see at LI can be link or without
    Within div can be link or without

    So, issue is how to define the same font in all specifications within DIV.
    Is * compliant to all browsers?
    Yes * is full compliant. To define the same class for all the elements within a div with the id, say, "mydiv" it is enough to:
    Code:
    #mydiv *{
    color:#ff0000;
    }
    You may also specify only the tags you want to follow that class:
    Code:
    #mydiv ul, #mydiv a{
    color:#ff0000;
    }
    That means only the UL elements and the A elements nested in that DIV will follow that class, but not the other elements (for instance not the LI elements)

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