我正在学习HTML和CSS,并且我生成了有关float
属性的此代码。HTML浮动属性并排
\t
body {
width: 750px;
font-family: Arial, Verdana, sans-serif;
color: #665544;
}
p {
width: 230px;
float: left;
margin: 5px;
padding: 5px;
background-color: #efefef;
}
<!DOCTYPE html>
<html>
\t <head>
\t \t <title>Using Float to Place Elements Side-by-Side</title>
\t </head>
\t <body>
\t \t <h1>The Evolution of the Bicycle</h1>
\t \t <p id="one">In 1817 Baron von Drais invented a walking machine that would help him get around the royal gardens faster.</p>
\t \t <p id="two">The device know as the Draisienne (or "hobby horse") was made of wood, and propelled by pushing your feed on the ground in a gliding movement.</p>
\t \t <p id="three">It was not seen a suitable for any place other than a well maintained pathway. </p>
\t \t <p id="four">In 1865, the velocipede (meaning "fast foot") attached pedals to the front wheel, but its wooden structure made it extremely uncomfortable. </p>
\t \t <p id="five">In 1870 the first all-metal machine appeared. The pedals were attached directly to the front wheel.
\t \t <p id="six">Solid rubber tires and the long spokes of the large front wheel provided a much smoother ride than its predecessor.</p>
\t </body>
</html>
现在,我的问题是这样的 -
为什么第四段id="four"
下第三段id="three"
而不是移动到左侧边缘来了吗?
因为他们是 “浮动” 和第4单元有足够的空间,以左浮动... – Dekel