不能改变字体大小 - 愚蠢的问题 [英] can't change font size - stupid question

查看:84
本文介绍了不能改变字体大小 - 愚蠢的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试我的第一个无桌面网站,而且我已经撞到了墙上的b
。我不能改变div中的字体大小。


真的很快,我的样式表有:


----- --------------------------------

body {font:8pt" face" }

#nav {float:left;宽度:144px; }

#test {font:12pt; font-weight:bold}

------------------------------------ -


HTML有:


---------------------- ---------------

< div id =" nav">

text< br>

< div id =" test">更大的文字< / div>

< / div>

------- ------------------------------


我可以改变字体粗细,颜色和其他属性。除了尺寸外,一切都是
。无论我尝试什么,我都无法覆盖在体内设置的

磅值。


这看起来如此基本,它正在推动我疯了!帮助!


--cd

解决方案



" Coder Droid" ;写了...

我正在尝试我的第一个无桌面网站,而且我已经撞到了墙上。我不能改变div中的字体大小。

真快,我的样式表有:

------------- ------------------------
body {font:8pt" face" }
#nav {float:left;宽度:144px; }
#test {font:12pt; font-weight:bold}
-------------------------------------



尝试将''font:12pt''更改为''font-size:12pt''


Jim Roberts


也可以参考这个来声明字体属性...

http://www.w3.org/TR/REC-CSS1#font-properties


Quor the raven名为Coder Droid:

我正在尝试我的第一个无桌面网站,我已经抬起头来反对一堵墙。我不能改变div中的字体大小。

真快,我的样式表有:
body {font:8pt" face" }


错误:删除引号和单词face


此外。 pt(分)用于打印。使用%代替访问者

可以看到他/她自己的默认大小。不要使用px,因为IE用户如果他们的视力不够完美,那么
将无法改变大小。


body {

字体大小:100%;

font-family:sans-serif;

}

#nav {向左飘浮;宽度:144px; }


改为使用:


#nav(float:left; width:14em;}

.. 。或者em中的任何宽度都是合适的。使用em来表示div的大小

确保当访问者调整文本大小时设计不会崩溃。

#test {font :12pt; font-weight:bold}


再次,使用百分比设置上面的字体。如果你真的想要你的

导航字体更大比身体,使用字体大小:110%

我可以改变字体重量,颜色和其他属性。
除了大小以外的一切。无论我尝试什么,我只是不能覆盖在体内设置的磅值。

这看起来如此基本,它让我疯了!求助!



一旦你学会了基础知识,其余的很容易。:-)


-

-bts

-这个空间故意留空。


I''m trying my first table-less site, and I''ve bumped my head up against
a wall. I can''t change the font size within a div.

Real quick, my style sheet has:

-------------------------------------
body { font: 8pt "face" }
#nav {float: left; width: 144px; }
#test { font: 12pt; font-weight: bold }
-------------------------------------

HTML has:

-------------------------------------
<div id="nav">
text <br>
<div id="test">bigger text</div>
</div>
-------------------------------------

I can change the font weight, color, and other attributes. Everything
except for the size. No matter what I try, I just can''t override the
point size set in body.

This seems so elementary, it''s driving me nuts! Help!

--cd

解决方案


"Coder Droid" wrote ...

I''m trying my first table-less site, and I''ve bumped my head up against
a wall. I can''t change the font size within a div.

Real quick, my style sheet has:

-------------------------------------
body { font: 8pt "face" }
#nav {float: left; width: 144px; }
#test { font: 12pt; font-weight: bold }
-------------------------------------



Try changing ''font: 12pt'' to ''font-size: 12pt''

Jim Roberts


also, refer to this for declaring font properties...

http://www.w3.org/TR/REC-CSS1#font-properties


Quoth the raven named Coder Droid:

I''m trying my first table-less site, and I''ve bumped my head up
against a wall. I can''t change the font size within a div.

Real quick, my style sheet has: body { font: 8pt "face" }
Error: remove the quotes and word "face"

Further. pt (points) is for printing. Use % instead so the visitor
gets to see his/her own default size. Don''t use px either, as IE users
won''t be able to change size if they have less than perfect vision.

body {
font-size: 100%;
font-family: sans-serif;
}
#nav {float: left; width: 144px; }
Use instead:

#nav (float: left; width: 14em; }
...or whatever width in em is appropriate. Using em for sizes of divs
assures that the design doesn''t fall apart when visitor resizes text.
#test { font: 12pt; font-weight: bold }
Again, set font as above, using a percentage. If you really want your
nav font to be larger than the body, use font-size: 110%
I can change the font weight, color, and other attributes.
Everything except for the size. No matter what I try, I just can''t
override the point size set in body.

This seems so elementary, it''s driving me nuts! Help!



Once you learn the basics, the rest is easy. :-)

--
-bts
-This space intentionally left blank.


这篇关于不能改变字体大小 - 愚蠢的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