gpt4 book ai didi

html - 选择边距不起作用

转载 作者:行者123 更新时间:2023-11-28 02:08:26 24 4
gpt4 key购买 nike

我正在处理注册表单,当我想在同一行输入 ["text"](年份)并选择元素(日期和月份)时遇到问题,这就是我得到的: registration form我想通过在顶部添加边距来删除选择标签底部的边距(默认添加),所以我添加了这个:

input[type="email"],
input[type="password"],
input[type="text"],
select {
display: block;
width: 80%;
height: 30px;
text-align: center;
border: none;
font-size: 1em;
color: #313A3D;
background-color: #E8E9EA;
margin-top: 10px;
}
<html>

<head>
<link rel="stylesheet" type="text/css" href="./css/styleAuth.css" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>

<body>
<header>
<div class="navbartop">
<!--<a class="title" href="./auth.html" >title of the template</a>-->
<a class="item selected" href="#auth">Authentification</a>
<a class="item" href="#register">register</a>
<a class="item" href="#newsleter">newsleter</a>
<a class="item" href="#comments">Comments</a>
</div>
</header>
<section class="secondSection">
<div class="registerPanel">
<div class="row topbuffer">
<div class="col-md-6"><input type="text" name="fn" placeholder="first name" /> </div>
<div class="col-md-6"><input type="text" name="ln" placeholder="last name" /></div>
</div>
<div class="row topBuffer">
<div class="col-md-4">
<select>
<option selected="">day</option>
<option>1...31</option>
</select>
</div>
<div class="col-md-4">
<select>
<option>month</option>
<option>1...12</option>
</select>
</div>
<div class="col-md-4">
<input type="text" name="y" placeholder="year" />
</div>
</div>
<div class="row topBuffer">
<div class="col-md-12"><input type="email" name="email" placeholder="email" /></div>
</div>
<div class="row topBuffer">
<div class="col-md-6"><input type="password" name="pw1" placeholder="enter your password" /></div>
<div class="col-md-6"><input type="password" name="pw2" placeholder="comfirm your password" /></div>
</div>
</div>
</section>

</body>

</html>

...但它仍然不起作用,顶部的边距没有效果,所以任何人都可以帮助我,伙计们!提前致谢

最佳答案

试试这个。无需编写任何 css

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Test Code</title>

<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css " crossorigin="anonymous ">
<style>
input[type="email"],
input[type="password"],
input[type="text"],
select {
/* display : block;
width : 80%;
height : 30px;
text-align : center;
border : none;
font-size : 1em;
color: #313A3D;
background-color: #E8E9EA;
margin-top : 10px; */
}
</style>
</head>

<body>
<header>
<div class="navbartop">
<!--<a class="title" href="./auth.html" >title of the template</a>-->
<a class="item selected" href="#auth">Authentification</a>
<a class="item" href="#register">register</a>
<a class="item" href="#newsleter">newsleter</a>
<a class="item" href="#comments">Comments</a>
</div>
</header>
<section class="secondSection">
<div class="registerPanel">
<div class="row topbuffer form-group">
<div class="col-md-6">
<input type="text" name="fn" placeholder="first name" / class="form-control"> </div>
<div class="col-md-6">
<input type="text" name="ln" placeholder="last name" / class="form-control">
</div>
</div>
<div class="row topBuffer form-group">
<div class="col-md-4">
<select class="form-control">
<option selected="">day</option>
<option>1...31</option>
</select>
</div>
<div class="col-md-4">
<select class="form-control">
<option>month</option>
<option>1...12</option>
</select>
</div>
<div class="col-md-4">
<input type="text" name="y" placeholder="year" class="form-control" />
</div>
</div>
<div class="form-group">
<input type="email" name="email" placeholder="email" / class="form-control">
</div>
<div class="row form-group">
<div class="col-md-6">
<input type="password" name="pw1" placeholder="enter your password" / class="form-control">
</div>
<div class="col-md-6">
<input type="password" name="pw2" placeholder="comfirm your password" / class="form-control">
</div>
</div>
</div>
</section>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" crossorigin="anonymous"></script>
</body>

</html>

关于html - 选择边距不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48896475/

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