Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to prevent wrapping

Status
Not open for further replies.

dexeloper

Programmer
Oct 26, 2004
162
GB
Look at this page
I want the content not to flow down/wrap. I want to have all the text in one line with a horizontal scroll bar. I realise I could set the container div to a width of, say, 130% but the width is unpredictable.

Any ideas?
 
Loose the float:left on each month div, just keep the display inline. Having both defeats the purpose of either.

Then in your containers style set white-space to nowrap, and overflow-x to scroll.

That should make the divs continue on, and the container will scroll as it needs to.

Tested in FF, Chrome, and IE.

Code:
#container {
overflow-x:scroll; 
white-space:nowrap; 
font-family:verdana,arial,helvetica,geneva,sans-serif;
background-color:#EEEEFF;
font-size:8pt;
color:#333333;
}
.month {
display:inline; 
background-color:#EEEEFF;
}

Though if you are going to make the divs inline, then maybe spans which are already inline elements may be a better choice.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Many thanks Vacunita, worked a treat.
Not sure the relevance of 'textarea' BobbaFet.
Good weekend everyone.
 
You wanna display it in a straight line... then you can with text area, just a matter of setting the right number of cols.

[bobafett] BobbaFet [bobafett]
Code:
if not Programming = 'Severe Migraine' then
                       ShowMessage('Eureka!');
 
If you want to be semantically correct (and also reduce the amount of code you need to make it work), you would use the <pre> tag. It was designed to preserve formatting (spaces, carriage returns) of your text.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
He's using a number of Div's there. I doubt textarea or a <pre> would do anything to them. It looks like just a line of text but its not really.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
That's right Vacunita.
But thanks everyone for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top