How to put an image next to each other

前端 未结 5 1902
醉话见心
醉话见心 2021-01-01 15:51

I\'m trying to put these two \'hyperlinked\' icons next to each other but I can\'t seem to do that. As you can see, the twitter icon falls to the next line.. (they are both

5条回答
  •  灰色年华
    2021-01-01 16:28

    You don't need the div's.

    HTML:

    
    

    CSS:

    .nav3 {
        background-color: #E9E8C7;
        height: auto;
        width: 150px;
        float: left;
        padding-left: 20px;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        color: #333333;
        padding-top: 20px;
        padding-right: 20px;
    }
    
    .icons{
        display:inline-block;
        width: 64px; 
        height: 64px; 
       }
    
     a.icons:hover {
         background: #C93;
     }
    

    See this fiddle

提交回复
热议问题