您的位置:首页 > Web前端 > CSS

css,div简单应用

2010-11-09 22:44 501 查看
css文件:

body { font-family:Verdana; font-size:10px; margin:0;}

#container {margin:0 auto; width:100%;}

#mainContent { height:200px; margin-bottom:5px;}
#left { float:left; width:250px; height:200px; background-color:#999;}
#right { float:right; width:250px; height:200px;background-color:#999;}
#conter { margin:0 205px !important; margin:0 202px; height:200px; background-color:#CCC;}
#below1 { height:150px; background-color:#CCC;  margin-top:5px; margin-bottom:5px;overflow-y:scroll;}
#below2 { height:150px; background-color:#CCC;  margin-bottom:5px; overflow-y:scroll;}
#footer { height:40px; background-color:#FFC;}#mainContent #below1 div table {
 font-family: Verdana, Geneva, sans-serif;
}

jsp文件:

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml">
<link href="layout.css" rel="stylesheet" type="text/css" />
<head>

</head>

<body>
<div id="container">

  <div id="header">This is the Header</div>
  <div id="mainContent">
    <div id="left">This is the left</div>
    <div id="right">This is the right</div>
    <div id="conter"></div>
    <div id="below1"></div>
    <div id="below2">This is the below2</div>
   
  </div>
  <div id="footer">
<span style="display:none"></span>
 
  </div>
  </div>
</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息