等效于“字体大小+ 2”的HTML样式标签
什么是新的风格方式临时增加字体大小,然后返回正常(不使用CSS,或CSS是更好的方式?)。
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.
下面的第1行工作(旧的做事方式)。
第2行的修复是什么?
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>.
我将创建一个类(让我们说.hebrew)并将font-size属性设置为1.2em。这样,无论周围文本的字体大小如何,希伯来语类的文本将会大20%。
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;
}
这里是快速 demo jsFiddle 来说明(用绿色显示以帮助显示差异)。
Here's a quick demo jsFiddle to illustrate (colored with green to help show the difference).
评论,要在您的HTML中使用这个,您将添加类如下:
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>