.

How do you make html/css work for different browsers?

<<

famfu786

Newbie
Newbie

Posts: 3

Joined: Tue Apr 27, 2010 3:37 am

Post Thu Jul 29, 2010 12:12 am

How do you make html/css work for different browsers?

My website looks good in internet explorer but it looks funny in firefox and chrome. What are the differences in the coding/css for all three? How do I fix this problem?
<<

secureseve

User avatar

Jr. Member
Jr. Member

Posts: 79

Joined: Thu Apr 08, 2010 10:40 pm

Location: DMZ

Post Thu Jul 29, 2010 9:41 am

Re: How do you make html/css work for different browsers?

Ah, web development. A love, and a curse. Cross-browser compat. has always been an issue with browsers interpreting css differently. The best thing to do is to stick with the w3 standards and even then it's still going to be weird. So you might have to write CSS for different browsers. Another thing is to use a CSS framework. I haven't used them because I stopped doing web dev in general, but these look promising: http://www.blueprintcss.org/
http://960.gs/

good luck.
http://twitter.com/mikesantillana
eLearnSecurity Team Member.
<<

KrisTeason

User avatar

Hero Member
Hero Member

Posts: 515

Joined: Sat Sep 08, 2007 7:48 pm

Location: /dev/null

Post Thu Jul 29, 2010 12:09 pm

Re: How do you make html/css work for different browsers?

One way we learned in one of my web dev class is to use javascript to detect the specific browser as well as version and then use a selection structure (if / elseif / else) to check whether it's Internet Explorer Version x, Firefox, then set up the page like so, etc. We'd utilize the navigator class to make use of detecting the browser name and version - check it out http://krook.org/jsdom/navigator.html

I'll back secureseven in saying stick to w3 standards. It's good they give a ton of examples and show what browsers they're compatible with - you could take this into consideration when developing.
eCPPT (Silver/Gold), eWPT, GSEC, GISP, GCIH, OSCP, OSWP
<<

dynamik

Recruiters
Recruiters

Posts: 1119

Joined: Sun Nov 09, 2008 11:00 am

Location: Mile High City

Post Sun Aug 01, 2010 12:19 am

Re: How do you make html/css work for different browsers?

The advice that I've always been given (and use with decent success) is to design for Firefox and then adjust to IE. You can make additional CSS entries for IE using syntax that is illegal and ignored by FF to make any adjustments necessary. I started out doing web design and quickly abandoned it because I couldn't tolerate this garbage. I can't believe it's still so much of a problem a decade later :(
The day you stop learning is the day you start becoming obsolete.

Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

.
Powered by phpBB® Forum Software © phpBB Group.
Designed by ST Software