【发布时间】:2017-04-30 19:08:50
【问题描述】:
我知道以前有人问过这个问题,但我找不到任何对我有帮助的东西。我使用'table'和'inline'来对齐我的输入框无济于事。我知道我用错了,我只是不确定在哪里。
HTML5 代码
<!DOCTYPE>
<html lang = 'en'>
<head>
<meta charset = 'UTF-8'/>
<script src = 'ABS.js'></script>
<link rel = 'stylesheet' href = 'ABS.css'/>
<h1> Adventure Booking System </h1>
<h3> Student Name: Kyle Sharp - ID: 101604364 </h3>
</head>
<body>
<div class = 'alignline'>
<p class = 'left'> Enter Customer Name </p><input type = 'text' id = 'custname'/> <br />
<p class = 'left'> Enter Adventure Code </p><input type = 'text' id = 'advcode'/> <br />
<p class = 'left'> Enter Lunch Code </p><input type = 'text' id = 'lunchcode'/> <br />
<p class = 'left'> Enter No. of people </p><input type = 'text' id = 'nopeople'/> <br />
<p class = 'left'> Enter Seller ID </p><input type = 'text' id = 'sellerid'/> <br />
</div>
<button type = 'button' onclick = 'displayAdvOptions()'> Show Adventure Options and Prices </button> <br />
<button type = 'button' onclick = 'displayLunchOptions()'> Show Lunch Options and Prices </button> <br />
<button type = 'button' onclick 'validateAndCalc()'> Validate data and calculate total </button> <br />
<p id = 'msg1'></p>
<p id = 'msg2'></p>
<p id = 'msg3'></p>
<p id = 'msg3'></p>
</body>
</html>
CSS 代码
body {
background-color: Yellow;
display: table;
}
h1 {
color: blue;
font-family: Impact, Charcoal, sans-serif;
}
h3 {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}
.left {
color: purple;
font-family: Tahoma, Geneva, sans-serif;
font-weight: bold;
}
.alignline p{
display: inline;
}
button {
margin-top: 10px;
}
原谅可怕的调色板
【问题讨论】: