Pls help me to validate some code!

J

jollyroger

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>
 
B

Beauregard T. Shagnasty

jollyroger said:
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)

<!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
 
N

Neredbojias

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.
 
A

Andy Dingley

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
 
A

Andy Dingley

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top