![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: at my computer desk
Posts: 138
Rep Power: 3
![]() |
tables dont work in firefox; they work in IE
hi guys,
this page (copy paste in notepad save as .htm and open) <!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>
<title>Sreenath Pillai's Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
body {
margin:0;
padding:0;
font: bold 11px/1.5em Verdana;
}
h2 {
font: bold 14px Verdana, Arial, Helvetica, sans-serif;
color: #000;
margin: 0px;
padding: 0px 0px 0px 15px;
}
/*- Menu Tabs F--------------------------- */
#tabsF {
float:left;
width:100%;
background:#efefef;
font-size:93%;
line-height:normal;
border-bottom:1px solid #666;
}
#tabsF ul {
margin:0;
padding:10px 10px 0 50px;
list-style:none;
}
#tabsF li {
display:inline;
margin:0;
padding:0;
}
#tabsF a {
float:left;
background:url("tableftF.gif") no-repeat left top;
margin:0;
padding:0 0 0 4px;
text-decoration:none;
}
#tabsF a span {
float:left;
display:block;
background:url("tabrightF.gif") no-repeat right top;
padding:5px 15px 4px 6px;
color:#666;
}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
#tabsF a span {float:none;}
/* End IE5-Mac hack */
#tabsF a:hover span {
color:#FFF;
}
#tabsF a:hover {
background-position:0% -42px;
}
#tabsF a:hover span {
background-position:100% -42px;
}
</style>
</head>
<body bgcolor="#cccccc">
<h1 align="center">Sreenath Pillai's Homepage</h1>
<div id="tabsF">
<ul>
<li><a href="#" title="Link 1"><span>Home Page</span></a></li>
<li><a href="#" title="Link 2"><span>Forums</span></a></li>
<li><a href="#" title="Link 3"><span>Store (coming soon)</span></a></li>
<li><a href="#" title="Longer Link Text"><span>About me</span></a></li>
<li><a href="#" title="Link 5"><span>My writings/publications</span></a></li>
<li><a href="#" title="Link 6"><span>My Current Projects</span></a></li>
<li><a href="#" title="Link 7"><span>Site News</span></a></li>
<li><a href="#" title="Link 8"><span>Contact Me</span></a></li>
</ul>
</div>
<table border="1" width="100%" id="table1">
<tr height=100%>
<td width=20%>adsf</td>
<td width=60%>adsfafa</td>
<td width=20%>asdfasdf</td>
</tr>
</table>
</body>
</html> |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
...
<div id="tabsF">
<ul>
<li><a href="#" title="Link 1"><span>Home Page</span></a></li>
<li><a href="#" title="Link 2"><span>Forums</span></a></li>
<li><a href="#" title="Link 3"><span>Store (coming soon)</span></a></li>
<li><a href="#" title="Longer Link Text"><span>About me</span></a></li>
<li><a href="#" title="Link 5"><span>My writings/publications</span></a></li>
<li><a href="#" title="Link 6"><span>My Current Projects</span></a></li>
<li><a href="#" title="Link 7"><span>Site News</span></a></li>
<li><a href="#" title="Link 8"><span>Contact Me</span></a></li>
</ul>
</div>
<script type="text/javascript">
var browser=navigator.appName
if (browser=="Netscape")
{document.write("<br><br><br><br>")}
</script>
<table border="1" width="100%" id="table1">
<tr height=100%>
<td width=20%>adsf</td>
<td width=60%>adsfafa</td>
<td width=20%>asdfasdf</td>
</tr>
</table></body></html>
__________________
Pain is just weakness leaving the body.
Last edited by AntiNinja; Aug 5th, 2006 at 4:53 PM. |
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Uh... With all due respect, AntiNinja, Javascript hacks are not usually the way to solve CSS problems. Your solution also won't help Opera or Safari users. Why not just fix the CSS, instead of applying an arcane hack?
In this case, the problem revolves around all those "float: left;"s. Remove them, and the "display: block;" on "#tabsF a span", add a bit more padding to the enclosing div, and there's your solution. |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: at my computer desk
Posts: 138
Rep Power: 3
![]() |
thanks, i got it
thanks arevos and ninja, but i got it. this is what i did:
<!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>
<title>Sreenath Pillai's Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
body {
margin:0;
padding:0;
font-family: Verdana;
font-weight:bold;
font-size: 8pt;
background-color:#cccccc;
}
h2 {
font-family: Verdana;
font-weight:bold;
font-size: 14pt;
margin: 0px;
padding: 0px;
height:25px;
}
#HeaderBlock
{
height:90px;
position:absolute;
top:5px;
}
#ContentBlock
{
position:absolute;
top:100px;
}
/*- Menu Tabs F--------------------------- */
#tabsF {
float:left;
width:100%;
height:30px;
background-color:#efefef;
border-bottom:1px solid #666666;
}
#tabsF ul {
margin:0;
padding:9px 10px 0px 50px;
list-style:none;
}
#tabsF li {
display:inline;
margin:0;
padding:0;
font-size:93%;
border-bottom:1px solid #666666;
}
.normal a {
float:left;
background:url("tableftF.gif") no-repeat left top;
margin:0;
padding:0 0 0 4px;
text-decoration:none;
}
.selected a {
float:left;
background:url("tableftF.gif") no-repeat left top;
background-position:0% -42px;
margin:0;
padding:0px 0 0 4px;
text-decoration:none;
}
.normal a span {
float:left;
display:block;
background:url("tabrightF.gif") no-repeat right top;
padding:5px 15px 4px 6px;
color:#666666;
}
.selected a span {
float:left;
display:block;
background:url("tabrightF.gif") no-repeat right top;
background-position:100% -42px;
padding:5px 15px 4px 6px;
color:#666666;
}
.normal a:hover span {
color:#FFFFFF;
}
.normal a:hover {
background-position:0% -42px;
}
.normal a:hover span {
background-position:100% -42px;
}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
.normal a span {float:none;}
/* End IE5-Mac hack */
</style>
</head>
<body>
<div id="HeaderBlock">
<h1 align="center">Sreenath Pillai's Homepage</h1>
<div id="tabsF">
<ul>
<li class="normal"><a href="#" title="Link 1"><span>Home Page</span></a></li>
<li class="normal"><a href="#" title="Link 2"><span>Forums</span></a></li>
<li class="normal"><a href="#" title="Link 3"><span>Store (coming soon)</span></a></li>
<li class="normal"><a href="#" title="Longer Link Text"><span>About me</span></a></li>
<li class="selected"><a href="#" title="Link 5"><span>My writings/publications</span></a></li>
<li class="normal"><a href="#" title="Link 6"><span>My Current Projects</span></a></li>
<li class="normal"><a href="#" title="Link 7"><span>Site News</span></a></li>
<li class="normal"><a href="#" title="Link 8"><span>Contact Me</span></a></li>
</ul>
</div>
</div>
<br/><br/>
<div id="ContentBlock" style="position:absolute:top:5px;left:0px;">
<table border="1" width="100%" id="table1">
<tr height=100%>
<td width=20%>adsf</td>
<td width=60%>adsfafa</td>
<td width=20%>asdfasdf</td>
</tr>
</table>
</div>
</body>
</html> |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| JavaScript and Firefox | JPS | JavaScript and Client-Side Browser Scripting | 2 | Mar 30th, 2006 11:34 AM |
| problems in firefox and opera | gemini_shooter | HTML / XHTML / CSS | 5 | Dec 11th, 2005 12:29 PM |
| firefox vs IE, stats for programming forums | big_k105 | Coder's Corner Lounge | 31 | May 21st, 2005 12:04 PM |
| Using tables with css | dmorales | HTML / XHTML / CSS | 17 | Apr 14th, 2005 12:01 AM |
| 40 Things you'd like to say out loud at work | big_k105 | Coder's Corner Lounge | 11 | Jan 25th, 2005 3:13 AM |