As you can see, I have a container, which is displayed as inline-block
. Within this container, I have two div
s, #line1
and #line2
. They contain the same length of characters.
If I add more characters to #line1
, the widths of #container
and #line2
will increase accordingly. But that is not what I expect.
What I expect is that widths do not change and I can see characters, which I just add into #line1
, through scrolling horizontally.
#container {
display: inline-block;
}
#line1 {
background: lightblue;
}
#line2 {
background: orange;
}
<div id="container">
<div id="line1">123</div>
<div id="line2">123</div>
</div>
Update
Is there any method to achieve this effect if I do not want to use a fixed width? Simply because I want them to be responsive.