Forum Moderators: open

Message Too Old, No Replies

Adding Bold Tag Within Heading Tag

         

gouri

8:38 pm on Dec 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Normally, when you put any words in an H1 or H2 tag, I see that the text is bolded. You can check by copying and pasting into Word and see that the words are bolded.

I am currently in a situation where I am specifying the font size within the h1 and h2 tags and when this is done, the text in the tag does not bold. I wanted to ask if it might be ok to put the words in a strong tag, the strong tag being inside the heading tag?

I think some of the power of the h1 and h2 tags might come from the fact that they are bolded and if the words in it are not maybe the bold tag has to be added.

pageoneresults

8:50 pm on Dec 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Normally, when you put any words in an H1 or H2 tag, I see that the text is bolded. You can check by copying and pasting into Word and see that the words are bolded.

No need to go through those steps gouri, the <h> elements are bold by default.

I am currently in a situation where I am specifying the font size within the h1 and h2 tags and when this is done, the text in the tag does not bold.

It sounds like you are not doing something correctly. You should be specifying the style of the <h> element through an external style sheet, embedded style ( in <head> ) or an inline style like this...

<h1 style="font-size:110%"></h1>

I wanted to ask if it might be ok to put the words in a strong tag, the strong tag being inside the heading tag?

I wouldn't, that's not good practice. Code bloat galore.

I think some of the power of the h1 and h2 tags might come from the fact that they are bolded and if the words in it are not maybe the bold tag has to be added.

I thought we had this discussion just recently? You're focusing too hard on the minutia of the elements. Use the <h> elements as the HTML guidelines specify you use them. If you've done everything properly and have really separated style from content, you'll end up with a page that is nothing but raw html elements with everything being styled from your external style sheets. You'll have a page that may look like this...

<body>
<h1>
<p></p>
<ul>
<li></li>
</ul>
<h2></h2>
<p></p>
<p></p>
</body>

It will be very simple and then you'll see that all that extra fluff you are adding doesn't do anything other than add to page weight. In fact, it may even negate some positive stuff that occurs from a nice clean indexing free of errors and such.

lavazza

9:05 pm on Dec 4, 2008 (gmt 0)

10+ Year Member



I am specifying the font size within the h1 and h2 tags

It may well be the way you are doing this

If you post a tiny snippet of the relevant code, you're likely to get some feedback :)

gouri

10:33 pm on Dec 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For some of the templates, I cannot use css. It changes the way the template appears when viewing the pages on the internet. I have to use html, and when I use it, it is ok. I hear what you are saying about css not adding fluff to the code.

Below I posted a sample of the code and when I copy and paste the text from the webpage onto Word, it does not show that it is bolded. For that reason, I wanted to see if adding <strong></strong>
before and after the text might be ok?

<h2><font face="arial" size="3">text here</font></h2>

to <h2><font face="arial" size="3"><strong>text here</strong></font></h2>

tedster

1:41 am on Dec 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can add CSS rules to the <head> section of the page itself, or even inline... and you never need to use <font> tags. They are deperecated and eventually will vanish.

in the <head>

<style type="text/css">h2{font-family:arial,sans-serif;font-size:1.5em;font-weight:bold;:}</style>

inline

<h2 style="font-family:arial,sans-serif;font-size:1.5em;font-weight:bold;">text here</h2>

gouri

2:07 pm on Dec 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you for showing me both ways of using CSS on a page. I think this is something that I can go with.