二小1号 2018-03-01 03:23 采纳率: 50%
浏览 5076
已采纳

webstorm打开的html页面与本地打开的同一个html样式显示不一样

同样的一个页面,使用webstorm自带的服务器打开,和在本地打开后显示的样式不一样
不知道是什么原因,请大神指点。

原代码:

 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        .father {
            width: 1000px;
            height: 560px;
            margin: 0 auto;
            background: url(images/ui.png) no-repeat top center;
            position: relative;
        }
        .son {
            width: 150px;
            height: 30px;
            background: pink;
            position: absolute;
            bottom: 10px;
            left: 50%;/*1000*50%*/
            margin-left: -75px;
            /*right: 75px;*/
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son"></div>
    </div>
</body>
</html>

图片说明

图片说明

图片说明

图片说明

同样的html文件,打开后的样子就是不一样,大小不一样。

  • 写回答

6条回答 默认 最新

  • 牛坛子 2018-03-01 03:25
    关注

    你的比例不一样,你将webstom比例调试成chrom一样的宽度比例就是一样的了。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?