I would like to place a number at top right corner of the font awesome cart icon.
I have created this simple html.
<!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>
The result is as follows.
How can i make the number appear the top right corner of the cart icon as shown in the following image?
I appreciate any help from css experts. Thanks!
Best Answer
This appears to have been answered previously: Shopping cart - number of items in cart CSS
Modified the code to suit your request: http://jsfiddle.net/LhrLe0j6/361/
CSS: