4 Replies - 524 Views - Last Post: 23 August 2012 - 09:14 PM

#1 clarissa_milner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 23-August 12

What is padding, and how do I use it?

Posted 23 August 2012 - 07:37 PM

I am studying CSS at ECU and I have come across padding, I think I understand that it is to create space between text and the border, but am not able to make it work for me.
Is This A Good Question/Topic? 0
  • +

Replies To: What is padding, and how do I use it?

#2 AnalyticLunatic  Icon User is offline

  • D.I.C Lover

Reputation: 223
  • View blog
  • Posts: 1,035
  • Joined: 25-June 12

Re: What is padding, and how do I use it?

Posted 23 August 2012 - 07:43 PM

View Postclarissa_milner, on 23 August 2012 - 07:37 PM, said:

I am studying CSS at ECU and I have come across padding, I think I understand that it is to create space between text and the border, but am not able to make it work for me.


padding: 5px

OR

padding-left: 5px
padding-right: 5px
padding-top: 5px
padding-bottom:px
Was This Post Helpful? 2
  • +
  • -

#3 fromTheSprawl  Icon User is offline

  • Monomania
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,056
  • Joined: 28-December 10

Re: What is padding, and how do I use it?

Posted 23 August 2012 - 07:48 PM

What you should try to do is create a box element, turn the borders on, add the text inside and see how it works when you manipulate the values. Basically, padding is the space between the inside elements with relation to their immediate parent elements. So:

<div id="box">
<p>Emperor Tomato Ketchup</p>
</div>



Setting the padding of the box will adjust the text inside. The higher the value, the further the box will be from the text. ^^
Was This Post Helpful? 1
  • +
  • -

#4 clarissa_milner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 23-August 12

Re: What is padding, and how do I use it?

Posted 23 August 2012 - 08:11 PM

Thank you, AnalyticLunatic, I was forgetting to add the px...

fromTheSprawl your info was really helpful too :)
Was This Post Helpful? 0
  • +
  • -

#5 AnalyticLunatic  Icon User is offline

  • D.I.C Lover

Reputation: 223
  • View blog
  • Posts: 1,035
  • Joined: 25-June 12

Re: What is padding, and how do I use it?

Posted 23 August 2012 - 09:14 PM

View Postclarissa_milner, on 23 August 2012 - 08:11 PM, said:

Thank you, AnalyticLunatic, I was forgetting to add the px...

fromTheSprawl your info was really helpful too :)


Glad I could help. Always be sure to add what measurement you are using.
In some browsers, it will be assumed the number represents px.

Whichever measurement you use, use that same one throughout the whole site.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1