css-float

Fixed width div on left, fill remaining width div on right

a 夏天 提交于 2020-01-22 05:10:51
问题 I want a div with a fixed width image on the left and a variable width div with a background color, which should extend its width 100% on my device. I can't stop the second div from overflowing my fixed div. When I add overflow:hidden at the variable width div it just jumps under the photo, on the next row. How can I fix this the right way (i.e. without hacks or margin-left, since I need to make the site responsive later with media queries and I have to change the image with other resolution

container div not applyin background-color to the two floating divs inside it

限于喜欢 提交于 2020-01-16 05:26:12
问题 I'm trying to apply background-color to a div that has two floating divs inside it, but it is not applying it. both divs inside the container are cleared and displaying beside each other like i want tehm to be, but the overall background-color is not applying jsfiddle here <div class="contactformcontainer"> <div class="maincontactform"> <h4>SEND US A MAIL</h4> <form> <input type="text" placeholder="What is your name ?"> <input type="text" placeholder="Email"> <textarea type="text" placeholder

toggle not working for resize

馋奶兔 提交于 2020-01-16 03:27:19
问题 when i resize the browser the nav having home profile etc should disappear and MENU would pop up. on clicking it CLOSE MENU would come with the nav below but the background of close menu expanda height wise instead of being as it is..also after the toggle the menu goes behind the content and hover doesnt work my html is as follows <nav class="nav"> <input type="checkbox" id="toggle" /> <label for="toggle" class="toggle" data-open="MENU" data-close="Close Menu" onclick></label> <ul class="menu

Set floating div to height: 100%?

核能气质少年 提交于 2020-01-16 00:46:12
问题 I suspect there is no answer to this but I was wondering if there is a way to set the height of a floating div to 100%? I have two divs within a wrapper div: <div id="wrapper"> <div id="left"> </div> <div id="right"> </div> </div> The right div has a set height and I want the left div to match it, so I created: #wrapper { background-color: red; width: 200px; height: 100%; overflow: auto; padding: 5px; } #left{ width: 90px; height: 100%; float:left; background-color: #ccc; } #right{ width:

Set floating div to height: 100%?

喜夏-厌秋 提交于 2020-01-16 00:46:03
问题 I suspect there is no answer to this but I was wondering if there is a way to set the height of a floating div to 100%? I have two divs within a wrapper div: <div id="wrapper"> <div id="left"> </div> <div id="right"> </div> </div> The right div has a set height and I want the left div to match it, so I created: #wrapper { background-color: red; width: 200px; height: 100%; overflow: auto; padding: 5px; } #left{ width: 90px; height: 100%; float:left; background-color: #ccc; } #right{ width:

Not able to arrange two divs side by side

老子叫甜甜 提交于 2020-01-15 10:19:08
问题 Okay, so I know there are a few questions similar to this on StackOverflow which already have been answered but they didn't help me. I am building a messaging service and for that I have two divs, contacts_box (300px) and message_box (500px). They are both wrapped inside a parent div which is 800px in width . I want align these two divs side by side inside the parent div . But no matter what I do, I just can't get them to align! Please take a look at my HTML and CSS and show where I am going

A floated image does not count toward DIV width, how can I make it so?

六眼飞鱼酱① 提交于 2020-01-15 10:10:34
问题 The following code: <div> <img src="" style="float: left;"> <p>Lorem Ipsum...</p> </div> Renders a div container with text, and a floated image on the left. Great. The text included therein also expands the div as much as it can while maintaining the text in a single line (unless otherwise writ). However, with a floated image, the width of the div container does not expand as much as it can, and prematurely line-breaks the text based on the width of the image. That is, if the floated image is

A floated image does not count toward DIV width, how can I make it so?

人盡茶涼 提交于 2020-01-15 10:09:07
问题 The following code: <div> <img src="" style="float: left;"> <p>Lorem Ipsum...</p> </div> Renders a div container with text, and a floated image on the left. Great. The text included therein also expands the div as much as it can while maintaining the text in a single line (unless otherwise writ). However, with a floated image, the width of the div container does not expand as much as it can, and prematurely line-breaks the text based on the width of the image. That is, if the floated image is

IE not clearing subsequent floats

怎甘沉沦 提交于 2020-01-14 17:50:54
问题 I'm trying to get two divs to float to opposite sides of the page, with text flowing between them. The top of the second (left-aligned) div should be even with the bottom of the first (right-aligned) div. The code below works fine in FF, Chrome, Opera, etc. fine, but they do not clear properly in IE. Both divs appear at the top of the text. If I move the left-aligned div low enough within the text, it works fine in IE, but that's not really a sustainable solution. I've found multiple pages on

Are floated element really removed from normal html flow?

纵饮孤独 提交于 2020-01-14 06:55:28
问题 Here's my jsFiddle In my Fiddle link i have floated my left-sidebar and right-sidebar. As per my knowledge floated element are removed from html normal flow. i just did not understand if it is so why it is displacing my right-sidebar. <div class="content-area"> <div class="left-sidebar"></div> <div class="main-area">hi</div> <div class="right-sidebar"></div> my css: .content-area { background-color: #bbb; height: 310px; } .left-sidebar { float: left; width: 50px; height: 100%; background