Results 1 to 8 of 8

Thread: Okay Twey, let's make a Strict Doctype work!

  1. #1
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default Okay Twey, let's make a Strict Doctype work!

    Alrighty ladies and gentlemen! In a recent round-a-bout with Twey over the compliance standards between transitional and strict doctypes, I have attempted to turn the pages on my site from trans valid to strict valid.

    Now, at this current point, I have both pages and both CSS validated.

    However, the Trans valid page while being valid, looks the way I want it too.

    While the Strict valid page has all the content, but obviously does not look how I want it.

    Currently here is the HTML for the Strict page:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Enter The Car</title>
    <link rel="stylesheet" type="text/css" href="/levels.css">
    </head>
    
    <body>
    <h1>1</h1>
    <div class="container">
    <div class="images">
    <map name="cwot">
    <area shape='rect' coords='340,130,410,198' href='leveltwo.htm' alt='Enter Here!'>
    </map>
    <img src="cwot1.jpg" width="500" height="319" usemap="#cwot" alt= "Enter Here!" /><p>
    <object type="audio/mpeg" data="/mus1.mp3" width="200" height="20">
      <param name="src" value="/mus1.mp3" />
      <param name="autoplay" value="false" />
      <param name="autoStart" value="0" />
      alt : <a href="/mus1.mp3">Play The Level Music!</a>
    </object>
    </p>
    <p>
    If you still need more help with this level go <a href= "/more.html">HERE</a><br />
    Or you could try the forum on for size, go <a href= "/forum/">HERE</a> for that.
    </p>
    </div>
    </div>
    
    <!-- THIS is a hint tag! Look for these through out the game, don't get confused witht he very similar looking coding tags.  For now... Just click on the car door! -->	
    </body>
    </html>
    and the valid CSS:

    Code:
    body {
    	padding-left: 2em;
    	font-family: Georgia, "Times New Roman", Times, serif;
    	font-weight: 600;
    	color: #BBD;
    	background-color: #000;
    }
    
    ul.navbar {
    	list-style-type: none;
    	padding: 0;
    	margin: 0;
    	position: absolute;
    	top: 2em;
    	left: 1em;
    	width: 9em;
    }
    
    h1 {
    	font-family: Georgia, Arial, SunSans-Regular, sans-serif;
    }
    
    h2 {
    	font-family: Georgia, Arial, SunSans-Regular, sans-serif;
    }
    
    h3 {
    	font-family: Georgia, Arial, SunSans-Regular, sans-serif;
    }
    
    hr {
    	border: none 0; 
    	border-top: 3px double #C00;
    	width: 100&#37;;
    	height: 3px;
    	margin: 10px auto 0 0;
    	text-align: left;
    }
    
    ul.navbar li {
    	color: blue;
    	background: #369;
    	margin: 0.5em 0;
    	padding: 0.3em;
    	border-right: 1em solid black }
    
    ul.navbar a {
    	text-decoration: none;
    }
    
    a:link {
    	color: #FF3030;
    	background: #000;
    }
    
    a:hover {
    	color: #228B22;
    	background: #000;
    }
    
    a:visited {
    	color: #CD2626;
    	background: #000;
    }
    
    address {
    	margin-top: 1em;
    	padding-top: 1em;
    	border-top: thin dotted;
    }
    
    img {
    	border-style: none;
    }
    
    #container {
    	text-align: center;
    }
    
    #images {
    	text-align: left;
    	width: 600px;
    }
    So I have tried all the "centering" tricks with the Strict type and nothing is working... what do I need to tweak?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Holy crap I did it...

    Okay first I got rid of the container stuff (both div and CSS).

    I was looking up some things about this and saw one answer said <div id="images">

    So I changed "class" to "id" and it is working (at least in FF as that is all I have checked thus far...

    So class and id are both strict valid, but they are doing different things?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The difference between them is that an ID has higher specificity. For example, if you had:
    Code:
    <div id="divid" class="divclass">
    and
    Code:
    #divid {
      background-color: blue;
    }
    
    .divclass {
      background-color: red;
    }
    ... the <div> should have a blue background, since an ID can only refer to one element, and so is the most specific selector one can have.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    But if id and class are exactly the same, why would it matter? As far as working and validating goes I mean. This is one that didn't make sense to me (your explanation in reference to the problem) I mean I know what you mean, but it doesn't seem to make workable sense to the issue at hand.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    All you need is a bit of patience...
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  6. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Who ordered the fortune cookie?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well, unless you've edited, your CSS mentions:
    Code:
    #container {
            text-align: center;
    }
    #container means "an element with an ID of container," so it won't apply to something with a class of "container." If you want to select by class, use . instead of #.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Ohhh I had my elements mixed up Yes I used # instead of .

    Okay, got it now, so silly.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

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
  •