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.

problem with clearfix

Featured Replies

Can you tell me please, why my home page is not centered, https://codepen.io/mikelamardes/pen/KvzaLP

 

Do you mean the content? You can't have margin: 0 auto; on a 100% width item because it visually won't appear in the center. I would use classes instead so you're able to re-use various width containers to display content. Here's an example https://codepen.io/anon/pen/dzMxQg. There's no use in setting a width on something that doesn't require one, you will make it harder to re-use what you have already.

  • Author

 

Do you mean the content? You can't have margin: 0 auto; on a 100% width item because it visually won't appear in the center. I would use classes instead so you're able to re-use various width containers to display content. Here's an example https://codepen.io/anon/pen/dzMxQg. There's no use in setting a width on something that doesn't require one, you will make it harder to re-use what you have already.

 

So my parent box can not center the children inside if its size is 100% am I right?

 

So my parent box can not center the children inside if its size is 100% am I right?

 

Sort of. Your parent div with a width of 100% is likely in the center, but you just can't see it because it spans full width. It won't center the child items automatically, the way this is usually done is to wrap them in a smaller container like in my example above. If you want the text to be centered inside of that, you can use text-align. I've updated my example here to show how that works https://codepen.io/anon/pen/JyKoxv.

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.