SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
Apr 25, 2004, 11:23 #1
- Join Date
- Nov 2003
- Location
- united states
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
if this can be done with XHTML & XML
I've been looking for tutorial that deals with XHTML & XML working together, and not having much luck. I'm trying my best to understand XHTML & XML. I like to set up my navigation menu in XML and for it to show up in my XHTML. I just don't know how to achieve this and setting up the url links to the pages. I'm pretty sure I have my XHTML document setup properly
HTML Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <Meta tags here /> <base ref here /> <link href="location to the pages in my site" /> <link rel="stylesheet" href="loaction of my style sheet" /> <link rel="shortcut icon" href="location for favicon" /> </head> <body> </body> </html>
-
Apr 25, 2004, 13:39 #2
- Join Date
- Jan 2004
- Location
- Chipping Campden, UK
- Posts
- 403
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi
There isn't much point in making a site xml, as there isn't the browser support for it.
BUT, by making it xhtml, you meet the xml standards too, just that you don't use the advanced features of xml that will confuse browsers that aren't with it.
So, really, design for xhtml now, use exclusively (or at least as much as you can) css for styling and layout, and tables ONLY to handle tabular data (ie not design).
I can't see the point of going for xhtml 1.0 strict. You might as well do 1.1 strict. It cuts out a few things, but xml won't allow them anyway.
Your code looks OK, except DON'T use the <?xml declaration at the start, as it knocks IE for six, and doesn't do anything important (yet).
For one of your meta tags, you need to declare the language and character set, my standard code starts like this:
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
Just make everything lower case, end unpaired tags (img, etc), fully declare attributes (e.g. <input ...... enabled> is no good, it needs <input ..... enabled="1"), no use of target on links (if necesary, use java to open a new window and name the window if you want). All content has to be inside block tags (<div>, <p>, etc.) and use id and class declarations everywhere you want to change the default behavior of a tag.
Also, other good bits of advice for css:
Set all major tags to margin:0, border:0 and padding:0 to level the browser playing field (html, body, hr, ul, li, img, div, p, etc.) as the browsers all have different defaults, and even some versions are different from others.
Set the font size to 76% in the body (font-size:76%) and then use ems for font-size, padding and margins therein. DO set a default font family for the page (something like font-family:verdana,arial,sans-serif.
Do not set much on default tag types (div, p, img, a, ul, li, etc), rather, give them an id (if they are used once in the page) or a class (for multiple use in the page) and set things like font attributes, text-alignments, color etc.
Design for Firefox or Safari and then modify it to work in IE (remember that IE 5 has a major box model bug) for PC and MAC (MAC version is woefully lacking and different to IE5.x for the PC).
Do watch out for major IE bugs (see www.positioniseverything.net ) such as the justified italics bug, the 3 pixel jog, and so on.
Trevor
-
Apr 25, 2004, 18:09 #3
- Join Date
- Nov 2003
- Location
- united states
- Posts
- 24
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanxs for the wonderful tips ClevaTreva, because I do want to get use to building a XHTML site.
-
Apr 25, 2004, 18:19 #4
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
Originally Posted by ClevaTreva
but my advice is not to try to hack your way around them
you'll drive yourself nuckin futs
see the IE6 Peekaboo Bug
then read on to the The IE Three Pixel Text-Jog
make sure you read everything, all the way down to the Holly hack
css involves a certain amount of zen
if you find yourself hacking your way around all these bugs,
then you have not yet grasped the pebble, grasshopper
-
Apr 26, 2004, 03:29 #5
- Join Date
- Apr 2002
- Location
- A Maze of Twisty Little Passages
- Posts
- 6,316
- Mentioned
- 60 Post(s)
- Tagged
- 0 Thread(s)
The XML declaration does plenty if you serve XHTML as XHTML instead of text/html. As you are aware such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16.
As was previously stated though unless you are serving to an xml processor generally you are just as well writing xhtml for a static page.
-
Apr 26, 2004, 06:02 #6
Originally Posted by r937
Originally Posted by ClevaTreva
-
Apr 26, 2004, 06:23 #7
- Join Date
- Jan 2004
- Location
- Chipping Campden, UK
- Posts
- 403
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by vgarcia
Yes, I agree about the shouldn't be, but it can be!
IE and the other browsers are happy with it being served as text/html, and so you can get away with that for now, whilst cutting out code in xhtml1.0 that isn't allowed in 1.1
It juts makes changing over in the future a bit easier. But then, I guess changing the doctype is no hassle either, if you have coded for 1.1 anyway.
Trevor
-
Apr 26, 2004, 06:33 #8
Originally Posted by ClevaTreva
Bookmarks