A website question.
Hey all! I just got my new website layout all finished here-
http://www.jeremiahrich.com
Anyways, I did it all by hand and then scanned it. My friend helped me code it through ASP (wanted PHP but he doesn't know php). Anyways, for some reason it displays weird on IE for the Mac. Safari looks fine and so does IE on PC. On the Mac, it doesn't have the scollbars, and it is spaced wrong. Unfortunately my friend does not have a Mac so he cannot help me troubleshoot it so I decided to turn here. Thanks a bunch!
http://www.jeremiahrich.com
Anyways, I did it all by hand and then scanned it. My friend helped me code it through ASP (wanted PHP but he doesn't know php). Anyways, for some reason it displays weird on IE for the Mac. Safari looks fine and so does IE on PC. On the Mac, it doesn't have the scollbars, and it is spaced wrong. Unfortunately my friend does not have a Mac so he cannot help me troubleshoot it so I decided to turn here. Thanks a bunch!
Comments
seems that stuff shifts around a lot where it's not supposed to.
if those are to big, i'll resize 'em.
1) you have a body tag above a head tag and another body tag.
2) the placement of your <div> is, to say the least, strange. div is a block level element, and will cause a fuss when used like that, even though it may be in concordance with standards. Have you tried moving the div to inside that td element? I'm guessing (without getting in it too much) that it's this use of DIV mixed with TABLEs (and nested tables!
3) I notice that you use many elements that are no longer part of the html 4.01 standard. That's bad practice. If I were you, I'd go to W3C.org (the standards organisation for this stuff) and validate your html file. You'll have to declare the DTD though, which will be the following for your page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
.
W3C has a validation service that'll tell you all of the issues and errors with your HTML Pretty helpful. And it has the additional advantage that after you pass the test, you can point an accusing finger at whatever browser handles your file wrong.
My personal recommendation: lose the tables, or at least the nested ones. There is a move, among CSS users, to rely entirely on DIV elements these days, along with absolute and relative positioning. Anyway, I just finished this site, and I'm happy to tell you that I have not used a table, except where it actually was used the way it was meant to be. (I have a slight issue with font sizes though, but that's not DIV related). I'd be glad to help you out if you want to clean up the code further.
Originally posted by der Kopf
I'd go to W3C.org (the standards organisation for this stuff) and validate your html file.
I think you mean http://www.w3.org/
I agree on the rest of der Kopf's points too. Lose the tables. Either make a clean break for CSS and DIVs or don't use them at all. And validate that code!!
Originally posted by Brad
I think you mean http://www.w3.org/
I agree on the rest of der Kopf's points too. Lose the tables. Either make a clean break for CSS and DIVs or don't use them at all. And validate that code!!
Well, apparently w3c.org dns'es to w3.org. I didn't know that. I guess maybe it used to be w3c.org back when I was younger, or maybe I just tried the name of the organization as URL. In either case, thanks for the heads up.
Function MenuItem(strTitle, strURL)
\tMenuItem = "<a href='http://www.jeremiahrich.com/" & strURL & "'><img border=0 src='http://www.jeremiahrich.com/images/menu/" & strTitle & ".gif'></a><br>"
End Function
%>
<%= MenuItem("Home", "index.asp") %>
<%= MenuItem("About", "about.asp") %>
<%= MenuItem("News", "news.asp") %>
<%= MenuItem("Media", "media.asp") %>
<%= MenuItem("Music", "music.asp") %>
<%= MenuItem("Photos", "Photos.asp") %>
<%= MenuItem("Misc", "Misc.asp") %>
<%= MenuItem("Contact", "contact.asp") %>
My friend wrote this for me so I guess I need to know how to do the equivelent in PHP. Looked on Google but so far at least have not found out how to do it. This lets me of course make and organize the menu easily. It is called up by an include in the main layout of my page. So, if anyone can help me figure out how to do this in PHP, I would greatly appreciate it. After this is done I will start tackling the formatting errors. Thanks!
-Jeremiah
The code would become (with capitalization adapted to my and PHP's preference, respectively):
<!-- php buffer start --><code><span style="color: #000000">
<br /><span style="color: #0000BB"><?php
<br />
<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">menu_Item </span><span style="color: #007700">(</span><span style="color: #0000BB">string_img</span><span style="color: #007700">, </span><span style="color: #0000BB">string_url</span><span style="color: #007700">) {
<br />
<br /> </span><span style="color: #0000BB">return_value </span><span style="color: #007700">= </span><span style="color: #DD0000">"<a href='http://www.jeremiahrich.com/"</span><span style="color: #007700">.</span><span style="color: #0000BB">string_url</span><span style="color: #007700">.</span><span style="color: #DD0000">"'><img border=0 src='http://www.jeremiahrich.com/images/menu/'"</span><span style="color: #007700">.</span><span style="color: #0000BB">string_img</span><span style="color: #007700">.</span><span style="color: #DD0000">".gif'></a><br>"</span><span style="color: #007700">;
<br /> return </span><span style="color: #0000BB">return_value</span><span style="color: #007700">;
<br />
<br />}
<br />
<br /></span><span style="color: #0000BB">?>
<br /></span>
<br /> <span style="color: #0000BB"><?= menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Home"</span><span style="color: #007700">, </span><span style="color: #DD0000">"index.asp"</span><span style="color: #007700">) </span><span style="color: #0000BB">?>
<br /></span> <span style="color: #0000BB"><?= menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"About"</span><span style="color: #007700">, </span><span style="color: #DD0000">"about.asp"</span><span style="color: #007700">) </span><span style="color: #0000BB">?>
<br /></span> <span style="color: #0000BB"><?= menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"News"</span><span style="color: #007700">, </span><span style="color: #DD0000">"news.asp"</span><span style="color: #007700">) </span><span style="color: #0000BB">?>
<br /></span> <span style="color: #0000BB"><?= menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Media"</span><span style="color: #007700">, </span><span style="color: #DD0000">"media.asp"</span><span style="color: #007700">) </span><span style="color: #0000BB">?>
<br /></span> <span style="color: #0000BB"><?= menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Music"</span><span style="color: #007700">, </span><span style="color: #DD0000">"music.asp"</span><span style="color: #007700">) </span><span style="color: #0000BB">?>
<br /></span> <span style="color: #0000BB"><?= menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Photos"</span><span style="color: #007700">, </span><span style="color: #DD0000">"Photos.asp"</span><span style="color: #007700">) </span><span style="color: #0000BB">?>
<br /></span> <span style="color: #0000BB"><?= menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Misc"</span><span style="color: #007700">, </span><span style="color: #DD0000">"Misc.asp"</span><span style="color: #007700">) </span><span style="color: #0000BB">?>
<br /></span> <span style="color: #0000BB"><?= menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Contact"</span><span style="color: #007700">, </span><span style="color: #DD0000">"contact.asp"</span><span style="color: #007700">) </span><span style="color: #0000BB">?></span>
</span>
One thing though: are you sure you wish to use absolute links? I've always wondered why people would do that. I always use relative links ("./contact.asp" rather than "http://www.jeremiahrich.com/contact.asp"
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"><?php
<br />
<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">menu_Item </span><span style="color: #007700">(</span><span style="color: #0000BB">$img_string</span><span style="color: #007700">, </span><span style="color: #0000BB">$url_string</span><span style="color: #007700">) {
<br />
<br />\</span><span style="color: #0000BB">techo </span><span style="color: #DD0000">"<a href='./"</span><span style="color: #007700">.</span><span style="color: #0000BB">$url_string</span><span style="color: #007700">.</span><span style="color: #DD0000">"'><img border='0' src='./images/menu/"</span><span style="color: #007700">.</span><span style="color: #0000BB">$img_string</span><span style="color: #007700">.</span><span style="color: #DD0000">".gif'></a><br>"</span><span style="color: #007700">;
<br />
<br />}
<br />
<br /></span><span style="color: #0000BB">?>
<br /></span>
<br /><span style="color: #0000BB"><?php
<br />
<br /></span><span style="color: #007700">\</span><span style="color: #0000BB">tmenu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"home"</span><span style="color: #007700">, </span><span style="color: #DD0000">"index.php"</span><span style="color: #007700">);
<br />\</span><span style="color: #0000BB">tmenu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"about"</span><span style="color: #007700">, </span><span style="color: #DD0000">"about.php"</span><span style="color: #007700">);
<br />\</span><span style="color: #0000BB">tmenu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"news"</span><span style="color: #007700">, </span><span style="color: #DD0000">"news.php"</span><span style="color: #007700">);
<br />\</span><span style="color: #0000BB">tmenu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"media"</span><span style="color: #007700">, </span><span style="color: #DD0000">"media.php"</span><span style="color: #007700">);
<br />\</span><span style="color: #0000BB">tmenu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"music"</span><span style="color: #007700">, </span><span style="color: #DD0000">"music.php"</span><span style="color: #007700">);
<br />\</span><span style="color: #0000BB">tmenu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"photos"</span><span style="color: #007700">, </span><span style="color: #DD0000">"photos.php"</span><span style="color: #007700">);
<br />\</span><span style="color: #0000BB">tmenu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"misc"</span><span style="color: #007700">, </span><span style="color: #DD0000">"misc.php"</span><span style="color: #007700">);
<br />\</span><span style="color: #0000BB">tmenu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"contact"</span><span style="color: #007700">, </span><span style="color: #DD0000">"contact.php"</span><span style="color: #007700">);
<br />
<br /></span><span style="color: #0000BB">?></span>
</span>
EDIT: A misplaced apostrophe messed things up in the image department. Also, I've taken the liberty to move towards relative links. AND, I've taken the liberty to move to all lower caps. Personally (again), I keep filenames always lower case. Some server is case sensitive, and will boggle your mind a bit more after you've fixed all the bugs. So I'm thinking it's good practice to keep everything just lower case.
-Jeremiah