【问题标题】:Image not centered on website, centered on mobile device图片不以网站为中心,以移动设备为中心
【发布时间】:2017-04-20 00:31:00
【问题描述】:

我正在为比赛做一些事情,代码必须在移动设备上可用。我现在有代码,但图像不在网站上。在移动设备上,图像居中。 如果我们尝试在网站上居中显示图像,则图像在移动设备上会被截断。


<div style = "margin-left: 12.5%; display: block;">
    <img src = "images/Files for contact page/FINAL.png" alt="" usemap="#map" />
    <map name = "map">
        <area shape = "circle" coords="682, 392, 70" href = "https://apprentices-flynboy.c9users.io/forum" />
        <area shape = "circle" coords="338, 389, 70" href = "https://apprentices-flynboy.c9users.io/forum" />
        <area shape = "circle" coords="831, 164, 70" href = "https://apprentices-flynboy.c9users.io/forum" />
        <area shape = "circle" coords="510, 163, 70" href = "https://apprentices-flynboy.c9users.io/forum" />
        <area shape = "circle" coords="199, 173, 70" href = "https://apprentices-flynboy.c9users.io/forum" />
    </map>
  </div>

我很抱歉我的格式很糟糕。我以前从未使用过这个网站,所以我正在努力学习!

【问题讨论】:

    标签: image formatting size center


    【解决方案1】:

    我承认这是一个可怕的答案,因为我认为 center 已被弃用。

    但我觉得我一直都遇到这些问题,而始终有效的一件事是&lt;center&gt;。您也可以尝试将您的图片移出您的区块。

    <center>
    img
    </center>
    

    自从我每天都做 html 以来已经有好几年了,但它值得一试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-21
      • 1970-01-01
      相关资源
      最近更新 更多