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 Float

Featured Replies

Hey guys, so I've started designing my first home page, it's nothing special but I really just want to get to grips with all the slicing and coding using divs stuff.

 

I have come across one problem:

 

http://dtym.co.uk/

 

Basically, I want the rectangle which is all the way down the bottom on the right, next to the skinnier one above.

 

I have tried using float: left, but it doesn't seem to be working.

 

Weird thing is, my navigation is also made up of 3 parts, and the float:left worked fine with them, and they're all on the same level.

 

Any help guys ?

Hi,

always specify a width on a floated element otherwise it can fill the width of its container.

Give #newsbar1 a width to match it's background image and you should be ok.

  • Author
Hi,

always specify a width on a floated element otherwise it can fill the width of its container.

Give #newsbar1 a width to match it's background image and you should be ok.

 

It still doesn't work :(

It still doesn't work :(

 

Hi

 

In your css remove float:left; and add margin-left:24px; in your #newsbar2

 

Then in your html replace this

<div id="newsbar1">
</div>

<div id="newsbar2">
</div>

 

with this

 

<div id="newsbar1">


<div id="newsbar2">
</div></div>

 

That should sort it in firefox I havent checked in ie though

 

Pat

  • Author

Thanks Pat, it works perfect in FF :)

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.