-1
I would like to make a shopping cart icon, and put a number inside it to iterate according to the products that the customer puts in the cart, but I could not do, an example: Note: HTML and CSS, the icone is font-awesome, I’m using Bootstrap 4
HTML
<div class="content-carrinho d-flex">
<a href=""><span class="fa fa-shopping-cart" aria-hidden="true"></span></a>
</div>
CSS
.content-carrinho a {
padding-right: 40px;
}
.content-carrinho span{
color: white;
}
It depends on what this icone is, is a source of fontawsome or gliph? is a SVG? is an image with
<img>
? Give details, there are many ways to do the same thing as it will depend on the technology you initially used to be able to provide you with an answer that will specifically serve your case.– Guilherme Nascimento
is a font-awesome, sorry not to mention the question
– João Vizu
Post what you have done so far, only the HTML part of such icone.
– Guilherme Nascimento
Ready, the image in the post is an example
– João Vizu
is using some other framework that I don’t know about? what does it mean
d-flex
? This may conflict with any solution I provide in a response, you better read the recommendations for how to formulate an example: https://answall.com/help/mcve, if not people will get you several solutions most can fail by conflicting with something that has on your site and then we will stay all day until something works.– Guilherme Nascimento
Even though I am not sure if you will conflict, I have made an answer, try https://answall.com/a/237805/3635, if it works blz, otherwise follow what I said in the previous comment.
– Guilherme Nascimento
Thanks for the topic of Creating Examples, I’ll give a read, it’s my second post here, to half lost, but d-flex is a property of Bootstrap 4 that leaves the flex container. Thanks for the help, I’ll try to make an example and come back for a feedback
– João Vizu