The <strong> HTML tag is known as a phrase tag, it is mainly used to style text. By default it makes text bold to emphasize the look of the tagged text. It is often used in replacement for the b tag. In SEO terms it helps with keyword optimisation, but it is unknown if it is more, less or equally effective as using the b tag. It works equally as well in table based layouts as well as CSS based ones. As with all phrase based HTML tags it can be used in situations where consistency between browsers is difficult to achieve in other ways. When text is put between the opening and closing <strong> tag it is displayed as a strong text.
<strong>Some strong text in here</strong>
Any text between the opening and closing tag will be displayed as a strong text.
It is possible to style and add functionality to the <strong> tag, this is done by adding an attribute to after the p in the opening <strong> tag
Attributes allowed for the <strong>tag include :-class, dir, id, lang, style and title.
In most cases class and id are used and its basic usage is shown below
<strong id=”header”>Some strong text</strong>
With all attributes there is a space after the initial p then the attribute name, then an equal’s sign and the identifier of the attribute in double quotes.
Both id and class attributes refer to CSS styling of the element and is either stored in the <head> of the webpage on in an external file.
With id this usually refers to a single instance on a page where as class usually refers to a repeating element on a page, it is for this reason for the <strong> tag may use either the id or class as an attribute.
The attribute style allows you to include css style information for a single <strong> tag.
The dir attribute allows for left reading and right reading text, lang allows you to specify a language for the tag and title allows you to include extra information for a tag.
<strong>Some strong text</strong> – basic usage example.
<strong id=”header”>Some strong text</strong> – strong text which is styled by the id header.
<strong class=”header”> Some strong text </strong> – strong text which is styled by the class header.
<strong id =”header” class=”header”> Some strong text </strong> – strong text which is styled by the class header and the id header.
<strong style=”color:#F00;”>Some strong text</strong> – strong text which has a custom colour of red.
<strong dir=”rtl”>Some strong text</strong> – strong text where the text reads from right to left.
<strong lang=”uk”>Some strong text</strong> – strong text where the language has been tagged as UK.
<strong title=”title”>Some strong text</strong> – strong text where the tag has been titled title.
Touching on just the surface of the <strong> HTML tag it is easy to see how versatile it is. To take full advantage of it an understanding of CSS is an advantage.