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.

Best way to position to position smaller elements?

Featured Replies

Is there a text book way to position smaller elements contained within the design?

 

See screenshot of the learn more button and contact us button, usually to get those side by side i would put them both in their own div float left and then get them where i want with padding or margins, i understand this is a sloppy way to do it? (or is it?)

 

Naturally the elements are positioned in rows. see my code

 

                               <div class="span8">

				<div class="learn-more"><p><a href="#">Learn more</a></p></div>

				<p class="featured-link"><a href="#">Contact us today!</a></p>

			</div>

 

post-35918-0-81834900-1325839046_thumb.png

 

So i want the <p> element to be inline and perfectly centered vertically with learn more button. So is using floats messy? is there a 'correct' way to do it?

Edited by Uplift

  • Author

I think i managed it

 

Instead of using a div i applied all styling directly to the hyperlink, it looks like removing the block element places the 2 hyperlinks inline, so it's pretty exactly how i want it without any positioning.

 

				<div class="span8">

				<a href="#" class="learn-more">Learn more</a>

				<a href="#" class="featured-link">Contact us today!</a>			

			</div>

I would recomend adding:

 

display: inline;

 

Just in case a browser renders the default differently.

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.