A website question.

Posted:
in Genius Bar edited January 2014
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!

Comments

  • Reply 1 of 10
    alcimedesalcimedes Posts: 5,486member
    i'll post images. Camino had issues as well.



    seems that stuff shifts around a lot where it's not supposed to.















    if those are to big, i'll resize 'em.
  • Reply 2 of 10
    der kopfder kopf Posts: 2,275member
    I'm having a quick glance at your source code. Two things that immedialely strike me:



    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! ) that eludes some browsers.

    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:



    Code:


    <!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.
  • Reply 3 of 10
    Quote:

    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!!
  • Reply 4 of 10
    der kopfder kopf Posts: 2,275member
    Quote:

    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.
  • Reply 5 of 10
    Thanks for all of the resopnses! I really do not have time at the moment to read through some of this, but I will tonight when I come home from work. So thanks a bunch!
  • Reply 6 of 10
    Hey. I am working on transitioning my website right now from ASP to PHP. (So everything uses the same thing, and I prefer php) Anyways, got everything done except for my menu page. The asp script is as follows-



    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
  • Reply 7 of 10
    der kopfder kopf Posts: 2,275member
    Actually, if I read that code right, that's really not hard at all in PHP. It breaks down in one generic, homebrew string function ('MenuItem'), and 8 calls to that function. About the only thing you'd need to change is the string concatenator: '&' becomes '.', and maybe the brackets ( <% becomes <? ). Of course, there is a way to use those ASP style brackets for PHP, but I'm too lazy to look it up.



    The code would become (with capitalization adapted to my and PHP's preference, respectively):




    PHP Code:



    <!-- php buffer start --><code><span style="color: #000000">

    <br /><span style="color: #0000BB">&lt;?php
    <br />
    <br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">menu_Item&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">string_img</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">string_url</span><span style="color: #007700">)&nbsp;{
    <br />
    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">return_value&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;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">"'&gt;&lt;img&nbsp;border=0&nbsp;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'&gt;&lt;/a&gt;&lt;br&gt;"</span><span style="color: #007700">;
    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">return_value</span><span style="color: #007700">;
    <br />
    <br />}
    <br />
    <br /></span><span style="color: #0000BB">?&gt;
    <br /></span>&nbsp;
    <br />&nbsp;<span style="color: #0000BB">&lt;?=&nbsp;menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Home"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"index.asp"</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">?&gt;
    <br /></span>&nbsp;<span style="color: #0000BB">&lt;?=&nbsp;menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"About"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"about.asp"</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">?&gt;
    <br /></span>&nbsp;<span style="color: #0000BB">&lt;?=&nbsp;menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"News"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"news.asp"</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">?&gt;
    <br /></span>&nbsp;<span style="color: #0000BB">&lt;?=&nbsp;menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Media"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"media.asp"</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">?&gt;
    <br /></span>&nbsp;<span style="color: #0000BB">&lt;?=&nbsp;menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Music"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"music.asp"</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">?&gt;
    <br /></span>&nbsp;<span style="color: #0000BB">&lt;?=&nbsp;menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Photos"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Photos.asp"</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">?&gt;
    <br /></span>&nbsp;<span style="color: #0000BB">&lt;?=&nbsp;menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Misc"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Misc.asp"</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">?&gt;
    <br /></span>&nbsp;<span style="color: #0000BB">&lt;?=&nbsp;menu_Item</span><span style="color: #007700">(</span><span style="color: #DD0000">"Contact"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"contact.asp"</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">?&gt;</span>
    </span>



    Now, if I didn't forget a dot or a capital, that should do the very same thing, but in PHP.

    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";). That way I can quietly code and test the code on my own comp (using OS X's included Apache server with PHP module on my ibook) and then just move it over without worrying twice about it. Even if you'd think that something is too far away to get at it relatively, you can mostly do it (if it's downstream from the same 'root directory'). I have links of the form: "../../../shared/imgs/kopf.jpg" or something to that effect.
  • Reply 8 of 10
    der kopfder kopf Posts: 2,275member
    Of course the above code can't work! It's so often like that when coding: you just stare at faulty code without seeing the most obvious (often just the lack of a paranthesis). Here, I forgot (I FORGOT!) to add the dollar sign before variable names, the way PHP likes it. And I noticed that menu_item by itself wouldn't be enough. There had to be someone echoing. So, the revised code:




    PHP Code:



    <!-- php buffer start --><code><span style="color: #000000">
    <span style="color: #0000BB">&lt;?php
    <br />
    <br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">menu_Item&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$img_string</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$url_string</span><span style="color: #007700">)&nbsp;{
    <br />
    <br />\</span><span style="color: #0000BB">techo&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href='./"</span><span style="color: #007700">.</span><span style="color: #0000BB">$url_string</span><span style="color: #007700">.</span><span style="color: #DD0000">"'&gt;&lt;img&nbsp;border='0'&nbsp;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'&gt;&lt;/a&gt;&lt;br&gt;"</span><span style="color: #007700">;
    <br />
    <br />}
    <br />
    <br /></span><span style="color: #0000BB">?&gt;
    <br /></span>
    <br /><span style="color: #0000BB">&lt;?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">,&nbsp;</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">,&nbsp;</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">,&nbsp;</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">,&nbsp;</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">,&nbsp;</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">,&nbsp;</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">,&nbsp;</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">,&nbsp;</span><span style="color: #DD0000">"contact.php"</span><span style="color: #007700">);
    <br />
    <br /></span><span style="color: #0000BB">?&gt;</span>
    </span>



    I'll correct the code on the ftp site, Jeremiah, don't worry, I just wanted to post this here, for the record, as it were.



    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.
  • Reply 9 of 10
    Thanks so much man. I really appreciate it. And it now works! Heh. Did you clean up the code as well or just do the menu thing? Once again, thanks a bunch!

    -Jeremiah
Sign In or Register to comment.