作者sheauren (Ray)
看板Web_Design
标题Re: [问题] 用css设定物件的位置
时间Mon Mar 24 12:16:29 2008
※ 引述《gop66 (gop)》之铭言:
: 请问一下 下面这样的效果要怎麽设定呢?
: http://subweb.health.gov.tw/Nosmoking/04_1.asp
: 就是让整个页面上下没有空隙 水平的话是置中对齐
: 这要怎麽做呢? 用css做吗?
: 我看书上类似的东西是写
: position: absolute;
: top: 0px;
: bottom: 0px;
: 虽然上下有达到我想要的效果
: 可是左右我想要设成置中对齐 用这个方法好像都只能设绝对位置...
: 我是初学者 书上没写我就不会了.....= =
: 还请板友们多多指教 >"<
: 谢谢~
我的做法比较简单
不过要知道width的px或是percent才有办法
<div style='margin-left:50%; left:-40%;
width:80%; position:absolute;'>
</div>
or
<div style='margin-left:50%; left:-200px;
width:400px; position:absolute;'>
</div>
--
被遗忘的眯眯:
http://sheauren.blogspot.com/
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.20.131.187
※ 编辑: sheauren 来自: 61.20.131.187 (03/24 12:16)