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.

setting margins

Featured Replies

Hi

 

I am writing css, and my text is going right the way across my page.

 

I was wondering if anyone can help me sort this out. I'm a newbie to writing code, so be gentle! lol.

 

I am guessing I will need to set the left and right margin. Do you know how I would do this?

p{margin:0 1.5em 0 1em}

 

You can use any type of measurements, em, pt, px etc.

 

The numbers come in a compass sequence (north east south west, or clockwise, whichever is easier for you to remember).

 

and remember, margins are outside an element, padding is inside.

 

P.S the p{} means it will apply to all <p></p> tags :)

  • Author

thanks, with this, am i able to set the margin a different colour from the center where i want text, or is that a little more complex? thanks x

thanks, with this, am i able to set the margin a different colour from the center where i want text, or is that a little more complex? thanks x

Not sure exactly what you mean.

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.