怎樣在DW中添加Banner按鈕

來源:互聯網
上載者:User
這次給大家帶來怎樣在DW中添加Banner按鈕,在DW中添加Banner按鈕的注意事項有哪些,下面就是實戰案例,一起來看一下。

1、準備好一張banner素材,,放在img圖片庫中

2、開啟Dreamweaver軟體,ctrl+n建立一個html檔案並儲存

3、在body中建立內容構建內容框並設定類名稱

<p class="banner"><img src="img/banner.jpg" ><input type="button" value="左"  class="bt_left">    <input type="button" value="右" class="bt_right"></p>

在一個大框中包含圖片和兩個方向鍵,最後將左右定位到左右位置

4、在head下加入style標籤,對banner設定寬高屬性值:

<style>.banner{width:1200px;height:300px;margin:0 auto;overflow:hidden;}.banner img{width:100%;}</style>

5、對大框banner設定為相對定位,設定左側按鈕絕對位置,並設定位置

.bt_left{position:absolute;top:50%;left:20px;}

6、對右側按鈕設定絕對位置,並設定位置

.bt_right{position:absolute;top:50%;right:20px;}

相信看了本文案例你已經掌握了方法,更多精彩請關注php中文網其它相關文章!

推薦閱讀:

前端實戰項目中20條CSS代碼使用注意事項

使用純CSS3截取字串

相關文章

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.