① 在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網頁。
③ 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中,如何使圖片和文字居中對齊
插入圖片後,在「 格局」菜單下,我們 可以看到「對齊」選項,在對齊下我們 可以依據需要 取捨「左對齊」、「居中對齊」、「右對齊」和「兩端對齊」。
⑥ DW怎麼讓圖片上下左右居中
如果完全上下居中,並且兼容不同瀏覽器高度,需要使用js獲取屏幕高度然後減去DIV高度,再取個值的一半,就是距離頂部的高度。建議不用這么麻煩,只要按鈕美觀,在屏幕第一屏就可以了。使用下面這個</embed >後面加個margin-top
<div align="center" style="margin-top:180px">