Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Sticky Footer Styling: Navigation Icons Alignment

I'm trying to style a sticky footer in CSS using bootstrap 3. I would like to have three icons in the footer that are centered. I cant figure out how to center these as Im using float: left and in-line block. I've tried setting the one div w the class="row" to include "center-block" and each individual icons.

    <div class="row center-block">
    <div class="footer">
        <div class="col-xs-12">
                    <div><a href="#" target="_top"><div class="prev_button"></div></a></div>
                <div><a href="#" target="_top"><div class="home_button"></div></a></div>
                <div><a href="#" target="_top"><div class="next_button"></div></a></div>
        </div>
    </div>
</div>
    ``` 

  ```css

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px;
  background-color: transparent;
}

.home_button, .prev_button, .next_button {
    width: 47px;
    height: 41px;
    background-position: center;
    background-repeat: no-repeat;
    float: left;
    display: inline-block;
    background-color: transparent;
    margin: 0 auto;

}

    /*  Normal & Hover States */
        .home_button {
            background-image:url(../img/home.hover.png);
                border-bottom:1px solid #C6C8CA;
                border-top:1px solid #C6C8CA;
        }

        .home_button:hover {
                background-image:url(../img/home.png);
                background-color: #E87511;
        }

        .prev_button {
                background-image:url(../img/prev.hover.png);
                border-bottom:1px solid #C6C8CA;
                border-top:1px solid #C6C8CA;
                border-left: 1px solid #c6c8ca;
                -webkit-border-top-left-radius: 5px;
                -webkit-border-top-right-radius: 0px;
                -webkit-border-bottom-right-radius: 0px;
                -webkit-border-bottom-left-radius: 5px;
        }

        .prev_button:hover {
                background-image:url(../img/prev.png);
                background-color: #E87511;
                -webkit-border-top-left-radius: 5px;
                -webkit-border-top-right-radius: 0px;
                -webkit-border-bottom-right-radius: 0px;
                -webkit-border-bottom-left-radius: 5px;
        }

        .next_button {
            background-image:url(../img/next.hover.png);
            border-bottom:1px solid #C6C8CA;
                border-top:1px solid #C6C8CA;
                border-right: 1px solid #c6c8ca;
                -webkit-border-top-right-radius: 5px;
                -webkit-border-bottom-right-radius: 5px;
        }

        .next_button:hover {
            background-image:url(../img/next.png);
                background-color: #E87511;
                    -webkit-border-top-right-radius: 5px;
            -webkit-border-bottom-right-radius: 5px;
        }
    ```

2 Answers

got it!

in case anyone is interested i just made it an unordered list and then added the below

            li {
  display: inline-block;
}

ul {
    list-style: none;
    text-align: center;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

.home_button, .prev_button, .next_button {
    width: 47px;
    height: 41px;
    background-position: center;
    background-repeat: no-repeat;
    display: inline-block;
    background-color: transparent;
    margin: 0 auto;

}

            ```

If you add these rules to your styles, I believe you will get the result you are looking for.

.footer { text-align: center; }
.col-xs-12 { display: inline-block; }

unfortunately that didnt work. any other suggestions. appreciate the help