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.

Responsive Grid Query

Featured Replies

Hello,

 

I'm trying to get started with coding a responsive website, and learning a lot from some useful blog posts online. But I wondered if someone could help me with (a possibly very basic!) query.

 

I've created a container grid which I want to hold a 2 column layout. One blog I'm using to help me get started walks through using a container div with a width of 980px. I've then arranged a <section> and <aside> within the container with both of their widths specified in %.

 

When I try to minimize the browser with the above code, the container isn't scaling down - I'm assuming because it's specified in px? If I change the container to 75% instead of 960px the container and elements within minimize which is great. However - is it valid/safe to do this? When looking for help online, a lot of places seem to mention the same again with regards to using the container as 960px - but it doesn't respond when I try to resize the browser, so where am I going wrong?

 

Apologies if this is a simple question, but I'm just getting started with the basics.

The container needs a max-width of 980 not a width. And add margin: 0 auto to center it. No need for a 100% width, block elements like a div already have a default width of 100%.

 

On most sites I'd recommend you go wider than 980 pixels, this will look very narrow on many screens.

Edited by rbrtsmith

  • Author

Thank you both for such quick replies, it's much appreciated.

 

Robert, what width would you recommend for the container? Would 1024px be best or would you recommend going bigger still?

There isn't an all round recommended width, it depends on the project, font-sizes and so on. A typical width is in the 1200 range but with things being responsive it doesn't matter which number you pick as long as things are readable (not to many or few characters per line). I've built projects that don't have a max-width. http://wasabiadmin.se/eflag for example. I've also built some that have a width of 1100px.

To keep things simple for you just roll with 1200, it's a nice round easy to work with number.

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.