Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.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/33.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 CSS:如何保持图像不被修改;抵销;总是_Html_Css_Image - Fatal编程技术网

Html CSS:如何保持图像不被修改;抵销;总是

Html CSS:如何保持图像不被修改;抵销;总是,html,css,image,Html,Css,Image,这就是你得到的: 问题是,当您调整窗口大小时,图像也会调整大小,这会造成两件不好的事情: 徽标不再正确对齐 整个徽标更小或更高 像这样: 我在谷歌上没有找到解决方案:图像没有调整大小,具有固定偏移量,不是背景图像,而是标记img在HTML中设置图像的实际值,如下所示: <img src="/static/img/footer-top.png" style="margin: 0; padding: 0; width: 100%; position: relative; l

这就是你得到的:

问题是,当您调整窗口大小时,图像也会调整大小,这会造成两件不好的事情:

  • 徽标不再正确对齐
  • 整个徽标更小或更高
像这样:


我在谷歌上没有找到解决方案:图像没有调整大小,具有固定偏移量不是
背景图像
,而是标记
img
在HTML中设置图像的实际值,如下所示:

<img src="/static/img/footer-top.png" 
     style="margin: 0; padding: 0; width: 100%; position: relative; left: 0">

<footer id="footer" style="background-color: #214269; height: 100%">
    <div class="footerrow">
        <div class="container">
            <div class="col-lg-12">
                <div class="footer-box">
                    <ul class="footer-links">
                        <li class="active"><a href="/fr/legal/a-propos/">À propos</a></li>
                        <li><a href="/fr/legal/contact/">Contact</a></li>
                        <!-- blabla -->
                    </ul>
                </div>
            </div>
        </div>
    </div>
</footer>

主页关于画廊联系人


不要在img标签中使用
宽度:100%
非常感谢你,我想我永远也不会正确使用CSS。。。。我已经根据我的需要更新了你的代码:你会得到它的!我仍在学习自己,大多数时候我感觉自己在摸索着破解代码,直到找到合适的东西。随着我的破解,代码变得更加高效。别担心弄得一团糟。下面是另一个快速示例,如果您希望在不使用位置属性的情况下将图像保持在主菜单按钮的正上方:
<img class="vanish" src="images/colours.png" alt="Colourful painting" width="480" height="615">