Forum Moderators: open
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.
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.
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>
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>