我的 CSS:
body
{
font-family:verdana;
line-height:1.5em;
color:#666;
font-size:0.8em;
}
.objectAttributesOuter
{
border: 1px solid #999;
padding:6px;
margin:6px;
background-color:#EDEEFA
}
.objectAttributes
{
padding: 5px, 0px, 5px, 5px;
}
.whiteBoxWithBorder
{
padding:5px;
margin-right:5px;
background-color:#fff;
border: solid 1px #ccc;
float:left;
}
我的 HTML:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1">
<Title>Details</Title>
<link rel = "stylesheet" href="css.css" type = "text/css" />
</HEAD>
<BODY>
<div class = "objectAttributesOuter">
<div class="objectAttributes">
<div class="whiteBoxWithBorder">
GetType()
</div>
<div class="whiteBoxWithBorder">
Returns the type ...
</div>
</div>
</div>
</BODY>
</HTML>
理想的渲染是在“objectAttributesOuter”内渲染“whiteBox”,但您可以看到它重叠。如果我删除浮动标签,则 2 个 div 会在 whiteBox 内呈现,但不会并排显示。
有什么想法可以让它们在“objectAttributesOuter”标签中并排显示吗?