css html 缺少框文本的边框和对齐方式
css html form missing border and alignment of box text
将表单放入框中时遇到一些困难。结果并不好。我很好奇是否有人有建议。这是一个将放置在动态文本旁边的表单。我也很好奇如何将框文本向右移动一步,因为文本比上面的长一个字母。没什么特别的,但对齐和表单框是至关重要的。 Illustration
一张我想要的表格的图片:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="action_page.html">
<form>
<h1>Text<h1></br></br>
Name: <input type="text" name="Name" placeholder="Name hier.."></br>
Epost: <input type="text" name="Epost" placeholder="Epost hier.."></br>
<input type="submit" value="Senden">
</form>
</body>
</html>
尝试使用它,看看是否有帮助:-
<!DOCTYPE html>
<html>
<head>
<style>
* {
box-sizing: border-box;
}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
resize: vertical;
}
label {
padding: 12px 12px 12px 0;
display: inline-block;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
float: right;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
.col-25 {
float: left;
width: 25%;
margin-top: 6px;
}
.col-75 {
float: left;
width: 75%;
margin-top: 6px;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
.col-25, .col-75, input[type=submit] {
width: 100%;
margin-top: 0;
}
}
</style>
</head>
<body>
<div class="container">
<form action="/action_page.php">
<div class="row">
<div class="col-25">
<label for="fname">Name:</label>
</div>
<div class="col-75">
<input type="text" id="fname" name="Name" placeholder="Name hier..">
</div>
</div>
<div class="row">
<div class="col-25">
<label for="fname">Epost:</label>
</div>
<div class="col-75">
<input type="text" id="fname" name="epost" placeholder="Epost hier..">
</div>
</div>
</div>
</div>
<div class="row">
<input type="submit" value="Submit">
</div>
</form>
</div>
</body>
</html>
我已经添加了 CSS 你也可以看到相应的元素并添加到你的代码中以获得所需的 effect.Please 赞成票(如果有帮助的话)。
请尝试这样的操作
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="#">
<h1>Text</h1>
<div class="input-wrapper">
<label for="name">Name</label>
<input type="text" name="Name" placeholder="Name" id="name">
</div>
<div class="input-wrapper">
<label for="email">Email</label>
<input type="text" name="Epost" placeholder="Email" id="email">
</div>
<button type="submit">Send</button>
</form>
</body>
</html>
添加一些 CSS 样式后,结果可能是这样的:
https://codepen.io/anon/pen/QobvQL?editors=1100
将表单放入框中时遇到一些困难。结果并不好。我很好奇是否有人有建议。这是一个将放置在动态文本旁边的表单。我也很好奇如何将框文本向右移动一步,因为文本比上面的长一个字母。没什么特别的,但对齐和表单框是至关重要的。 Illustration
一张我想要的表格的图片:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="action_page.html">
<form>
<h1>Text<h1></br></br>
Name: <input type="text" name="Name" placeholder="Name hier.."></br>
Epost: <input type="text" name="Epost" placeholder="Epost hier.."></br>
<input type="submit" value="Senden">
</form>
</body>
</html>
尝试使用它,看看是否有帮助:-
<!DOCTYPE html>
<html>
<head>
<style>
* {
box-sizing: border-box;
}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
resize: vertical;
}
label {
padding: 12px 12px 12px 0;
display: inline-block;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
float: right;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
.col-25 {
float: left;
width: 25%;
margin-top: 6px;
}
.col-75 {
float: left;
width: 75%;
margin-top: 6px;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
.col-25, .col-75, input[type=submit] {
width: 100%;
margin-top: 0;
}
}
</style>
</head>
<body>
<div class="container">
<form action="/action_page.php">
<div class="row">
<div class="col-25">
<label for="fname">Name:</label>
</div>
<div class="col-75">
<input type="text" id="fname" name="Name" placeholder="Name hier..">
</div>
</div>
<div class="row">
<div class="col-25">
<label for="fname">Epost:</label>
</div>
<div class="col-75">
<input type="text" id="fname" name="epost" placeholder="Epost hier..">
</div>
</div>
</div>
</div>
<div class="row">
<input type="submit" value="Submit">
</div>
</form>
</div>
</body>
</html>
我已经添加了 CSS 你也可以看到相应的元素并添加到你的代码中以获得所需的 effect.Please 赞成票(如果有帮助的话)。
请尝试这样的操作
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="#">
<h1>Text</h1>
<div class="input-wrapper">
<label for="name">Name</label>
<input type="text" name="Name" placeholder="Name" id="name">
</div>
<div class="input-wrapper">
<label for="email">Email</label>
<input type="text" name="Epost" placeholder="Email" id="email">
</div>
<button type="submit">Send</button>
</form>
</body>
</html>
添加一些 CSS 样式后,结果可能是这样的: https://codepen.io/anon/pen/QobvQL?editors=1100