How to start using xhtml in place of html

Discussion in 'Software' started by Unbanable, Mar 10, 2008.

  1. Unbanable

    Unbanable Specialist

    I want to start using xhtml... I guess technically I'd be "serving it" as html or something. I don't really understand all of that stuff yet, I thought that using xhtml was usually simply a matter of changing the doctype, adding a meta tag, an attribute to the html tag and using self closing tags. But apparently not. I save my html page as .xhtml, do everything I said above, it validates using the W3 validator, but I'm not able to open it using a web browser. What am I doing wrong? Any ideas?

    When I try to open it using a web browser, it gives me a download dialog box and says it's an application.
     
  2. rayzur

    rayzur Private First Class

    XHTML is a stricter and cleaner version of HTML. It is a good practice to prepare yourself for XHTML by starting to write strict HTML.

    I use XHTML exclusively now. What I miss with my hand coding, my "HTML Tidy" Firefox extension catches when my doctypes are set to "XHTML-Strict".

    You can find out all you need to know about getting started at "W3schools - intro to XHTML".

    Happy Coding!

    Make sure your doctypes are right, get "HTML-Kit" editor, it has a built in "HTML-Tidy" clean up tool in it.
    Don't save your pages as .xhtml - That's why you can't open them in your browser. Save them as .html or .htm
    There is a complete discussion and FAQ guide at sitepoint.
     
  3. rayzur

    rayzur Private First Class

  4. Unbanable

    Unbanable Specialist

    Thank you. I believe that as far as the coding went, everything was correct, because, like I said, it validated using the W3 validator. I always try to keep my code as strict as possible and I always run it through a validator. I thought that I needed to save the files as .xhtml, though, so I think that may have been the problem. Thanks for the help!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds