gpt4 book ai didi

HTML 样式边距禁用表单

转载 作者:行者123 更新时间:2023-11-28 08:06:45 25 4
gpt4 key购买 nike

我试图将左侧的菜单和一个文本框与一个选项菜单对齐,以搜索右侧表单内的我的记录。但是,当我以负像素将表单留白到顶部时,它不起作用。

这是代码

<%@ 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>

最佳答案

你可以使用下面的代码..

<!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>

关于HTML 样式边距禁用表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29455618/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com