我从来没有使用过百分比布局。当然,我已经研究过它们,但没有任何练习。所以,我要求大家看到我的布局的截图并告诉我:我怎样才能以不同的百分比条件显示相同的布局,并且最终不会丢失任何布局质量?我的意思是,没有div的叠加和空格。动态宽度使用百分比
正如你看到的,我的布局“R确定。但是,在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>
请创建一个jsfiddle;这将使它更容易帮助。 –
你想要什么_less spacing_或_more spacing_?我的意思是哪一个是正确的? – Asif
@AaronDigulla:如你所愿。等一下。 + Asif:我需要我的图层之间有相同的间距。我可以用像素来做到这一点,但我无法使用它们。我想要的正确方式是1024x768像素分辨率。 –