3

I have a bunch of <label> elements in my <footer>. Right now, the labels wrap when they exceed the width of the <footer>.

How can I make the labels scroll horizontally inside of the footer?

Here is a JSFiddle where the labels are wrapping. http://jsfiddle.net/DTcHh/5088/

Don P
  • 60,113
  • 114
  • 300
  • 432

2 Answers2

4

It's very simple:

footer {
    background: black;
    padding: 10px;
    overflow-x: auto; /* scrollbar only when needed */
}
footer .btn-group {
    font-size: 0; /* eliminates the white space gap between non-floated .btn s */
    white-space: nowrap; /* prevents child inline .btn s from wrapping to the next line */
}
footer .btn-group .btn {
    float: none;
}

Demo: http://jsfiddle.net/DTcHh/5091/

Arbel
  • 30,599
  • 2
  • 28
  • 29
1

This should help out. Use:

white-space: nowrap;

to prevent it from starting on a new line, and then:

overflow-x: scroll;

to make it use a scrollbar.

Community
  • 1
  • 1
plushyObject
  • 1,123
  • 6
  • 14