I am trying to display code on my site, but the container it is in is 90%, and thus when the code is more that the page can fit, it extends off the the right. I wanted to have it overflow inside a div very much like github.

Thank you :)

link|flag

1 Answer

up vote 1 down vote accepted

Can you do this?

<div style="width:90%; border: solid 1px red;"> //Outer (current div)
  <div style="overflow: auto;"> //width: auto; (default)
    <div style="width: 4000px;">Test Wide Content ...</div> //content!
  </div>
</div>
link|flag
Yes thank you :) was actually being caused by the display:table i had in a parent div – Alex Feb 4 at 1:18
@Alex - Excellent, glad it works for you! – Nick Craver Feb 4 at 1:19

Your Answer

 
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.