[b]before modifying[/b]
<p>This item has no width and is stretched
by the content it contains.</p>
[b]after modifying[/b]
<p>This item has no width and is stretched
by the content [COLOR="#FF0000"]<b>[/COLOR]it[COLOR="#FF0000"]</b>[/COLOR] contains.</p>
I deleted my post because I thought for a moment that I must be missing something; but in retrospect, I don’t think I was.
The <b> tag has already been given {display:block} so it will generate line breaks.
You will need to use a different tag to target the text. For example…
[noparse]<span>it</span>[/noparse]
If you really want to use the [noparse]<b>[/noparse] tag to target “it”, then you could re-code the [noparse]<b>[/noparse] so it addresses only the top and bottom lines:
.top b,
.bottom b {display:block}
That would leave .content untouched.
(I’ve never seen this hack before… interesting :scratch: )
The ‘error’ happened in your selection (or planning), specifically : .test b{…}
this rule will apply to ALL DESCENDANT B TAGS of .test, perhaps you wanted to have a B tag that was a child of the DIV be a block, or maybe this specific B tag inside the P was an exception which you wanted to be inline.
Depending on the code of your entire page, you could use a class for the B tag you want to be block/inline.
.test .noBlock b { display:inline; }
<p class="noBlock">This item has no width and is stretched
by the content <b>it</b> contains.</p>