Why is my content going outside the div?
-
I want my content to stay within a div, it works perfectly fine when a word has a space, but if one word is incredibly long, it will go outside my div and not be contained within the div. How can I fix this?
-
Answer:
Based on what you've said, it sounds like text is sitting outside of your div unintentionally. Correct me if I'm wrong. Firstly ensure that your div has a width and is floating correctly: is the text or the div inheriting something that it shouldn't, such as margin, padding or position values? After that, if you aren't already, try using overflow: auto on your div - this will make paragraphs or text in general, be contained inside the div and introduce a browser scroll bar, if necessary, if it attempts to exceed the width of the div. If you are noticing a trend of inheritance on divs, try using clear: both. Please also ensure that your text is contained in a block level element; for example a heading, a span, p or article. Browsers sometimes don't know where to position words outside of blocks and they may disrupt the flow. If this doesn't fix it, please paste your code onto Pastebucket and I will take a look for you.
Matthew Petrucci at Quora Visit the source
Related Q & A:
- Why is my cat suddenly urinating outside of the litter box?Best solution by Yahoo! Answers
- Why doesn't ClickOnce in Visual Studio deploy content files from dependent assemblies?Best solution by Stack Overflow
- Why is Yahoo 360 going to closing down?Best solution by Yahoo! Answers
- Why are yahoo games going so slow?Best solution by Yahoo! Answers
- Why is the screen going green and red?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.