边距/填充问题 - 中级 CSS 学生

发布于 2024-12-17 04:30:54 字数 772 浏览 2 评论 0原文

我试图弄清楚填充是否可以调整,这里

是 HTML:

<div id="branding">
     <h1>
    {block:IfHeaderImage}<a href="/"><img src="{image:Header}" alt="{Title}" /></a>    {/block:IfHeaderImage}

     {block:IfNotHeaderImage}<a href="/">{Title}</a>{/block:IfNotHeaderImage}
     </h1>
</div><!-- #branding -->

以及相关的 CSS:

#header #branding {
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    margin: 0 auto 3px;
    {block:IfNotHeaderImage}padding: 40px 0;{/block:IfNotHeaderImage}
    width: 900px;
}

我尝试过:添加高度属性并更改填充,但没有任何效果。这是在 Tumblr(此网站)中完成的,而且有点挑剔。

非常感谢任何帮助!

I'm trying to figure out if the padding is adjustable in this

Here's the HTML:

<div id="branding">
     <h1>
    {block:IfHeaderImage}<a href="/"><img src="{image:Header}" alt="{Title}" /></a>    {/block:IfHeaderImage}

     {block:IfNotHeaderImage}<a href="/">{Title}</a>{/block:IfNotHeaderImage}
     </h1>
</div><!-- #branding -->

And the associated CSS:

#header #branding {
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    margin: 0 auto 3px;
    {block:IfNotHeaderImage}padding: 40px 0;{/block:IfNotHeaderImage}
    width: 900px;
}

I tried: adding a height property and changing the padding, but nothing worked. This is being done in Tumblr (this site), and it has been a bit finicky.

Any help much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫七 2024-12-24 04:30:55

在 Chrome 中没问题。请参阅屏幕截图:http://cl.ly/3z2c3D18291K260s2D1K

It's fine in Chrome. See screenshot: http://cl.ly/3z2c3D18291K260s2D1K

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文