Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Adding a style to an H3 tag?
Old 07-10-2009, 04:03 PM Adding a style to an H3 tag?
Ultra Talker

Posts: 316
Trades: 0
I have a few instances of an H3 tag on a page.

For one of them I want to apply an additional style.

I have created a new class called underline. Can I apply this style to this one instance of my H3?

I thought maybe something like this might work but no:

Code:
<h3 class="underline">
Any ideas?

Thanks.
Joe3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-10-2009, 04:10 PM Re: Adding a style to an H3 tag?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Yes, you can do that. You can also combine classes, so if you already have a class for the H3 and you want to ADD this underline, you can do it like this:

<h3 class="red underline">, "red" being the first class, and "underline" being the 2nd.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-10-2009, 04:26 PM Re: Adding a style to an H3 tag?
Ultra Talker

Posts: 316
Trades: 0
Thank you. That works for me! Next question:

What if there is a link in the <h3> tag like <h3>link here</h3> and there is already h3 link styles. Can I overwrite them?

I have tried <h3 class="underline"> and creating link styles for underline like so:
Code:
.underline a:link, .underline a:active, .underline a:visited {
    text-decoration:hover;
    color:yellow;
    }
.underline a:hover {
    text-decoration:none;
    color:yellow;
    }
But the H3 link styles prevail.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 07-10-2009, 04:30 PM Re: Adding a style to an H3 tag?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You'll have to write it as h3.underline a:link, etc. See, .underline a:link could apply to ANYTHING, where as h3.underline is more specific and ONLY applies to an H3 with the class of .underline.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-10-2009, 04:57 PM Re: Adding a style to an H3 tag?
Ultra Talker

Posts: 316
Trades: 0
Thanks. Just to make matters more complicated those H3s are inside a div which has its own link styles so the actual h3 link styles had to be called #right-middle h3.underline a:link etc

I'm sure I'm doing something fundamentally wrong but it seems to work.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 07-10-2009, 05:28 PM Re: Adding a style to an H3 tag?
kline11's Avatar
SearchBliss Web Tools

Posts: 1,724
Name: John
Location: USA
Trades: 0
Quote:
Originally Posted by Joe3000 View Post
Thanks. Just to make matters more complicated those H3s are inside a div which has its own link styles so the actual h3 link styles had to be called #right-middle h3.underline a:link etc

I'm sure I'm doing something fundamentally wrong but it seems to work.
What you're doing is fine.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to Adding a style to an H3 tag?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.10918 seconds with 12 queries