2011-06-12 55 views
0

我用了一个在线HTML制造商获得这个如何更改HTML字符串中的字体大小?

<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: x-large; color: #993300;\">A <strong>canyon</strong>&nbsp;is a deep, narrow valley with steep sides. &nbsp;Many canyons have rivers or streams running through them.</span></p> 

但字体太小,当我换上了更大的尺寸在HTML制造商,并将其复制到我的代码,它仍然显示了同样的尺寸。我在Web视图中使用它来显示一些带有自定义格式的文本。

回答

1

您可以在font-size属性中输入实际值,例如font-size:48px。如果你输入一个足够大的数字,它应该显示大于使用x-large

1

为什么在报价之前你有“\”?它不应该是:

<span style="font-family: arial, helvetica, sans-serif; font-size: x-large; color: #993300;"> 
+1

因为整行是nsstring的一部分,需要转义引号。 – Marty 2011-06-12 22:56:56

0

有两种方法可以解决这个问题。

第一种方式已经过时,所以你不应该使用这种方法:

<font size="5" face="arial" color="red">

HTML负责布局,因此,包括设计和格式并不好。

第二种方式是通过操纵CSS:

h1 {font-size:250%}

取而代之的百分比,可以使用像素像素。

祝你好运!

相关问题