I realize that in the modern day, most people use CSS to perform styling, and will have CSS define what H2 looks like.
However, please imagine that I’m trying to make my text looks like it is the default appearance of <h2>, but have it on a line with other text.
Is it possible to do this in HTML4?
Alternatively, is it possible to emulate it using CSS?
Assume I am NOT setting a style on <h2> directly.
By default, all HTML headings (
<h1>to<h5>) are displayed asblock. This means a heading will be in a separate line if there is other elements surrounding it.You can change that with CSS by applying
display: inlineto your heading. If you need it to keep some block behavior (like having a certain width, for example), you can usedisplay: inline-blockinstead.