Web Analytics Made Easy -
StatCounter Validating my site - CodingForum

Announcement

Collapse
No announcement yet.

Validating my site

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Validating my site

    My main page is three errors away from w3c validation. The only problem is that my errors aren't errors it all, but design elements that would kill my site as I know it. I've tried using different doctypes, but I only end up with more errors and/or major IE issues. Is there anything I can do to get around these errors (or IE issues in XHTML)?

    Results

  • #2
    lose the background-color="transparent" in the iframe, its doing nothing. Make the background color of the page being iframed in transparent. Nothing you can do about error 2 if you want to have a transparent iframe in IE. The first error, well thats common sense really. There is NO height attribute in a table. Make it style="height:100%" You can lose this also in the iframe
    Code:
    marginheight="0" marginwidth="0"
    It has no effect on the iframe.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment


    • #3
      You could use javascript to set the attribute allowtransparancy to true on all iframe's

      Code:
      <script type="text/javascript">
      function AllowTransparancy() {
       if (!document.getElementsByTagName) return;
       var iframes = document.getElementsByTagName("iframe");
       for (var i=0; i<anchors.length; i++) {
         var iframe = iframes[i];
         iframe.allowtransparancy = "true";
       }
      }
      
      body.onload=AllowTransparancy
      </script>
      Last edited by mrruben5; Jul 29, 2005, 09:14 PM.
      CATdude about IE6: "All your box-model are belong to us"

      Comment


      • #4
        Awesomeness. I thank you both. How do I do the javascript thing?

        Comment


        • #5
          Code:
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          <title>Untitled Document</title>
          </head>
          
          <body onload="document.getElementById('theframe').allowTransparency='true';">
          <iframe id="theframe" src="test.html"></iframe>
          </body>
          </html>
          Give the iframe a name and reference it using document.getElementById
          ||||If you are getting paid to do a job, don't ask for help on it!||||

          Comment


          • #6
            Code:
            function transIframe() {
              var iframe = document.getElementsByTagName('iframe')[0];
              iframe.setAttribute('allowtransparency', 'true'); 
            }
            
            window.onload = transIframe;


            Edit: lol, I don't know why I bothered... Should have known you would beat me to it!

            I take no responsibility for the above nonsense.


            Left Justified

            Comment


            • #7
              That'd do it. Thanks again.

              Comment


              • #8
                rofl they beat me to it
                CATdude about IE6: "All your box-model are belong to us"

                Comment

                Working...
                X