Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 段落中的独立文本设置_Html_Css - Fatal编程技术网

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

我有下面的段落与图像的一面,我需要一个“figcaption”在每个图像。我需要设置独立设置的“figcaption”文本。我该怎么做

此外,我不确定figcaption标记是否正确用于我的HTML:

<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%;
字体:斜体;
文本对齐:居中;
}