Cm0ua
Cm0ua

Reputation: 1

Footer with text on the left and text centered

I am trying to create a footer with text on the left and text in the center (relative to the window's width).

For now, I have a footer with two divs with width 50% and text align left. Unfortunately, the text in the second div is not perfectly centered relative to the whole footer.

The solution is probably obvious, but I can't seem to find it.

Upvotes: 0

Views: 55

Answers (1)

Ole Haugset
Ole Haugset

Reputation: 3797

This should do the trick:

<div id="footer">
    <span class="left">
        Left
    </span>
    Center
</div>

<style>
    #footer {
        width:100%;
        text-align:center;
    }
    .left {
        float:left;
    }   
</style>

See fiddle: http://jsfiddle.net/y8g3j7qx/

Upvotes: 2

Related Questions