【问题标题】:Using form for button navigation and buttons do not appear使用表单进行按钮导航和按钮不出现
【发布时间】:2014-01-21 20:06:54
【问题描述】:

所以我为我的大学作业创建了一个网站,它有一个非常好的导航系统,使用两列,左边有导航按钮,使用表单和输入,这导致我的网站看起来就像我想要的那样,就像这样

http://gyazo.com/38ed9ea8133e44c57209c6992d2a4554

由于个人原因,我正在尝试重新创建一个类似的站点,以便我可以一起了解更多关于 CSS 和 HTML 的功能,但由于某种原因,即使所有代码都相同,按钮也不会出现,我也不能对于我的生活,看看为什么他们不会在新网站上显示。下面是我的 CSS 文件和下面的 HTML。

如果您知道原因,请告诉我!
这是我的 CSS

h1 {
    color:#FFFFFF;
    text-align:center;
}
body {
    margin-top:75px;
    margin-bottom:75px;
    margin-left:30px;
    margin-right:30px;
    background-color:#A9BCF5;
}
.bt {
    width:1050px;
}
.bt tr {
    margin:0;
    padding:4px;
    align:center;
    list-style-type:none;
}
.bt td {
    align:left;
}



这是 html

<!DOCTYPE html>
    <head>
    <title>
        Test4CSS
    </title>
    <link rel="stylesheet" type="text/css" href="style.css">
     <h1>Test Heading Text for the site</h1>
    </head>
        <body>
            <table class="bt">
             <tbody>
              <tr>
               <td>
            <form action="index.html>
             <input type="submit" value="Home Page">
            </form>
            <form action="page1.html>
             <input type="submit" value="The First Page">
            </form>
            <form action="page2.html>
             <input type="submit" value="The Second Page">
            </form>
            <form action="page3.html>
             <input type="submit" value="The Third Page">
            </form>
            <form action="page4.html>
             <input type="submit" value="The Fourth Page">
            </form>
            <form action="page5.html>
             <input type="submit" value="The Fifth Page">
            </form>
              </td>
              <td>
            <p>
            This is the example text for the page, to understand<br>
            a little bit about the formatting that I have put in place.
            </p>
              </td>
             </tr>
            </table>
        </body>
</html>

【问题讨论】:

    标签: html css forms button input


    【解决方案1】:

    这很容易 - 请参阅 http://codepen.io/anon/pen/iwhnJ

    你的报价有一些错误。

    <form action="index.html">
             <input type="submit" value="Home Page">
    </form>
    

    在上面的行中缺少“”:&lt;form action="index.html&gt;这是所有表单元素的情况,而不是&lt;form action="page3.html&gt;,你必须写&lt;form action="page3.html"&gt;

    【讨论】:

    • 太棒了!感谢负载,前几天我遇到了这个问题,我一直想念那些。在你再次输入我的代码之前,我什至没有意识到其中的区别。
    猜你喜欢
    • 1970-01-01
    • 2020-05-18
    • 2014-10-13
    • 1970-01-01
    • 2017-08-12
    • 1970-01-01
    • 2010-12-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多