Changez Khan Changez Khan - 3 months ago 9
CSS Question

"overflow-x: auto" not working as it should

I am trying with

overflow-x: auto
, but it is not working as it should. Where no scroll bar should be visible, it is showing horizontal scrollbar.

Vertical scrollbar(
overflow-y
) is working perfectly as desired, but horizontal scrollbar(
overflow-x
) is not working properly. Here is the JSFiddle link.

Answer

Here are some minor changes required in your classes to get it work as you expected.

.container_row
{
    width: 100%;
    white-space: nowrap;
    display: inline-block;
    margin: 0 auto;
}
#name_label 
{
    list-style: disc inside;
    margin-left: 10px;
    float: left;
    color: white;
    display: list-item;
    width: 50%;
}
#name_text
{
    color: white;
    padding-left: 5px;
    width: 50%;
    display: inline;
}

Updated

Check this Example fiddle

Comments