Solved

100% width of parent

Posted on 2015-01-13
3
65 Views
Last Modified: 2015-01-19
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%
0
Comment
Question by:tonelm54
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 40547684
You have 5px of padding so it sticks out 10px. Try padding:5px 0.
0
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 40547713
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
 
LVL 6

Expert Comment

by:Mikkel Sandberg
ID: 40547942
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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question