身体标签与边缘权利 [英] Body tag vs margin-right

查看:64
本文介绍了身体标签与边缘权利的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我用的是< BODY leftmargin = 20>哪个工作正常。但后来我改为

< BODY style =" margin-left:20px;"这也很好。


为了尝试形式化,我决定使用样式表,所以我将b $ b链接到其他样式我设定工作正常。但我的保证金

整个页面都不起作用。


...在我的页面中,身体标签除了一个之外没有任何属性。 />

< BODY vlink =" blue" >


和链接样式表/

BODY {margin-left:20px}

什么我做错了吗?


-

Hi

I was using <BODY leftmargin=20 > which worked ok. but then I changed it to
<BODY style="margin-left:20px;" and this works fine as well.

In order to try and formalise things I decided to use a style sheet so I
linked it in and every other style i have set works fine. but my margin for
the entire page does not work.

... in my page now the body tag has no attributes apart from one.

<BODY vlink="blue" >

and in the linked style sheet/

BODY { margin-left:20px }
What am I doing wrong ?

--

推荐答案

Terry Moon写道:
Terry Moon wrote:
我正在使用< BODY leftmargin = 20>哪个工作正常。


对于某些奇怪的工作值。它是专有标记,只有某些浏览器支持
,所以你测试得不好。此外,

设置以像素为单位的边距,而不是相对于字体大小。

然后我将其更改为
< BODY style =" margin-左:20像素;"这也很好。


对于工作的不同值。它支持

浏览器启用CSS,假设没有其他样式表覆盖它。

为了尝试形式化,我决定使用样式表我把它连接起来,我设置的每一种风格都很好。


这是一个好主意,特别是因为以这种集中的方式处理
的方式可以让你在发现错误时更容易修复错误。浪费

左边20像素不太好。

..在我的页面中,身体标签除了一个之外没有属性。
< BODY vlink =" blue" >


那是'非常糟糕的做法。如果没有设置其他

颜色,切勿触摸颜色,也不要将访问过的链接颜色设置为常见的默认颜色

未访问的链接。但这与边距无关。

和链接样式表/

BODY {margin-left:20px}


如果这不起作用且< BODY style =" margin-left:20px;">工作,然后

你有

a)你的HTML标记错误

b)样式表中其他地方的错误

c)一个有问题的浏览器。

我做错了什么?
I was using <BODY leftmargin=20 > which worked ok.
For some odd values of "worked". It is proprietary markup that is
supported by some browsers only, so you didn''t test well. Besides, it
sets the margin in pixels, not relative to font size.
but then I changed it to
<BODY style="margin-left:20px;" and this works fine as well.
For different values of "worked". It does something on supporting
browsers with CSS enabled, assuming that no other style sheet overrides it.
In order to try and formalise things I decided to use a style sheet so I
linked it in and every other style i have set works fine.
That''s a good idea, especially since doing things in such a centralized
manner lets you fix errors more easily when you notice that e.g. wasting
20 pixels on the left is not that fine.
.. in my page now the body tag has no attributes apart from one.

<BODY vlink="blue" >
That''s _very_ poor practice. Never touch a color without setting other
colors, and never set visited link color to the common default color of
unvisited links. But this has nothing to do with margins.
and in the linked style sheet/

BODY { margin-left:20px }
If this does not work and <BODY style="margin-left:20px;"> works, then
you have
a) an error in your HTML markup
b) an error elsewhere in the style sheet
c) a faulty browser.
What am I doing wrong ?




您没有向我们显示URL,首先。



You are not showing the URL to us, to begin with.


感谢您的回复。


如果您不介意还有一个问题吗?


嵌套标签是否继承了封闭标签样式属性,例如,如果body标签有一个margin-left,则为
:nn然后将所有段落括起来

therin默认情况下也有此保证金?


-


Jukka K. Korpela < JK ****** @ cs.tut.fi>在消息中写道

news:dq ********** @ phys-news4.kolumbus.fi ...
Thanks for your reply.

One more question if you dont mind please?

