Web Analytics Made Easy -
StatCounter xhtml validation - CodingForum

Announcement

Collapse
No announcement yet.

xhtml validation

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

  • xhtml validation

    Hey im having a little problem with validation. I want my page to work in all browsers so i thought i should keep to w3 standards, but i have got a bit stuck. I think i am using the wrong doctype, but i could be wrong... the html is
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>alanmonger.co.uk | Home</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div align="center" style="padding-top:1%" />
    <?php
    
    	include "header.php"
    	
    ?>
    <div id="main">
    
    <div id="content">
    <!-- Start of StatCounter Code -->
    <script type="text/javascript" language="javascript">
    <!-- 
    var sc_project=654070; 
    var sc_invisible=0; 
    var sc_partition=5; 
    var sc_security="c6ca2f08"; 
    //-->
    </script>
    
    <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img  src="http://c6.statcounter.com/counter.php?sc_project=654070&java=0&security=c6ca2f08&invisible=0" alt="hit counter" border="0"></a> </noscript>
    <!-- End of StatCounter Code -->
    </div>
    <?php
    	include "footer.php";
    ?>
    </div>
    </div>
    </body>
    </html>
    cheers for any help

  • #2
    We need to see the code when it gets to the browser meaning with the php includes already parsed. A link to the site would be best.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment


    • #3
      Originally posted by _Aerospace_Eng_ View Post
      We need to see the code when it gets to the browser meaning with the php includes already parsed. A link to the site would be best.
      oops sorry its www.alanmonger.co.uk

      Comment


      • #4
        Okay from the looks of things you seem to have no idea what XHTML is. I suggest using an HTML transitional doctype or HTML Strict one. Some of the things you have in your code need to be done in CSS for example this
        Code:
        <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
        can be trimmed down to
        Code:
        <body>
        then in CSS
        Code:
        body {
        background:#FFF;
        margin:0;
        padding:0;
        }
        however I noticed you have two body tags you should only have one.
        Get rid of the second one here
        Code:
        <body>
        <div align="center" style="padding-top:1%" />
        <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
        This is how I would have done it. There was no need for tables in your layout.
        Code:
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>alanmonger.co.uk | Home</title>
        <style type="text/css">
        html, body {
        margin:0;
        padding:0;
        border:0;
        height:100%;
        background:#FFF url(nav/back_widecenter.gif) top left repeat-y;
        color:#000;
        }
        a img {
        border:0;
        }
        #container {
        width:800px;
        margin:auto;
        }
        #header {
        height:147px;
        background:url(images/layout_01.gif) no-repeat bottom;
        text-indent:-9999px;
        }
        #nav {
        margin:0;
        padding:0 0 0 127px;
        list-style:none;
        background:url(images/layout_02.gif) no-repeat;
        height:31px;
        }
        #nav li {
        float:left;
        line-height:0px;
        font-size:0;
        }
        #main {
        background:#9DB9C5 url(images/layout_09.gif) no-repeat;
        text-align:center;
        padding-top:30px;
        color:#000;
        }
        #content {
        padding:8px;
        background:#FFF;
        width:686px;
        min-height:686px;
        color:#000;
        margin:auto;
        text-align:justify;
        }
        * html #content {
        height:686px;
        }
        #stats {
        text-align:center;
        }
        #valid {
        padding:20px 0;
        }
        </style>
        </head>
        <body>
        <div id="container">
            <div id="header">alanmonger.co.uk - Home</div>
            <ul id="nav">
                <li><a href="index.php"><img src="images/layout_03.gif" width="64" height="31" alt="" /></a></li>
                <li><a href="images.php"><img src="images/layout_04.gif" width="90" height="31" alt="" /></a></li>
                <li><a href="videos.php"><img src="images/layout_05.gif" width="73" height="31" alt="" /></a></li>
                <li><a href="games.php"><img src="images/layout_06.gif" width="85" height="31" alt="" /></a></li>
                <li><a href="contact.php"><img src="images/layout_07.gif" width="96" height="31" alt="" /></a></li>
                <li><img src="images/layout_08.gif" width="265" height="31" alt="" /></li>
            </ul>
            <div id="main">
                <div id="content">
                    <div id="stats">
                        <!-- Start of StatCounter Code -->
                        <script type="text/javascript">
                            <!-- 
                            var sc_project=654070; 
                            var sc_invisible=0; 
                            var sc_partition=5; 
                            var sc_security="c6ca2f08"; 
                            //-->
                        </script>
                        <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script>
                        <noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c6.statcounter.com/counter.php?sc_project=654070&amp;java=0&amp;security=c6ca2f08&amp;invisible=0" alt="hit counter" /></a></noscript>
                        <!-- End of StatCounter Code -->
                    </div>
                </div>
                <div id="valid"><a href="http://jigsaw.w3.org/css-validator/"><img width="88" height="31" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a></div>
            </div>
        </div>
        </body>
        </html>
        Last edited by _Aerospace_Eng_; Sep 29, 2006, 12:45 PM.
        ||||If you are getting paid to do a job, don't ask for help on it!||||

        Comment


        • #5
          wow... thanks a lot, that really helps...

          im still a bit new to web design, and i am just learning from different pages... i had no idea you could achieve the same effects with lists...

          thanks alot for your help, i really appreciate it.

          Ciggy

          Comment


          • #6
            hey, i sorted out the html and css problem but now have a javascript related problem. Id like to but it in a javascript thread, but i thought as i have already made one based on validation, id post it here.

            Anyway the problem is, i have not begun to learn javascript, so i have no idea how to solve the problem. So i have a javascript code, that is provided by statcounter, to record the number of times that people go into the page. The problem is, that it isnt validated by w3c standards. I was wondering if it is possible to change the code to make it meet the requirement to become valid... anyway here is the code for the main page (visible)

            Code:
            <!-- Start of StatCounter Code -->
            <script type="text/javascript">
            <!-- 
            var sc_project=654070; 
            var sc_invisible=0; 
            var sc_partition=5; 
            var sc_security="c6ca2f08"; 
            var sc_https=1; 
            var sc_remove_link=1; 
            //-->
            </script>
            
            <script type="text/javascript" src="https://secure.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><img class="statcounter" src="https://c6.statcounter.com/counter.php?sc_project=654070&java=0&security=c6ca2f08&invisible=0" alt="web stats" /></div></noscript>
            <!-- End of StatCounter Code -->
            and here is the code for the other pages (invisible)

            Code:
            <!-- Start of StatCounter Code -->
            <script type="text/javascript">
            <!-- 
            var sc_project=654070; 
            var sc_invisible=1; 
            var sc_partition=5; 
            var sc_security="c6ca2f08"; 
            var sc_https=1; 
            var sc_remove_link=1; 
            //-->
            </script>
            
            <script type="text/javascript" src="https://secure.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><img class="statcounter" src="https://c6.statcounter.com/counter.php?sc_project=654070&java=0&security=c6ca2f08&invisible=0" alt="web stats" /></div></noscript>
            <!-- End of StatCounter Code -->
            cheers

            ciggy

            Comment


            • #7
              Look closely at the javascript in the code I gave you and look at the code you have. Notice anything different? &amp; maybe?
              ||||If you are getting paid to do a job, don't ask for help on it!||||

              Comment


              • #8
                oh yes... sorry i missed that, as i am trying to learn form my mistakes, i have taken what you have given me and started again from scratch.... i missed the javascript ... thanks alot... but could you tell me what &amp does?

                Comment


                • #9
                  Its an html entity. Its equivalent to & which is an ampersand. &amp; is what you use in HTML to replace it. It will still work the same way, its just the valid way to do it.
                  ||||If you are getting paid to do a job, don't ask for help on it!||||

                  Comment


                  • #10
                    Originally posted by _Aerospace_Eng_ View Post
                    Its an html entity. Its equivalent to & which is an ampersand. &amp; is what you use in HTML to replace it. It will still work the same way, its just the valid way to do it.
                    cool my website is now completely valid... ill keep the &amp; in mind for the next time i do some editing

                    thanks

                    ciggy

                    Comment


                    • #11
                      last problem i promise

                      this is my video code

                      Code:
                      <object width="686px" height="686px">
                      <param name="movie" value="http://www.dailymotion.com/swf/3IUyHBbCaavWw1CTr"></param>
                      <embed src="http://www.dailymotion.com/swf/3IUyHBbCaavWw1CTr" width=686px height=686px/></object>
                      yet W3C comes up with lots of errors that i dont know how to fix

                      like there is no attribute "src", there is no attribute "width", and something about shorttag.... which i dont know what it is and cant seem to find information on it.

                      Any help would be much appreciated

                      Comment


                      • #12
                        Code:
                        <object type="application/x-shockwave-flash" data="http://www.dailymotion.com/swf/3IUyHBbCaavWw1CTr" width="686" height="686">
                        <param name="movie" value="http://www.dailymotion.com/swf/3IUyHBbCaavWw1CTr" />
                        </object>
                        You should really learn what XHTML is. You don't seem to know what it is at this point.
                        ||||If you are getting paid to do a job, don't ask for help on it!||||

                        Comment


                        • #13
                          Originally posted by _Aerospace_Eng_ View Post
                          Code:
                          <object type="application/x-shockwave-flash" data="http://www.dailymotion.com/swf/3IUyHBbCaavWw1CTr" width="686" height="686">
                          <param name="movie" value="http://www.dailymotion.com/swf/3IUyHBbCaavWw1CTr" />
                          </object>
                          You should really learn what XHTML is. You don't seem to know what it is at this point.

                          thanks for that, and your right.. i dont know xhtml, but i suppose i should start learning... i have been trying to learn different languages at the same time (php and c++) but if it is important to learn xhtml then i shall start to go into it

                          Comment


                          • #14
                            hey aerospace, could you explain to me how the navigation part of the html works? I have got the most part of it, but the end result always seems to end up jagged.

                            Cheers

                            Ciggy

                            Comment


                            • #15
                              What exactly are you wanting to know? You need to be more specific. The float:left; on the li's allows them to be on one line without any space in between them. Zeroing out the margin on the ul resolves any extra spacing issues. I thought it was pretty straight forward.
                              ||||If you are getting paid to do a job, don't ask for help on it!||||

                              Comment

                              Working...
                              X