Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pre tag width:100% or max-width:100% overflow:auto is not flexible [closed]

Tags:

html

css

Here is a link to an example: http://whiterootmedia.com/database/dusty_arlia/the_img_tag_and_its_attributes.html

My tag element will contain long lines of code. Whenever its container changes to a width:auto (below 1200px width) the tag will not shrink in width. I would like the window to keep shrinking and the element to have a scroll bar for the width.

Currently I have this css:

pre {overflow:auto; max-width:100%}

like image 203
Dusty Avatar asked Jan 13 '13 00:01

Dusty


1 Answers

I added this css to my display:table; container:

table-layout:fixed;
width: 100%;

CSS display:table layouts are harder to style. If you're just starting out, just use float to position divs in a container.

like image 142
Dusty Avatar answered Oct 28 '22 00:10

Dusty