Html 段落中的独立文本设置
我有下面的段落与图像的一面,我需要一个“figcaption”在每个图像。我需要设置独立设置的“figcaption”文本。我该怎么做 此外,我不确定figcaption标记是否正确用于我的HTML:Html 段落中的独立文本设置,html,css,Html,Css,我有下面的段落与图像的一面,我需要一个“figcaption”在每个图像。我需要设置独立设置的“figcaption”文本。我该怎么做 此外,我不确定figcaption标记是否正确用于我的HTML: <p><figure><span class="image right"><img src="images/scania_old.jpg" alt="Stoptrans first truck" /><figcaption>Stoptra
<p><figure><span class="image right"><img src="images/scania_old.jpg" alt="Stoptrans first truck" /><figcaption>Stoptrans first truck in the 80's</figcaption></span></figure>Vestibulum ultrices risus velit, sit amet.</p>
我需要我的figcaption使用此设置:
.image.right {
float: right;
margin: 0 0 1em 1.5em;
top: 0.25em;
}
.image.left {
float: left;
margin: 0 1.5em 1em 0;
top: 0.25em;
}
font-size: 75%;
font-style: italic;
text-align: center;
通过将样式应用于figcaption类型标记或在html中赋予它class属性,可以像对待任何其他标记一样对待figcaption标记 将样式应用于figcaption:
figcaption {
font-size: 75%;
font-style: italic;
text-align: center;
}
使用类属性:
<figcaption class="example">Stoptrans first truck in the 80's</figcaption>
.example {
font-size: 75%;
font-style: italic;
text-align: center;
}
Stoptrans是80年代的第一辆卡车
.举例{
字体大小:75%;
字体:斜体;
文本对齐:居中;
}