![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||||
| ||||||
|
|
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. |
|
.. 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 ? |
#3
| |||
| |||
|
|
Terry Moon wrote: 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 ? You are not showing the URL to us, to begin with. |
#4
| |||
| |||
|
|
Terry Moon wrote: 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. |
#5
| |||
| |||
|
|
_Could_ any other style sheet override it? I thought an inline style always overrides any attached or embedded sheet. |
#6
| |||
| |||
|
|
_Could_ any other style sheet override it? I thought an inline style always overrides any attached or embedded sheet. An in-line style declaration is more specific than any other selector, so an author style sheet couldn't override it. |
|
However, a user style sheet could. |
#7
| |||
| |||
|
|
Thanks for your reply. |
|
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 ? |
#8
| |||
| |||
|
|
An author style sheet can override [an in-line declaration] by using !important. |
#9
| |||
| |||
|
|
An in-line style declaration is more specific than any other selector, so an author style sheet couldn't override it. An author style sheet can override it by using !important. |
#10
| |||
| |||
|
|
"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> wrote: An in-line style declaration is more specific than any other selector, so an author style sheet couldn't override it. An author style sheet can override it by using !important. Nope. |
![]() |
| Thread Tools | |
| Display Modes | |
| |