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
<p> tags and <h4> tags
Old 07-31-2006, 12:55 PM <p> tags and <h4> tags
Webmaster Talker

Posts: 626
Trades: 0
I am looking to style the <h4> tags that I have within a p tag... This is what I have done:

[css]
p h4 {
font-size:14px;
color:#AA0000;
}
[/css]

When I take the "p" away and have just the h4, it works but it changes all the h4 tags. I only want to change the ones I have within the p tag.

Am I doing this wrong? Do I have to use a class for this?
jim.thornton is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-31-2006, 01:44 PM Re: <p> tags and <h4> tags
b0881's Avatar
Super Talker

Posts: 112
Name: Bobby
Trades: 0
You only want to use a h4 tag for one piece of text really, this way its unique.
b0881 is offline
Reply With Quote
View Public Profile
 
Old 07-31-2006, 01:49 PM Re: <p> tags and <h4> tags
Webmaster Talker

Posts: 626
Trades: 0
The way I have been been re-designing my pages includes a writeup on a product/service and half way through the article, I put an h4 tag with a keyword phrase in there. Similar to how they do it in magazines.

So I really only have one or two pieces of text within the h4 tags, but I have them within the <p></p>. Is that the wrong way of doing it??

I thought it would be good to do it within a <p> tag so that if for any reason I wanted to use an h4 tag somewhere else, I could without the style being affected.

Is it better to place h4 tags on their own? For example:

<p>Blah blah </p>

<h4>Keyword phrase</h4>

<p>another write up going into detail of the keyword phrase</p>
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 07-31-2006, 01:53 PM Re: <p> tags and <h4> tags
b0881's Avatar
Super Talker

Posts: 112
Name: Bobby
Trades: 0
no the way you are using it is fine, but how come your so fixated on using the h4 tag?

Are you also using h1, h2 and h3 tags?

If not then give each emphasised pieced of text a seperate h tag, then just style each h tag the same. Theoretically it should work if you just used the same tag I think but its not really advisable.

Let me know how you get on.
b0881 is offline
Reply With Quote
View Public Profile
 
Old 07-31-2006, 02:08 PM Re: <p> tags and <h4> tags
Webmaster Talker

Posts: 626
Trades: 0
I am using the h1 tags as the content title.

There really isn't any reason for the fixation on h4 tags, I guess that is a good idea just to style each one differently and use the appropriate tag for the specific style I want.

Thanks.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 07-31-2006, 02:09 PM Re: <p> tags and <h4> tags
b0881's Avatar
Super Talker

Posts: 112
Name: Bobby
Trades: 0
No problem, happy to help.
b0881 is offline
Reply With Quote
View Public Profile
 
Old 07-31-2006, 07:33 PM Re: <p> tags and <h4> tags
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
It is semantically improper markup to put a HEADING tag INSIDE a <p>. A heading is just that, it should stand alone as it would in any standard document outline. If you want a section of text inside a <p> to be different, create a class and use a <span> wrapped around that section of text.

Sticking a heading inside a paragraph just to populate a keyword is improper. A heading is just that, a HEADING.
__________________
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-31-2006, 07:58 PM Re: <p> tags and <h4> tags
b0881's Avatar
Super Talker

Posts: 112
Name: Bobby
Trades: 0
True, it could probably be labelled improper, but personally I think if it works and it validates then its not a huge issue.

Just a matter of opinion I suppose.
b0881 is offline
Reply With Quote
View Public Profile
 
Old 07-31-2006, 08:18 PM Re: <p> tags and <h4> tags
Skilled Talker

Posts: 92
Trades: 0
You have your people who care and those that don't. It takes more work to get a heading tag to work since you also have to set the padding and margins to 0 so the text isn't messed up. It would be a lot easier to just use a span as LadynRed suggested.
__________________

Please login or register to view this content. Registration is FREE
Entertaining at least a few people every Monday night from 4-6 pm EST.
waffles is offline
Reply With Quote
View Public Profile Visit waffles's homepage!
 
Old 07-31-2006, 08:24 PM Re: <p> tags and <h4> tags
b0881's Avatar
Super Talker

Posts: 112
Name: Bobby
Trades: 0
If you just want to make certain pieces of text bold you could always simply use the <strong> tag, it's an option.
b0881 is offline
Reply With Quote
View Public Profile
 
Old 08-01-2006, 12:01 AM Re: <p> tags and <h4> tags
Webmaster Talker

Posts: 626
Trades: 0
I thought the <strong> tag is being deprecated?

The idea of using the h4 tag is not only to populate keywords. The intention is for look and feel but I figured I would get an extra SEO burst by using the heading tags. Some of my pages don't have it (if it doesn't fit or look right).
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 08-01-2006, 05:32 AM Re: <p> tags and <h4> tags
b0881's Avatar
Super Talker

Posts: 112
Name: Bobby
Trades: 0
Yeah I believe it is, it was just as a short term option untill you decided how you were going to play it by CSS thats all.
b0881 is offline
Reply With Quote
View Public Profile
 
