我目前在JSP工作,我想要并排放置两个大空盒子,但是盒子完全显示的唯一方法是它们中是否有字符。(即我目前有两个并排的大盒子,每个都有一个' a
此外,我希望我的标题能够自动在屏幕两侧显示它们,而不必手动添加填充:
<%@ page %>
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"></link>
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"></link>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style>
#header {
background-color:white;
color:black;
text-align:center;
padding:5px;
}
</style>
<style> #Container2 div { float: left; width: 800px; height: 575px; border: 3px solid black; } </style>
</head>
<body>
<div id="header">
<h1>1</h1>
</div>
<p>Please Choose an Object</p>
<select>
<option value="0" selected="selected">Select...</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<p></p>
<div id = "container" style = "width:100%">
<div id ="left" style = "float:left; width: 25%;">
<p>Please Choose an HTTP Request</p>
<select>
<option value="0" selected="selected">Select...</option>
<option value="GET">GET</option>
<option value="POST">POST</option>
<option value="PUT">PUT</option>
<option value="DELETE">DELETE</option>
</select>
</div>
<div id = "middle" style = "float:left; width: 50%;">
<p>Please Choose an ID</p>
<select>
</select>
</div>
<div id = "right" style = "float:left; width: 25%;">
<p>Please Choose a Type</p>
<select>
<option value="0" selected="selected">Select...</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
</div>
<p align="right">
<button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span> Submit</button>
</p>
<p></p>
<div id="Container2"> <div>a</div> <div>a</div> </div>
</body>
</html>
答案 0 :(得分:0)
首先,您可以将所有样式放在一个style
标记中,每次要为单个div /元素设置样式时,无需打开样式标记。
其次,您的 Container2 在每个textarea
中没有任何input
代码或div
代码。因此只有一个没有任何文本或textarea / input元素的空div,因此 div 仅用作容器,您可以将元素分组为多个部分,然后将样式应用于该div /部分。