View Full Version : OK, So Internet Explorer Now Hates EVERY Tables Layout I Make.
CuriousLittleBird 02-08-2007, 07:17 PM Exhibit #1: my site (http://www.withinmyworld.org/aboutface/). Mozilla Firefox and Opera love it to pieces. MWAH. Couldn't get a better display with it.
Internet Explorer? I get a HUGE space between my top image and my main content/navbar, which makes my content go up and down depending on how long the content is. :confused:
I have fiddled with it for two weeks, changing subtle little things, and I am so sick of it now that I have half a mind to stop messing with it altogether and tell people what browser to use. IE makes me want to smash things. :mad:
Right-clicking and selecting "View Source" will show you all the code (both HTML and CSS), since it was coded with PHP includes. Any help on this would be appreciated. (And I'm not considering divs in table-formation for this layout at this time, since I can't get that layout to work in ANY browser.)
LeSabre 02-08-2007, 11:57 PM I am looking thru it now.... I'll let you know if I come up w/anything.
:)
LeSabre 02-09-2007, 04:09 AM Well I have found a work around for you :D - but not necessarily a fix. :grouch: For some odd reason the first row wanted to stretch out past the 100px height limit you specified, I have no idea why, but it wanted to. So I got to thinking that if we shortened up that first row a bit, to um.. let's say 100px tall (the size of one of your color faces AND also the size of the banner) then we could get row 2 to stretch as long as we needed.....
So, I tidy'ed up your table tags w/some CSS - I hope you don't mind, you can just apply the styles back as you like, but thought you might like to see some different ways of doing it. ;) THEN, lol, I put one of your colored faces and the banner in the top row and put the rest in the second row.... I also styled the bottom div w/some CSS too. It worked perfectly afterwards!!
OK, so I have included everything in the original source so you can just copy n' paste and plug it in and render it to check if it works for you. Make a backup of your original, just in case. ;) I also included some comments for you, so you know what I did, lol :hehe: OK, here it goes, I hope I didn't leave anything out :confusion
<!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>RAbout|Face - my alternative Facebook</title>
<style type="text/css">
body {color:#FFFFFF; background-color:#000000; font-size:12px; font-family: tahoma, sans-serif;}
a:link {color:#FC2B2B; text-decoration:none;}
a:visited {color:#3EFA45; text-decoration:none;}
a:active {color:#FCF937; text-decoration:none;}
a:hover {color:#FBA72B; text-decoration:none;}
/* YOUR CSS NOT USED/NEEDED
.sub {color:#7D3BFC; font-weight:bold;}
#side {width:100px; height:auto; padding:0px;}
#img {width:500px; height:100px; padding:0px;}
*/
.heading {color:#FFFFFF; background-image:url('bg.jpg'); background-repeat:repeat-x; line-height:14px; font-size:14px; border:1px solid #4040FA; font-weight:bold;}
#main {font-size:12px; border:1px solid #6C6C6C; width:390px; padding:5px; height:auto;}
#nav {font-size:13px; width:110px; padding:5px; height:auto;}
/*My Added Table CSS Codes For You :)*/
/* Controls borders, padding and vertically aligns ALL tables, rows, cells and images */
table, tr, td, img {border:0px; padding:0px; vertical-align:top;}
/* Specifies your main table properties */
table#contain {width:600px; text-align:center;}
/* Used to align text to the left since everything else is centered */
.leftalign {text-align:left;}
/* Bottom div styles and position */
div.alertdiv {position:absolute; left:721px; top:227px; width:16px; height:16px; visibility:hidden;}
/* Bottom div img style and position*/
img.newicon {position:absolute; left:0px; top:0px;}
</style>
</head> <body>
<table id="contain" align="center" cellspacing="0">
<tr>
<td>
<img src="red.jpg">
</td>
<td colspan="2"><img src="top.jpg"></td>
</tr>
<tr>
<td>
<img src="orange.jpg"><br />
<img src="yellow.jpg"><br />
<img src="green.jpg"><br />
<img src="blue.jpg"><br />
<img src="indigo.jpg"><br />
<img src="violet.jpg"><br />
</td>
<td id="main"><p class="heading">Welcome</p>
<p class="leftalign">This is my alternative Facebook, made mostly because my "About Me" section didn't have enough room for all the stuff I wanted to put on there. Also, I wanted to have a really small, lighthearted site about me, so I just got bored enough one day to make this. YAY!</p>
</td>
<td id="nav">
<p class="heading">Navigation</p>
<p>
<a href="http://www.withinmyworld.org/aboutface/blurbs.php">Personal Blurbs</a><br>
<a href="http://www.withinmyworld.org/aboutface/readinglist.php">Reading List</a><br>
<a href="http://www.withinmyworld.org/aboutface/latestmix.php">Latest iTunes Mix</a><br>
<a href="http://www.withinmyworld.org/aboutface/robinish.php">Robinish</a><br>
<a href="http://www.withinmyworld.org/aboutface/sydney.php">Sydney</a><br>
<a href="http://www.withinmyworld.org/aboutface/">Home</a><br>
<a href="http://uncg.facebook.com/profile.php?id=25009261" target="_blank">Back to Facebook</a><br>
</p>
</td>
</tr>
</table>
<div class="alertdiv" id="linkalert-box"><img class="newicon" id="linkalert-icon" src="new-icon.png" ></div>
</body></html>
CuriousLittleBird 02-09-2007, 10:10 PM Thank you for the fixes! :) I really appreciate you working through all that code and getting it to work like that. W00tsauce!
I just have a few questions about the code itself:
1. Does this have to be in XHTML for it to work? I ask because I know nothing of how to code the language, and when I saw that it was in XHTML, it made me nervous. :blush:
2. What is this bottom div for?
<div class="alertdiv" id="linkalert-box"><img class="newicon" id="linkalert-icon" src="new-icon.png" ></div>
3. I actually did want the border for the middle (content) table cell, so how would I specify that without wrecking all the rest of the awesome coding?
Thank you so much for helping with this! *dances* I've learned a lot about CSS's specifications just by looking at your code. :D
LeSabre 02-10-2007, 03:08 AM Thank you for the fixes! :) I really appreciate you working through all that code and getting it to work like that. W00tsauce! Thank you so much for helping with this! *dances* I've learned a lot about CSS's specifications just by looking at your code. :D
I am so very glad it helped you do what you needed :cheer2: and gave you some insight to how CSS can work for you!
OK, now for your Q's :)
**
1. Does this have to be in XHTML for it to work? I ask because I know nothing of how to code the language, and when I saw that it was in XHTML, it made me nervous. :blush:
No, it doesn't BUT... it is the *new* HTML or the replacement for it. I have it set up that way in Dreamweaver so that anytime I make a new document it is automatically added in there. It (XHTML) is also highly recommended to use. You really don't need to know much outside of HTML to use it; it's a cleaner code style. i.e. closing all your tags in the correct order. I found some great pages explaining these things. Here are some quotes with the links if you're interested in some reading material.
From Wikipedia (http://en.wikipedia.org/wiki/XHTML) - "The Extensible HyperText Markup Language, or XHTML, is a markup language that has the same depth of expression as HTML, but a stricter syntax. XHTML can be thought of as the intersection of HTML and XML in many respects, since it is a reformulation of HTML in XML. XHTML 1.0 became a World Wide Web Consortium (W3C) Recommendation on January 26, 2000. XHTML 1.1 became a W3C recommendation May 31, 2001. XHTML is the successor to HTML. As such, many consider XHTML to be the current or latest version of HTML. However, XHTML is a separate recommendation; the W3C continues to recommend the use of XHTML 1.1, XHTML 1.0, and HTML 4.01 for web publishing."
From W3Schools (http://www.w3schools.com/xhtml/xhtml_intro.asp) - "XHTML is aimed to replace HTML
XHTML is almost identical to HTML 4.01
XHTML is a stricter and cleaner version of HTML
XHTML is HTML defined as an XML application
XHTML is a W3C Recommendation"
From W3 Org (http://www.w3.org/MarkUp/) - "XHTML 1.0 Transitional - Many people writing Web pages for the general public to access might want to use this flavor of XHTML 1.0. The idea is to take advantage of XHTML features including style sheets but nonetheless to make small adjustments to your markup for the benefit of those viewing your pages with older browsers which can't understand style sheets. These include using the body element with bgcolor, text and link attributes."
Random site w/HTML vs XHTML differences (http://www.codeproject.com/html/htmltoxhtml.asp) - "All tags in lowercase. Since XHTML is a valid XML specification it is case sensitive. This means that <STRONG> is not the same thing as <strong>. Remeber to use a DOCTYPE, put in your xmlns, use lowercase for attributes and tags, always use valid structure, put attribute values in quotes and always close empty tags."
HTML and XHTML Frequently Answered Questions (http://www.w3.org/MarkUp/2004/xhtml-faq)
**
2. What is this bottom div for?
<div class="alertdiv" id="linkalert-box"><img class="newicon" id="linkalert-icon" src="new-icon.png" ></div>
That bottom div was there as some link alert thing, I really don't know if you don't, lol ;)
This is the way you had it set up in your source after the end table tag::
<div style="position:absolute; left:721px; top:227px; width:16px; height:16px; visibility:hidden;" id="linkalert-box"><img style="position:absolute; left:0px; top:0px;" src="new-icon.png" id="linkalert-icon"></div>
And this is how I transformed it w/CSS:
<style type="text/css">
div.alertdiv {position:absolute; left:721px; top:227px; width:16px; height:16px; visibility:hidden;}
img.newicon {position:absolute; left:0px; top:0px;}
</style>
<div class="alertdiv" id="linkalert-box"><img class="newicon" id="linkalert-icon" src="new-icon.png" ></div>
I gave the div and the img class names so that CSS can be applied to it, just basically moving the styles that WERE created into the stylesheet.
**
3. I actually did want the border for the middle (content) table cell, so how would I specify that without wrecking all the rest of the awesome coding?
As far as I can tell, that border will still be there, it is when I render the code I redid for you, a screenshot of my code in IE7 (http://i4.tinypic.com/2i1mdkg.jpg). But if you want to add a border to a cell or row just create a class name and apply a style, like:
.border2 {border:2px solid black;}
and then give the row or cell a class in the HTML, like
<td class="border2">Stuff</td>
I seem to have written a book, lol, I hope this helps you... if anything is confusing, just ask!
CuriousLittleBird 02-10-2007, 04:02 AM Thankies muchly for the help :D I feel all smart (or at least better web-educated) now. ^_^
XHTML sounds cool, actually--I had thought it was almost a completely different language, but it sounds like I should be able to make the switch pretty easily. LOL I feel like such a newb (or n00bzilla XD) about using it, but hey, if I learned HTML, I suppose I can try my hand at learning its stricter and cleaner cousin. XD
...That bottom div thingy worries me though, because it doesn't show up when I view source on my pages, even now...and I certainly didn't put it there to begin with. Makes me wonder if someone's trying to use my site for their own purposes. :scared:
LeSabre 02-10-2007, 04:35 AM OMG, I am soooo sorry.... but that link alert thing is my fault!! :eek: I realized it AFTER I posted that big long book, lol. Apparently when I saved your source there was a bit of info from one of my Firefox extensions that I have =/.
I never realized that before, but when I help someone I just save the questioned site page in Firefox as a complete web page and, I guess, it saves that bit of extension info too..... :mad:
My apologies again :blush: Just delete that part of the css and the div under the table.. No worries ;)
Oh, and good, I'm glad you liked that info :)
CuriousLittleBird 02-10-2007, 01:21 PM No problem! ^_^ I'm glad it was something as innocuous as that. :D Whew!
|