Old 08-01-2006, 06:23 AM Re: <p> tags and <h4> tags
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
LaydyInRed is right, no hX tags should be inside P tags. It probably won't validate. h1, h2, h3, h4 etc. are headings, p is paragraph. Headings go above paragraphs, not inside them. If you want to style them seperately from other h4 tags, think about putting the whole lot inside a DIV and style the children of that DIV. Or just give them all a class name and style that.

The reason you would use h4 tags as opposed to h1, h2, h3, etc. is to do with document structure - NOT style or SEO. For example,

Heading 1
- Heading 2
- - Heading 3
- - Heading 3
- - - Heading 4
- - Heading 3
- - Heading 3
- Heading 2
- - Heading 3

etc. It depends which 'level' of headings you're at. Some screen readers and things actually make use of this to help the user navigate around the document.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 08-01-2006, 12:24 PM Re: <p> tags and <h4> tags
Webmaster Talker

Posts: 626
Trades: 0
I am not using the h4 tags for the purpose of SEO, it is just my understanding that if keyword phrases are in hx tags that it helps with SEO. It will be very user friendly when I am done.

I am using the h4 as opposed to the h1 h2 h3 tags because I am thinking ahead. As I am redesigning these pages I will be using other hx tags elsewhere.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 08-01-2006, 04:27 PM Re: <p> tags and <h4> tags
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
I am not using the h4 tags for the purpose of SEO, it is just my understanding that if keyword phrases are in hx tags that it helps with SEO.
You just contradicted yourself, you want to put a keyword in an H4 to help SEO.. forgive me but that IS for the purpose of SEO. It is STILL improper markup no matter what your reasoning is. If a person using a screen reader came upon your heading inside a <p> it would read it to the user AS A HEADING - but it would NOT make any sense to have a heading stuck in the middle of a paragraph.
__________________
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 08-01-2006, 05:24 PM Re: <p> tags and <h4> tags
Skilled Talker

Posts: 92
Trades: 0
Just wrap a span around it and make it look like a heading. It's not that hard.
__________________

Please login or register to view this content. Registration is FREE
Entertaining at least a few people every Monday night from 4-6 pm EST.
waffles is offline
Reply With Quote
View Public Profile Visit waffles's homepage!
 
Old 08-01-2006, 11:11 PM Re: <p> tags and <h4> tags
Webmaster Talker

Posts: 626
Trades: 0
LadyNred... I missed a word there... ONLY. I am not ONLY using the h4 tag for the purpose of SEO. It is just my understanding that it I can benefit from keywords in a heading tag.

waffles, I'm not worried about the difficulty of using a span and making it look like a heading but I just thought if I am going to make it look like a heading I might as well using a heading tag.

LadynRed, as far a looking odd... Magazines and news papers do it all the time. They have a paragraph and they put bold sub-heading styled clips which are designed to get the readers attention and want to continue reading. They use strategically chosen phrases which are basically keyword phrases, that is the idea I am going with.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 08-02-2006, 07:26 AM Re: <p> tags and <h4> tags
AliKat's Avatar
Extreme Talker

Latest Blog Post:
Save the Children
Posts: 176
Location: MS
Trades: 0
Quote:
Originally Posted by zincoxide View Post
sub-heading styled clips
Keyword is styled. As everyone else has pointed out putting an h4 in a p is not valid markup.

If you want to continue as you are you can use a class inside all of your h4 inside of a p to distinquish which h4s you want to style. However his is invalid markup and you should either use a span tag or a strong tag. I personally suggest using a span and a class.

Something to the effect of .keyword {font-weight: bold;}
AliKat is offline
Reply With Quote
View Public Profile Visit AliKat's homepage!
 
Old 08-02-2006, 11:01 AM Re: <p> tags and <h4> tags
Webmaster Talker

Posts: 626
Trades: 0
I'm not saying that I will necessarily continue as I am, LadyNred just said that it would look funny having a heading in the middle of a paragraph.

Is it invalid markup if I take it out of the p tags and just leave them on their own? The only reason I had it in the p tag was so that I can control them separate from all the others. However, with the suggestion of having h1, h2, h3, h4, all styled differently and then just use the appropriate one.

Or, is that improper as well? I'm just thinking, if I am going to have it look like a heading, why not get the extra boost for the SEO? I'm not trying to be stubborn on this, I'm just looking for some opinions.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 08-02-2006, 04:14 PM Re: <p> tags and <h4> tags
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You can style any element any way you wish, and styling each Hx separately is perfectly legit.

Quote:
Magazines and news papers do it all the time. They have a paragraph and they put bold sub-heading styled clips which are designed to get the readers attention and want to continue reading.
I believe what you're referring to is called a pull quote and it is something else entirely. I can put pull quotes in a web page, but it would be styled text, not an Hx.
__________________
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
 
Reply     « Reply to <p> tags and <h4> tags

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 0.54789 seconds with 12 queries