我提前道歉,我有非常适度的编码经验,并试图掌握HTML ...
从明确地(下面/附上)应用联系表格的一些基本代码时,我试图纳入所讨论的最新内容here
似乎无法正确使用它,只是喜欢左侧的字段标题,它们后面的实际字段是对齐的,每个字段之间都有一个返回值,同时坚持使用Insightly所需的编码..
提前感谢您的帮助!
[编辑1]
非常感谢,我现在设法通过一些CSS(附加)使它看起来或多或少。不幸的是,我不能让它按照需要行事,它提出要非常好,但它在提交时没有清除字段,也没有找到提供确认的工作方法强烈>它被发送,除了一个特别丑陋的警报窗口(特别是在铬)。任何帮助'重置提交'并告诉用户它被发送的方式会很棒!我确实从here尝试了一些CSS,但无济于事......
<style type="text/css">
/*************CHSE Stylesheet ***/
body {
background-color: transparent;
height:360px;
width:280px;
}
textarea {
height:70px;
width:273px;
}
</style>
<style>
form label{
display: inline-block;
width: 100px;
font-weight: bold;
}
</style>
<form name="insightly_web_to_contact" action="https://example.insight.ly/WebToContact/Create" method="post"<span style="font-size:14px;"><span style="color:#FFFFFF;font-weight:bold"><span style="font-family:Open Sans;"><input type="hidden" name="formId" value="xxxxxxxxxxxxxxx/xxxxxx=="/>
<span style="font-size:14px;"><span style="color:#FFFFFF;font-weight:bold"><span style="font-family:Open Sans;"><center>Quick Message:</center><br/>
<label for="insightly_firstName">First Name: </label><input id="insightly_firstName" name="FirstName" required="" type="text"/><br/><br/><label for="insightly_lastName">Last Name: </label><input id="insightly_lastName" name="LastName" required="" type="text"/><br/><br/><input type="hidden" name="emails[0].Label" required="" value="Work"/><label for="email[0]_Value">Email: </label><input id="emails[0]_Value" name="emails[0].Value" required="" type="text"/><br/><br/><label for="insightly_background">Message: </label><textarea id="insightly_background" name="background">
</textarea><br/><br/><center><input type="submit" value="Send Message"></center></form>
答案 0 :(得分:0)
吸引人的布局的关键是DIV和CSS。
首先,使用DIV对各个输入区域进行分组,并将每个区域划分为左/右(通过float
)。
例如,您可能希望标签和输入字段很好地对齐:
.frmGroup{overflow:hidden;}
.frmLeft {float:left;width:120px;}
.frmRight{float:left;width:300px;}
#thisone{margin-top:50px;}
<form>
<div class="frmGroup">
<div class="frmLeft"><label for="fn">First Name:</label></div>
<div class="frmRight"><input id="fn" type="text" /></div>
</div>
<div class="frmGroup">
<div class="frmLeft">Last Name:</div>
<div class="frmRight"><input type="text" /></div>
</div>
<div id="thisone">
<textarea cols="50" rows="5"></textarea>
</div>
</form>
float
指令特别有用,因为它允许您并排排列DIV。然而!它还从HTML“流”中删除DIV,这意味着它们占用零垂直空间。要解决此问题,请将overflow:____
添加到父DIV。 例如,我使用了overflow:hidden
]。在底部的jsFiddle中,通过删除/添加该行进行实验。
您还可以为特定DIV指定ID,并将其设置为在上/下/左/右边缘或填充。
DIV具有block
元素的附加优势,与最后添加<br>
具有相同的效果。
*另请注意,<label>
标记实际上仅对按钮,复选框等有用,因为它们允许用户通过单击文本标签来单击按钮/复选框。