Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-14-2003, 12:18 AM   PM User | #1
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
XML Declaration Problem

we all know that an xml document needs a root element, in xhtml this is <html>
however i am running into some CSS problems, mainly in the overflow attrib. (as far as i can see)
when i add the xml declaration, my html element looses the css configurations, is it the conflicting versions bitween the xhtml dtd and the xml? what could be causing this?
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
......
</html>
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
cg9com is offline   Reply With Quote
Old 01-14-2003, 12:21 AM   PM User | #2
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Try styling the <html> element instead of <body> with CSS.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 01-14-2003, 12:43 AM   PM User | #3
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
thats what i was doing, thats where the question arose.
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.

Last edited by cg9com; 01-14-2003 at 12:45 AM..
cg9com is offline   Reply With Quote
Old 01-14-2003, 12:55 AM   PM User | #4
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Which browser? What is the document being served as?

If IE sees that <?xml?> processing instruction, it gets all confused and puts itself into quirks mode.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 01-14-2003, 05:06 AM   PM User | #5
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
i was testing in IE6
all styling to the <html> element stops when the xml declaration is added.
i know its not even required in a xhtml document, but i was putting it there for a reason.
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
cg9com is offline   Reply With Quote
Old 01-14-2003, 03:14 PM   PM User | #6
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
That's the whole rub of it - if the first thing on the page is <?xml?> then IE6 goes into quirks mode, so the BODY represents the entire canvas; whereas Gecko, in that same situation, goes into Standards mode, where HTML represents the entire canvas.

As far as I know, there's no direct solution for this.
brothercake is offline   Reply With Quote
Old 01-14-2003, 09:40 PM   PM User | #7
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point

*sigh* ill keep it out of my document then, until a solution arises.
thanks guys.
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
cg9com is offline   Reply With Quote
Old 01-15-2003, 11:07 PM   PM User | #8
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
being stubborn ive been constantly trying to work with the w3 validator in getting this to work, no sucess but after messing around a bit, it keeps returning an error to me now that was never there before.
Quote:
Line 14, column 6: end tag for "body" which is not finished (explain...).
</body>
i stripped it down and this is literally all i have in my document, and its still returning the error, why?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>cg9com</title>
<link rel="stylesheet" type="text/css" href="cg9com.css" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="cg9com" />
</head>
<body>
</body>
</html>

maybe in editing i got rid of something? i dont see anything though.
also is specifying a charset iso important?
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
cg9com is offline   Reply With Quote
Old 01-16-2003, 12:43 PM   PM User | #9
MCookie
Regular Coder

 
Join Date: Jun 2002
Location: NL
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
MCookie is an unknown quantity at this point
<body>
<p>When you put some text between your body tags, the page is valid. Don't know why.</p>
</body>
MCookie is offline   Reply With Quote
Old 01-16-2003, 07:25 PM   PM User | #10
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
oh yea i keep forgetting stuff like that, old coding habits thanks
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
cg9com is offline   Reply With Quote
Old 01-28-2003, 05:53 PM   PM User | #11
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
how 'bout if i combine the 2 elements in CSS?
body, html {}
would it translate okay? possible solution?
cg9com is offline   Reply With Quote
Old 01-28-2003, 07:16 PM   PM User | #12
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Yes. Be careful with applying margins, padding, and borders with that though, as it will apply twice (once to html, and once to body) to any correct browser.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 01-28-2003, 08:28 PM   PM User | #13
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
is it still correct CSS?
if overflow:hidden; goes in the html, and i add "html, body" it would apply to the body as well, but it doesnt go in the body, the only time that it would apply there is in IE quirks ....
cg9com is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:32 AM.


Advertisement
Log in to turn off these ads.