0

所以现在我正在创建一个网站,我只是在页面上定位和格式化所有内容,然后再尝试对其进行更多风格化并添加一些 javascript。奇怪的是,我在表单后添加了三个 div 标签,以便将下一行分成三列。在我的 css 表上,我添加了一个边框,这样我就可以看到框的大小和标题。问题是什么都没有出现。任何帮助将不胜感激,因为我敢打赌它非常简单。

    <!doctype html>
    <html lang="en"">
    <head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="operationStyle.css">
<title>Operation:Educate Children</title>
<script language="javascript" type="text/javascript">
        image1=new Image();
        image1.src="supermario.png";
        image2=new Image();
        image2.src="mario.png";
</script>
    </head>
    <body>  
<header class="header">
    <img src="mario.png" alt="header"/>
    <h2>"Only the educated are free-Epictetus"</h2>
</header>




<table>
    <tr>
        <th><a href="educatedChilren.html">Home</a></th>
        <th><a href="aboutUs.html">About Us</a></th>
        <th><a href="currentProject.html">Current Project</a></th>
        <th><a href="getInvolved.html">Get Involved</a></th>
        <th><a href="Calendar.html">Calendar</a></th>
        <th><a href="Donate.html">Donate</a></th>
    </tr>
</table>


<div id="slideshow">
    <img class="slide" name="slide" src="supermario.png" width="100" height="200">
    <script>
        var step=1;
        function slideit(){
            if(!document.images)
                return;
            document.images.slide.src=eval("image"+step+".src")
            if(step<2)
                step++;
            else
                step=1;
            setTimeout("slideit()",2500);
            }
            slideit();
    </script>
<div>
<div class="contact">
    <h2>Contact Us!</h2>
    <form action="contact.php" method="post">
        <strong>Name:</strong>
        <input type="text" name="name"><br></br>
        <strong>E-Mail:</strong>
        <input type="text" name="email"><br></br>
        <strong>Message:</strong>
        <textarea name="message" cols="25" rows="12"></textarea>
        <input type="submit" value="Send">
        <input type="reset" value="Clear">
    </form
</div>

<div class="events">
    <h3><strong>Upcoming Events</strong></h3>
</div>

<div class="follow">
    <h3><strong><Follow Us!></h3></strong>
</div>

<div class="blog">

</div>



    </body>
    </html>

    BODY{
margin-left:15%;
margin-right:15%;
    }
    .header h2{
color:blue;
text-align:right;
border:5px solid black;
font-family:'Bookman Old Style',serif;
font-size:10pt;
font-style:italic;
width:28%;
float:right;
height:200px;

    }


    .header img{
width:70%;
float:left;
border:thin black;
height:200px;
    }
    table{
border:5px solid black;
width:100%;
height:75px;
clear:left;
    }

    .slide{
border:5px solid black;
width:70%;
height:400px;
float:left;
    }

    .contact{
border:5px solid black;
width:27%;
height:400px;
float:right;
    }

    .contact h2{
text-align:center;
    }

    .contact form{
margin-left:2%;
    }

    img.slide{
position:absolute;
left:0;
top:0;
    }

    #slideshow{
position:relative;
overflow:hidden;
    }

    .events{
float:left;
width:33%;
border:black;
height:200px;
    }

    .follow{
float:left;
width:33%;
border:black;
height:200px;
    }

    .blog{
float:left;
width:33%;
height:200px;
border:black;
    }
4

4 回答 4

0

有几个关闭标签是乱序的:

<div class="follow">
    <h3><strong><Follow Us!></h3></strong>
</div>

</h3>并且</strong>需要重新排序<h3><strong><Follow Us!></strong></h3>

您还缺少一个结束表单标签。 </form缺少结束语>

于 2013-06-18T21:03:32.650 回答
0

将您的 CSS 更改为:

.events, .follow, .blog { // they are all the same, why having three times as much code?
   float: left;
   width: 33%;
   border: 1px solid black;
   height: 200px;
}

然后修复丢失的 > in</form

你也错过了最后幻灯片 div 中的 /</div>

(并修复 Dany 指出的标签(<Follow Us!>> Follow Us!

然后你会看到 DIV

于 2013-06-18T20:58:32.630 回答
0

正如已经指出的那样,您的 HTML 代码有几个语法错误,这使得浏览器呈现<div>您在内部添加的 3 s <div class="contact">- 并且由于指定了它的高度,它们被切断了。

于 2013-06-18T21:05:24.410 回答
0

看看这一行:

<h3><strong><Follow Us!></h3></strong>

您在强标签内使用 < 和 > 。这可能会破坏您的 HTML。此外,您的标签顺序不正确,您应该将行更改为:

<h3><strong>Follow Us!</strong></h3>

此外,您最后一个表单的结束标记未正确关闭。

于 2013-06-18T20:55:20.543 回答