html - If an element has ancestors with heights < 100%, is there a way to still make it the height of the browser window without using JS? -


maybe there's way figure out browser height , use variable in sass? or perhaps sort of absolute positioning takes account window itself?

yes.

you can use position: fixed; starters, fix element relative window , height: 100% make take full height of window. option take element out of scroll.

a second way setting position: relative; on <html> or <body> tag, making sure elements down dom tree target element defaulted position: static;. finally, setting position: absolute; or position: relative; on target element make refer next element tree not set static.

more on position here at mdn , css tricks.

i final way use vh units. unit 1% of current viewport height value of 100 make element 100% height of screen. support not perfect, provide fallback.

finally, sass pre-compiled language never gets far browser. generated css used browser , used add power our css programming.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -