两个圆形边框连续?

时间:2013-01-04 22:40:28

标签: css css3

<style>
#firstname
{
border: 2px solid #3b5998;
padding: 10px 40px;
width: 100px;
background: #daf0ff;

}
</style>
</head>
<body>

<p id="firstname">This is a box,This is a box,This is a box,This is a box,This is a box, </p><p id="firstname">This is a box,This is a box,This is a box,This is a box,This is a box,</p>

在bowser上查看后,它显示了不同行中的框....如何将它们放在同一行?

1 个答案:

答案 0 :(得分:1)

float: left标记上使用display: inline-block<p />

<强>解释
您在这里使用块元素(<p />)。它们将始终强制换行,除非你浮动它们。您可以使用内联元素(例如<span/>)并排显示它们,但这会打破padding。因此float或{us}混合display: inline-block