Reputation: 883
I have a grid of div-boxes that vary in height and width: http://jsfiddle.net/9cnDS/
A few of them should be overflowing horizontally with overflow-x:auto, but they're overflowing vertically?..
The {{message}} should stay on 1 line, and when it is longer than the standard width of the box, the text should auto overflow horizontally
<div class="col2">
<div class="box9 border">
<div class="message">
<blockquote>
<div class="moreLeft">{{message}}</div>
</blockquote>
</div>
</div>
</div>
Here's the css:
.col2 {
width: 65%;
height:100%;
}
.box9 {
height:15%;
overflow-x: auto;
}
.moreLeft {
margin-left: -2%;
}
.message {
padding-top: 3.5%;
text-align: center;
}
blockquote {
height: 40px;
width: auto;
padding: 5px 10px;
margin: 0 0 20px;
font-size: 1.5vw;
border-left: 11px solid #000;
}
Upvotes: 1
Views: 142
Reputation: 10380
.box9 {
overflow: hidden;
overflow-x: auto;
white-space: nowrap;
}
This helps unless I'm misunderstanding your issue completely.
Upvotes: 2
Reputation: 4114
With white-space and overflow-y you should be fine:
.box9 {
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
}
Upvotes: 1
Reputation: 16675
Not sure what you are trying to do exactly, but adding white-space: nowrap
will prevent the text from overflowing vertically:
.box9 {
overflow-x: auto;
white-space: nowrap;
}
Upvotes: 3