100% width div gets cut off when I scroll right if my browser window is smaller than div's content

后端 未结 4 1313
难免孤独
难免孤独 2021-01-12 05:46

I had a problem on my own site with a

that is supposed to have 100% width. The code for it is shown below.

#myDiv {
    width: 100%;         


        
4条回答
  •  被撕碎了的回忆
    2021-01-12 06:33

    I've solved this issue for myself with display: inline-block. Here is example: http://jsfiddle.net/z01g0r2d/1/ . Note if you try to set width of the long content as, for example, 200% the solution stops working.

提交回复
热议问题