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.

px or %?

Featured Replies

I have allways used px for my div heights etc.

 

Should i be using % so that its the same in all screen res etc?

This is completely scenario dependant. That's why we have pixels, ems, percentages etc. If you want something 300px tall, set it to 300px. If you want it the height of the container, set it to 100%.

 

Most block elements I'll use pixels. I feel like I have more control design wise as my site will be pixel perfect. You can use percentages but also set max/min-width in pixels. If you're worried about extreme changes in resolution (looking good on mobile as well as a 30" display) look into responsive layouts. They're extremely easy to make and are impressive as hell. Also look at a decent css grid system.

 

Ems are associated with type and are more like percentages than they are pixels. Always do line-height in percentages for scalability (or just unitless em values such as 1.5 - I've been told that works). Using percentages for type also gives you design flexibility if you want your headers to be 3x the size of paragraph text then set it to 300%.

 

TL;DR: It depends completely. Ask yourself which would be more suitable. They're all acceptable!

 

Edit: Formatting

Edited by Ashley Byrom

  • Author

Thanks for the reply :)

 

Didnt want to get into bad habbits early on.

 

I prefer using px as well, was just checking :)

 

Thanks for all the info!

Although pixels are easier to use, percentages and ems are sometimes considered more suited to the market these days as devices and screen sizes vary drasticly.

 

Here's an interesting article about it if you're up for some reading: fluid layouts

 

I use ems for anything type based, pixels when fixed width images are involved, and percentages for general layout.

Use px and ems for accuracy, %s for children div boxes or fluid layouts.

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.