标题:那位大侠帮忙检查html和css代码
只看楼主
tiramisu1
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2011-5-5
结帖率:50%
 问题点数:0 回复次数:3 
那位大侠帮忙检查html和css代码
<html>
<head>
<!--
   New Perspectives on HTML and XHTML 5th Edition
   Tutorial 3
   Tutorial Case

   Sunny Acres Home Page
   Author:           
   Date:            

   Filename:         home.htm
   Supporting files: photo1.jpg, salogo.jpg
-->
   <title>Sunny Acres Home Page</title>
   <link href="farm.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="outer">
   <h1><img src="salogo.jpg" alt="Sunny Acres" /></h1>
   <div id="links">
      <a href="home.htm">Home</a><br />
      <a href="maze.htm">The Corn Maze</a><br />
      <a href="haunted.htm">The Haunted Maze</a><br />
      <a href="petting.htm">Petting Barn</a><br />
      <a href="produce.htm">Produce</a><br />
   </div>
 <div id="inner">
   <h2>Welcome</h2>
   <p>
      <img src="photo1.jpg" alt="home page photo" id="promoimage" />
      Welcome to the home page of our family farm,
      Sunny Acres, where there's always something
      happening. With the coming of fall, we're gearing up for our big AutumnFest
      and Farm Show. If you haven't visited our famous Corn Maze, be sure to do
      so before it gets torn down on November 5. This year's maze is bigger and
      better than ever.
   </p>
   <p>Farms can be educational and Sunny Acres is no exception. Schools and home-schooling
      parents, take an afternoon with us at our Petting Barn. We have over 100 friendly
      farm animals in a clean environment. Kids can bottle feed the baby goats, lambs,
      and calves while they learn about nature and the farming life. Please call ahead for
      large school groups.
   </p>
   <p>When the sun goes down this time of year, we're all looking for a good fright.
      Sunny Acres provides that too with another year of the Haunted Maze.
      Please plan on joining us during weekends in October or on Halloween for our
      big Halloween Festival.</p>
   <p>Of course, Sunny Acres is above all, a <i>farm</i>. Our Farm Shop is always open
      with reasonable prices and great produce. Save even more money by picking your
      own fruits and vegetables from our orchards and gardens.</p>
   <p>We all hope to see you soon, down on the farm.</p>
   <p>&mdash; Tammy &amp; Brent Nielsen</p>

   <h3>Hours</h3>
   <ul>
      <li>Farm Shop: 9 am - 5 pm Mon - Fri; 9 am - 3 pm Sat</li>
      <li>The Corn Maze: 11 am - 9 pm Sat; 11 am - 5 pm Sun</li>
      <li>The Haunted Maze: 5 pm - 9 pm Fri &amp; Sat</li>
      <li>Petting Barn: 9 am - 4 pm (Mon - Fri); 11 am - 3pm (Sat &amp; Sun)</li>
   </ul>

   <h3>Directions</h3>
   <ul>
      <li>From Council Bluffs, proceed east on I-80</li>
      <li>Take Exit 38 North to the Drake Frontage Road</li>
      <li>Turn right on Highway G</li>
      <li>Proceed east for 2.5 miles</li>
      <li>Sunny Acres is on your left; watch for the green sign</li>
   </ul>
 </div>
   <address>
      Sunny Acres &nbsp;☀&nbsp;
      Tammy &amp; Brent Nielsen &nbsp;☀&nbsp;
      1977 Highway G &nbsp;☀&nbsp;
      Council Bluffs, IA &nbsp;&nbsp; 51503
   </address>
</div>
</body>

</html>

下面是farm.css

body    {background-color: white; font-family: Arial, Helvetica, sans-serif;}
h2    {font-size: 2em; letter-spacing: 0.4em; text-indent: 1em; background-color: green; color: white}
h3    {width: 20em; padding-left: 1em; background-color: green; color: white}
address {text-align: center; font: normal small-caps 0.8em sans-serif; border-top: 0.5em double green; padding-top: 1em}
#promoimage    {float: right; margin: 0em 0em 1em 1em}
#outer        {width: 50em}
#links        {float: left; width: 10em; background-color: white; border-style: outset; border-width: 0.5em;}
#inner        {float: right; width: 36em; border-left: 0.1em solid green; padding-left: 1em}

