Html 为什么标签不使用整体形式
我有一个非常简单的表单,但是css有问题。不知何故,这3个标签并没有一直扩展到左边(窗体的边框)。 html代码Html 为什么标签不使用整体形式,html,css,Html,Css,我有一个非常简单的表单,但是css有问题。不知何故,这3个标签并没有一直扩展到左边(窗体的边框)。 html代码 <!doctype html> <html lang="en"> <head> <title>Form Validation</title> <script type="text/javascript" src="../jquery_lib/jquery-1.11.0.min.js"></
<!doctype html>
<html lang="en">
<head>
<title>Form Validation</title>
<script type="text/javascript" src="../jquery_lib/jquery-1.11.0.min.js"></script>
<link type="text/css" rel="stylesheet" href="stylesheet.css" />
<script type="text/javascript" src="animation.js"></script>
<script type="text/javascript" src="validation.js"></script>
<script>
</script>
</head>
<body>
<!-- Insert your content here -->
<h1>The Form</h1>
<form id="myForm" name="myForm" onsubmit="return validateForm()">
<ul>
<li class="title">Who Are You?</li>
<li class="fields">
<label>*First Name:</label><br/>
<input id="firstName" class="req" type="text" /><br/>
<label>Last Name:</label><br/>
<input id="lastName" type="text" /><br/>
<label>*Email:</label><br/>
<input id="email" class="req" type="text" /><br/>
</li>
<li class="title">Where Are You?</li>
<li class="fields">
<label>City:</label><br/>
<input id="city" type="text" /><br/>
<label>*State:</label><br/>
<input id="state" class="req" type="text" /><br/>
<label>Country</label><br/>
<input id="country" type="text" /><br/>
</li>
<li class="title">What Do You Do?</li>
<li class="fields">
<label>*Occupation:</label><br/>
<input id="occupation" class="req" type="text" /><br/>
<label>Company:</label><br/>
<input id="company" type="text" /><br/>
<label>Location:</label><br/>
<input id="location" type="text" /><br/>
</li>
</ul>
<input id="button" type="submit" value="Submit Form" />
</form>
</body>
</html>
很简单,您没有设置/重置浏览器默认添加到
UL
元素的填充
ul{
padding:0;
}
→
ul{
padding:0;
}