Okay, so I know that in HTML you can use the
tag, but isn\'t there a
\"weight=bold\"
attribute that I can use in the
You can make text or words Bold
with using <b>Text</b>
tag.
You can also use <strong>Text</strong>
tag
Head tags <h1>
, <h2>
, <h3>
, ... are default bolded tags and make your text Bold by default unless you change their style with CSS
Above tags was available in HTML but if you like to change the style with CSS
you can use
font-weight:bold
Use the <strong>
tag because it's more semantic. <b>
has been depreciated so it's best not to use it. Also bold text is given more Search Engine Optimisation (SEO) weight so it's always best to use a real <strong>
rather than making a <p>
or <span>
bold using CSS.
You can code like below..
<html>
<head>
<style>
p.boldstats{
font-weight: bold
}
</style>
</head>
<body>
<p class="boldstats"> The bold finder </p>
</body>
</html>
On a sidenote the below code will also make it bold.
<strong> text here </strong>
The answer by @Darryl Hein is correct despite one point - <b>
is not recommended at all since XHTML, because it's not semantic.
<strong>
means semantically highlighted text
font-weight: bold
means visually highlighted text
<strong>
can be css-tuned to not be bold, though it's a conventional default. It can be made red, or italic, or underlined (though all these possibilities are not really user-friendly). Use it for phrases / words in text, not because of visual design, but related to their meaning
font-weight: bold
should be used for design-related bold parts, like headers, sub-headers, table header cells etc.
Its in CSS you have to set font-weight: bold;
as style