Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4249014
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: 系统运维

2011-04-29 14:35:56

就像一个容器,可以把元素一起放进去

    在你的页面中使用
,但不要滥用。借助结构,把页面分成几个合理的逻辑结构,这样有助于网页结构的清晰和样式化。如果添加
只是使页面中有更多的结构、那么这样做除了是页面变得复杂之外没有任何真正的好处了。

这次 的代码: lounge.rar  


在 lounge.html 中添加


  1. div id="elixirs">
  2.     <h2>Weekly Elixir Specials</h2>
  3.     <p>
  4.       <img src="images/yellow.gif" alt="Lemon Breeze Elixir" />
  5.     </p>
  6.     <h3>Lemon Breeze</h3>
  7.     <p>
  8.       The ultimate healthy drink, this elixir combines
  9.       herbal botanicals, minerals, and vitamins with
  10.       a twist of lemon into a smooth citrus wonder
  11.       that will keep your immune system going all
  12.       day and all night.
  13.     </p>

  14.     <p>
  15.       <img src="images/chai.gif" alt="Chai Chiller Elixir" />
  16.     </p>
  17.     <h3>Chai Chiller</h3>
  18.     <p>
  19.       Not your traditional chai, this elixir mixes mat&eacute;
  20.       with chai spices and adds an extra chocolate kick for
  21.       a caffeinated taste sensation on ice.
  22.     </p>

  23.     <p>
  24.       <img src="images/black.gif" alt="Black Brain Brew Elixir" />
  25.     </p>
  26.     <h3>Black Brain Brew</h3>
  27.     <p>
  28.       Want to boost your memory? Try our Black Brain Brew
  29.       elixir, made with black oolong tea and just a touch
  30.       of espresso. Your brain will thank you for the boost.
  31.     </p>

  32.     <p>
  33.       Join us any evening for these and all our
  34.       other wonderful
  35.       <a href="beverages/elixir.html"
  36.          title="Head First Lounge Elixirs">elixirs</a>.
  37.     </p>
  38. </div>



在 lounge.css 中添加

  1. #elixirs {
  2.     border-width:thin;
  3.         border-style:solid;
  4.         border-color:#007e7e;
  5.         width:200px;

  6.         padding-right:20px;
  7.         padding-bottom:20px;
  8.         padding-left:20px;

  9.         margin-lefg:20px;
  10.         
  11.         text-align:center;

  12.         background-image:url(images/cocktail.gif);
  13.         background-repeat:repeat-x;
  14. }

  15. #elixirs h2{        ##如果没有加 这个,标题显示黑色
  16.     color:red;          elixris 子标题显示 红色
  17. }

  18. #elixirs h3{
  19.      color:blue;      exlirs 的 h3标题显示颜色
  20. }
有边框,有颜色,有背景






阅读(944) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~