代码改变世界

自己写的一个简单的页面

2011-07-25 19:27  Rollen Holt  阅读(511)  评论(0编辑  收藏  举报

css代码如下:

@charset "utf-8";
/* CSS Document */

*{
	margin: 0;
	padding: 0;
}

* body{
	font:  .8em Tahoma, "Trebuchet MS", Tahoma, sans-serif;
	line-height:1.6em;
	background: #fff url(images/bg.gif) repeat-x;
	color: #8E8E91;
}

#content{
	width: 930px;
	margin: 25px auto;
}

a{
	color: #EB0000;
	background: inherit;
	text-decoration: none;
}

a:hover{
	color: #808080;
	background: inherit;
	text-decoration: underline;
}

p{
	margin: 0 0 15px 0;
}

h1{
	font-family: "Bradley Hand ITC";
	color: #444;
}

#logo{
	width: 340px;
	float: left;
	margin: 10px 0 20px 0;
}

#menu{
	padding: 40px 0 0;
	float: left;
	margin: 0 0 38px;
}

#menu li{
	font-size: 1.1em;
	display: inline;   /*当想把list中的内容放在同一行的时候就用这个属性*/
}

#menu li a{
	float: left;
	width: 87px;
	padding: 2px 0 7px;
	text-align: center;
	margin: 0 0 0 10px;
	color: #636365;
}

#menu li a:hover{
	text-decoration: none;
	color: #7D9EDB;
	background: #fff url(images/button_grey.gif) no-repeat;
}

#menu li a.current {
	background: #fff url(images/button.gif) no-repeat;
	color: #fff;
}

.clear{
	clear: both;
}

#left{
	float: left;
	clear: left;
	margin: 0 0 20px;
	width: 270px;
}

#left img{
	padding: 6px;
	border-right: 1px solid #ccc;
	border-bottom: 1px solid #ccc;
	background: #fff;
}

.box{
	background: #eee;
	padding: 10px;
}

.smallthumb{
	width:109px;
}

#center{
	width: 240px;
	float: left;
	margin: 0 0 20px 25px;
}

#right{
	width: 380px;
	float: right;
}

.date{
	font-size: .8em;
	border-top: 1px solid #eee;
	padding: 5px 0 0;
}

.box li{
	list-style: none;
	border-bottom: 1px dotted #ccc;
	line-height: 26px;
}

.box li a{
	padding: 0 5px;
}

#footer{
	font-size: .84em;
	clear: both;
	padding: 15px;
	background: #eee;
}

#footer a {
	color: #444;
}

.caption {
	background: #fff url(images/title.gif) no-repeat;
	padding: 2px 0 0 18px;
	height: 35px;
	color: #fff;
}
.caption p {
	margin: 0;
}

  html代码如下(有兴趣的童鞋可以自行添加javascript,使得它更加的生动)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="author" content="Luka Cvrk (www.solucija.com)" />
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
    <link rel="stylesheet" href="home.css" type="text/css" />
    <title>Internet Studio</title>
</head>
<body>
    <div id="content">
        <div id="logo">
            <p>Consectetuer adipiscing elit</p>
            <h1>Internet Studio</h1>
        </div>
        <ul id="menu">
            <li><a class="current" href="#">Home</a></li>
            <li><a href="#">Services</a></li>
            <li><a href="#">Refrences</a></li>
            <li><a href="#">Career</a></li>
            <li><a href="#">About</a></li>
        </ul>
        
        <div class="clear"><br /></div>
        
        <div id="left">
            <div class="caption"><p>References</p></div>
            <div class="box">
                <a href="http://www.solucija.com/home/css-templates/"><img src="images/icor.gif" alt="Internet Corporation" /></a>
                <a href="http://www.solucija.com/home/css-templates/"><img src="images/ihos.gif" alt="Internet Hosting" class="smallthumb" /></a> <a href="http://www.solucija.com/home/css-templates/"><img src="images/ibroa.gif" alt="Internet Broadcast" class="smallthumb" /></a>
            </div>
        </div>
        
        <div id="center">
            <div class="caption"><p>Latest Articles</p></div>
            <div class="box">
                <ul>
                    <li><a href="#">Aliquam metus turpis, luctus ac</a></li>
                    <li><a href="#">Donec lacinia tristique ante</a></li>
                    <li><a href="#">Mauris facilisis, quam ut semper</a></li>
                    <li><a href="#">Curabitur sodales lacus at massa</a></li>
                    <li><a href="#">Etiam blandit ultricies nisl</a></li>
                    <li><a href="#">Phasellus vel leo</a></li>
                    <li><a href="#">Nam gravida nulla non eros</a></li>
                    <li><a href="#">Curabitur sollicitudin nonummy est</a></li>
                    <li><a href="#">Suspendisse egestas fringilla odio</a></li>
                    <li><a href="#">Maecenas libero neque volutpat</a></li>
                    <li><a href="#">Curabitur sodales lacus at massa</a></li>
                </ul>
            </div>
        </div>
        
        <div id="right">
            <h2>This is an example title</h2>
            <p>Suspendisse egestas fringilla odio. Donec lacinia tristique ante. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam blandit ultricies nisl. Nullam dapibus, mauris id scelerisque feugiat, sapien augue porta ipsum, ut blandit tellus enim vel mauris. Praesent accumsan metus vel ipsum. Maecenas aliquam blandit mi. Pellentesque dolor magna, posuere vel, condimentum id, accumsan ac, diam.</p>
            <p>Nulla venenatis, turpis eu vestibulum tincidunt, felis diam luctus velit, facilisis cursus mi ligula vitae nunc. Curabitur libero. Fusce felis. Nam gravida nulla non eros. Donec non nisl. Nulla ut odio. Curabitur sollicitudin nonummy est. Nullam molestie lectus quis nibh. </p>
            <p class="date"><a href="#">Comment(5)</a> · <a href="#">Read More</a></p>
        </div>
        
        <div id="footer">
            <div id="fl">
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pretium mauris nec arcu. Integer at leo vel ipsum elementum sodales. Nam est quam, posuere non, feugiat nec, consectetuer ac, lectus. Suspendisse egestas fringilla odio. Donec lacinia tristique ante. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
                <p>© Copyright 2007 Internet Studio<br />
                Design: <a href="http://www.solucija.com/">Luka Cvrk</a> · Sponsored by <a href="http://webpoint.wordpress.com/">B4Contact</a> · Released under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Licence</a></p>
            </div>
        </div>
    </div>
</body>
</html>