哪里是字体属性的正确位置? [英] Where's the proper place for font attributes?

查看:44
本文介绍了哪里是字体属性的正确位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


很可能成为新手!我不确定CSS

的一件事是:适当的地方在哪里?放置字体attibutes的地方?这让我有点困惑。以下面的样式表(这是

进度中的工作)为例。如果我不把字体属性放在

< body>中< p为H.和< td>标签,字体将不会以我想要的方式出现(当

我在FrontPage中工作时,无论如何)。将

字体属性放在< body>中似乎不够。标签,我必须把它放在任何地方如果我

希望我的页面看起来一致。这是正确的,还是我错过了

的东西?

body {background-color:black;保证金:5 5 5 5}


p {font-family:Arial; font-size:13pt;白颜色;行高:

125%; margin-top:5px; margin-bottom:5px}


table {width:100%;对齐:顶部;边界崩溃:崩溃;填充:5px}


tr {vertical-align:top; text-align:left}


td {font-family:arial; font-size:13pt;白颜色;行高:

125%;填充:7px}


#tdfaq {font-family:arial; font-size:13pt; font-weight:bold;颜色:

黑色;线高:125%;填充:7px}


h1 {font-family:arial;白颜色; font-size:24pt; font-weight:

bold; font-style:italic;文字装饰:下划线; text-align:center

}


..faq {background-image:url(''images / background_faq.gif''); font-color:

black}


预先感谢您的回复。我还有更多的问题,我将很快发布b $ b:>)


Viken K.

Hello all,

It stinks being a newbie! One thing that I''m not sure about with CSS
is: where is the "proper" place to put font attibutes? This has me a
little confused. Take the below style sheet (which is a work in
progress) as an example. If I don''t put the font attributes in the
<body> <p> and <td> tags, the font will not appear the way I want (when
I work in FrontPage, anyway). It doesn''t seem to be enough to put the
font attributes in the <body> tag, I have to put it everywhere if I
want my page to look uniform. Is this correct, or am I missing
something?
body { background-color: black; margin: 5 5 5 5 }

p { font-family: Arial; font-size: 13pt; color: white; line-height:
125%; margin-top: 5px; margin-bottom: 5px}

table {width: 100%; align:top; border-collapse: collapse; padding: 5px}

tr { vertical-align: top; text-align: left}

td { font-family: arial; font-size: 13pt; color: white; line-height:
125%; padding: 7px }

#tdfaq { font-family: arial; font-size: 13pt; font-weight: bold; color:
black; line-height: 125%; padding: 7px }

h1 { font-family: arial; color: white; font-size: 24pt; font-weight:
bold; font-style: italic; text-decoration: underline; text-align:center
}

..faq { background-image:url(''images/background_faq.gif''); font-color:
black}

Thanks in advance for any replies. I ahev more questions that I will
post soon :>)

Viken K.

推荐答案

2005年3月21日11:13:32 -0800,Viken Karaguesian< vi **** @ aol.com>写道:
On 21 Mar 2005 11:13:32 -0800, Viken Karaguesian <vi****@aol.com> wrote:
它很臭新手!我不确定CSS的一件事是
:适当的地方在哪里?放置字体attibutes的地方?这让我有点困惑。以下面的样式表(这是
进度中的工作)为例。如果我不把字体属性放在
< body>中< p为H.和< td>标签,字体将不会以我想要的方式出现(当我在FrontPage中工作时,无论如何)。


对于初学者:下载一些(免费共享软件)浏览器来测试你的页面。

喜欢Opera,Mozilla和FireFox。不要依赖FrontPage向您展示的内容。

不是WYSIWYG。


字体属性放在< body>中似乎不够。标签,如果我想让我的页面看起来一致,我必须把它放在任何地方。这是正确的,还是我错过了什么?


这应该就够了。如果你将font-family设置为body

选择器的属性,而不是为其他元素指定它,那么font-family将由你不喜欢的元素继承的
不要为其设置另一个字体系列。在你的例子中我

