Page 1 of 3 123 LastLast
Results 1 to 16 of 39

Thread: Xhtml

  1. #1
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts

    Xhtml

    Can someone please explain to me exactly what XHTML is supposed to do, or rather what makes it better than normal HTML? And also - where's a good place to learn how to write XHTML properly (bearing in mind I already know basic HTML)?

    Thanks

    Mike
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

  2. #2
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    check out w3schools. Basicly the way you type XHTML is stricter and cleaner than HTML. In other words its has more organised structure.

  3. #3
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    XHTML is HTML following the XML guideline e.g. all tags should be closed

    e.g.

    HTML
    <b>text</b>
    <img src="blah.gif">

    XHTML
    <b>text</b>
    <img src="blah.gif" />

    Note the closing / on tags which don't normally have them

    There are other rules but that's a brief taster

  4. #4
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    Thanks guys, looking through those pages as we speak - I think it's going to take a while to sift through all of my pages, but I'll get there!
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

  5. #5
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    Okay, quick question - ran one of my pages through the validator and it tells me I can't use bgcolor or text attributes in the <body> tag - so what do I use instead?

    Thanks

    Mike

    Edit: This happens with the color attribute in the <font> tag as well.
    Last edited by mike_w; 19-11-2004 at 06:24 PM.
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

  6. #6
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    Not sure if this is correct but if i saw that i would apply bg colours and fonts to the body using CSS. If ur not sure it would go somthing along the lines of:

    <style type="text/css">

    body {

    background-color: #000000;
    font-family:Arial,Verdana, sans-serif;
    font-size: 12px;

    }

    </style>

    This would go inbetween the html head tags.
    Last edited by Dorza; 19-11-2004 at 08:27 PM.

  7. #7
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    Quote Originally Posted by Dorza
    Not sure if this is correct but if i saw that i would apply bg colours and fonts to the body using CSS.
    Thanks, just discovered that by looking at other XHTML compliant sites. I've just found out how to make classes in a stylesheet, so I think I've got it cracked!
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

  8. #8
    Flak Monkey! Dorza's Avatar
    Join Date
    Jul 2003
    Location
    UK - South Wales
    Posts
    1,762
    Thanks
    34
    Thanked
    17 times in 15 posts
    • Dorza's system
      • Motherboard:
      • Asus P5B Deluxe - WiFi
      • CPU:
      • Q6600 @ 3.06Ghz
      • Memory:
      • 2GB Crucial
      • Storage:
      • 500GB Samsung SpinPoint
      • Graphics card(s):
      • Geforce 9600GT
      • PSU:
      • Cosair HX520W
      • Case:
      • LianLi something something or other
      • Monitor(s):
      • Eizo FlexScan S1910 (1280*1024)
      • Internet:
      • 2mb Virgin (when they want to give me that: else 1mb)
    I found that reading the css section on that site i provided was very easy. You can pick css up very fast. I did anyway

  9. #9
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    Quote Originally Posted by Dorza
    I found that reading the css section on that site i provided was very easy. You can pick css up very fast. I did anyway
    Well, the XHTML is relatively simple so far... just taking a very long time to convert all of my pages!
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

  10. #10
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    Okay - last questions now (I really hope so - I've checked all of the pages with the validator and these are the only errors that I can't solve).

    Firstly, how do I solve this error:

    Line 5, column 6: end tag for "head" which is not finished
    Secondly, how do I remove borders from frames?

    Thirdly, how do I open links in a new page (since target="_blank" doesn't work)?

    Finally, how do I solve this error:

    No Character Encoding Found! Falling back to UTF-8.
    All the help is greatly appreciated!
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

  11. #11
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    If you want no frameborder:

    Frameborder="0" and border="0" in the framset tag. You will also want noresize to stop the scrollbar appearing when the page content is too large to fit in the frame.

    Close the head tag with </head>

    Try _new for target.

    You have to specify the ecnode type for the page/site. Can't remember how, you can do it in your style sheet (best). Somthing like enctype I believe. Try google or wait for a response.
    To err is human. To really foul things up ... you need a computer.

  12. #12
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    Quote Originally Posted by yamangman
    If you want no frameborder:

    Frameborder="0" and border="0" in the framset tag.
    Already tried that, but the validator doesn't like it.

    Close the head tag with </head>
    I have! Here's the template I use for all my pages, and even this generates that error!

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
    <body>
    </body>
    </html>
    Try _new for target.
    I think the problem is that you can't use "target=" at all, and _new still generates errors.
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

  13. #13
    Registered+
    Join Date
    Jun 2004
    Posts
    31
    Thanks
    0
    Thanked
    0 times in 0 posts
    "target" isn't a part of XHTML, but it can be imported to the DOM somehow (apparently easier than it sounds, but I've never had to do it.)

  14. #14
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    replace target="_blank" with rel="external" and load the following JavaScript in your page

    Code:
    function externalLinks() { 
     if (!document.getElementsByTagName) return; 
     var anchors = document.getElementsByTagName("a"); 
     for (var i=0; i<anchors.length; i++) { 
       var anchor = anchors[i]; 
       if (anchor.getAttribute("href") && 
           anchor.getAttribute("rel") == "external") 
         anchor.target = "_blank"; 
     }
    I haven't found another W3C compliant way of getting round it

  15. #15
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    I seem to have found a way to get around using target - is there anything wrong with using this method (validator doesn't complain when I use it):

    <a href="example.html" onclick="window.open('example.html', '_blank', ''); return false;">Example</a>
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

  16. #16
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    It's fine except that if you want to add in parameters etc then you don't have any central control. The method I indicated means you can do anything to every link on your site that opens in a new window by altering the one function rather than going through every link manually

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Invalid XHTML
    By Zathras in forum HEXUS Suggestions
    Replies: 3
    Last Post: 13-11-2004, 12:28 AM
  2. Xhtml
    By Gordy in forum Software
    Replies: 5
    Last Post: 15-03-2004, 06:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •