HTML样式边距禁用表单

HTML样式边距禁用表单,html,css,Html,Css,我试图将左侧的菜单和一个文本框与一个选项菜单对齐,以搜索右侧表单中的记录。但是,当我将窗体边距设置为负像素时,它不起作用 这是密码 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ include file="header.jsp"%> <!DOCTYPE html PUBLIC "-//W3C//DTD

我试图将左侧的菜单和一个文本框与一个选项菜单对齐,以搜索右侧表单中的记录。但是,当我将窗体边距设置为负像素时,它不起作用

这是密码

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="header.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SEARCH - VMS</title>

<style>
input[type=text]{
    width: 10%;
    height: 20px;
    padding: 5px;
    margin-bottom: 25px;
    margin-top: 5px;

    border: 2px solid #ccc;
    color: #4f4f4f;
    font-size: 16px;
    border-radius: 5px;
    }

input[type=submit],input[type=reset]{
     border-radius: 7px;
    -moz-border-radius: 7px;
    -webkit-border-radius: 7px;
    background-color: #f6f6f6;
    cursor: pointer;
    margin-left: 12px;
    height: 35px;
    padding: 5px;
    width: 100px;
    }
</style>

</head>



<form name="search" method="post" action="SearchController?op=1">

<div style="margin-left: 500px;"> 
SELECT TYPE TO SEARCH DRIVER<br><br>

<select name="list">
<option>dname</option>
<option>dcontact</option>
</select>
<input type="text" name="txtField">


<input type="submit" value="Search" name="search">
<input type="reset" value = "Reset">
</div>
</form>
<div style="margin-top: -118px;">
<%@ include file="menu.jsp" %>
</div>

</html>

搜索-虚拟机
输入[类型=文本]{
宽度:10%;
高度:20px;
填充物:5px;
边缘底部:25px;
边缘顶部:5px;
边框:2个实心#ccc;
颜色:#4F4F;
字体大小:16px;
边界半径:5px;
}
输入[类型=提交],输入[类型=重置]{
边界半径:7px;
-moz边界半径:7px;
-webkit边界半径:7px;
背景色:#f6f6f6;
光标:指针;
左边距:12px;
高度:35px;
填充物:5px;
宽度:100px;
}
选择类型以搜索驱动程序

dname 接触
您可以使用以下代码

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"     http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SEARCH - VMS</title>

<style>
input[type=text]{
width: 10%;
height: 20px;
padding: 5px;
margin-bottom: 25px;
margin-top: 5px;

border: 2px solid #ccc;
color: #4f4f4f;
font-size: 16px;
border-radius: 5px;
}

input[type=submit],input[type=reset]{
 border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
background-color: #f6f6f6;
cursor: pointer;
margin-left: 12px;
height: 35px;
padding: 5px;
width: 100px;
}
form{display:block;
margin-top:-10px;}
</style>

</head>


<body>
<form name="search" method="post" action="SearchController?op=1">

<div> 
SELECT TYPE TO SEARCH DRIVER<br><br>

<select name="list">
<option>dname</option>
<option>dcontact</option>
</select>
<input type="text" name="txtField">


<input type="submit" value="Search" name="search">
<input type="reset" value = "Reset">
</div>
</form>
<div>
 <%@ include file="menu.jsp" %>
</div>
</body>
</html>