问题
What is the new "style" way of temporary increasing a font size, and then returning back to the normal (without using CSS, or is CSS the better way?).
I want to insert a Hebrew word in my text, and for beginners, the Hebrew font is just too small. I always want it bigger than the current font size, not pegged to some specific size.
Line 1 below works (the old way of doing things). What is the fix to line 2?
This is normal. <font size="+2">bigger</font> back to norm.
<span style='{FONT-SIZE: +2}'> and also bigger</span>.
回答1:
I would create a class (let's say .hebrew) and set the font-size property to 1.2em. This way whatever the font size is of the surrounding text, the text with the class of hebrew will be 20% larger.
.hebrew {
font-size: 1.2em;
}
Here's a quick demo jsFiddle to illustrate (colored with green to help show the difference).
And as noted in the comments, to use this in your HTML you would add the class like so:
<span class="hebrew"> malesuada augue imperdiet eget. Cum et magnis</span>
回答2:
<font size="+2">
is equivalent to font-size: x-large;
so your second line should be
<span style='font-size: x-large;'> and also bigger</span>.
回答3:
CSS is the better way to do this.
<span style="font-size: 120%;"></span>
来源:https://stackoverflow.com/questions/9458157/html-style-tag-equivalent-of-font-size2