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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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%;"/>

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.