如何阻止此 CSS 横幅在重复时溢出?

发布于 2024-11-10 04:51:16 字数 3060 浏览 3 评论 0原文

在此页面上,我构建了一个 CSS Ribbon 标题,其中在后台设置了文本/图标。

这些集合将在页面上复制,横幅仅在一组上完美运行,但在我尝试在背景正下方创建一个 div 后,覆盖了整个部分。

HTML:

<div>


<p class="paddingbottom"><span class="bold">WHO ARE THEY? </span> Deborah is an active member of Golden Seeds a nation-wide angel investor network that provides early stage and growth capital to women-led and women-owned companies across all sectors.  During summer 2010, Jamie interned for Golden Seeds and learned how entrepreneurial ventures are funded in a collaborative environment where women’s potential for economic growth is actualized.</p>

<p>.If you are an accredited investor interested in joining Golden Seeds, please click here.</p>
</div>

</div>
<div class="clear"></div>


<div>
<p class="headerorg"><span class="shiftorg">Golden Seed </span> <span class="right"><span class="whitetitle">Website:  <a href="http://www.goldenseeds.com/">goldenseeds.com</a></span><a href="#"><img src="" alt="facebook"/></a><a href="#"><img src="http://jumpthru.net/newsite/wp-content/themes/twentyten/images/other/twitter.png" alt="twitter"/></a></span></p>


<img src="" />
<div class="leftcolorg">

<p class="paddingbottom"><span class="bold">WHO ARE THEY? </span> Deborah is an active member of Golden Seeds a nation-wide angel investor network that provides early stage and growth capital to women-led and women-owned companies across all sectors.  During summer 2010, Jamie interned for Golden Seeds and learned how entrepreneurial ventures are funded in a collaborative environment where women’s potential for economic growth is actualized.</p>

<p>WHY ARE THEY IN OUR NETWORK?JumpThru collaborates with Golden Seeds to help increase the number of women-led tech companies that get the support and funding they need to grow.  Advise on tech deals, collaborate on educational programming.If you are an entrepreneur seeking funding, please click here for the application to Golden Seeds’ program. 

If you are an accredited investor interested in joining Golden Seeds, please click here.</p>
</div>

</div>
<div class="clear"></div>

CSS:

.headerorg {
        position: relative;
        color: #fff;
        font-style:italic;
        text-transform:uppercase;
        margin: 0 0 20px -15px;
        padding: 1px 0 2px;
        background: #ff9900;
        }


.headerorg a {
    color:#FFF;
}


.headerorg:before
    {
        content: '';
        position: absolute;
        border-style: solid;
        border-color: transparent;
        bottom: -8px;
    }

.headerorg:before
    {
        border-width: 0 10px 10px 0;
        border-right-color: #8b5f1d;
        left: 0;
    }


.shiftorg {
    padding-left: 15px;
    background-position: 5px 50%;
    background-image: url();
    background-repeat:no-repeat;
}

On this page, I've built a CSS Ribbon header that has text/ icons set in the background.

The sets will be duplicated down the page, The banner works perfect on just one set, but after I try to create a div exactly below the background covers the entire section.

The HTML:

<div>


<p class="paddingbottom"><span class="bold">WHO ARE THEY? </span> Deborah is an active member of Golden Seeds a nation-wide angel investor network that provides early stage and growth capital to women-led and women-owned companies across all sectors.  During summer 2010, Jamie interned for Golden Seeds and learned how entrepreneurial ventures are funded in a collaborative environment where women’s potential for economic growth is actualized.</p>

<p>.If you are an accredited investor interested in joining Golden Seeds, please click here.</p>
</div>

</div>
<div class="clear"></div>


<div>
<p class="headerorg"><span class="shiftorg">Golden Seed </span> <span class="right"><span class="whitetitle">Website:  <a href="http://www.goldenseeds.com/">goldenseeds.com</a></span><a href="#"><img src="" alt="facebook"/></a><a href="#"><img src="http://jumpthru.net/newsite/wp-content/themes/twentyten/images/other/twitter.png" alt="twitter"/></a></span></p>


<img src="" />
<div class="leftcolorg">

<p class="paddingbottom"><span class="bold">WHO ARE THEY? </span> Deborah is an active member of Golden Seeds a nation-wide angel investor network that provides early stage and growth capital to women-led and women-owned companies across all sectors.  During summer 2010, Jamie interned for Golden Seeds and learned how entrepreneurial ventures are funded in a collaborative environment where women’s potential for economic growth is actualized.</p>

<p>WHY ARE THEY IN OUR NETWORK?JumpThru collaborates with Golden Seeds to help increase the number of women-led tech companies that get the support and funding they need to grow.  Advise on tech deals, collaborate on educational programming.If you are an entrepreneur seeking funding, please click here for the application to Golden Seeds’ program. 

If you are an accredited investor interested in joining Golden Seeds, please click here.</p>
</div>

</div>
<div class="clear"></div>

The CSS:

.headerorg {
        position: relative;
        color: #fff;
        font-style:italic;
        text-transform:uppercase;
        margin: 0 0 20px -15px;
        padding: 1px 0 2px;
        background: #ff9900;
        }


.headerorg a {
    color:#FFF;
}


.headerorg:before
    {
        content: '';
        position: absolute;
        border-style: solid;
        border-color: transparent;
        bottom: -8px;
    }

.headerorg:before
    {
        border-width: 0 10px 10px 0;
        border-right-color: #8b5f1d;
        left: 0;
    }


.shiftorg {
    padding-left: 15px;
    background-position: 5px 50%;
    background-image: url();
    background-repeat:no-repeat;
}

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

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

发布评论

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

评论(2

仙女 2024-11-17 04:51:16

问题是你的浮动清理不起作用。

为了实现浮动清除,您可以使用以下方法:

<div class="clear"></div>

这是一种可靠的方法,虽然很原始。

问题出在你的CSS上(第321行,style.css):

.clear {
    :both;
}

应该是:

.clear {
    clear: both;
}

你显然对你的class感到困惑并且属性都被命名为clear

The problem is that your float clearing isn't working.

To achieve float clearing, you're using this:

<div class="clear"></div>

Which is a reliable, if primitive method.

The problem is with your CSS (line 321, style.css):

.clear {
    :both;
}

That should be:

.clear {
    clear: both;
}

You evidently got confused by the fact that your class and the property are both named clear.

帅气尐潴 2024-11-17 04:51:16

有一个

...。如果您删除 class 属性,它对我来说看起来不错。

There is a <p class="headerorg">.... If you remove the class attribute it looks good to me.

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