Is there a way to remove bold styling from part of a header?
<h1>**This text should be bold**, but this text should not</h1>
Is there a way to accomplish this?
Join Stack Overflow to learn, share knowledge, and build your career.
Is there a way to remove bold styling from part of a header?
<h1>**This text should be bold**, but this text should not</h1>
Is there a way to accomplish this?
You could wrap the not-bold text into a span and give the span the following properties:
.notbold{
font-weight:normal
}
and
<h1>**This text should be bold**, <span class='notbold'>but this text should not</span></h1>
See: http://jsfiddle.net/MRcpa/1/
Use <span>
when you want to change the style of elements without placing them in a new block-level element in the document.
If you don't want a separate CSS file, you can use inline CSS:
<h1>This text should be bold, <span style="font-weight:normal">but this text should not</span></h1>
However, as Madara's comment suggests, you might want to consider putting the unbolded part in a different header, depending on the use case involved.
Yes you can add text inside <span>
and override css. jsfiddle
html:
<h1>**This text should be bold**, <span>but this text should not</span><h1>
css:
span{
font-weight: normal;
}
Better one: Instead of using extra span tags in html and increasing html code, you can do as below:
<div id="sc-nav-display">
<table class="sc-nav-table">
<tr>
<th class="nav-invent-head">Inventory</th>
<th class="nav-orders-head">Orders</th>
</tr>
</table>
</div>
Here, you can use CSS as below:
#sc-nav-display th{
font-weight: normal;
}
You just need to use ID assigned to the respected div tag of table. I used "#sc-nav-display" with "th" in CSS, so that, every other table headings will remain BOLD until and unless you do the same to all others table head as I said.
It is super simple, By using "font" inside paragraph. An example is shown below:
<h1>Heading 1</h1>
<p><font size="6"> Heading 1</font></p>
Heading 1
Heading 1
<ul>
<li><strong>This text will be bold.</strong>This text will NOT be bold.
</li>
</ul>
strong
element within an unordered list item.
– Heretic Monkey
Jan 31 '17 at 22:34