My website bagonize.com looks great on all browsers (including internet explorer) yet does not work well at all on safari. Can anyone please tell me what is wrong? I'm assuming its just a line of code I'm missing. Thanks in advance!
When code appears differently on different browsers bad coding is suspect not a line of code. http://validator.w3.org shows 54 errors and 18 warnings. example </br> is not correct. the /> is not used with html5. You a number of <div> tags with no closing tags(A big error). Correct your code and see if things work a little better.
Maybe someone will come along and correct everything for you, but I won't look at the problem until the errors are fixed. My editor says there are 63 of them.
I know a tag ending in /> will not cause your problems but how hard is it to do a replace /> with a >?
How hard is it to add the end tag for <h4> and <a>? and can't we replace </br> with the correct tag?
felgall I spent this morning looking up and reading the "are closing tags legal in html5" articles on the web. My mind reals. I didn't come away with the "/> is perfectly valid in XHTML5. " as you did but with a "they're OK, will cause no harm" feeling. They do cause my editor to barf and are easy to remove as I stated so I do. Guess if other don't want to it's OK.
But missing end tags will cause a problem and the last </div> on the page has no start tag. Even though I did say I wasn't gonna look at the code until it was cleaned up I did look at it and went ahead and did clean it back when this was first posted. Cleaning the code fixed the problems in all browsers except for OPERA and it's only problem that I saw was a larger than normal gap between the top and the middle section of the page.
I'm with sunfighter, you should clean up your code to both help and now and to prevent more issues in the future. Also, all browsers do different things (*cough* IE *cough*), so you should consider making separate bits of code for each browser. That would solve the problem of cross-browser compatibility. If this is too much of a time investment for you, just consider the fact that each browser (FF, IE, GC, O, etc.) has very specific different rules for how things are displayed. To prevent a multitude of errors, you should have everything validate and be cross-browser compatible.
Hope this helps.
PS. I would suggest separate code for mobile operating systems as well.
Last edited by L0adOpt1c; 01-09-2013 at 03:33 PM..
Reason: Added the PS
thank you sunfighter for taking the time to clean the code and see what it would look like. I will take out all the /> and replace with > in order to get errors down to as little as possible.
for a validator i use http://validator.w3.org, in order to see my errors. Is this the best way to go about it or is there another way?
In response to the cross browser capability, do any of you have any really good websites or tips to go about learning how to see what kind of browser (or mobile) it is and then call the appropriate script? I'm assuming its a simple script/line. But my assumptions were wrong previously so idk
felgall I spent this morning looking up and reading the "are closing tags legal in html5" articles on the web.
You misread what I wrote - I said that they are valid (in fact they are required) in XHTML5 - I agree that they are invalid in HTML 5 just as they are invalid in HTML4. A lot of people use them in HTML 4/5 because they intend to switch over to XHTML once everyone uses browsers that support it (just waiting for IE8 to die and then XHTML will be useable). The XHTML5 spec is being developed in parallel to HTML 5 so that they will be as close to the same as possible with the closing slashes being one of the few necessary differences.
Both HTML 5 and XHTML 5 use the same doctype since the doctype has never told the browser whether the page is using HTML or XHTML separate ones are unnecessary - browsers have always used the MIME type to determine whether the page is HTML or XHTML.