June 23rd, 2013, 02:14 PM
I'm new to CSS and I'm having some trouble with right padding.
Have a look at my site:
You will see that I've added a border to the 'resources' paragraph.
However, the right padding, goes all the way to the right side of the page. I want the right padding to be just like the left one, where there's only a few pixels between the content and the border.
I've used the 'padding-right' attribute but no matter what I do, it keeps extending to the very right side of the page. The paragraph in question has the custom class called 'resources'.
You can see the CSS file here:
How can I change this? Thank you very much
June 23rd, 2013, 02:27 PM
The problem isn't your padding, its the fact that its defaulting to using a 100% width and then applying the padding/margin accordingly.
So, either setup a wrapper/containing DIV and set a specific width for it to hold the contents to a certain width....or, apply a width property to your <p> tags to keep them from going over a certain width....[or if anyone else has better option, please chime in.]
June 23rd, 2013, 02:50 PM
Thanks, I changed the width of the paragraph and was able to achieve what I was looking for.