【发布时间】:2015-05-03 13:24:29
【问题描述】:
我正在学习使用 Bootstrap,但对页脚和引用元素有点困惑。具体来说,我想知道是否可以(或建议)在块引用之外使用它们。 (我看了看这些线程—— Valid use of <q>, <blockquote> and <cite> Correct use of Blockquote, q and cite?)
我正在开发一系列包含图像和/或文本的浮动 div。在下面的第一个示例中,我将文本插入到具有“Caption”类的 div 中。文本包含一个引用标签。
除了我用页脚替换了 div.Caption 之外,第二个示例是相同的。您可以看到工作示例@http://jsfiddle.net/cp0fwqbx/3/(但是,我无法链接到 Bootstrap 的 CSS 页面,因此 pull-left 和 pull-right 类显然不起作用。)
我猜测以下两种方法都可以,但我想知道其中一种方法是否比另一种方法具有明显优势。还是应该只使用页脚并引用带有块引号的元素?
HTML
<div class="Shadow pull-left Wx250">
<div class="Img"><img src="http://www.politix.us/images/home/header.gif" alt="Politix Header">
<div class="Caption">Politix Header <cite>courtesy <a href="http://www.geobop.com" title="Geobop">Geobop</a></cite></div>
</div>
</div>
<br style="clear: both;">
<div class="Shadow pull-right Wx250">
<div class="Img"><img src="http://www.politix.us/images/home/header.gif" alt="Politix Header">
<footer>Politix Header <cite>courtesy <a href="http://www.geobop.com" title="Geobop">Geobop</a></cite></footer>
</div>
</div>
CSS
body { font-family: Arial, Verdana, sans-serif; }
.Shadow.pull-right { margin-left: 30px; }
.Shadow.pull-left { margin-right: 30px; }
.Shadow .Txt, .Shadow .Img { position: relative; bottom: 15px; left: 15px; }
.Shadow.pull-left, .Shadow.pull-right { margin-top: 25px; }
.Shadow { background: #ccc; }
.Img .Txt, .Img .Caption, .Img footer { padding: 5px 15px; background: #fff; border: none; border-bottom: 1px dotted #000; }
img { width: 100%; }
.Wx250 { width: 250px; }
【问题讨论】:
标签: css twitter-bootstrap