【问题标题】:Customize Entry title [closed]自定义条目标题[关闭]
【发布时间】:2014-10-04 20:07:01
【问题描述】:

好吧,我在玩 CSS,但我想做一些我想做的事情,但我做不到;我不知道该怎么做。见,this is the website I'm testing。如果您看到条目标题,它们有黑色背景。但是我想让这个背景占据整个空间,像这样:See the photo.

我需要什么代码?

【问题讨论】:

    标签: html css title


    【解决方案1】:

    这应该可以解决问题: 负边距放大黑框,填充保持文本回到原来的位置。

    这样做有点脏,但这是最短的解决方案。

    只需将其添加到 CSS 代码的末尾即可:

    #contentmiddle div.title > h1{
      margin-left: -40px;
      margin-right: -40px;
      margin-top: -40px;
      padding: 50px;
      padding-bottom: 30px;
    }
    

    或者更短的:

    #contentmiddle div.title > h1{
      margin: -40px;
      padding: 50px;
      margin-bottom: 20px;
      padding-bottom: 30px;
    }
    

    【讨论】:

    • 你是个天才!效果很好,你不知道我是怎么感谢你的!
    • 很高兴我能帮上忙。接受正确答案怎么样? :>
    猜你喜欢
    • 1970-01-01
    • 2018-01-23
    • 1970-01-01
    • 2013-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多