how to set different font sizes in the same html h

2019-03-07 02:59发布

问题:

I want to create an html header as follows

"Version1: (10.3.4) vs Version2: (10.3.4)"

and I want the version number be smaller than the words "Version1" and "Version2"

how can I do this?

回答1:

This is what you need. No special coding required.

<h1>Version1: <small>(10.3.4)</small> vs Version2: <small>(10.3.4)</small></h1>



回答2:

Wrap the version number inside a span and give it a different font-size.

span {
  font-size: 0.5em;
}
<h1>"Version1: <span>(10.3.4)</span>  vs Version2: <span>(10.3.4)</span>"</h1>



回答3:

"Version1:<span style="font-size:10px;"> (10.3.4)</span>  vs Version2: <span style="font-size:10px;">(10.3.4)</span>