Jump to content

Detect browser then change site accordingly


DrFishNips

Recommended Posts

My site always changes slightly depending on what browser I'm looking at it with. Some browsers the layout is slightly off and if I change the layout to fit that browser then the layout is off on the other browsers. I was thinking of adding layout variables all over the site which change depending on what browser is detected. I could even do it with screen resolution. Is this the best way to ensure your site can be viewed properly by all browsers and screen resolutions?

Yep heres an example

http://toxicopoeia.com/plantsofthegods/

On Firefox and Opera that message textarea fits inside the green box. On Galeon its a little too big. If I adjust it so it fits in the green box on Galeon then its too small on Firefox and Opera. If your on Windows I dunno if you can get Galeon. I haven't tried IE yet I'll test it out now.

 

As for screen resolutions 800x600 and lower the page doesn't fit on the screen. Thats not much of a problem though.

yeah, browsers will use different fonts, and COLS/ROWS will be translated accordingly...for this case, I would just add a width:100% on the textarea and it will fill to the parent:

<textarea name="shoutbox_msg" type="text" cols="15" rows="3" style="width: 100%;"/>

yeah, browsers will use different fonts, and COLS/ROWS will be translated accordingly...for this case, I would just add a width:100% on the textarea and it will fill to the parent:

<textarea name="shoutbox_msg" type="text" cols="15" rows="3" style="width: 100%;"/>

 

Nice one. Thanks a lot I didn't even know you could use % on text areas. Good old CSS. Can you do that with all form elements?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.