css圖片滾動代碼怎麼寫?輪播圖橫向滾動展示

來源:互聯網
上載者:User
在日常工作中網頁上的輪播圖展示必不可少,那麼對於剛入門的小白而言本篇文章關於css圖片滾動代碼的介紹更是淺顯易懂。希望本篇文章對大家有所協助。

css圖片滾動程式碼範例具體如下:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>css圖片滾動程式碼範例</title></head><body><style>    .imglist{        overflow-x: auto;        overflow-y: hidden;        height:180px;        white-space: nowrap;}    img{        width:auto;        height:100%;        margin-right:10px;    }</style><div class="imglist">    <img src="img/1.png"/>    <img src="img/2.png"/>    <img src="img/3.png"/>    <img src="img/4.png"/>    <img src="img/5.png"/></div></body></html>

註:在 HTML 中,<img> 標籤沒有結束標籤,並且不能左浮動,外層容器必須加不換行。<img> 標籤並不會在網頁中插入映像,而是從網頁上連結映像,建立的是被引用映像的佔位空間。

white-space: nowrap;

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.