Skip to content
 

Changing CSS Styles Via JavaScript, Based On The User’s Web Browser

Recently asked in Yahoo! Answers:

Can I Use JavaScript To Figure Browser Window Height Inside A Conditional Statement?

My CSS tends to break on IE when the browser window get too small to contain all my content (the top of the content disappears).

I already have a conditional statement to add an IE stylesheet if that browser is present. I wanted to add the Javascript statement inside the conditional that will determine whether the window height is less than 750 pixels high. If that is the case, two CSS properties are added.

It hasn’t worked. Am I close, far off…just missing something?

Here is the conditional:

Comments (1)

  1. Scott Walker says:

    OK, so I have to fess up that this was my question. This was above and beyond the call for detail on this answer.

    I will implement this over the next few days, and report the findings!

Leave a Reply

Spam Protection by WP-SpamFree