Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Floating Child Divs height not inherited by Parent Div

Featured Replies

When using float: left or right in Child divs, make sure to add position: relative to them. And add overflow: hidden in their Parent div. The Parent div will inherit the height of his Child divs. The code below will show you want I mean.

 

<style type="text/css">
.body {
background-color: #000;
height: auto;
position: relative;
overflow: hidden;
width: 500px;
}
.left {
background-color: #00F;
float: left;
height: 400px;
position: relative;
width: 200px;
}
.right {
background-color: #F00;
float: right;
height: 600px;
position: relative;
width: 300px;
}
</style>
<div class="body">
 <div class="left"></div>
 <div class="right"></div>
</div>

 

7th-Media-Signature.gif

Try this, u have to clear after floating for arranging other elements. Lots of way the clear, i just giving the easy one.

<div class="body">
  <div class="left"></div>
  <div class="right"></div>
<div style="clear: both;"></div>
</div>

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.