css怎样制作网页啊.详细点,最好是做好的.

html-css010

css怎样制作网页啊.详细点,最好是做好的.,第1张

单纯的 CSS 是做不了网站的 它一般配合div一起用,当然也可以和table一起用 我想你问这个问题,应该会用 table 做网页吧 CSS 只是控制样式的,并非你指的“做网站” 打个比如 你写一个table 让它在页面居中 <table align="center"><tr><td></td></tr></table> 而用div + css <!-- 这段代码放到title里,如果做到外链CSS更好 --><style type="text/css">.mainBody {margin:0 auto} </style><!-- 这段代码放到body里 --><div class="mainBody"></div>这样能做到表现和结构的分离,也就是把一些控制整个页面的代码都放到 CSS 里,而页面只放一些网站的框架和内容。这样容易维护 当然,DIV+CSS 还有很多优点。这里就不和你说了,我想你要的就是上面我说的而已

<style>

.head{

width:100%

height:60px

}

.main{

width:70%

height:400px

float:left

}

.main{

width:30%

height:400px

float:right

}

.footer{

width:100%

height:60px

}

</style>

<div class ="head">这里是head区域</div>

<div class ="main">这里是主要内容区域</div>

<div class="main_left">这里是右侧区域</div>

<div class="footer">这里是页脚区域</div>

function createTable(){

document.write("<table border='2' width='300' height='200'><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></table>")

}

<input type="button" value="生成" onclick="createTable()"/>