HTML与CSS:属性的作用及部分属性的使用例子

属性:是用于个性化元素,即提供额外的元素信息。

type属性

<html>

 <head>

            <title>Starbuzz Coffee</title>
			<style type="text/css">
			      body{
				  background-color: #d2b48c;
				  margin-left: 20%;
				  margin-right: 20%;
				  border: 1px dotted gray;
				  padding: 10px 10px 10px 10px;
				  font-family: sans-serif;
				  }
		    </style>

 </head>

 <body>

      <h1>Starbuzz Coffee Beverages</h1>

      <h2>House Blend,$1.49</h2>
  
      <p>A smooth,mild blend of coffees from Mexico,Boliva and Guatemala.</p>

      <h2>Mocha Cafe Latte,$2.35</h2>

      <p>Espresso,steamed mikl and chocholate syrup.</p>

       <h2>Cappuccino,$1.89</h2>

      <p>A mixture of espresso,steamed milk and foam.</p>

      <h2>Chai Tea,$1.85</h2>

       <p>A spicy drink made with black tea,spices,mikl and honey.</p>

 </body>

</html>

href(超文本引用)属性

 一般:

<a href="baidu.html">百度</a> 

由父到子:

<a href="WebSource/baidu.html">百度</a>

由子到父:

<a href="../baidu.html">百度</a>


scr属性(显示图片):

 <img scr="haizeiwang.gif">



  

posted @ 2012-02-23 01:15  KeenLeung  阅读(360)  评论(0编辑  收藏  举报