سؤال

I had to apply a clearfix to my list items in order for a border to wrap around my floats, but once I added the clearfix, it caused a wordwrap I had applied to the list to stop working and now long URLs extend the div into other divs.

If anyone could help with this issue, it would be greatly appreciated. The issue can be viewed here: http://www.noellesnotes.com (Tweets section of the footer).

Here;s the relevant code:

HTML

<div id="tweets">
    <ul>
        <li class="clearfix">
            <p class="tweet">The tweet.</p>
            <p class="timePosted">TIME</p>
            <p class="interact">INTERACT LINKS</p>
        </li>
    </ul>
</div>

CSS

.tweet, .tweet a, .tweet span, .interact a{
    margin-bottom: 10px;
    font-size: 12px;
    font-family: 'Open Sans', sans-serif, Georgia, sans-serif;
    word-wrap:break-word;
}

.timePosted{
    width:40%;
    font-size: 12px;
    float: left;
    font-weight: bold;
    text-align: left;
}

.interact{
    width:60%;
    font-size: 12px;
    float: left;
    text-align: right;
    overflow: hidden;
}

.interact a{
    margin-right: 3px;
    text-decoration: underline;
    font-family: 'Arvo', Georgia;
}

#tweets ul{
    margin-left: 0;
    padding-left: 0;
    list-style: none;
}

#tweets ul li{
    border: 3px solid rgba(255,255,255,0.4);
    margin: 3px 0;
    padding: 3px;
}

.clearfix:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

.clearfix {   /* for IE/Mac */
    display: inline-block;
}
هل كانت مفيدة؟

المحلول

Adding:

#tweets ul li { width: 100%; }

Solved the issue for me :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top