Skip to main content
Inspiring
May 11, 2017
Answered

alignment issue of horizontal icons with one as an img pulled in, wrapping to nxt line

The trouble is the blog icon is an image. It is wrapping to next line. How can I get it into the mix? It will be last in the horizontal lineup. Lastly, I would ideally like the icons slightly closer together. Would that be handled in the ID with negative padding? I may have already tried that with no resolve.

<div class="col-md-3 col-xs-12 ">

    <div class="social">

          <div id="socialIconID">

<a href="#" target="_blank"><i class="fa fa-linkedin-square" aria-hidden="true"></i></a>

<a href="#" target="_blank"><i class="fa fa-facebook-official" aria-hidden="true"></i></a>

<a href="#" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a>

<a href="#/" target="_blank"><i class="fa fa-pinterest" aria-hidden="true"></i></a>

          </div>

    <ul><ul class="blog"><a target="_blank" href="#"></a></ul></ul>

    </div>

</div>

----------------------------------------------------

.social ul {

    float: left;

}

.social {

    padding: 33px 0 0 1px;

    margin-left: -20px;

}

.social a {

    background-size: contain;

    display: inline-block;

    height: 33px;

    width: 43px;   

}

.blog a {

    background: rgba(0, 0, 0, 0) url("images/blog.png");

}

.blog a:hover {

    background: rgba(0, 0, 0, 0) url("images/blog_over.png");

}

#socialIconID {

    color: #7e75a2;

    font-size: 38px;

    margin-left: -90px;

}

Appreciate the help!

    This topic is closed to new replies. Start a new post to keep the conversation going.
    osgood_Correct answer
    Legend
    May 11, 2017

    Just include it within another anchor tag with the class of blog, after the font awesome icons;

    <a href="#" target="_blank" class="blog"></a>

    Then give it a height and width to match the blog image size (presumably its only small).

    .blog {

    background: url("images/blog.png");

    width: 100px; /* height of blog image */

    height: 30px; /* width of blog image */

    display: inline-block;

    }

    .blog:hover {

    background: url("images/blog_over.png");

    }

    2 replies

    osgood_Correct answer
    Legend
    May 11, 2017

    Just include it within another anchor tag with the class of blog, after the font awesome icons;

    <a href="#" target="_blank" class="blog"></a>

    Then give it a height and width to match the blog image size (presumably its only small).

    .blog {

    background: url("images/blog.png");

    width: 100px; /* height of blog image */

    height: 30px; /* width of blog image */

    display: inline-block;

    }

    .blog:hover {

    background: url("images/blog_over.png");

    }

    Translate
    Legend
    May 11, 2017

    You might even want to consider using Flexbox:

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="UTF-8" />

    <title>Flexbox Align</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

    <style>

    #socialIconID {

    display: -webkit-box;

    display: -ms-flexbox;

    display: flex;

    -webkit-box-pack: center;

    -ms-flex-pack: center;

    justify-content: center;

    -webkit-box-align: center;

    -ms-flex-align: center;

    align-items: center;

    }

    #socialIconID a {

    display: inline-block;

    margin: 0 7px;

    color: #666;

    }

    #socialIconID a i {

    font-size: 25px;

    margin: 0;

    padding: 0;

    }

    .blog {

    background: url("images/blog.png");

    width: 20px; /* height of blog image */

    height: 20px; /* width of blog image */

    display: inline-block;

    background-color: #666;

    margin: 0 0 0 4px;

    }

    .blog:hover {

    background: url("images/blog_over.png");

    background-color: #999;

    }

    </style>

    </head>

    <body>

    <div id="socialIconID">

    <a href="#" target="_blank"><i class="fa fa-linkedin-square" aria-hidden="true"></i></a>

    <a href="#" target="_blank"><i class="fa fa-facebook-official" aria-hidden="true"></i></a>

    <a href="#" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a>

    <a href="#" target="_blank"><i class="fa fa-pinterest" aria-hidden="true"></i></a>

    <a href="#" target="_blank" class="blog"></a>

    </div>

    </body>

    </html>

    Translate