没有看到你为身体设置字体系列。身体{背景颜色:黑色;保证金:5 5 5 5}
It stinks being a newbie! One thing that I''m not sure about with CSS
is: where is the "proper" place to put font attibutes? This has me a
little confused. Take the below style sheet (which is a work in
progress) as an example. If I don''t put the font attributes in the
<body> <p> and <td> tags, the font will not appear the way I want (when
I work in FrontPage, anyway).
For starters: Download some (free of shareware) browsers to test your pages in.
Like Opera, Mozilla and FireFox. Don''t rely on what FrontPage shows you. There
is no such thing as WYSIWYG.
It doesn''t seem to be enough to put the
font attributes in the <body> tag, I have to put it everywhere if I
want my page to look uniform. Is this correct, or am I missing
something?

It should be enough. If you set a font-family as a property for the body
selector and do not specify it for other elements, the font-family will be
inherited by elements you don''t set another font-family for. In your example I
don''t see you setting a font-family for the body. body { background-color: black; margin: 5 5 5 5 }



它在哪里?


另外:5 5 5 5不行。如果你设置的长度为0,则为零,你需要

指定它是什么。是em,en,ex,inch,cm,px,sheep,到月球的距离

还是回来?这是什么5?


其他评论(现在):

- 你使用了很多固定大小的值。这不是一个好主意。 Google voor

液体或液体设计< http://www.google.com/search?q =液体+ OR +液体+设计>

- 您使用点为您的字体大小。也不是一个好主意。点是纸张。

对于屏幕,还有其他更有用的长度,例如''em''或''%''。谷歌

这个组,并找出为什么固定大小的字体不是很好的设计。

- 你使用font-color:black; CSS中没有这样的属性,你的意思是

color:black;习惯于非常精确地工作并验证你的工作,以便找到

这些奇怪的异常在

< http://jigsaw.w3.org/css-validator/validator -uri.html>为您的CSS和

< http://validator.w3.org/>对于你的标记。

- 你使用表{width:100%;}和其他样式让我觉得你使用表格

为你的布局。谷歌进行无表格设计,找出为什么不这样做

< http://www.google.com/search?q=%20tableless design%20>并且

< http://groups.google.com/groups?q = tableless + design& as_ugroup = alt.html%2C + co mp.infosystems.www.authoring。%2A>


-

, - - < - @ - PretLetters:''woest wyf'',遇见了vele interesses:---- ------。

|博客| http://home.wanadoo.nl/b。 de.zoete / _private / weblog.html |

| webontwerp | http://home.wanadoo.nl/b。 de.zoete / html / webontwerp.html |

| zweefvliegen | http://home.wanadoo.nl/b。 de.zoete / html / vliegen.html |

` --------------------------- ----------------------- - < - @ ------------''


Where is it at?

Also: the 5 5 5 5 won''t do. If you set a length other then 0, zero, you need to
specify what it is. Is it em, en, ex, inch, cm, px, sheep, distance to the moon
and back? What is that 5?

Other comments (for now):
- you use a lot of fixed sized values. That is not such a good idea. Google voor
liquid or fluid design <http://www.google.com/search?q=liquid+OR+fluid+design>
- you use point for your font-size. Not a good idea either. Point is for paper.
For screen there are other, more useful lengths, such as ''em'' or ''%''. Google
this group and find out why a fixed size for fonts is not good design.
- you use font-color:black; there is no such property in CSS, you mean
color:black; Get used to working very exact and validate your work to find just
these strange anomalities at
<http://jigsaw.w3.org/css-validator/validator-uri.html> for your CSS and at
<http://validator.w3.org/> for your markup.
- you use table {width:100%;} and other styles that make me think you use tables
for you layout. Google for tableless design to find out why not to do that
<http://www.google.com/search?q=%20tableless design%20> and
<http://groups.google.com/groups?q=tableless+design&as_ugroup=alt.html%2C+co mp.infosystems.www.authoring.%2A>

--
,-- --<--@ -- PretLetters: ''woest wyf'', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------''


Viken Karaguesian写道:
Viken Karaguesian wrote:
它很臭新手!我不确定CSS的一件事是
:适当的地方在哪里?放置字体attibutes的地方?


CSS中没有属性。 CSS有属性。和字体最好避免使用
,短手属性有意意重置一些

意外的未指定值。

这让我有一个
有点困惑。以下面的样式表(这是
进度中的工作)为例。如果我不把字体属性放在
< body>中< p为H.和< td>标签,


Internet Explorer在将某些属性继承到

表时存在某些问题,因此您需要在表元素上重新指定其中一些属性(例如table

{font-size:100%;}使用与父元素相同的字体大小。


其他元素没有问题尽管如此,至少在我知道的情况下还是很好。

字体不会以我想要的方式出现(当我在FrontPage工作时,无论如何)。


FrontPage不是一个非常好的软件。

body {background-color:black; margin:5 5 5 5}


当您指定

背景颜色时,指定前景色总是一个好主意。您可能有一个默认方案为黑色的用户

白色(事实上,这很常见!)所以他们会在

黑色背景上获得黑色文字。


此外,对于除零之外的长度,需要单位。(例如,保证金: 5ex;)。

验证者会告诉你: http://jigsaw.w3.org/css-validator/

p {font-family:Arial; font-size:13pt;


积分是非常不适合使用屏幕的单位。
http://css-discuss.incutio.com/?page=UsingPoints

table {width:100%;对齐:顶部;


CSS中没有对齐属性(再次 - 验证器!)

.faq {background-image:url(''images / background_faq.gif' ');
It stinks being a newbie! One thing that I''m not sure about with CSS
is: where is the "proper" place to put font attibutes?
There are no attributes in CSS. CSS has properties. And "font" is generally
best avoided, short hand properties have a tendency to reset some
unspecified values unexpectedly.
This has me a
little confused. Take the below style sheet (which is a work in
progress) as an example. If I don''t put the font attributes in the
<body> <p> and <td> tags,
Internet Explorer has certain issues with inheriting some properties into
tables, so you need to respecify some of them on table elements (e.g. table
{ font-size: 100%; } to use the same font size as the parent element.

It doesn''t have a problem with elements other then table though, at least as
far as I''m aware.
the font will not appear the way I want (when
I work in FrontPage, anyway).
FrontPage is not a very good piece of software.
body { background-color: black; margin: 5 5 5 5 }
Its always a good idea to specify a foreground colour when you specify a
background colour. You might have a user who has a default scheme of black
on white (in fact, that''s very common!) so they will get black text on a
black background.

Also, for lengths other then zero, units are required. (e.g. margin: 5ex; ).
The validator would have told you this: http://jigsaw.w3.org/css-validator/
p { font-family: Arial; font-size: 13pt;
Points are highly unsuitable units for use of screen.
http://css-discuss.incutio.com/?page=UsingPoints
table {width: 100%; align:top;
There is no align property in CSS (again - validator!)
.faq { background-image:url(''images/background_faq.gif'');




Internet Explorer for Mac有一个错误,其中无法识别

表格的网址:url(' 'foo''),坚持使用url(foo)或url(foo)。


-

David Dorward< http: //blog.dorward.me.uk/> < http://dorward.me.uk/>

Home是〜/ .bashrc的地方



Internet Explorer for Mac has a bug in which is can''t recognise urls of the
form: url(''foo''), stick to url(foo) or url("foo") instead.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Viken Karaguesian写道:
Viken Karaguesian wrote:
大家好,


你好,

它很臭新手!


不,它不是 - 它是每个专业人士的起点;-)

有一点我不确定关于CSS
是:哪里是适当的放置字体attibutes的地方?


无论你需要它们。从< body>开始元素,以及你在哪里
想要它的不同,你把它设置为那个元素。

这让我有点困惑。以下面的样式表(这是
进度中的工作)为例。如果我不把字体属性放在
< body>中< p为H.和< td>标签,字体将不会以我想要的方式出现(当我在FrontPage中工作时,无论如何)。


据我所知,< p>应该从< body>获取它,但是< td>在某些浏览器中没有




字体属性放在< body>中似乎不够。标签,如果我想让我的页面看起来一致,我必须把它放在任何地方。这是正确的,还是我错过了什么?


真的,afaik只有TD(和输入和textarea等表单元素)

有时不会采用< body>的样式。 />
body {background-color:black;保证金:5 5 5 5}


保证金:5什么? Hobnobs?我认为你的意思是5px,因为5em看起来有点像边缘一样宽b $ b。或许你的意思是5%,这也是一个很好的可能性。

浏览器并不擅长猜测。

p {font-family:Arial; font-size:13pt;白颜色;行高:
125%; margin-top:5px; margin-bottom:5px}


你知道你在这个

样式表中没有设置任何字体样式,对吗? />
table {width:100%;对齐:顶部;边界崩溃:崩溃;填充:5px}


align不是有效的属性,我认为你的意思是垂直对齐。

tr {vertical-align:top; text-align:left}


这2个属性应该设置为TD。

td {font-family:arial; font-size:13pt;白颜色;行高:
125%;填充:7px}
#tdfaq {font-family:arial; font-size:13pt; font-weight:bold;颜色:
黑色;线高:125%;填充:7px}

h1 {font-family:arial;白颜色; font-size:24pt; font-weight:
粗体; font-style:italic;文字装饰:下划线; text-align:center
}
.faq {background-image:url(''images / background_faq.gif''); font-color:
black}
Hello all,
Hi you,
It stinks being a newbie!
No it doesn''t -- it''s the starting point of every professional ;-)
One thing that I''m not sure about with CSS
is: where is the "proper" place to put font attibutes?
Whereever you need them. Start with the <body> element, and where you
want it differently, you set it to that element.
This has me a
little confused. Take the below style sheet (which is a work in
progress) as an example. If I don''t put the font attributes in the
<body> <p> and <td> tags, the font will not appear the way I want (when
I work in FrontPage, anyway).
As far as I know, <p> should take it from <body>, but <td> doesn''t in
some browsers.
It doesn''t seem to be enough to put the
font attributes in the <body> tag, I have to put it everywhere if I
want my page to look uniform. Is this correct, or am I missing
something?
Really, afaik only TD (and form elements like input and textarea)
sometimes doesn''t take the styles from <body>.
body { background-color: black; margin: 5 5 5 5 }
margin: 5 what? Hobnobs? I reckon you mean 5px, as 5em seems a bit
wide as a margin. Or maybe you mean 5%, that''s a good possibility too.
The browser isn''t good at guessing though.
p { font-family: Arial; font-size: 13pt; color: white; line-height:
125%; margin-top: 5px; margin-bottom: 5px}
You do realize that you didn''t set any font styles in the body in this
stylesheet, right?
table {width: 100%; align:top; border-collapse: collapse; padding: 5px}
align isn''t a valid property, I think you mean vertical-align.
tr { vertical-align: top; text-align: left}
Those 2 properties should be set to the TD.
td { font-family: arial; font-size: 13pt; color: white; line-height:
125%; padding: 7px } #tdfaq { font-family: arial; font-size: 13pt; font-weight: bold; color:
black; line-height: 125%; padding: 7px }

h1 { font-family: arial; color: white; font-size: 24pt; font-weight:
bold; font-style: italic; text-decoration: underline; text-align:center
}

.faq { background-image:url(''images/background_faq.gif''); font-color:
black}




font-color应该是彩色的。


和所有的上图:不要将pt用于屏幕字体大小。改为使用%




-

Els http://locusmeus.com/

Sonhos vem。 Sonhos v?o。 Orestoébritfeito。

- Renato Russo -



font-color should be color.

And to all of the above: don''t use pt for screen font sizes. Use %
instead.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos v?o. O resto é imperfeito.
- Renato Russo -


这篇关于哪里是字体属性的正确位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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