css文件中的body标签不起作用。为什么? [英] body tag inside a css file doesn't work.Why?

查看:324
本文介绍了css文件中的body标签不起作用。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是css的新手,我有一个问题。

i有一个外部css(style.css),我链接到所有html页面。

里面的css文件有一个类detais声明如下:

* ================ ================================= ========== * /

..details {

font-family:tahoma,verdana,arial,helvetica;

字体大小:11pt;

颜色:#051E78;


}

* ============================ ===================== ========== * /

此外,在css文件中有一个html标签主体声明如下:

/ * ================================= ================ ========== * /

body {font-family:tahoma,verdana,arial,helvetica;

字体大小:11pt;

颜色:#051E78;

背景颜色:#87ceeb;

margin-top:0px;

margin-bottom:0px;

margin-right:0px;

margin-left:0px;

}

* ================================================ = ========== * /

当我在标签内应用详细信息类时(即< td class = details>)一切正常。

我的字体大小固定为11pt。

但是当我不在标签内应用详细信息类(即< td>,< tr>或者什么)时,我的字体有变量为什么会发生这种情况?

我认为字体大小应该是(11pt固定大小),因为它们位于< body>内。我的html页面的标签。

提前感谢

thanasis

Hello to everyone,
i''m new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a class detais declared as follows:
*================================================= ========== */
..details {
font-family: tahoma, verdana, arial, helvetica;
font-size:11pt;
color:#051E78;

}
*================================================= ========== */
Moreover , inside the css file there is an html tag body declared as follows:
/*================================================= ========== */
body { font-family: tahoma, verdana, arial, helvetica;
font-size:11pt;
color:#051E78;
background-color:#87ceeb;
margin-top:0px;
margin-bottom:0px;
margin-right:0px;
margin-left:0px;
}
*================================================= ========== */
When i apply the details class inside a tag(i.e <td class=details>) everything is ok.
My font size is fixed to 11pt.
However when i don''t apply the details class inside a tag (i.e <td>, <tr> or whatsoever) my fonts have variable length.Why does this happen?
I thought that the font size should be (11pt-fixed size) as they lie inside the <body> tag of my html page.
thanks in advance
thanasis

推荐答案

Thanasis(sch )写道:
Thanasis (sch) wrote:
大家好,
我是css的新手,我有一个问题。
我有一个外部css(style.css) ,我链接所有的html页面。
在css文件中有一个* class * detais声明如下:
Hello to everyone,
i''m new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a *class* detais declared as follows:




请不要发布用HTML格式。


您使用的浏览器是什么?乍一看,你是对的 - 但是,由于

没有提供网址,我们无法检查你的其他代码。


此外,请注意固定字体大小,特别是以屏幕使用的单位为单位,

是一个坏主意。搜索这个小组以找出原因 - 你真的想要

你的字体是0.15英寸高,与屏幕尺寸或分辨率无关吗?


-

Mark。



Please don''t post in HTML.

What browser are you using? At first sight, you''re right - however, by
not supplying a URL we can''t check your other code.

Also, note that fixed font sizes, especially in pt units for screen use,
is a bad idea. Search this group to find out why - do you really want
your fonts to be 0.15in high independent of screen size or resolution?

--
Mark.


感谢您的回复Mark。


我的css网址是:

www.greek-properties.biz/style.css


是的我想。告诉我怎么做

提前谢谢

thanasis

" Mark Tranchant" <毫安** @ tranchant.plus.com>在消息中写道

news:bx ******************* @ stones.force9.net ...
Thanks for your reply Mark.

my css url is:

www.greek-properties.biz/style.css

yes i ''d like.Tell my how to do this
thanks in advance
thanasis
"Mark Tranchant" <ma**@tranchant.plus.com> wrote in message
news:bx*******************@stones.force9.net...
Thanasis(sch)写道:
Thanasis (sch) wrote:
大家好,
我是css的新手,我有一个问题。
我有一个外部的CSS(风格) .css),我在所有html页面中链接。
在css文件中有一个* class * detais声明如下:
Hello to everyone,
i''m new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a *class* detais declared as follows:



请不要发布HTML。

您使用的浏览器是什么?乍一看,你是对的 - 但是,通过
不提供URL,我们无法检查你的其他代码。

另外,请注意固定的字体大小,特别是在pt中屏幕使用的单位,
是一个坏主意。搜索这个小组以找出原因 - 你真的想要你的字体是0.15英寸高,与屏幕大小或分辨率无关吗?

-
Mark。



Please don''t post in HTML.

What browser are you using? At first sight, you''re right - however, by
not supplying a URL we can''t check your other code.

Also, note that fixed font sizes, especially in pt units for screen use,
is a bad idea. Search this group to find out why - do you really want
your fonts to be 0.15in high independent of screen size or resolution?

--
Mark.



我的问题是身体标签不起作用的原因


" Thanasis(sch)" <第********* @ hotmail.com>在消息中写道

news:40 ******** @ news.sch.gr ...
my question is why the body tag doesn''t work

"Thanasis (sch)" <th*********@hotmail.com> wrote in message
news:40********@news.sch.gr...
感谢您的回复Mark。
<我的css网址是:

www。 greek-properties.biz/style.css

是的我想要。告诉我如何做到这一点
在此先感谢
thanasis

" Mark Tranchant" <毫安** @ tranchant.plus.com>在消息中写道
新闻:bx ******************* @ stones.force9.net ...
Thanks for your reply Mark.

my css url is:

www.greek-properties.biz/style.css

yes i ''d like.Tell my how to do this
thanks in advance
thanasis
"Mark Tranchant" <ma**@tranchant.plus.com> wrote in message
news:bx*******************@stones.force9.net...
Thanasis(sch)写道:
Thanasis (sch) wrote:
大家好,
我是css的新手,我有一个问题。
我有一个外部的CSS(style.css),我在所有html页面中链接。
在css文件中有一个* class * detais声明如下:
Hello to everyone,
i''m new to css and i have a question.
i have an external css (style.css) , that i link in all html pages.
inside the css file there is a *class* detais declared as follows:



请不要用HTML发布。

您使用的浏览器是什么?乍一看,你是对的 - 但是,通过
不提供URL,我们无法检查你的其他代码。

另外,请注意固定的字体大小,特别是在pt中屏幕使用的单位,
是一个坏主意。搜索这个小组以找出原因 - 你真的想要你的字体是0.15英寸高,与屏幕大小或分辨率无关吗?

-
Mark。



Please don''t post in HTML.

What browser are you using? At first sight, you''re right - however, by
not supplying a URL we can''t check your other code.

Also, note that fixed font sizes, especially in pt units for screen use,
is a bad idea. Search this group to find out why - do you really want
your fonts to be 0.15in high independent of screen size or resolution?

--
Mark.




这篇关于css文件中的body标签不起作用。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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