Solved

browser height and keeping the scrollbar for this.

Posted on 2013-11-12
4
419 Views
Last Modified: 2013-11-14
Hi there;

<div id="myDiv" style="height: 100vh; zoom: 1; overflow: auto; " runat="server">

Open in new window


I have a div as above and I want to set the height of that div with the size of user agent, IE or chrome.

But, when it's resized, I want to see the scrollbar in which overflow:auto should do the trick. But not working when I set it with vh..

Is there a way to grab and set the browser height to my div gently?

Regards.
0
Comment
Question by:jazzIIIlove
  • 2
  • 2
4 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39641942
I'm not sure I understand the question 100vh should be setting the div to 100% of the height of the viewport, and the overflow auto could generate scroll bars either vertically of horizontally if the content of the dive is larger than the viewport.

Without a link to the page it is impossible to know everything that might be affecting the rendering.  BTW vh is not support in older browsers.

Cd&
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 39643807
I may have to use this in ie8 and 9. Supported?
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 39645899
Partially support in IE9 and IE10, fully support in IE11.  Not support in IE prior to IE9

My experience with it in IE9 and IE10 is that it gets it right most of the time put gets it wrong when there is a calculation involved.

Cd&
0
 
LVL 12

Author Closing Comment

by:jazzIIIlove
ID: 39647974
Thanks. I have to ask another question, it seems.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Angular- another way of coding hide and display 3 36
Autoprefixer and text editors 1 23
Error in script 11 43
bootstrap footer centering and expand problems 7 17
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now