Is there any way to use pure css to make div height fixed and width adaptive content (which will exceed the browser width)

is used for a dynamic display of picture video, which requires a row of picture and video, which is controlled by a horizontal scroll bar.
found that it is troublesome to use js to get the sum of the video widths of all the pictures and then set the width to the parent div.
I would like to ask if there is a pure css method in which child elements are displayed horizontally without wrapping lines in the parent element! Or a simple js method is fine! Thank you, bosses

Mar.04,2021

overflow-x:auto


you can refer to my demo, to solve this problem recently

https://codeshelper.com/n/13.

the key is to set overflow:auto;

to the parent element.
Menu