HTML/CSS probs with a div-based webpage

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

HTML/CSS probs with a div-based webpage

Postby SnoringFrog » Tue Aug 12, 2008 12:58 pm

I've had a few different problems with this page. In an earlier version, I had the bottom content contained in a div called 'bottom'; however, in IE this created an unwanted gap between the two top divs and the bottom one that I couldn't figure out how to get rid of.

So I tried something else, and I thought I had it figured out. This layout works well enough in FF ((still needs a bit of work, but nothing I don't already know how to do, just haven't gotten to it yet)), but it displays weird in IE. I know that adding the proper doctype fixes the problem, but I don't have that option. The webhost I have to work with isn't the best, and thus I need a way to make this display properly in quirks mode in IE.

My problem is the image that appears on it's own row in the middle of the page, it should be in the same row as the two images directly below it.

Here's my code:
Code: Select all

<html>

   <head>
      <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
      <meta name="generator" content="Adobe GoLive">
      <title>Berean Baptist Church</title>
      <style type="text/css">
         #all{
            width: 755px;
            }
      
         img{
            border: 0px;
            }
            
         a.default:hover{
            cursor: default;
            }
            
         #D_1091040261286 {
            display: none;
            }
            
         #firstright{
            float: right;
            height: 230px;
            width: 240px;
            }
            
         #firstleft{
            float: left;
            height: 230px;
            width: 504px;
            }
            
         #bottom{
            text-align: center;
            height: 560px;
            width: 762px;
            }
            
         #tablist{
            padding: 0px 0px 3px 0px;
            margin-top: 5px;
            margin-left: 1px;
            font: bold 10px Verdana;
            }
            
         .buttons{
            font: bold 10px Verdana;
            }
            
         #tablist li{
            list-style: none;
            display: inline;
            margin: 0;
            }
            
         #tablist li a{
            color: white;
            text-decoration: none;
            padding: 3px;
            margin-left: 0px;
            border: 1px solid black;
            background-color: #69090A;
            }
            
         #tablist li a:hover{
            color: #b1272a;
            background-color: #efefd1;
            cursor: pointer;
            }
            
         #linkboxes {
            background-color: transparent;
            border: 1px solid black;
            }
            
         #linkboxes td {
             border: 1px solid;
             }
            
         #beforeyouattend a {
            background: url(/images/10000/3000/914BE/user/beforeyouattend.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
            
         #beforeyouattend a:hover {
            background: url(/images/10000/3000/914BE/user/beforeyouattendhover.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
            
         #weeklybulletin a {
            background: url(/images/10000/3000/914BE/user/weeklybulletin.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
            
         #weeklybulletin a:hover {
            background: url(/images/10000/3000/914BE/user/weeklybulletinhover.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
               
            
         #volunteeropportunities a {
            background: url(/images/10000/3000/914BE/user/volunteeropportunities.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
            
         #volunteeropportunities a:hover {
            background: url(/images/10000/3000/914BE/user/volunteeropportunitieshover.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
               
         #pastorsblog a {
            background: url(/images/10000/3000/914BE/user/pastorsblog.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
            
         #pastorsblog a:hover {
            background: url(/images/10000/3000/914BE/user/pastorsbloghover.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
            
         #employmentopportunities a {
            background: url(/images/10000/3000/914BE/user/employmentopportunities.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
            
         #employmentopportunities a:hover {
            background: url(/images/10000/3000/914BE/user/employmentopportunitieshover.gif);
            display: block;
            width: 220px;
            height: 28px;
            }
            
         #enter a {
            background: url(/images/10000/3000/914BE/user/enter.gif);
            display: block;
            width: 14px;
            height: 28px;
            }
            
         #enter a:hover {
            background: url(/images/10000/3000/914BE/user/enterhover.gif);
            display: block;
            width: 14px;
            height: 28px;
            }
                        
         #photo {
            border: 1px solid black;
            }
      
      </style>

      
   </head>

   <body>
   <div id="all">
      <div id="firstright">
         <div align="center">   
            <form style="margin-bottom: 5px;" method="get" action="http://www.google.com/search">
               <input id="google" name="q" type="text" size="20" maxlength="255" value="Google search" onfocus="select();" /><img src="/images/10000/3000/914BE/user/google.gif" style="margin:0px; padding:0px;"/>            
               
               <div style="margin-top: 7px; margin-bottom: 8px;"><input type="submit" value="Search" />
               <input type="checkbox"  name="sitesearch" value="bbcfnc.org"/><font size="2">only search </font>
               </div>
            </form>   
            <table cellspacing="2" cellpadding="0" id="linkboxes" width="240">
               <tr>
                  <td align="center" valign="middle"><div id="beforeyouattend"><a href="/10000/3000/914BE/welcome"></a></div></td>
                  <td width="14px" height="28"><div id="enter"><a href="/10000/3000/914BE/welcome5"></a></div></td>
               </tr>
               <tr>
                  <td align="center" valign="middle"><div id="weeklybulletin"><a href="/images/10000/3000/914BE/user/ThisWeeksBulletin.pdf"></a></div></td>
                  <td width="14px" height="28"><div id="enter"><a href="/10000/3000/914BE/ministry10"></a></div></td>
               </tr>
               <tr>
                  <td align="center" valign="middle"><div id="volunteeropportunities"><a href="/10000/3000/914BE/floating4"></a></div></td>
                  <td width="14px" height="28"><div id="enter"><a href="/10000/3000/914BE/floating4"></a></div></td>
               </tr>
               <tr>
                  <td align="center" valign="middle"><div id="pastorsblog"><a href="http://pastorseansblog.blogspot.com/"></a></div></td>
                  <td width="14px" height="28"><div id="enter"><a href="http://pastorseansblog.blogspot.com"></a></div></td>
               </tr>
               <tr>
                  <td align="center" valign="middle"><div id="employmentopportunities"><a href="/10000/3000/914BE/floating6"></a></div></td>
                  <td width="14px" height="28"><div id="enter"><a href="/10000/3000/914BE/floating6"></a></div></td>
               </tr>
            </table>                  
         </div>
      </div>
      
      <div id="firstleft">
         <div>
            <a id="links" class="pointer" href="#links"><img width="500" height="200" id="photo" src="/images/10000/3000/914BE/user/homepagegallery01.gif" /></a>
            <ul id="tablist">
               <li><a class="buttons" id="previousbutton" onclick="prev()" onmouseover="number=1; changecontent();" onmouseout="number=2; changecontent();">PREVIOUS</a></li>
               <li><a class="buttons" id="pausebutton" onclick="pause()" onmouseover="number=3; changecontent();" onmouseout="number=4; changecontent();">PAUSE</a></li>
               <li><a class="buttons" id="nextbutton" onclick="next()" onmouseover="number=5; changecontent();" onmouseout="number=6; changecontent();">NEXT</a></li>
               <li><a class="buttons" id="servicetimes" onmouseover="number=7; changecontent()" onmouseout="number=8; changecontent()" href="/10000/3000/914BE/floating5"> SUNDAY WORSHIP SERVICES: 8:30am, 10:45am, 6:00pm</a></li>
            </ul>               
         </div>      
      </div>
         <img align="middle" height="3px" width="185px" src="/images/10000/3000/914BE/user/blank.png"/>

         
         <a href="http://www.e-giving.org/start.asp?id=1556"><img src="/images/10000/3000/914BE/user/egiving.gif" alt="E-giving" align="middle" width="185" height="185" hspace="0" vspace="0" ></a>
         <a href="/10000/3000/914BE/staff1"><img id="welcome" align="middle" onmouseover="number=9; changecontent()" onmouseout="number=10; changecontent()" height="187px" width="370px" src="/images/10000/3000/914BE/user/Welcome-To-Berean.gif"/></a>
         <a href="http://www.bbcfnc.org/media/media/recent.php"><img id="sermonconnect" onmouseover="number=11; changecontent()" onmouseout="number=12; changecontent()" src="/images/10000/3000/914BE/user/sermonsonline.gif" alt="Connect" title="Connect" align="middle" width="185" height="185" hspace="0" vspace="0" ></a>

         <img align="middle" height="5px" width="740px" src="/images/10000/3000/914BE/user/blank.png"/>

         <a href="/10000/3000/914BE/history"><img src="/images/10000/3000/914BE/user/UPWARD-box.gif" alt="Upwards" align="middle" width="185" height="185" hspace="0" vspace="0" /></a>
         <a href="/10000/3000/914BE/ministry5"><img src="/images/10000/3000/914BE/user/Berean-Baptist-Academy.gif" alt="Berean Baptist Academy" align="middle" width="185" height="185" hspace="0" vspace="0" /></a>
         <a href="/10000/3000/914BE/ShowCalendarMonth"><img src="/images/10000/3000/914BE/user/calendar.gif" alt="Calendar" align="middle" width="185" height="185" hspace="0" vspace="0"/></a>
         <a href="/10000/3000/914BE/ministry6"><img src="/images/10000/3000/914BE/user/AWANA-box.gif" alt="Awana" align="middle" width="185" height="185" hspace="0" vspace="0" /></a>

         <img align="middle" height="5px" width="740px" src="/images/10000/3000/914BE/user/blank.png"/>

         <div align="center"><img src="/images/10000/3000/914BE/user/BereanCampusPanorama.JPG" width="753" height="172"></div>
      </div>
   </body>

</html>


I need a solution that doesn't cause the page to display wrong in Firefox, and I'd prefer not to have to use a browser-detection script to document.write different HTML in. I know that would work and I could do that, but I think it would work just as well to stick to the table-based layout that's up on our site now rather than bothering with extra scripts.
UC Pseudonym wrote:For a while I wasn't sure how to answer this, and then I thought "What would Batman do?" Excuse me while I find a warehouse with a skylight...
[SIZE="7"][color="MediumTurquoise"]Cobalt Figure 8[/color][/SIZE]
DeviantArt || Myspace || Facebook || Greasemonkey Scripts || Stylish Userstyles
User avatar
SnoringFrog
 
Posts: 1159
Joined: Tue Jul 26, 2005 9:25 pm
Location: Liberty University, VA

Postby Cap'n Nick » Tue Aug 12, 2008 3:13 pm

I found a few open DIV tags--closing them might make your page perform more consistently. Also, the image seems to behave correctly when a left float is applied to the DIV containing it. The Fox isn't affected and IE shapes up. If anyone has a fix that doesn't involve a float, though, that would probably be better.
User avatar
Cap'n Nick
 
Posts: 1008
Joined: Sat Nov 13, 2004 10:00 am
Location: Kojima, Japan

Postby SnoringFrog » Wed Aug 13, 2008 2:49 pm

I was able to figure it out. Forgot I'd posted this topic here or I would have posted my solution here too.

I ended up using a conditional CSS statement for IE to get it fixed.
UC Pseudonym wrote:For a while I wasn't sure how to answer this, and then I thought "What would Batman do?" Excuse me while I find a warehouse with a skylight...
[SIZE="7"][color="MediumTurquoise"]Cobalt Figure 8[/color][/SIZE]
DeviantArt || Myspace || Facebook || Greasemonkey Scripts || Stylish Userstyles
User avatar
SnoringFrog
 
Posts: 1159
Joined: Tue Jul 26, 2005 9:25 pm
Location: Liberty University, VA


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 235 guests