gpt4 book ai didi

html - 如何让我的文本框更靠近我的标签?

转载 作者:太空宇宙 更新时间:2023-11-03 21:14:15 24 4
gpt4 key购买 nike

.intro h1 {
font-family: 'Cambria';
font-size: 16pt;
font: bold;
text-align: left;
}

.intro p {
font-family: 'Calibri';
font: italic;
font-size: 12pt;
padding: 0px 690px 0px 20px;
text-align: left;
}

.content {
border: 2px solid;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}

#para1 {
padding: 0px 1050px 0px 20px;
}

#para2 {
padding: 0px 1099px 0px 20px;
}

.username-label,
.username-textbox,
.password-label,
.password-textbox {
margin: 10px 0px 0px 300px;
position: relative;
top: -70px;
}

#button1{
background-color: #add8e6;
margin:0px 0px 20px 370px;
width: 100px;
position: relative;
top: -70px;
}

#button2{
background-color: #add8e6;
}


.Username-label1,
.Password-label2,
.Email-label3,
.Repeat-Email-label4,
.username-new-input-textbox,
.password-new-input-textbox,
.email-new-input-textbox,
.reenter-new-input-textbox
{
margin: 0px 0px 0px 350px;
position: relative;
top: -20px;
}
<html>

<head>

<link href="Home.css" rel="stylesheet" />
<title>Project</title>

</head>

<body>
<script src="~/Scripts/jquery-2.1.1.min.js"></script>

<script src="~/Scripts/jquery-ui.min.js"></script>
<script src="~/Scripts/Home.js"></script>



<div class="container">
<div class="intro">

<h1>Welcome to Cuyahoga Community College Student Services Online</h1>

<p>Cuyahoga Community College recognizes students' rights to access personal and academic records in accordance with the Family Educational Rights and Privacy Act of 1974 (FERPA) as amended by Public Law 93-568.</p>
</div>
<br/>

<div class="content">
<div class="row top">
<p id="para1">Already have an account with us? Returning users may log in by entering their site username and password. </p>
<div id="login">
<label class="username-label">
<span>Username</span> &nbsp;
<input class="existing username-input-textbox" type="text" value="" />
</label>
<br/><br/>
<label class="password-label">
<span>Password</span> &nbsp;
<input class="existing password-input-textbox" type="password" value="" />
</label>
<br/><br/>
<button id="button1">Log in</button>
</div>
</div>
<hr/>
<div class="row bottom">
<p id="para2">New users, please create a new account by providing us with some basic information.</p>
<div class= "new_customers_info">
<label class="Username-label1">
<span>Username</span>
<input class="username-new-input-textbox" type="text" value="" />
</label>
<br/><br/>

<label class="Password-label2">
<span>Password</span>
<input class="password-new-input-textbox" type="password" value="" />
</label>
<br/><br/>

<label class="Email-label3">
<span>Email</span>
<input class="email-new-input-textbox" type="text" value=""/>
</label>
<br/><br/>

<label class="Repeat-Email-label4">
<span>Repeat Email Address</span>
<input class="reenter-new-input-textbox" type="text" value="" />
</label>
<br/><br/>

<button id="button2">Create Account</button>
</div>
</div>
</div>
<br/><br/>
<footer>Cuyahoga Community College</footer>
<footer>700 Carnegie Avenue, Cleveland, Ohio, 44115</footer>
</div>
</body>
</html>

我想弄清楚如何让我的文本框更靠近我的标签。如何使用 CSS 实现此目的?我尝试搞乱 margin left 定位,但这只会将元素进一步向右移动。有什么建议么?这是我的代码。

最佳答案

你有标签和输入在一起。但是,如果您将输入与边距放在一起,它们会进一步移动。它应该更像这样:

.Username-label1, 
.Password-label2,
.Email-label3,
.Repeat-Email-label4
{
margin: 0px 0px 0px 350px;
position: relative;
top: -20px;
}
.username-new-input-textbox,
.password-new-input-textbox,
.email-new-input-textbox,
.reenter-new-input-textbox
{
position: relative;
}

关于html - 如何让我的文本框更靠近我的标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43639222/

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