首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

新手啊DREAMWRAVER中如何在不同显示器上固定元素位置

2012-06-07 
新手求助啊,DREAMWRAVER中怎么在不同显示器上固定元素位置啊我添加了个DIV层里面放了FLASH在17寸的电脑上

新手求助啊,DREAMWRAVER中怎么在不同显示器上固定元素位置啊
我添加了个DIV层 里面放了FLASH 在17寸的电脑上定好了位置 放在22寸屏幕上位置就变了呀 请问怎么办啊
这里是代码
.F1 {
position: absolute;
height: 500px;
width: 800px;
top: 2870px;
left: 139px;
}
.F2 {
position: absolute;
height: 500px;
width: 800px;
top: 3247px;
left: 139px;
}


[解决办法]
给父容器定义
width: ;
position:relative;
margin:0 auto;

子元素再来 absolute
[解决办法]

HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /></head><body><div style="background:red; width:600px; height:300px; position:absolute; left:50%; top:50%; margin-top:-150px; margin-left:-300px"> 在显示器中水平垂直居中<br />    margin-top:-150px; 高度的一半<br />    margin-left:-300px 宽度的一半<br /></div></body></html> 

热点排行