Html 如何阻止CSS表格行脱离屏幕
以下是JSFIDLE:Html 如何阻止CSS表格行脱离屏幕,html,css,css-tables,Html,Css,Css Tables,以下是JSFIDLE: 请给我(重拍) 请告诉我-1 与披头士乐队(重拍) 与披头士-3 辛苦的一天';s之夜(重拍) 辛苦的一天';s之夜-2 披头士待售(重拍) 披头士乐队待售-4 橡胶灵魂(重拍) 橡胶灵魂-3 左轮手枪(重新录制) 左轮手枪-4 神奇神秘之旅(重拍) 神奇神秘之旅-2 披头士乐队(重拍) 披头士-5 随它去吧(重拍) 顺其自然-2 现在,表格行的宽度是由其中的单元格数量设置的。所以宽度大约是1600,它离开屏幕,我必须水平滚动才能看到它们。是否有办法阻止这
请给我(重拍)
请告诉我-1
与披头士乐队(重拍)
与披头士-3
辛苦的一天';s之夜(重拍)
辛苦的一天';s之夜-2
披头士待售(重拍)
披头士乐队待售-4
橡胶灵魂(重拍)
橡胶灵魂-3
左轮手枪(重新录制)
左轮手枪-4
神奇神秘之旅(重拍)
神奇神秘之旅-2
披头士乐队(重拍)
披头士-5
随它去吧(重拍)
顺其自然-2
现在,表格行的宽度是由其中的单元格数量设置的。所以宽度大约是1600,它离开屏幕,我必须水平滚动才能看到它们。是否有办法阻止这种情况,使其不超过我的显示器的宽度?也许
表格布局
就是您要寻找的,并且最终img的最大宽度
:
.table{
显示:表格;
边界塌陷:塌陷;
宽度:100%;
表布局:固定;
}
.行{
显示:表格行;
}
.cellForArtistName{
显示:表格单元格;
}
细胞孔菌{
显示:表格单元格;
溢出:隐藏;
填充物:5px;
}
.艺人姓名{
字体大小:40px;
保证金:0px 0px 0px 0px;
垫底:10px;
填充顶部:35px;
}
img{
最大宽度:100%;
}
.相册名称{
/*宽度:175px*/
}
披头士乐队
请给我(重拍)
请告诉我-1
与披头士乐队(重拍)
与披头士-3
辛苦的一天';s之夜(重拍)
辛苦的一天';s之夜-2
披头士待售(重拍)
披头士乐队待售-4
橡胶灵魂(重拍)
橡胶灵魂-3
左轮手枪(重新录制)
左轮手枪-4
神奇神秘之旅(重拍)
神奇神秘之旅-2
披头士乐队(重拍)
披头士-5
随它去吧(重拍)
顺其自然-2
您是否考虑过使用twitter引导网格?这会让你的生活更轻松,也许吧?
<div class="row">
<div class="cellForAlbum">
<a href="spotify:track:3KiexfmhxHvG5IgAElmTkd">
<img src="https://i.scdn.co/image/1e6c3774deb8c44852ac169e03ce3f7a37c936af" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">Please Please Me (Remastered)</div>
<span class="caption">Please Please Me - 1</span>
</div>
</div>
<div class="cellForAlbum">
<a href="spotify:track:4ekUX4pWizXXksJe0JfS9U">
<img src="https://i.scdn.co/image/1e684af9619d7310229826fab2d6ce490cb954f1" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">With The Beatles (Remastered)</div>
<span class="caption">With The Beatles - 3</span>
</div>
</div>
<div class="cellForAlbum">
<a href="spotify:track:5J2CHimS7dWYMImCHkEFaJ">
<img src="https://i.scdn.co/image/56f312139863addd3837e68e6c198150e80f510a" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">A Hard Day's Night (Remastered)</div>
<span class="caption">A Hard Day's Night - 2</span>
</div>
</div>
<div class="cellForAlbum">
<a href="spotify:track:4ltC6PrqkTtpcRNi5lvS4z">
<img src="https://i.scdn.co/image/863e2f879a99e4afb084a6d0eb39ef37e596d5d2" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">Beatles For Sale (Remastered)</div>
<span class="caption">Beatles For Sale - 4</span>
</div>
</div>
<div class="cellForAlbum">
<a href="spotify:track:06ypiqmILMdVeaiErMFA91">
<img src="https://i.scdn.co/image/e26910fd9e7bb1671213cb9ed06a855077ddd79f" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">Rubber Soul (Remastered)</div>
<span class="caption">Rubber Soul - 3</span>
</div>
</div>
<div class="cellForAlbum">
<a href="spotify:track:4BRkPBUxOYffM2QXVlq7aC">
<img src="https://i.scdn.co/image/75ef0990aa0bb02ef7f6a52d41cc2c4c8028c3ba" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">Revolver (Remastered)</div>
<span class="caption">Revolver - 4</span>
</div>
</div>
<div class="cellForAlbum">
<a href="spotify:track:0qHMhBZqYb99yhX9BHcIkV">
<img src="https://i.scdn.co/image/5efcba83e06ce03ca843b459a4189f861ddc5f23" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">Magical Mystery Tour (Remastered)</div>
<span class="caption">Magical Mystery Tour - 2</span>
</div>
</div>
<div class="cellForAlbum">
<a href="spotify:track:0j3p1p06deJ7f9xmJ9yG22">
<img src="https://i.scdn.co/image/2782d94528b449fb6910300cc8c8f93ab8cc7a8d" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">The Beatles (Remastered)</div>
<span class="caption">The Beatles - 5</span>
</div>
</div>
<div class="cellForAlbum">
<a href="spotify:track:0CaBBQsaAiRHhiLmzi7ZRp">
<img src="https://i.scdn.co/image/b3651a85f2bca826b38194c51d09cd7b068aa3ab" alt="" />
</a>
<div class="albumName">
<!-- the below hidden div has the album name that gets sent to the server onclick of this albumName div -->
<div style="display:none;">Let It Be (Remastered)</div>
<span class="caption">Let It Be - 2</span>
</div>
</div>
</div>