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.

What is the professional way to float divs?

Featured Replies

http://bkwebdesignandhosting.co.uk/?page_id=4

 

The above url is my packages page and i would like to know the simplest and professional way to float these so there all next to each other. thanks :)

 

html/css:

<div id="b1" style="width: 168px; border: #0f0 1px dotted; padding: 2px;"><img src="http://www.bkwebdesignandhosting.co.uk/wp-content/themes/Basic'>http://www.bkwebdesignandhosting.co.uk/wp-content/themes/Basic'>http://www.bkwebdesignandhosting.co.uk/wp-content/themes/Basic Foundation Themes/Basic303/images/bronze.png" alt="bronze package" width="168" height="99" />

<ul>

<li>1-2 Pages</li>

<li>Logo/Header Design</li>

<li>Custom Design Layout</li>

<li>Customer enquiry form</li>

<li>Unlimited email accounts</li>

<li>(SEO) Search engine optimisation</li>

</ul>

<a>Click here for full info!</a>

</div>

<div id="s1" style="width: 168px; border: #0f0 1px dotted; padding: 2px;"><img src="http://www.bkwebdesignandhosting.co.uk/wp-content/themes/Basic Foundation Themes/Basic303/images/silver.png" alt="bronze package" width="168" height="99" />

<ul>

<li>1-2 Pages</li>

<li>Logo/Header Design</li>

<li>Custom Design Layout</li>

<li>Customer enquiry form</li>

<li>Unlimited email accounts</li>

<li>(SEO) Search engine optimisation</li>

</ul>

<a>Click here for full info!</a>

</div>

<div id="g1" style="width: 168px; border: #0f0 1px dotted; padding: 2px;"><img src="http://www.bkwebdesignandhosting.co.uk/wp-content/themes/Basic Foundation Themes/Basic303/images/gold.png" alt="bronze package" width="168" height="99" />

<ul>

<li>1-2 Pages</li>

<li>Logo/Header Design</li>

<li>Custom Design Layout</li>

<li>Customer enquiry form</li>

<li>Unlimited email accounts</li>

<li>(SEO) Search engine optimisation</li>

</ul>

<a>Click here for full info!</a>

</div>

First of all I would get into the habit of using Style Sheets instead of writing the styles out in-line.

 

Secondly, surely just giving all the div boxes you want stacked next to each other a float left and a slight margin left will do the job, so long as their parent div is giving them enough room to space out next to each other, otherwise they will 'line break'.

  • Author

ok thanks for that, btw i do use a style sheet usually however this is done using the back end of wordpress when you can edit your pages so i thought ill do it all there and if i ever need to change it i can easily :) where ever i am.

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.