lets say I got 20 same divs with float:left property and some width. I want them to be in one line and if they dont fit in screen just to make page scroll horizontally.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s basically how floats work. If you want the described behaviour you can do something else instead, for instance
white-space: nowrap;on the container anddisplay: inline-block;instead of float.http://jsfiddle.net/NPzsV/3/
One thing to note though: with this approach, newlines/spaces/tabs between the divs will cause a space between them in the rendering.