Creating a CSS class to use in DIV to affect all contents of the DIV???

Discussion in 'HTML' started by Some One, Aug 7, 2003.

  1. Some One

    Some One Guest

    Hi!

    I've created a CSS class that I use in a DIV tag. Is there a way that
    I can write this class so it affects all the elements within the DIV?
    I'm trying to affect the "text-decoration" of all the text elements
    within the DIV (anchors, paragraphs, etc.)

    What I have is pretty simple. The part sample below should produce
    three lines of text on the browser, all links to various pages. The
    first should be the default link colour, with no underline. The second
    should be white text with an underline. The third and fourth should be
    white text with no underline, indented 10 pixels. That isn't what
    happens. They all follow the "a" (anchor) setting of "none" for the
    decoration and the last two ignore the "color" setting to white. The
    indent DOES work.

    Obviously I'm doing something wrong. Can someone take a look and let
    me know what my mistake is?

    -------------------------------
    <style>
    a { text-decoration: 'none';}

    .menu { color: '#ffffff';}

    .level1 { margin-left: '0px'; text-decoration: 'underline';}

    .level2 { margin-left: '10px'; text-decoration: 'none';}

    </style>

    ....some code

    <a href="home.html">Home</a><br>
    <div class="menu level1"><a href="apage.html">A page</a><br></div>
    <div class="menu level2"><a href="subpage1.html">Subpage
    1</a><br></div>
    <div class="menu level2"><a href="subpage2.html">Subpage
    2</a><br></div>

    -----------------------------------

    Thanks muchly!!!

    P.S. I didn't see a CSS newsgroup - is there one that I missed?
     
    Some One, Aug 7, 2003
    #1
    1. Advertising

  2. Some One wrote:

    > I've created a CSS class that I use in a DIV tag. Is there a way that
    > I can write this class so it affects all the elements within the DIV?
    > I'm trying to affect the "text-decoration" of all the text elements
    > within the DIV (anchors, paragraphs, etc.)


    Set text-decoration to 'foobar' for all elements contained within the
    <div> with class 'blah':

    div.blah * { text-decoration: foobar; }

    Set only for specific elements:

    div.blah p, div.blah li { text-decoration: foobar; }

    --
    Toby A Inkster BSc (Hons) ARCS | mailto: | pgp:0x6A2A7D39
    aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:
    http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
    playing://(nothing)
     
    Toby A Inkster, Aug 7, 2003
    #2
    1. Advertising

  3. Some One

    Some One Guest

    "Toby A Inkster" <> wrote in message
    news:p...
    > Some One wrote:
    >
    > > I've created a CSS class that I use in a DIV tag. Is there a way

    that
    > > I can write this class so it affects all the elements within the

    DIV?
    > > I'm trying to affect the "text-decoration" of all the text

    elements
    > > within the DIV (anchors, paragraphs, etc.)

    >
    > Set text-decoration to 'foobar' for all elements contained within

    the
    > <div> with class 'blah':
    >
    > div.blah * { text-decoration: foobar; }
    >
    > Set only for specific elements:
    >
    > div.blah p, div.blah li { text-decoration: foobar; }


    Thank you VERY much!

    This was exactly what I needed to know. I knew it could be done, but
    could not remember how (or think of what to Google).

    Take care!
     
    Some One, Aug 7, 2003
    #3
  4. Some One wrote:

    > This was exactly what I needed to know. I knew it could be done, but
    > could not remember how (or think of what to Google).


    For future reference, go to Google, enter "css selectors" and hit "I'm
    Feeling Lucky" :)

    --
    Toby A Inkster BSc (Hons) ARCS | mailto: | pgp:0x6A2A7D39
    aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:
    http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
    playing://(nothing)
     
    Toby A Inkster, Aug 7, 2003
    #4
  5. Some One

    andy johnson Guest

    On Thu, 07 Aug 2003 22:26:02 +0100, Toby A Inkster
    <> wrote:

    >Some One wrote:
    >
    >> This was exactly what I needed to know. I knew it could be done, but
    >> could not remember how (or think of what to Google).

    >
    >For future reference, go to Google, enter "css selectors" and hit "I'm
    >Feeling Lucky" :)



    Well, I'm feeling STUPIDD. I've been trying to learn CSS, with some
    success actually, and run across the foobar thing occasionally, as in
    the W3C site, which is what google took me to a la above... WHAT IS IT
    in dumbshit?

    TIA,

    Andy

    "There would be a lot more civility in this world if people
    didn't take that as an invitation to walk all over you"
    - (Calvin and Hobbes)
     
    andy johnson, Aug 8, 2003
    #5
  6. andy johnson wrote:

    > Well, I'm feeling STUPIDD. I've been trying to learn CSS, with some
    > success actually, and run across the foobar thing occasionally, as in
    > the W3C site, which is what google took me to a la above... WHAT IS IT
    > in dumbshit?


    The original FOLDOC seems to be down, but there are mirrors:

    http://www.nightflight.com/foldoc-bin/foldoc.cgi?query=foobar

    --
    Toby A Inkster BSc (Hons) ARCS | mailto: | pgp:0x6A2A7D39
    aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:
    http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
    playing://(nothing)
     
    Toby A Inkster, Aug 9, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ad
    Replies:
    2
    Views:
    7,592
  2. Replies:
    1
    Views:
    402
    Jonathan Wood
    Jun 18, 2008
  3. Daniel Waite
    Replies:
    8
    Views:
    156
    Andrew Stewart
    May 2, 2008
  4. Replies:
    0
    Views:
    203
  5. Yan Huang
    Replies:
    3
    Views:
    106
    Thomas 'PointedEars' Lahn
    Oct 15, 2009
Loading...

Share This Page