I want a div with a fixed image size on the left and a variable width div with a background color, which should increase its width by 100% on my device. I can not stop the second div from overflowing my fixed div.
When I add overflow: hidden in the width div variable, it just bounces under the photo in the next line.
How can I fix this correctly (i.e. without hacks or markers on the left, since I will need to respond to the site later using media queries, and I need to change the image with different resolution images for each device)?
- novice web designer trying to solve the horror of responsive websites -
HTML:
<div class="header"></div> <div class="header-right"></div>
CSS
.header{ float:left; background-image: url('img/header.png'); background-repeat: no-repeat; width: 240px; height: 100px; } .header-right{ float:left; overflow:hidden; background-color:#000; width: 100%; height: 100px; }
css css-float overflow fixed-width variable-width
Anamaria Miehs 04 Oct 2018-12-12T00: 00Z
source share