Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Creating a CSS class to use in DIV to affect all contents of the DIV???

Reply
Thread Tools

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

 
 
Some One
Guest
Posts: n/a
 
      08-07-2003
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?


 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      08-07-2003
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 | (E-Mail Removed) | pgp:0x6A2A7D39
aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:(E-Mail Removed)
http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
playing://(nothing)
 
Reply With Quote
 
 
 
 
Some One
Guest
Posts: n/a
 
      08-07-2003

"Toby A Inkster" <(E-Mail Removed)> wrote in message
news(E-Mail Removed). ..
> 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!


 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      08-07-2003
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 | (E-Mail Removed) | pgp:0x6A2A7D39
aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:(E-Mail Removed)
http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
playing://(nothing)
 
Reply With Quote
 
andy johnson
Guest
Posts: n/a
 
      08-08-2003
On Thu, 07 Aug 2003 22:26:02 +0100, Toby A Inkster
<(E-Mail Removed)> 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)
 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      08-09-2003
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-bi...i?query=foobar

--
Toby A Inkster BSc (Hons) ARCS | (E-Mail Removed) | pgp:0x6A2A7D39
aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:(E-Mail Removed)
http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
playing://(nothing)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any way to affect gridview row appearance based on contents? COHENMARVIN@lycos.com ASP .Net 1 06-18-2008 08:17 PM
possible viewport question, need to control what portion of div contents appear when overflow:auto and too much content in div Jake Barnes Javascript 1 09-05-2007 11:00 PM
if innerHTML used twice then it replaces the contents i want it to display all the contents virendra.amritkar@gmail.com Javascript 0 06-29-2007 08:13 AM
What class in CSS affect the head of GridView ad ASP .Net 2 08-04-2006 02:15 PM
<div class="position"> and <div class" section"> Luigi Donatello Asero HTML 31 05-07-2006 02:52 AM



Advertisments