By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,879 Members | 1,809 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,879 IT Pros & Developers. It's quick & easy.

CSS question

100+
P: 254
Expand|Select|Wrap|Line Numbers
  1. h1.b { font-weight: bold }
  2.  
This one explain as, define a class b to h1 element. To use this style, use the following code in html :
-----------------
<h1 class="b">This is header title</h1>

how about the following ? :
Expand|Select|Wrap|Line Numbers
  1. . { text-decoration: underline }
  2.  
how to explain that? which html element can use it?
Feb 6 '07 #1
Share this Question
Share on Google+
5 Replies


jhardman
Expert 2.5K+
P: 3,405

how about the following ? :
Expand|Select|Wrap|Line Numbers
  1. . { text-decoration: underline }
  2.  
I wasn't aware you could use that. I thought you had to say for example:
Expand|Select|Wrap|Line Numbers
  1. .u { text-decoration: underline }
  2.  
and use it in :
Expand|Select|Wrap|Line Numbers
  1. <p class="u">here is an underline paragraph</p>
  2. <p>here is an underlined <span class="u">word</span> in a paragraph</p>
  3. <h1 class="u">here is an underlined header</u>
  4.  
Feb 7 '07 #2

100+
P: 254
hi there,

i know how your example works.

all i been thru for my website design, the following are used by me.
Expand|Select|Wrap|Line Numbers
  1. .u { text-decoration: underline }
  2. h1.u { font-weight: bold }
  3. h1#x { font-weight: normal }
  4. #x { text-decoration: underline }
  5.  
others i never use before.

As the question i ask about
Expand|Select|Wrap|Line Numbers
  1.  . { text-decoration: underline }
  2.  
this happens in my exam question. And i dont know how to answer that, i just say, any html element can use it in a document.

haha.
thanks for the help.
Feb 8 '07 #3

drhowarddrfine
Expert 5K+
P: 7,435
The universal selector is an asterisk '*'. If you just use a period, the validator issues a parsing error. While what you are doing may appear to work, it might just be the browser guessing at what you are trying to do and you can't count on it to be consistent across browsers or pages.
Feb 9 '07 #4

jhardman
Expert 2.5K+
P: 3,405
you said this was an exam question?

I think it was a trick question. As drhoward said, some browsers might recognize it, but it doesn't follow any standard I know.

Jared
Feb 9 '07 #5

100+
P: 254
you said this was an exam question?

I think it was a trick question. As drhoward said, some browsers might recognize it, but it doesn't follow any standard I know.

Jared
yeah it appeared in my test asking me to explain it.

it costs me 8mark, but it shouldn't be a matter to me.

thanks for the helps.
Feb 9 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.