【发布时间】:2015-09-06 04:39:40
【问题描述】:
我想将粗体格式应用于图 1、图 2、...直到 图 111。
我只能更改 HTML 和 CSS,并且需要在不使用 JavaScript 或 jQuery 的情况下执行此操作。除了在 HTML 中添加<strong> 之外还有什么办法吗?
CSS 中有::first letter,但没有::first word。我可以在 CSS 中使用 ~like %figure 吗?
<p>Figure 3 All incidences of ...</p>
<div id="imgcontainer" style="height: auto;">
<p><img src="Images/misc/newsletters/msIssue7_monoAnti4_850x550.png" style="margin-bottom: 10px;" /></p>
<p>Figure 4 ...</p>
</div>
<div id="imgcontainer" style="height: auto;">
<p><img src="Images/misc/newsletters/msIssue7_monoAnti5_350x370.png" style="float: left; width: 450px; margin: 8px 20px 8px 0px;" /></p>
<p>Figure 5 Sequence information obtained from MS/MS analysis of capillary electrophoresis ...</p>
</div>
<p><img src="Images/misc/newsletters/msIssue7_monoAnti6_850x350.png" style="width: 850px; height: 200px; margin: 8px 8px 8px 0px;" /></p>
<p>Figure 6 Separation of ...</p>
【问题讨论】:
-
如果您希望文本“Figure x”比周围的文本更具影响力,或者您希望,例如,当您通过语音合成器运行网站时,它们的发音会更响亮,那么您将使用
<strong>。否则,使用< span>s 和样式会更好。 -
鉴于您可以更改 HTML + CSS 并且似乎不愿意添加额外的标签和样式,您可以使用类似this fiddle 的东西来自动生成文本并设置它的样式。如果您想使用这种方法,我会添加答案并进行解释。
-
@Harry 哦,这很好。我会赞成。
-
@MrLister:谢谢伙计。我添加了一个答案,因为它可能对其他用户也有帮助:)
标签: html css figure css-counter