css

1.通常采用margin:-100px等来细化div的位置

#win{position:absolute;top:50%;left:50%;width:400px;height:200px;margin:-102px 0 0 -202px;display:none;}

位置为50%,50%,但位置得稍微调节下,这是margin+负数就有了用武之地
2 div固定长度时,内部的图片会自动扩展

<!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>
<title>非常好看的CSS圆角边框 by www.865171.cn</title>
<style type="text/css" media="screen,print">
*{padding: 0; margin: 0;}
body {background-color:#fff; margin: 10px; padding: 0;}
html body{font: 62.5%/1.4em Arial, Helvetica, sans-serif;color:#333333}
html>body{font: 62.5%/1.4em Arial, Helvetica, sans-serif;color:#333333}
p, table, ul, dl, h2 {font-size: 1.2em}
caption {font-size: 1.4em}
h3 {
color: #cfcfcf;
font-weight: bold;
text-transform: capitalize;
margin-top:30px;
padding-bottom:10px;
}
a:link {color: #CC6633;}
a:visited {color: #CC6633;}
a:hover {color: #999966;}
a:active {color: #CC6633;}
a:focus{color: #CC6633;}
.portletcontent {
padding:0 7px 0 0;
background:#fff url(images/borders.gif) 100% 0 repeat-y;
}
.bi {
padding:0 0 0 1px;
background:#000 url(images/) 0 0 repeat-y;
}
.bb {
height:30px;
margin:0 -7px 0 -1px;
background:url(images/box.gif) 100% 100% no-repeat;
}
.bb div {
width:18px;
height:30px;
background:url(images/box.gif) 0 100% no-repeat;
}
.portlet h2 {
height:20px;
padding:0 0 0 10px;
background-color:#666;
background-image:url(images/topright.gif);
background-position:right top;
background-repeat:no-repeat;
color:#592C16;
line-height:20px;
}

.portletcontent p {
padding:8px 10px 8px 10px;
background:#fff;
}
</style>

</head>
<body>


<div class="portlet"><!-- Start Portlet -->
<h2 style="background-color:#0066CC;color:#FFFFFF;">CSS圆角边框</h2>
<div class="portletcontent">
<div class="bi">
<!-- Visual Content for Portlet below -->
<p>从前有两个人,分别住在河两岸,两个人耳朵都不好,不过倒是都很客气。一天早晨,河西的看见河东的拿着把镰刀出门,就对着对岸大叫:喂!我说,你是去割草吗?河东的看见河西的向他大叫,知道是关心自己去做什么,于是大叫:啊,不,我是去割草呀!河西的看见对岸的人冲他大叫,知道对方回答自己了,很有礼貌地说:哦,是吗,我还以为你是去割草呢!

</p>
<div class="bb"><div></div></div>
</div>
</div><!-- End Portlet Content-->
</div><!-- End Portlet -->

<div class="portlet" style="width:50% "><!-- Start Portlet -->
<h2 style="background-color:#0066CC;color:#FFFFFF;">CSS圆角边框二</h2>
<div class="portletcontent"><div class="bi">
<!-- Visual Content for Portlet below -->
<p>
您现在进入的是免费模板网,请记住本站网址www.865171.cn,非常感谢您对我们的大力支持,我们将努力的做到最好,Let's go,加油。此页面提供了三种不同大小的圆角边框,美观个性而不张扬!
</p>
<div class="bb"><div></div></div>
</div>
</div><!-- End Portlet Content-->
</div><!-- End Portlet -->


<div class="portlet" style="width:300px "><!-- Start Portlet -->
<h2 style="background-color:#0066CC; color:#FFFFFF;">CSS圆角边框三</h2>
<div class="portletcontent"><div class="bi">
<!-- Visual Content for Portlet below -->
<p>
有一天,大象和骆驼在一起说话,骆驼问大象:你为什么长的这么大?大象说:“我不和奶奶长在背上的人讲话”这时大象问骆驼说:骆驼你为什么长得这么小啊?骆驼说:“我不和鸡鸡长在脸上的人讲话!”
</p>
<div class="bb"><div></div></div>
</div>
</div><!-- End Portlet Content-->
</div><!-- End Portlet -->
</body></html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值