联系表格造型问题

时间:2017-02-24 13:18:15

标签: html css forms contact

我正在尝试设置我在网站上设置的联系表单。我采用了一个现成的(带有CSS样式和php动作的html)但是当我把它放在我的html中时,它没有将html与css链接起来。我该如何定义div?谢谢。

<div id="contact"  class="contact">
    <div class="row">
        <div class="divider4"></div>
        <form action="mail.php" method="post" id="vreme">
    
            <div class="column-1">
                YOUR NAME<br/><br/>
                <input name="name" id="name" value="" />
            </div>

    
            <div class="column-2">
                YOUR E-MAIL<br/><br/>
                <input name="email" id="email" value="" />
            </div>

            <div class="column-3">  
                MESSAGE<br/><br/>        
                <textarea id="message" name="message" ></textarea>
            </div> 

            <div class="button">
                <span><input class="submit" id="submit" name="submit" type="submit" value="Send"></span>
            </div>
        </form>
    </div>
</div>

4 个答案:

答案 0 :(得分:2)

您是否已将css引用包含在页眉中?如在

<link rel="stylesheet" href="css/form-style.css" type="text/css">

答案 1 :(得分:2)

该网站中应该有一个给定html表单的css文件。您应该通过在html的head部分中提及以下代码将该form.css文件连接到form.html帖子。检查并查看

<html>

<head>
<link rel="stylesheet" href="css/form.css" type="text/css">
</head>

<body>
<div id="contact"  class="contact">
  <div class="row"><div class="divider4"></div>
  <form action="mail.php" method="post" id="vreme">

    <div class="column-1">
            YOUR NAME<br/><br/>
            <input name="name" id="name" value="" />
            </div>


    <div class="column-2">
            YOUR E-MAIL<br/><br/>
            <input name="email" id="email" value="" />
            </div>

    <div class="column-3">  
            MESSAGE<br/><br/>        
            <textarea id="message" name="message" ></textarea>
            </div> 

    <div class="button">
                <span><input class="submit" id="submit" name="submit" type="submit" value="Send"></span>
              </div>
</form>
  </div></div>

</body>
</html>

答案 2 :(得分:0)

我已经包含了css参考,我的页面样式的其余部分正在工作,但事实并非如此。奇怪的是,我从我以前工作过的网站上看到了它,它在那里工作得很好。

<link rel="stylesheet" href="assets/style.css" type="text/css">

答案 3 :(得分:0)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Form Style</title>
<link type="text/css" rel="stylesheet" href="css/form.css"/> //css/form.css - select your file location
/* OR */
<style type="text/css">
/*Paste your css style code here*/
</style>
</head>
<body>
<div id="contact"  class="contact">
    <div class="row">
        <div class="divider4"></div>
        <form name="mail" action="mail.php" method="post" id="vreme">

            <div class="column-1">
                YOUR NAME<br/><br/>
                <input name="name" id="name" value="" />
            </div>


            <div class="column-2">
                YOUR E-MAIL<br/><br/>
                <input name="email" id="email" value="" />
            </div>

            <div class="column-3">  
                MESSAGE<br/><br/>        
                <textarea id="message" name="message" ></textarea>
            </div> 

            <div class="button">
                <span><input class="submit" id="submit" name="submit" type="submit" value="Send"></span>
            </div>
        </form>
    </div>
</div>
</body>
</html>

希望这会有所帮助......