473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Styling the root element HTML

Hi,

Can I style the root element (HTML) just like any other (and will it work as
expected) or are there restrictions to take into account?

Thanks in advance,
Thomas
Jul 21 '05 #1
10 2504
In our last episode,
<d7*************@news.t-online.com>,
the lovely and talented Thomas Mlynarczyk
broadcast on comp.infosystems.www.authoring.stylesheets:
Can I style the root element (HTML) just like any other (and will it work as
expected) or are there restrictions to take into account?


What exactly would that accomplish that styling BODY or FRAMESET
would not?

--
Lars Eighner ei*****@io.com http://www.larseighner.com/
War on Terrorism: History a Mystery
"He's busy making history, but doesn't look back at his own, or the
world's.... Bush would rather look forward than backward." --_Newsweek_
Jul 21 '05 #2
On Tue, 24 May 2005 22:37:14 +0200, Thomas Mlynarczyk
<bl*************@hotmail.com> wrote:
Can I style the root element (HTML) just like any other (and will it work as
expected) or are there restrictions to take into account?


You can style it (I did :-) ) All I encountered was that the bg-colour you set
for the html element will be the bg-colour for the browser viewport (found out
this is agreed upon behaviour). I found no other strange things.
--
,-- --<--@ -- 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 |
`-------------------------------------------------- --<--@ ------------'

Jul 21 '05 #3
Also sprach Lars Eighner:
Can I style the root element (HTML) just like any other (and will it
work as expected) or are there restrictions to take into account?
What exactly would that accomplish that styling BODY or FRAMESET
would not?

I want to have a background image and in addition on the left side a graphic
(say about 200px wide) as background for the menu. Both should stretch to
the full height of the viewport (even when the latter is being resized) or
the height of the document - whichever is greater. I can do the left side
graphic by assigning it as background image to the body with repeat-y. But
then the rest of the space could only be a single color (body's background
color) or I'd have to wrap the main background image in a div, but then it
would stretch only as far as the content goes. So I thought assigning the
main background image to the html element instead would solve the problem in
an elegant way.
Jul 21 '05 #4
Also sprach Barbara de Zoete:

Can I style the root element
You can style it (I did :-) ) All I encountered was that the
bg-colour you set for the html element will be the bg-colour for the
browser viewport (found out this is agreed upon behaviour).


Meaning that if I scroll or resize the viewport, I will "see the end" of the
background? I'd like to give HTML a background-image (and, for "imageless"
clients, a background-color as well) and expect it to behave as if it was
assigned to BODY instead, so I could assign two overlapping background
images (the one for the body "clipped" by "repeat-y").
Jul 21 '05 #5
"Thomas Mlynarczyk" <bl*************@hotmail.com> wrote:
Can I style the root element (HTML) just like any other (and will it work as
expected) or are there restrictions to take into account?


For documents served as text/html (including "xhtml" served as
text/html) it is recommended to style the body element, not the html
element. http://www.w3.org/TR/CSS21/colors.html#q2

--
Spartanicus
Jul 21 '05 #6
Lars Eighner wrote:
In our last episode,
<d7*************@news.t-online.com>,
the lovely and talented Thomas Mlynarczyk
broadcast on comp.infosystems.www.authoring.stylesheets:
Can I style the root element (HTML) just like any other (and will it work as
expected) or are there restrictions to take into account?


What exactly would that accomplish that styling BODY or FRAMESET
would not?


http://groups-beta.google.com/group/...344178669c4033

(http://tinylink.com/?hwDO8Ui7T7)
Jul 21 '05 #7
Also sprach Harlan Messinger:

http://groups-beta.google.com/group/...ring.styleshee
ts/browse_frm/thread/5623f732af2ad0e1/f3344178669c4033?q=messinger+html+body
+red+background-color&rnum=2&hl=en#f3344178669c4033

I don't quite see the point. The code example produces a red canvas, as
expected. But as I precised, I want to do this:

html { background: #abc url(canvasbackground.jpg); }
body { background: url(leftsidebackground.jpg) repeat-y; } /* picture is
200px wide */

Jul 21 '05 #8
Also sprach Spartanicus:
For documents served as text/html (including "xhtml" served as
text/html) it is recommended to style the body element, not the html
element. http://www.w3.org/TR/CSS21/colors.html#q2


In other words: to be on the safe side, I'd better not? :-(
Jul 21 '05 #9
Thomas Mlynarczyk wrote:
Also sprach Harlan Messinger:
http://groups-beta.google.com/group/...ring.styleshee
ts/browse_frm/thread/5623f732af2ad0e1/f3344178669c4033?q=messinger+html+body
+red+background-color&rnum=2&hl=en#f3344178669c4033

I don't quite see the point. The code example produces a red canvas, as
expected.
In IE or Firefox it produces a green canvas with the body's background
appearing in red against it.

But as I precised, I want to do this:
html { background: #abc url(canvasbackground.jpg); }
body { background: url(leftsidebackground.jpg) repeat-y; } /* picture is
200px wide */


That should work like my example, with the addition of the background
images. Nothing wrong with it.
Jul 21 '05 #10
Thomas Mlynarczyk schrieb:

Can I style the root element (HTML) just like any other
Yes.
(and will it work as expected)


No, not always.
Jul 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ray | last post by:
Hi Groups To achieve the visual effect of the page http://www.freewebs.com/nsl/test1.html but remove the table and use CSS, I wrote a page like this http://www.freewebs.com/nsl/test2.html I...
2
by: Stanimir Stamenkov | last post by:
I'm trying to clear some sizing issues relative to the initial containing block and the root document element. The sample document I'm trying with: http://stanio.info/viewport_fill.html ...
28
by: Andy Dingley | last post by:
What specifies the permitted root element(s) for a document ? HTML, SGML, XHTML or XML ? Valid HTML documents need to have a well-known DTD and a doctypedecl in each document like this:...
4
by: Eric Lindsay | last post by:
Although http://www.w3.org/Style/LieBos2e/enter/ say "The title of a document does not show up on the canvas, so it is not affected by CSS styles", there is a note by Seamus P. H. Leahy on styling...
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
3
by: Momomo | last post by:
Hi, I am having a problem with a control which is caused by a style on the page which I am not able to trace. If I use the control in a page without any styling it looks ok. Is there a way to...
40
by: Jukka K. Korpela | last post by:
My basic style sheet has a distinctive background and border for forms, to make the structure clearer and to make it visually evident what belongs to a form. However, as people complained that...
2
by: shapper | last post by:
Hello, I am styling the labels on a section of my page as follows: label {float: left; width: 6.5em;} Now I want to remove this styling from a label that has the class "Message". Mu...
4
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
when I try to style a div using the id tag, from an external style sheet, it is not recognized. If I change the style sheet id to a class, it is recognized. Is this how styling a div within an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.