Do the nested tags inherit the enclosing tag style attributes, for example,
if the body tag had a margin-left:nn then would all paragraphs enclosed
therin also have this margin by default ?

--

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:dq**********@phys-news4.kolumbus.fi...
Terry Moon写道:
Terry Moon wrote:
我使用< BODY leftmargin = 20>哪个工作正常。
I was using <BODY leftmargin=20 > which worked ok.



对于一些奇怪的工作值。它是专有标记,仅由某些浏览器支持,因此您测试不好。此外,它以像素为单位设置边距,而不是相对于字体大小。



For some odd values of "worked". It is proprietary markup that is
supported by some browsers only, so you didn''t test well. Besides, it sets
the margin in pixels, not relative to font size.

然后我将其更改为< BODY style =" margin-left:20px; "这也很好。
but then I changed it to <BODY style="margin-left:20px;" and this works
fine as well.



对于工作的不同值。假设没有其他样式表覆盖它,它在支持浏览器上做了一些事情。假设没有其他样式表覆盖它。



For different values of "worked". It does something on supporting browsers
with CSS enabled, assuming that no other style sheet overrides it.

为了尝试形式化事物我决定使用样式表所以我把它连接起来,我设置的每一种风格都很好。
In order to try and formalise things I decided to use a style sheet so I
linked it in and every other style i have set works fine.



这是一个好主意,特别是因为以这种集中的方式做事当你注意到例如,让你更容易修复错误浪费
左边的20个像素并不是那么好。



That''s a good idea, especially since doing things in such a centralized
manner lets you fix errors more easily when you notice that e.g. wasting
20 pixels on the left is not that fine.

..在我的页面中,身体标签除了一个之外没有任何属性。
< BODY vlink =" blue" >
.. in my page now the body tag has no attributes apart from one.

<BODY vlink="blue" >



那是'非常糟糕的做法。切勿在未设置其他颜色的情况下触摸颜色,也不要将访问过的链接颜色设置为未访问链接的常见默认颜色。但这与边距无关。



That''s _very_ poor practice. Never touch a color without setting other
colors, and never set visited link color to the common default color of
unvisited links. But this has nothing to do with margins.

和链接样式表/

BODY {margin-left:20px}
and in the linked style sheet/

BODY { margin-left:20px }



如果这不起作用且< BODY style =" margin-left:20px;">工作,然后你有
a)HTML标记中的错误
b)样式表中其他地方的错误
c)浏览器错误。



If this does not work and <BODY style="margin-left:20px;"> works, then you
have
a) an error in your HTML markup
b) an error elsewhere in the style sheet
c) a faulty browser.

我做错了什么?



你没有向我们展示我们的URL。



You are not showing the URL to us, to begin with.



星期六,2006年1月21日16:08:47 +0200来自Jukka K. Korpela

< jk ****** @ cs.tut.fi>:
Sat, 21 Jan 2006 16:08:47 +0200 from Jukka K. Korpela
<jk******@cs.tut.fi>:
Terry Moon写道:
Terry Moon wrote:
< BODY style =" margin-left:20px;"这也很好。
<BODY style="margin-left:20px;" and this works fine as well.



对于工作的不同值。它支持启用CSS的浏览器,假设没有其他样式表覆盖它。



For different values of "worked". It does something on supporting
browsers with CSS enabled, assuming that no other style sheet overrides it.




_Could_任何其他样式表覆盖它?我认为内联样式

总是覆盖任何附加或嵌入的表格。


-

Stan Brown,Oak Road Systems,美国纽约州汤普金斯县
http://OakRoadSystems.com/

HTML 4.01规范: http://www.w3.org / TR / html401 /

验证人: http:// validator.w3.org/

CSS 2.1规范: http://www.w3.org/TR/CSS21/

验证人: http://jigsaw.w3.org/css-validator/

为什么我们不能帮助你:
http://diveintomark.org/archives/200 ...... _wont_help_you



_Could_ any other style sheet override it? I thought an inline style
always overrides any attached or embedded sheet.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won''t Help You:
http://diveintomark.org/archives/200..._wont_help_you


这篇关于身体标签与边缘权利的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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