网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 大图片根据分辨率自适应宽度仍居中显示
范文
    问题:一个1920*900的大图,在1024*768的分辨率只能显示一部分,希望仍居中显示
    解决方案css:
    代码如下:
    width: 100%;
    background-position: 50% 50%;
    示例code:
    代码如下:
    <style>
    body {
    background-repeat: no-repeat;
    width: 100%;
    background-position-x: 50%;
    background-position-y: 118px;
    background-image:url(@url.image(/xxx/xx.jpg));
    }
    .book {
    margin: 0 auto;
    width: 960px;
    height: 700px;
    position: relative;
    }
    </style>
    代码如下:
    <div class=book></div>
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/18 8:28:19