如何在文本框中移动用户输入?
How do I move user input inside text box?
我正在尝试将用户输入进一步向右移动,因为边框与文本截断并且看起来不整齐。我试图让它在文本之前有一个空格,但我无法让它工作。因此,如果有人知道如何解决此问题,我将不胜感激。
图片在这里:
完整代码:
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Welcome!
</title>
</head>
<style>
html {
background-color: cadetblue;
font-family: Blippo, fantasy;
}
.welcomes {
font-size: 80px;
font-weight: 900;
margin-top: 10%;
color: white;
}
.name {
width: 38%;
margin-left: 32%;
height: 30px;
border-radius: 25px;
border-color: white;
outline: none;
caret-color: cadetblue;
}
</style>
<body>
<div class="welcomes">
<center>
Welcome!
</center>
</div>
<br>
<br>
<input type="text" class="name" style="font-family: Blippo, fantasy; color: cadetblue; font-size: 25px;" placeholder=" Please Enter Your Name To Continue!">
</body>
</html>
输入标签使用padding-left
。
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Welcome!
</title>
</head>
<style>
html {
background-color: cadetblue;
font-family: Blippo, fantasy;
}
.welcomes {
font-size: 80px;
font-weight: 900;
margin-top: 10%;
color: white;
}
.name {
width: 38%;
margin-left: 32%;
height: 30px;
border-radius: 25px;
border-color: white;
outline: none;
caret-color: cadetblue;
}
</style>
<body>
<div class="welcomes">
<center>
Welcome!
</center>
</div>
<br>
<br>
<input type="text" class="name" style="font-family: Blippo, fantasy; color: cadetblue; font-size: 25px; padding-left: 20px;" placeholder=" Please Enter Your Name To Continue!">
</body>
</html>
enter code hereApply CSS style for input tag padding: 12px 14px;
设置顶部和底部填充为 12px,左右为 14px
<input type="text" class="name" style="padding:8px, 14px; font-family: Blippo, fantasy; color: cadetblue; font-size: 25px;" placeholder=" Please Enter Your Name To Continue!">
我正在尝试将用户输入进一步向右移动,因为边框与文本截断并且看起来不整齐。我试图让它在文本之前有一个空格,但我无法让它工作。因此,如果有人知道如何解决此问题,我将不胜感激。 图片在这里:
完整代码:
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Welcome!
</title>
</head>
<style>
html {
background-color: cadetblue;
font-family: Blippo, fantasy;
}
.welcomes {
font-size: 80px;
font-weight: 900;
margin-top: 10%;
color: white;
}
.name {
width: 38%;
margin-left: 32%;
height: 30px;
border-radius: 25px;
border-color: white;
outline: none;
caret-color: cadetblue;
}
</style>
<body>
<div class="welcomes">
<center>
Welcome!
</center>
</div>
<br>
<br>
<input type="text" class="name" style="font-family: Blippo, fantasy; color: cadetblue; font-size: 25px;" placeholder=" Please Enter Your Name To Continue!">
</body>
</html>
输入标签使用padding-left
。
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Welcome!
</title>
</head>
<style>
html {
background-color: cadetblue;
font-family: Blippo, fantasy;
}
.welcomes {
font-size: 80px;
font-weight: 900;
margin-top: 10%;
color: white;
}
.name {
width: 38%;
margin-left: 32%;
height: 30px;
border-radius: 25px;
border-color: white;
outline: none;
caret-color: cadetblue;
}
</style>
<body>
<div class="welcomes">
<center>
Welcome!
</center>
</div>
<br>
<br>
<input type="text" class="name" style="font-family: Blippo, fantasy; color: cadetblue; font-size: 25px; padding-left: 20px;" placeholder=" Please Enter Your Name To Continue!">
</body>
</html>
enter code hereApply CSS style for input tag padding: 12px 14px;
设置顶部和底部填充为 12px,左右为 14px
<input type="text" class="name" style="padding:8px, 14px; font-family: Blippo, fantasy; color: cadetblue; font-size: 25px;" placeholder=" Please Enter Your Name To Continue!">