100% width of parent

Quite a silly question, but I'm trying to fit a div element into the parent by setting width:100%; however its overflowing the parent, see my example in jsfiddle

As you can (hopefully) see:-
overflow
Any ideas whats going wrong? Setting the width 100%
tonelm54Asked:
Who is Participating?
 
Tom BeckConnect With a Mentor Commented:
To pad the text without affecting the width of the parent div you could put the text in a span tag and pad that.

http://jsfiddle.net/dL624hxk/1/
0
 
Tom BeckCommented:
You have 5px of padding so it sticks out 10px. Try padding:5px 0.
0
 
Mikkel SandbergFront End DeveloperCommented:
There also appears to be something funky with your jQuery. When you click on a title that is already selected, the .divBody for the title collapses and then expands again. I'm not sure if this is the desired effect, but it just behaves different than I was expecting.
0
All Courses

From novice to tech pro — start learning today.