SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Addicted to the Source of Life PowerBit's Avatar
    Join Date
    Feb 2004
    Location
    Loveland Co
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Basic Questions about Doc Type and HTML Version

    HI there,

    It's been a while since I have been in the business of coding. I would like to know if this doc type and head I am using is sufficient for basic coding

    HTML 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>
    <title> </title>
    <meta name="keywords" content=" " />
    <meta name="description" content=" " />
    <meta name="title" content="" />
    <meta name="robots" content="index, follow" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="assets/styleSheet.css" media="screen,projection" />
    That really sums it up.

    Thanks for your help!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Yes, that's fine. I don't use all those metas, but it's up to you. Keywords are generally ignored now, as far as I know. I gather it's best to have the content-type straight after the <head> tag, lke so:

    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>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    The two other 'up to date' doctypes in use today are:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    and

    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    The first of these is the HTML 4.01 doctype, and the last one has come along mainly for use with HTML5, which is still in development, but the doctype itself is fine to use on any site. I tend to use the last one now, as it's simpler.

  3. #3
    Addicted to the Source of Life PowerBit's Avatar
    Join Date
    Feb 2004
    Location
    Loveland Co
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thank you!

    Thanks for the response.

    Is the last doc type, supported over all devices and much of the newest supporting browsers?

  4. #4
    Addicted to the Source of Life PowerBit's Avatar
    Join Date
    Feb 2004
    Location
    Loveland Co
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something else I am thinking about... I am aware that Frames are antiquated; but what I like about them is the ease to manufacture a quick navigation between images and menus within a page with out loading a new page as well as getting caught up in all the extra hassles of Ajax. Do you see Frames remaining as useful elements using a transitional doc type? Does the last doc type you mention support frames?

    I appreciate your helpfulness.

  5. #5
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by PowerBit View Post
    Is the last doc type, supported over all devices and much of the newest supporting browsers?
    I've not found any devices or browsers that don't cope with <!DOCTYPE html>, including older ones. What you will find is that some features of HTML5 are not supported in older browsers, but as long as you stick to code that is part of HTML4 you'll be fine.

    Quote Originally Posted by PowerBit View Post
    Something else I am thinking about... I am aware that Frames are antiquated; but what I like about them is the ease to manufacture a quick navigation between images and menus within a page with out loading a new page as well as getting caught up in all the extra hassles of Ajax. Do you see Frames remaining as useful elements using a transitional doc type? Does the last doc type you mention support frames?
    No, frames are not allowed in HTML5 – iframes are, but not frames.

    If you want to swap images without loading a new page, you can do that with very simple Javascript, there's no need to go for full-on AJAX. You might find that iframes give you the scope to do this without any form of scripting, although they do introduce their own problems. I can see why you might want to load images without loading a whole new page – but I'm not sure whether it's worthwhile. If you've written your page well, the size of the actual HTML will be so much smaller than the image that it will seem to load more-or-less instantaneously. The total size of the HTML will probably be less than the size of the AJAX needed to accomplish an image swap as well!

    I don't generally recommend iframes as a solution – occasionally they are right, but more often they are wrong – without seeing your site in context, it's difficult to be able to give you a more definite answer.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by PowerBit View Post
    the ease to manufacture a quick navigation between images and menus within a page with out loading a new page
    I'm not sure what you are describing there, but as Stevie says, you could probably use simple JavaScript, if not just CSS.

  7. #7
    Addicted to the Source of Life PowerBit's Avatar
    Join Date
    Feb 2004
    Location
    Loveland Co
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Ralph and Stevie

    Thanks for the simple answers. : )

  8. #8
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    No, frames are not allowed in HTML5 – iframes are, but not frames.
    IE9 doesn't allow frames neither...

    I suppose, even if you use a doctype for html 4 or xhtml, it would't work. (have to test it)

    At work, we have an intraweb, with frames ... :s
    I guess we'll have to change the whole thing now the company decided to work with Windows 7 where IE9 is the standard new browser. :aah:


Bookmarks

Posting Permissions

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