【问题标题】:Getting rid of margins?摆脱利润空间?
【发布时间】:2017-03-03 02:38:53
【问题描述】:

所以我正在为一个朋友的艺术网站期刊编码,而我的一部分代码并没有去掉一些边距/填充,我担心这些边距/填充可能是主要网站在正文中编码的一部分,或者一些东西,所以这将是我需要手动覆盖的东西。 This is what I am working on. 那个杂志皮肤。底部的岩石应该与日志的边缘齐平,但无论我尝试什么,它们都不会做我想要的。

这是我目前掌握的编码,数量不多:

<div class="body">
    <div class="header"></div>
        <div class="contentholder"></div><div class="rockfooter"></div>  
</div>

还有:

.gr-body {
background: url(http://orig14.deviantart.net/8b57/f/2016/279/f/5/frontpagebackground_by_wulfghast-dak5apt.jpg);
background-size: 100%;
background-repeat: no-repeat;
background-color: #1c1119;
color: #545454; }

.header {
background-image: url(http://s10.postimg.org/bvl7xjjbd/branchborder.png);
background-position: top center;
background-repeat: no-repeat;
background-size: contain;
 margin-left: auto;
margin-right: auto;
margin-top: 20%;
position: relative;
z-index: 2;
height: 873px;
width: 74%;
display: block; }

.contentholder {
width: 68%;
margin-left: auto;
margin-right: auto;
margin-top: -800px;
-moz-box-shadow: 0 0 20px 5px #0a0a0a;
-webkit-box-shadow: 0 0 20px 5px #0a0a0a;
box-shadow: 0 0 20px 5px #0a0a0a;
background-color: #50463b;
position: relative;
z-index: 1;
display: block; }

.rockfooter {
background: url(http://s17.postimg.org/is79jxd3z/footer3_by_wulfghast_dakd92b_1.png);
height: 1000px;
width: 100%;
background-position: bottom;
background-repeat: no-repeat;
background-size: contain;
margin-left: auto;
margin-right: auto;
margin-top: -985px;
position: relative;
z-index: 4; }

.bottom {
display: none; }

【问题讨论】:

    标签: html css padding margins skin


    【解决方案1】:

    在您分享的特定页面上,您的摇滚

    <div class=body>
    

    在一个

    里面
    <div class=text>
    

    周围有填充物。

    看看你是否无法摆脱那个填充物,它会让它与侧面齐平。

    【讨论】:

    • 这是真的......您可能想要添加解决方案“.text{padding: 0px;}”作为 OP 尝试的答案
    • 这看起来有效!我什至从未想过通过我的浏览器检查它。谢谢!
    • 没问题!永远记得先通过浏览器检查,你会经常发现一些你没想到的奇怪的东西!
    【解决方案2】:

    您可以使用以下方法重置一般定义:

    * {
      box-sizing: border-box;
      margin: 0;
      vertical-align: baseline;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-14
      • 1970-01-01
      相关资源
      最近更新 更多