• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
jean 's house for art
电脑美术工程师,插画师,自由艺术者JEAN的技术BLOG
博客园    首页    新随笔    联系   管理    订阅  订阅

页面实现居中显示的方法 流动

流动式布局,第一种

 

<!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=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {text-align:center;
}

#apDiv1 {
width:750px;
margin:0 auto;
text-align:left;
position:relative;
}
#right {
width:150px;
float:left;
background-color:#333300;
}

#left {
width:150px;
float:left;
background-color:#000000;
}
-->
#content {
width:450px;
float:left;
}
</style>
</head>

<body>
<div id="apDiv1">


<div id="left">

</div>

<div id="content">
  <p>特帅吧,</p>
  <p>居中显示!</p>
</div>

<div id="right">

</div>
</div>


</body>
</html>

 

 

就是用text-align来了个回,这就是我做点笔记给自己。:)

posted @ 2009-01-31 21:12  郗鉴  阅读(377)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3