關於在css裡設定圖片圓角的問題

來源:互聯網
上載者:User

標籤:

今天做了一個項目,內頁的產品圖片都是帶圓角的,於是前端的做了圓角的效果,div+css是這樣的,首先div布局是:

<div class="tiandi_item" onclick="javascript:location.href=‘#‘">
<div class="tiandi_item_img"><img src="images/tiandi_04.jpg" /></div>
<div class="tiandi_item_text ellipsis">六一兒童節互動六一兒童節互動六一兒童節互動</div>

(css檔案裡)加入如下樣式:

.tiandi_item{ width:160px; height:145px; background-color:#faecb2; border-radius:12px; -webkit-border-radius:12px; -moz-border-radius:12px; text-align:center; padding-top:5px; line-height:30px; overflow:hidden; float:left; margin:0 50px 10px 0; cursor:pointer;}

.tiandi_item_img{ width:154px; height:112px; overflow:hidden;border-radius:12px; -webkit-border-radius:12px; -moz-border-radius:12px;}
.tiandi_item_img img{ width:100%; display: block; margin-bottom: 7px; border: 1px solid #ffd300; border-radius:12px; -webkit-border-radius:12px; -moz-border-radius:12px;}

控制圓角主要是border-radius:12px; -webkit-border-radius:12px; -moz-border-radius:12px;,後面的主要是相容webkit核心和moz的瀏覽器,.tiandi_item_img img也要加radius是因為圖片大小不同,有的圖片上邊有圓角,下邊沒有圓角

關於在css裡設定圖片圓角的問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.