The outside of the CSS does not wrap and the horizontal scroll bar is displayed.

Source: Internet
Author: User

I am not a professional front end, so toss long time AH Qaq

The requirement is two div, the inner Div does not wrap and the outer div shows the horizontal scroll bar when it is out.

This is similar to the following:

The first code is as follows:

<div class= "nowrap" >    <div class= "item-t" ></div>    <div class= "Item-t" ></div>    <div class= "item-t" ></div>    <div class= "Item-t" ></div></div>

CSS style:

. nowrap{White-space:nowrap;Overflow-x:Scroll;Height:200px;}. Item-t{Display:inline;float: Left;width:108px;Height:200px;background:Yellow;vertical-align:Top;}. Item-t+.item-t{Margin-left:15px;}

This is completely no way to meet the requirements, the White-space:nowarp as dead as not working, various experiments, the final version:

. Item-t  {display: inline-block; width: 108px; height: 200px; background: yellow; vertical-align: top;}

I only posted the modified part, why add a float not, which master know to tell me, thank you!

The outside of the CSS does not wrap and the horizontal scroll bar is displayed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.