English 中文(简体)
CSS - 具有背景色彩而不是重复背景形象的土木?
原标题:CSS - Faux columns with background color instead of repeating background image?
  • 时间:2009-10-16 11:36:47
  •  标签:

贺词,

我有两栏(ated)布局,这些栏目需要“ook”,就像它们有对应的高度。 “蓝色”一栏有背景颜色,需要视其为与内容相适应的主要内容一栏相同的高度。

我知道,通过将重复的背景形象应用到两栏的包装上来,并清除以下两栏的浮标,执行这一布局相对比较容易。 这是否是实现影响的唯一途径,或者是否可以通过将背景颜色应用于“可怕”一栏而不使用重复形象来做到这一点?

问题回答

具有与你最短的浮小块相同的背景。

HTML

<div id="wrap">
   <div id="longerDiv"></div>
   <div id="shorterDiv"></div>
</div>

CSS

#longerDiv {
   background:#9c9;
}

#wrap {
   background:#99c;
}

#shorterDiv {
   background:#99c;
}

更晚,从来都不会。 这样做可能有助于:

The htmls

<div id="content"> 
    <div id="left"></div>
    <div id="right"></div>
</div>

c

#content { background-color: #F1EBD9; }
#left { float: left; width: 14em; }
#right { margin-left: 14em; background-color: #FFF; }

http://alexandergutierrez。

如果出现较短的栏目,则不能设定以百计的高度。

然而,如果绝对定位的话,可以将基于百分位的高度排在较短的栏目上,但如果能够用浮动布局来做到这一点,我则大为 cur。

1px高全球公域网将是零碎的,仅是编外栏。 试图做你重新描述的话,只是为了一头.子和浏览器的不一致。

为什么你想要避免编外栏?

如果你真的不喜欢使用图像(但不仅有可靠的有色背景形象?),你可以使用真正的技术:。 http://www.positioniseverything.net/articles/onetruelayout/





相关问题
热门标签