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.

Problems with DIV positioning and floating

Featured Replies

Hello I have included a html file of a website I am working on, I have not used any generated code it is just done by hand. The problem is that when I try to position a new DIV under the header DIV with navigation in it will not let me add a margin to it. I believe this is something to do with the the float attribute and would like some help. To me the code looks clean but maybe it isn't.noiseshed.html

Can you post another html file with the code that's not functioning the way you want it to? This way, we can have a better idea of what you're trying to accomplish. Having said that, if you're attempting to add a div as a child of the header div, under the logo, then you'd have to add the clear property to that new navigation element so that it will be visible under your floated image.

 

example:

 

.nav_div{
clear: both;
}

Edited by Pete Prosper

  • Author

Here is the one with the problem in it, I have navigation div with margin_top and it wont work. I have also tried putting margin_bottom on the header div. I want there to be a margin between navigation and header.

 

noiseshed.html

Edited by stansterday

Well you kind of misspelled "margin-top". You spelled it as "margin_top". A hyphen is used, not an underscore. Fixing that should get rid of your issue :D

Edited by Pete Prosper

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.