how to set different font sizes in the same html h

2019-03-07 02:56发布

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?

3条回答
祖国的老花朵
2楼-- · 2019-03-07 03:11

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楼-- · 2019-03-07 03:22
"Version1:<span style="font-size:10px;"> (10.3.4)</span>  vs Version2: <span style="font-size:10px;">(10.3.4)</span>
查看更多
forever°为你锁心
4楼-- · 2019-03-07 03:25

This is what you need. No special coding required.

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

查看更多
登录 后发表回答