Pls help me to validate some code!

Discussion in 'HTML' started by jollyroger, Aug 6, 2007.

  1. jollyroger

    jollyroger Guest

    I have a table that will only validate if I use inline or an attached
    style. I would love to do that but for some really strange reason if I
    use the same identical attributes in my style it hoses up my layout??
    Can I please have a fresh eye look at this and tell me if it's
    something obvious I'm missing? Thanks!
    (I commented out the inline style for the table)

    <!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=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    ..sometext {
    font-family: Tahoma, Verdana;
    font-size: 11px;
    font-style: normal;
    font-weight: bold;
    color: #000000;
    }
    ..imagerow {
    background-color: #535563;
    padding: 0px;
    height: 205px;
    width: 100%;
    border-top-width: 0px;
    border-right-width: 0px;
    border-bottom-width: 0px;
    border-left-width: 0px;
    }
    ..tablefix {
    cellpadding: 0px;
    cellspacing: 0px;
    border: 0px;
    height: 25px;
    width: 243px;
    }
    -->
    </style>
    </head>
    <body>
    <table width="100%" border="0" cellpadding="0" cellspacing="0"
    bgcolor="#FAF9F7">
    <tr>
    <td width="2%" height="34" align="left" valign="bottom"
    bgcolor="#000066"></td>
    <td width="98%" align="left" valign="bottom" bgcolor="#000066"></
    td>
    </tr>
    <tr>
    <td height="2" colspan="2" align="left" valign="top"></td>
    </tr>
    <tr>
    <td height="205" align="left" valign="bottom" bgcolor="#535563"></
    td>
    <td height="205" align="left" valign="top"
    bgcolor="#535563"><table class="imagerow">
    <tr>
    <td width="33%" height="177" align="left" valign="bottom"
    bgcolor="#535563"><img src="img1.jpg" alt="" width="243" height="162"
    border="1" /></td>
    <td width="33%" align="left" valign="bottom"
    bgcolor="#535563"><img src="img2.jpg" alt="" width="243" height="162"
    border="1" /></td>
    <td width="34%" align="left" valign="bottom"
    bgcolor="#535563"><img src="img3.jpg" alt="" width="243" height="162"
    border="1" /></td>
    </tr>
    <tr>
    <td height="28" align="left" valign="bottom"
    bgcolor="#535563"><table width="243" height="25" border="0"
    cellpadding="0" cellspacing="0">
    <!--<table style="width:243; height:25; border:0;
    cellpadding:0; cellspacing:0">-->
    <tr>
    <td align="center" valign="middle" bgcolor="#FFFFFF"
    class="sometext">Box One </td>
    </tr>
    </table></td>
    <td align="left" valign="bottom" bgcolor="#535563"><table
    width="243" height="25" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="middle" bgcolor="#FFFFFF"
    class="sometext">Box Two </td>
    </tr>
    </table></td>
    <td align="left" valign="bottom" bgcolor="#535563"><table
    width="243" height="25" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="middle" bgcolor="#FFFFFF"
    class="sometext">Box Three </td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>
     
    jollyroger, Aug 6, 2007
    #1
    1. Advertising

  2. jollyroger wrote:

    > I have a table that will only validate if I use inline or an attached
    > style. I would love to do that but for some really strange reason if
    > I use the same identical attributes in my style it hoses up my
    > layout??


    First, I suggest you give the URL to your page, instead of posting code
    fragments here.

    > Can I please have a fresh eye look at this and tell me if it's
    > something obvious I'm missing? Thanks!


    Let us know when it's on a web server. Your mix of CSS and old-style
    inline styling is .. well .. old.

    > (I commented out the inline style for the table)


    With the "<!--" and "-->" ? HTML comment markers don't work in CSS and
    should be removed.

    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
    > www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    New pages should be Strict; you aren't Transitioning from anything.

    > <style type="text/css">
    > <!-- <--- remove these...


    > .sometext {
    > font-family: Tahoma, Verdana; <-- specify fallback
    > font-size: 11px; <-- change to 100%;
    > font-style: normal; <-- that is the default
    > font-weight: bold; <-- bold is hard to read


    See: http://k75s.home.att.net/fontsize.html

    Validate your pages first.
    http://validator.w3.org/
    http://jigsaw.w3.org/css-validator/validator.html

    --
    -bts
    -Motorcycles defy gravity; cars just suck
     
    Beauregard T. Shagnasty, Aug 6, 2007
    #2
    1. Advertising

  3. jollyroger

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Mon, 06 Aug 2007 11:32:56
    GMT jollyroger scribed:

    > I have a table that will only validate if I use inline or an attached
    > style. I would love to do that but for some really strange reason if I
    > use the same identical attributes in my style it hoses up my layout??
    > Can I please have a fresh eye look at this and tell me if it's
    > something obvious I'm missing? Thanks!
    > (I commented out the inline style for the table)
    >
    > <!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=utf-8" />
    > <title>Untitled Document</title>
    > <style type="text/css">
    > <!--
    > .sometext {
    > font-family: Tahoma, Verdana;
    > font-size: 11px;
    > font-style: normal;
    > font-weight: bold;
    > color: #000000;
    > }
    > .imagerow {
    > background-color: #535563;
    > padding: 0px;
    > height: 205px;
    > width: 100%;
    > border-top-width: 0px;
    > border-right-width: 0px;
    > border-bottom-width: 0px;
    > border-left-width: 0px;
    > }
    > .tablefix {
    > cellpadding: 0px;
    > cellspacing: 0px;
    > border: 0px;
    > height: 25px;
    > width: 243px;
    > }
    > -->
    > </style>
    > </head>
    > <body>
    > <table width="100%" border="0" cellpadding="0" cellspacing="0"
    > bgcolor="#FAF9F7">
    > <tr>
    > <td width="2%" height="34" align="left" valign="bottom"
    > bgcolor="#000066"></td>
    > <td width="98%" align="left" valign="bottom" bgcolor="#000066"></
    > td>
    > </tr>
    > <tr>
    > <td height="2" colspan="2" align="left" valign="top"></td>
    > </tr>
    > <tr>
    > <td height="205" align="left" valign="bottom" bgcolor="#535563"></
    > td>
    > <td height="205" align="left" valign="top"
    > bgcolor="#535563"><table class="imagerow">
    > <tr>
    > <td width="33%" height="177" align="left" valign="bottom"
    > bgcolor="#535563"><img src="img1.jpg" alt="" width="243" height="162"
    > border="1" /></td>
    > <td width="33%" align="left" valign="bottom"
    > bgcolor="#535563"><img src="img2.jpg" alt="" width="243" height="162"
    > border="1" /></td>
    > <td width="34%" align="left" valign="bottom"
    > bgcolor="#535563"><img src="img3.jpg" alt="" width="243" height="162"
    > border="1" /></td>
    > </tr>
    > <tr>
    > <td height="28" align="left" valign="bottom"
    > bgcolor="#535563"><table width="243" height="25" border="0"
    > cellpadding="0" cellspacing="0">
    > <!--<table style="width:243; height:25; border:0;
    > cellpadding:0; cellspacing:0">-->
    > <tr>
    > <td align="center" valign="middle" bgcolor="#FFFFFF"
    > class="sometext">Box One </td>
    > </tr>
    > </table></td>
    > <td align="left" valign="bottom" bgcolor="#535563"><table
    > width="243" height="25" border="0" cellpadding="0" cellspacing="0">
    > <tr>
    > <td align="center" valign="middle" bgcolor="#FFFFFF"
    > class="sometext">Box Two </td>
    > </tr>
    > </table></td>
    > <td align="left" valign="bottom" bgcolor="#535563"><table
    > width="243" height="25" border="0" cellpadding="0" cellspacing="0">
    > <tr>
    > <td align="center" valign="middle" bgcolor="#FFFFFF"
    > class="sometext">Box Three </td>
    > </tr>
    > </table></td>
    > </tr>
    > </table></td>
    > </tr>
    > </table>
    > </body>
    > </html>


    That markup sucks.

    Anyway, when you use css, you need to include units. It's also probably
    a bad idea to mix css and archaic html styling.

    --
    Neredbojias
    Half lies are worth twice as much as whole lies.
     
    Neredbojias, Aug 6, 2007
    #3
  4. jollyroger

    Andy Dingley Guest

    On 6 Aug, 12:32, jollyroger <> wrote:

    > I have a table that will only validate if I use inline or an attached
    > style.


    You have a mixture of HTML 3.2 code (<table> and presentational
    attributes) and XHTML. Please replace this pointless craziness with
    something sensible first. It's pointless to put work into a micture
    like this.

    * Use HTML 4.01 Strict rather than XHTML - XHTML is of no help to you
    and it's one more thing to confuse you.

    * Use HTML 4.01 Strict and CSS rather than HTML 3.2 markup with
    presentational attributes. It's hard work and pointless to try
    debugging the mixture of both.

    * Lose the <table>, if you possibly can. Legacy issues and available
    time might make this impractical.

    * Use CSS in a stylesheet (internal or external) if possible, or
    inline style elements if you absolutely must.

    * Validate your HTML and CSS to catch the trivial syntax errors

    * Post a URL to a working example, not a code fragment
     
    Andy Dingley, Aug 6, 2007
    #4
  5. jollyroger

    Andy Dingley Guest

    On 6 Aug, 13:04, "Beauregard T. Shagnasty"
    <> wrote:

    > With the "<!--" and "-->" ? HTML comment markers don't work in CSS and
    > should be removed.


    Although they _do_ work in XML, and so also in real XHTML. This code
    thus has a huge difference in behaviour depending on whether the
    "labelled as XHTML" content gets treated _as_ real XHTML, or merely
    (and most likely) as plain old HTML.

    Using comments like this is thus a terrible idea.
     
    Andy Dingley, Aug 6, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul F. Johnson
    Replies:
    7
    Views:
    469
    Mark Parnell
    Jan 7, 2004
  2. bruce
    Replies:
    4
    Views:
    755
    Cameron Laird
    Sep 22, 2006
  3. BL

    some help pls

    BL, Jan 27, 2005, in forum: C Programming
    Replies:
    0
    Views:
    298
  4. BL

    some help pls

    BL, Jan 27, 2005, in forum: C Programming
    Replies:
    15
    Views:
    561
    Flash Gordon
    Feb 1, 2005
  5. Dave Ello

    Help pls - need to NS-proof some code!

    Dave Ello, Nov 28, 2003, in forum: Javascript
    Replies:
    2
    Views:
    99
    Dave Ello
    Nov 28, 2003
Loading...

Share This Page