① 在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">