Search code examples
htmlcssstylesalignment

How to align text next to bullseye


I have created a bullseye logo using CSS and want to put a text aligned next to the logo.

#logo{
    width:25px;
    height:25px;
    border-radius:50%;
    background-color:red;
    background-clip:content-box;
    padding:5px;
    border:5px solid red;
    color:red;
}
<div id="logo" style="float:left;"><b ><span style="margin-left: 20px;p-bottom: -50px;"> text123</span></b></div>


Solution

  • You can use flexbox:

    #container {
      display: flex;
      align-items: center
    }
    
    #logo{
        width:25px;
        height:25px;
        border-radius:50%;
        background-color:red;
        background-clip:content-box;
        padding:5px;
        border:5px solid red;
        color:red;
    }
    
    #text {
      color: black;
      padding-left: 12px
    }
    <div id="container">
      <div id="logo"></div>
      <div id="text">text123</div>
    </div>