① DW8如何讓表格內的背景圖片居中顯示
DW8讓表格內的背景圖片居中顯示方法:
方法一、再建一表格,將圖片與表格分別放入兩個單元格中。
即:
<talbe>
<tr>
<td>
<!-- IMAGE -->
</td>
<td style="text-align:center">
<!-- TABLE -->
</td>
</tr>
</table>
方法二、在圖片外套一個DIV標簽,再在表格外套一個DIV,然後設置DIV屬性。
即:
<style>
.content{text-align:center;border:4px solid #99CC00;width:40%;}
.content #left{height:200px;float:left;border:4px solid #BB0000;width:40%;}
.content #right{height:200px;float:left;border:4px solid #009999;width:60%;text-align:center;} <!-- float還是left -->
.content img{width:100%;height:192px;}
.content .t1{width:80%;margin-top:2px;}
.content .t1 td{height:80px;border:3px dotted #990099;width:50%;text-align:center;}
</style>
<div class="content">
<div id="left"><img alt="LEFT" title="IMAGE" /></div>
<div id="right">RIGHT<table cellpadding="0" cellspacing="0"
class="t1"><tr><td>R11</td><td>R12</td></tr><tr><td>R21</td><td>R22</td></tr></table></div>
</div>
方法三、如果什麼都不相加也可以,只是不太好。
即:
<style>
.img{left:20px;position:absolute;border:5px solid #AA0000;width:150px;height:200px}
.table{width:30%;height:200px;text-align:center;font-family:"楷體";color=#992211;font-size:2em;}
td{border:3px solid #00AA00;}
</style>
<center>
<img class="img" alt="LEFT"/>
<table class="table" cellpadding="0" cellspacing="0">
<tr>
<td>
RIGHT1
</td>
<tr>
<tr>
<td>
RIGHT2
</td>
<tr>
</talbe>
</center>
② 如何使在dreamweaver的「頁面屬性」中設置的背景圖片居中
先插入一個div標簽,再建css規則,設置屬性讓圖片居中,如下圖:
<style type="text/css">
.an{ width:311px; /*背景圖片寬度*/
margin:auto; /*居中*/
background-image:url(images/hd.jpg) ; /*背景圖片*/
height:211px; /*背景圖片高度*/
}
③ 在dreamweaver 中怎麼使圖片居中
圖片居中常用的有兩種方法:
1、對img標簽的父標簽添加一個居中代碼(也就是text-align:center)
2、給img的父標簽添加一個寬度,然後給img標簽添加一個(margin:0 auto;)當然還必須給img標簽添加一個寬度或者是將他設置成塊元素(diplay:block)
如果你是在表格中添加img那就只需要給td添加一個居中代碼(text-align:center)就可以了。但是你不要對img添加別的東西,比如浮動什麼的。
④ 在DW裡面怎麼把背景圖片居中
<style>
body {
background-image:url(***.jpg); //圖片路徑
background-position:center; //居中
background-repeat: no-repeat; //不重復
background-attachment:fixed;
}
</style>
放在<head>和</head>之間,其中***.jpg是圖片相對路徑。用的時候把 //*** 去掉。
⑤ dreamweaver 背景圖片居中
實現原理:將圖片放到表格單元格里,通過添加align="center"實現居中。
1.准備圖片素材,新建html網頁。