PDA

View Full Version : line break before pre tag, get rid of



chopficaro
Mar 16th, 2010, 12:17 AM
i want to make a block of text with scroll bars. so i used the pre tag. but all browsers automatically generate a line break before the pre tag of the same size as the font size inside the pre tag. for design reasons this is bad in my case. can i get rid of the line break? or is there another way to create a box of text with a scroll bar?

Excavator
Mar 16th, 2010, 12:33 AM
Hello chopficaro,
Have you tried zeroing out the browser defaults put on the pre tag?
Try something like
pre {
margin: 0;
padding: 0;
}

chopficaro
Mar 16th, 2010, 12:42 AM
ya i tried that its not a border, padding or a margin its an actual line break

anyways i just found out that i could use the div tag and set the overflow to scroll, but that gets rid of my formatting, i like how the div tag fits though. so how do i keep my formatting? maybe somehow i could import a word document in php or something?

Excavator
Mar 16th, 2010, 02:12 AM
Did you try nesting them?


<div id="myscrollingdiv">
<pre>
quoted stuff
</pre
<!--end myscrollingdiv--></div>

See some scrolling divs here (http://nopeople.com/CSS/scrollers/index.html).


This might be easier if you provided actual code so we can see what your doing.

chopficaro
Mar 16th, 2010, 02:51 AM
ty! works great!