Home html Arranging multiple divs on one line

Arranging multiple divs on one line

Author

Date

Category

Please tell me how you can arrange several divs in one line in such a way that even if their total width exceeded the width of the container, they still would not wrap to a new line, but simply clipped divs that did not fit -ov.


Answer 1, authority 100%

There are many options, depending on how you want to display the blocks themselves. One with options:


Answer 2, authority 29%

.

& lt; div style = "overflow: hidden;" & gt;
  & lt; div style = "width: 1000%;" & gt;
    & lt; div style = "float: left; width: 100px; height: 100px;" & gt; content & lt; / div & gt;
    & lt; div style = "float: left; width: 100px; height: 100px;" & gt; content & lt; / div & gt;
    & lt; div style = "float: left; width: 100px; height: 100px;" & gt; content ++ & lt; / div & gt;
  & lt; / div & gt;
& lt; / div & gt;

Answer 3, authority 18%

In my opinion, the most normal solution:

& lt; div style = "overflow: hidden;" & gt;
  & lt; div style = "width: 1000%;" & gt;
    & lt; div style = "float: left; width: 100px; height: 100px;" & gt; content & lt; / div & gt;
    & lt; div style = "float: left; width: 100px; height: 100px;" & gt; content & lt; / div & gt;
    & lt; div style = "float: left; width: 100px; height: 100px;" & gt; content ++ & lt; / div & gt;
  & lt; / div & gt;
& lt; / div & gt;

Answer 4

I used this part for myself:

& lt; div style = "width: 1000%;" & gt;
& lt; div style = "float: left; width: 100px; height: 100px;" & gt; content & lt; / div & gt;
& lt; div style = "float: left; width: 100px; height: 100px;" & gt; content & lt; / div & gt;
& lt; div style = "float: left; width: 100px; height: 100px;" & gt; content ++ & lt; / div & gt;
& lt; / div & gt;

and it worked.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions