开发者

can we increase the font size in html?

开发者 https://www.devze.com 2023-01-14 17:07 出处:网络
How can we increase the font size in html? <font face=\"Garamond\" size=\"7\"> up to this size only it is working.

How can we increase the font size in html?

<font face="Garamond" size="7">

up to this size only it is working. Is there any way to increase the size开发者_开发知识库 of the font?


You can use the font-size css property: Example

<span style="font-size:20px;">This is large Text...</span>

There is also <font> tag but it is deprecated.


The largest size the font tag supports is 7. If you need it to be larger, you will have to use CSS, which you should probably be using anyway because the font element is deprecated.

The CSS font-size values, xx-small, x-small, small, medium, large, x-large, and xx-large are comparable to <font size="1"> through <font size="7"> if you want to specify the size like that, but you would run into the same size limitation. The more typical way is to use px or pt for absolute sizes, and % or em for relative sizes.


Adding onto the answers that exist. Inline styling is usually frowned upon, because:

  1. In huge HTML pages, this can cause a maintenance nightmare for anyone that has to maintain it.
  2. Does not separate content from design.
  3. They add unnecessary length to the HTML page.
0

精彩评论

暂无评论...
验证码 换一张
取 消