Answer the question
In order to leave comments, you need to log in
How to stretch a div horizontally if it is preceded by an image with 100% height?
There is a div that is preceded by a tricky padding on the left - the padding width should depend on the height of the window, I did this by embedding an image with the right proportions.
How can I force a div to take up all the remaining space on the right horizontally?
Without js and to make the solution suitable for IE9 and Android Browser...
<--------------------- 100% WINDOW WIDTH ---------------->
,--------------------------------------------------------, ^
|| || | | |
|| IMG 1x10 px || CONTENT DIV | FREE SPACE | |
|| display: table-cell || | | | 100% WINDOW HEIGHT
|| height 100 % || height 100 % | | |
|| || | | |
'--------------------------------------------------------' ь
<img src="data:image/gif;base64,R0lGODdhAQAKAIAAAAAAAP///ywAAAAAAQAKAAACA4SPBQA7" style="height: 100%; display: table-cell;"/>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question