cart icon inside a circle css code example

Example 1: css add circle to icon cart

span{
    font-size: 14px;
    font-weight: 900;
    position: absolute;
    border: solid blue;
    border-radius: 60%;
    height: 14px;
    width: 8px;
    background:blue;
}

Example 2: css add circle to icon cart

<!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    </style>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    </head>
    <body>

    <i class="fa" style="font-size:24px"></i>
    <span> 5 </span>

    </body>
    </html>

Tags:

Css Example