1.为什么在我的网页里面<address>不是在最下部而是在上部呢?
2.右边文字部分的<div>怎么把它的左边线变得和文字一样长呢 现在边线上下都超出了文字
搜索更多相关主题的帖子: 检查 alt files Sunny title 
2011-07-27 17:11
tiramisu1
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2011-5-5
得分:0 
2011-07-27 17:27
zx396535633
Rank: 1
来 自:山西长治
等 级:新手上路
帖 子:17
专家分:8
注 册:2012-8-14
得分:0 
<html>
<head>
<style type="text/css">
body    {background-color: white; font-family: Arial, Helvetica, sans-serif; height:1000px;}
h2    {font-size: 2em; letter-spacing: 0.4em; text-indent: 1em; background-color: green; color: white}
h3    {width: 20em; padding-left: 1em; background-color: green; color: white}
address {text-align: center; font: normal small-caps 0.8em sans-serif; border-top: 0.5em double green; padding-top: 1em}
#promoimage    {float: right; margin: 0em 0em 1em 1em}
#outer        {width: 50em}
#links        {float: left; width: 10em; background-color: white; border-style: outset; border-width: 0.5em;}
#inner        {float: right; width: 36em; border-left: 0.1em solid green; padding-left: 1em}
.footer{ clear:both; width:1000px;; height:80px;

}




</style>
<!--
   New Perspectives on HTML and XHTML 5th Edition
   Tutorial 3
   Tutorial Case

   Sunny Acres Home Page
   Author:           
   Date:            

   Filename:         home.htm
   Supporting files: photo1.jpg, salogo.jpg
-->
   <title>Sunny Acres Home Page</title>
   <link href="farm.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="outer">
   <h1><img src="4107474_120925019000_2.jpg" alt="Sunny Acres" /></h1>
   <div id="links">
      <a href="home.htm">Home</a><br />
      <a href="maze.htm">The Corn Maze</a><br />
      <a href="haunted.htm">The Haunted Maze</a><br />
      <a href="petting.htm">Petting Barn</a><br />
      <a href="produce.htm">Produce</a><br />
   </div>
<div id="inner">
   <h2>Welcome</h2>
   <p>
      <img src="photo1.jpg" alt="home page photo" id="promoimage" />
      Welcome to the home page of our family farm,
      Sunny Acres, where there's always something
      happening. With the coming of fall, we're gearing up for our big AutumnFest
      and Farm Show. If you haven't visited our famous Corn Maze, be sure to do
      so before it gets torn down on November 5. This year's maze is bigger and
      better than ever.
   </p>
   <p>Farms can be educational and Sunny Acres is no exception. Schools and home-schooling
      parents, take an afternoon with us at our Petting Barn. We have over 100 friendly
      farm animals in a clean environment. Kids can bottle feed the baby goats, lambs,
      and calves while they learn about nature and the farming life. Please call ahead for
      large school groups.
   </p>
   <p>When the sun goes down this time of year, we're all looking for a good fright.
      Sunny Acres provides that too with another year of the Haunted Maze.
      Please plan on joining us during weekends in October or on Halloween for our
      big Halloween Festival.</p>
   <p>Of course, Sunny Acres is above all, a <i>farm</i>. Our Farm Shop is always open
      with reasonable prices and great produce. Save even more money by picking your
      own fruits and vegetables from our orchards and gardens.</p>
   <p>We all hope to see you soon, down on the farm.</p>
   <p>&mdash; Tammy &amp; Brent Nielsen</p>

   <h3>Hours</h3>
   <ul>
      <li>Farm Shop: 9 am - 5 pm Mon - Fri; 9 am - 3 pm Sat</li>
      <li>The Corn Maze: 11 am - 9 pm Sat; 11 am - 5 pm Sun</li>
      <li>The Haunted Maze: 5 pm - 9 pm Fri &amp; Sat</li>
      <li>Petting Barn: 9 am - 4 pm (Mon - Fri); 11 am - 3pm (Sat &amp; Sun)</li>
   </ul>

   <h3>Directions</h3>
   <ul>
      <li>From Council Bluffs, proceed east on I-80</li>
      <li>Take Exit 38 North to the Drake Frontage Road</li>
      <li>Turn right on Highway G</li>
      <li>Proceed east for 2.5 miles</li>
      <li>Sunny Acres is on your left; watch for the green sign</li>
   </ul>
</div>
   
</div>
<div class="footer">
  <address>
      Sunny Acres &nbsp;☀&nbsp;
      Tammy &amp; Brent Nielsen &nbsp;☀&nbsp;
      1977 Highway G &nbsp;☀&nbsp;
      Council Bluffs, IA &nbsp;&nbsp; 51503
   </address>
   </div>
</body>

</html>
2013-08-03 15:14
zx396535633
Rank: 1
来 自:山西长治
等 级:新手上路
帖 子:17
专家分:8
注 册:2012-8-14
得分:0 
你想在底下你之前应该布局好~ 你看看我给你加了个div看看能明白不
2013-08-03 15:17



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-346220-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.060310 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved