我从未使用过百分比布局。当然,我已经研究过它们,但没有任何练习。所以,我请大家看看我的布局截图并告诉我:我怎样才能在不同的百分比条件下显示相同的布局,并且最终不损失任何布局质量?我的意思是,没有 div 的叠加和空格。
如您所见,我的布局还可以。但是,在 1024x768 中,我们有一点间距。另一方面,在 1920x1080 中,我们已经超出了层之间的空间。我正在使用 CSS 来做到这一点。看:
section#FeedDeck {
width: 100%;
height: 100%;
float: left;
}
.FeedContainer {
width: 100%;
float: left;
padding-bottom: 25px;
border-bottom: 1px solid #b9b9b9;
}
.LeftFeedSide {
width: 10%;
float: left;
}
.CenterFeedSide {
width: 80%;
float: left;
}
.RightFeedSide {
width: 10%;
float: right;
text-align: right;
font-size: 12px;
}
.RightFeedSide a {
width: 100%;
float: left;
}
我的 HTML:
<section id="FeedDeck">
<div class="FeedContainer">
<div class="LeftFeedSide">
<img src="60x60.jpg" alt="" />
</div>
<div class="CenterFeedSide">
<header id="FeedContent">
<h1>Anne Hathaway</h1>
<h4>Diretora de Design</h4>
</header>
<p>
Can you fix a broken drug company research lab?
</p>
<p>
Jack Scannell, the European pharmaceuticals analyst at
Sanford C. Bernstein, recently held a conference on the future
of drug research and development. On the last day, he had representatives
from two of the most successful drug development organizations on the planet:
Sean Bohen, who heads early resaerch and development at Genentech, part of Roche,
which has had a legendary string of cancer drug successes; and Mads Krogsgaard Thomsen,
the chief scientific officer at Novo Nordisk, one of the dominant players in diabetes and
the best-performing big pharma stock over the past decade. This story is based on a transcript
of their talks.
</p>
</div>
<div class="RightFeedSide">
<a href="#">#1</a>
<span>há um minuto atrás</span>
</div>
</div>
</section>