将<p> </ p> HTML中心与图片对齐

特殊情况代理

VA网站

我有一段用HTML编写的网站文章

如何与图像对齐(对齐居中)?

#main__img {
    text-align: center;
    height: 80%;
    width: 80%;
}

.main__content p {
    margin-top: 1rem;
    font-size: 1rem;
    text-align: justify;
    font-weight: 400;
}
<img id="#main__img" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb3FlgJlyfSfAyDxdt6bGxrG4fOxz2sIEOog&usqp=CAU" />

<div class="main__content">
<p> Visualizing Abolition maps the suppression of the African slave trade by tracing nearly 31,000 records of correspondence exchanged between the British Foreign Office and British commissioners, ministers, naval officers, and representatives of foreign governments around the world over the course of the nineteenth century. It provides users with three resources. First, a database that lists the names of the senders, recipients, places of origin and destination, dates, as well as the subject of the letters when available. Second, essays exploring different topics related to the suppression of the traffic. Finally, a gallery of images that provides visual context for the information available on the website. These resources allow students and researchers to further understand the history of the suppression of the African slave trade and expand our knowledge of the largest coerced migration in history. </p>
</div>

加夫格里夫

正确的HTML工具是figure element-具有显示元素(通常是图像-但可以是任何东西)和figcaption,通常是图形元素的第一个或最后一个子元素。figcaption包含与图像有关的文本。

该图用于将视觉元素与描述或相关文本进行整理,并且所有部分都可以设置样式。在这种情况下-就像在text元素上应用text-align:center以及margin:0一样简单,它会自动在页面中居中。得到您想要的stylnig。

figure  {
    width: 80%;
    margin: 0 auto;
    text-align: center
}


figcaption {
    margin-top: 1rem;
    font-size: 1rem;
    text-align: justify;
    font-weight: 400;
}
<figure>
  <img id="#main__img" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb3FlgJlyfSfAyDxdt6bGxrG4fOxz2sIEOog&usqp=CAU" />
  <figcaption>
    <p> Visualizing Abolition maps the suppression of the African slave trade by tracing nearly 31,000 records of correspondence exchanged between the British Foreign Office and British commissioners, ministers, naval officers, and representatives of foreign governments around the world over the course of the nineteenth century. It provides users with three resources. First, a database that lists the names of the senders, recipients, places of origin and destination, dates, as well as the subject of the letters when available. Second, essays exploring different topics related to the suppression of the traffic. Finally, a gallery of images that provides visual context for the information available on the website. These resources allow students and researchers to further understand the history of the suppression of the African slave trade and expand our knowledge of the largest coerced migration in history. </p>
  </figcaption>
<figure>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

将p:graphicImage对齐到p:column的中心

来自分类Dev

将p图表在p面板内部居中对齐

来自分类Dev

将div与这些div外部的p对齐

来自分类Dev

将 p 标签对齐到 div 的长度

来自分类Dev

css将p标签的某些项平均对齐

来自分类Dev

在表列(<p:panelGrid>)中将<p:selectOneMenu>与<p:outputLabel>水平对齐

来自分类Dev

无法将<p>的内部HTML更改为LocaleDateString()

来自分类Dev

将数据从Python传递到HTML <p>标签

来自分类Dev

如何使用sed将'<p>'替换为'<p> \ n',并将'</ p>'替换为'\ n </ p>'?

来自分类Dev

将<p>插入div Jquery

来自分类Dev

将<p>更改为<table>

来自分类Dev

HTML/CSS 如何将 div 与 4 个文本框对齐,包括 h1、p 和 pictrues

来自分类Dev

将<p:tooltip>设置为<p:schedule> primefaces的模型

来自分类Dev

Use of <p> tag in html

来自分类Dev

<p>初始-HTML

来自分类Dev

如何将视频格式(360p,480p,720p等)添加到HTML 5视频播放器?

来自分类Dev

HTACCESS将website / product.html?productid = P01重写为website / product / P01

来自分类Dev

位置<p>不能正确对齐

来自分类Dev

将HTML输入值传递给javascript函数,然后将JS结果输出到<p> HTML

来自分类Dev

换行后<br> <p>内的<p>内的文本将忽略<p>标记的css(如果还存在标题)

来自分类Dev

将两个<p>元素对齐在同一行中

来自分类Dev

当文本居中对齐时,将<a>和<p>放在一行中

来自分类Dev

将两个<p>元素对齐在同一行中

来自分类Dev

将Img标签与每个图像下方的p标签并排对齐-CSS

来自分类Dev

在<div>内将<p>右对齐而不使用浮点数

来自分类Dev

内容动态时,如何将<p>对齐到<div>或<td>中?

来自分类Dev

将.cer转换为.p12

来自分类Dev

Primefaces p:panelGrid将注释作为组件

来自分类Dev

将<p:menubar> CSS更改为RTL

Related 相关文章

  1. 1

    将p:graphicImage对齐到p:column的中心

  2. 2

    将p图表在p面板内部居中对齐

  3. 3

    将div与这些div外部的p对齐

  4. 4

    将 p 标签对齐到 div 的长度

  5. 5

    css将p标签的某些项平均对齐

  6. 6

    在表列(<p:panelGrid>)中将<p:selectOneMenu>与<p:outputLabel>水平对齐

  7. 7

    无法将<p>的内部HTML更改为LocaleDateString()

  8. 8

    将数据从Python传递到HTML <p>标签

  9. 9

    如何使用sed将'<p>'替换为'<p> \ n',并将'</ p>'替换为'\ n </ p>'?

  10. 10

    将<p>插入div Jquery

  11. 11

    将<p>更改为<table>

  12. 12

    HTML/CSS 如何将 div 与 4 个文本框对齐,包括 h1、p 和 pictrues

  13. 13

    将<p:tooltip>设置为<p:schedule> primefaces的模型

  14. 14

    Use of <p> tag in html

  15. 15

    <p>初始-HTML

  16. 16

    如何将视频格式(360p,480p,720p等)添加到HTML 5视频播放器?

  17. 17

    HTACCESS将website / product.html?productid = P01重写为website / product / P01

  18. 18

    位置<p>不能正确对齐

  19. 19

    将HTML输入值传递给javascript函数,然后将JS结果输出到<p> HTML

  20. 20

    换行后<br> <p>内的<p>内的文本将忽略<p>标记的css(如果还存在标题)

  21. 21

    将两个<p>元素对齐在同一行中

  22. 22

    当文本居中对齐时,将<a>和<p>放在一行中

  23. 23

    将两个<p>元素对齐在同一行中

  24. 24

    将Img标签与每个图像下方的p标签并排对齐-CSS

  25. 25

    在<div>内将<p>右对齐而不使用浮点数

  26. 26

    内容动态时,如何将<p>对齐到<div>或<td>中?

  27. 27

    将.cer转换为.p12

  28. 28

    Primefaces p:panelGrid将注释作为组件

  29. 29

    将<p:menubar> CSS更改为RTL

热门标签

归档