View Full Version : style within div

Phil Jackson
10-22-2009, 07:10 PM
Hi im working on this pet project:


its a function in php that loads in scripts and ouputs them to the browse.

pre.odd { background-color: #F4F4F4; }
pre.even { background-color: #a0d3a5; }
pre.even, pre.odd { margin:0; padding:5px; font-size:12px; color:#404040; border-top:1px solid #404040;}
div.codeBlock { width:800px; overflow:auto; margin:0 auto; border:1px solid #404040; border-top:none;}
pre span.lineNo { color:#C60; }

problem being if you scroll across at the bottom the coloured lines stop and do not continue. Anyone know why?

10-22-2009, 08:33 PM
Because you told your pre elements to be 550px wide and the code is longer, hence overflowing. And even without that width the elements would be 100% wide relative to the parent element’s width (which is 550px).