Change color

Good morning,

I can’t find or change the color of my shopping cart numbering?

Currently it is black.

My css code:

/* about section in page link */
.section3 {
    min-height: calc(100vh - 4rem);
    background: var(--deepdark);
    color: #fff;
    padding: 2rem 1rem;
    scroll-margin-top: 4rem;
}

.section3 h2 {
    text-align: center;
}


/* card styles */
.itemContainer {
    width: 95%;
    max-width: 1200px;
    margin: auto;
    margin-top: 7em;
    margin-bottom: 2em;
    display: grid;
    gap: 15px;
    column-gap: 10px;
    row-gap: 30px;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    align-items: center;

}

.card {
    width: 200px;
    height: 310px;
    padding: .5em;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 15px 3px rgba(0, 0, 0, .1);
    display: flex;
    flex-direction: column;
    align-content: space-between;
}

.cardImg {
    width: 65%;
    height: 200px;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cardImg img {
    width: 100%;
}

.itemDescContainer {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-top: 1em;
}

.itemName {
    font-size: 1rem;
    margin-bottom: .3em;
    color: black;
}

.itemPrice {
    font-weight: 500;
    color: black;
}

.addtocart {
    width: 35px;
    height: 35px;
    color: red;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1em;
    border-radius: 50%;
    cursor: pointer;
    transition: all .5s ease-in-out;
}

.addtocart:hover {
    background-color: #dbdbdb;
}

.cart {
    margin: 0;
}

@media screen and (min-width:650px) {
    .itemContainer {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media screen and (min-width:900px) {
    .itemContainer {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

@media screen and (min-width:1100px) {
    .itemContainer {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    }
}

/* Shopping Cart List */
.cartContainer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 0;
    max-width: 500px;
    z-index: 1000;
    background-color: #F8F8F8;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    overflow-y: scroll;
    scrollbar-width: thin;
    transition: all .5s ease-in-out;
}

.showCartContainer {
    width: 80%;
    padding: 1em;
    box-shadow: 0 0 15px 15px rgba(0, 0, 0, .4);
}

.closeCart {
    text-align: right;
    margin-bottom: 1em;
    cursor: pointer;
    font-size: 1.1rem;
    width: 50px;
    float: right;
    border-bottom: 2px solid black;
}

#cartTitle {
    font-size: 1.5rem;
    color: blue;
    font-weight: 900;
}

.eachCart {
    width: 97%;
    display: grid;
    grid-template-columns: 1fr 5fr;
    align-items: center;
    gap: 5px;
    background-color: white;
    margin: .5em;
    border-radius: 10px;
    box-shadow: 0 0 3px 1px rgba(0, 0, 0, .1);
    height: 110px;
    padding: .5em;
}

.cartImg {
    width: 100%;
}

.cartItemName {
    font-size: 1rem;
}

.cartItemPrice {
    font-weight: 500;
}

.cartDesc {
    margin-left: 2em;
}

.remove {
    border: none;
    background-color: blue;
    padding: .5em;
    font-size: .9rem;
    color: white;
    font-weight: bold;
    border-radius: 5px;
    margin-top: .3em;
    cursor: pointer;
    border: 2px solid blue;
    transition: all .2s ease-in-out;
}

.remove:hover {
    color: black;
    border: 2px solid blue;
    background-color: transparent;
}

#totalPriceContainer {
    background-color: blue;
    width: 100%;
    text-align: center;
    padding: 1em;
    color: white;
    border-radius: 10px;
}

#totalPrice {
    font-weight: 900;
}

Just a guess, but it would probably be this…

.itemPrice {
    font-weight: 500;
    color: black;
}
2 Likes

itempPrice is the color found in the cards.

I found when I went to inspect my page I forgot to add “totalItem”.

Thank you for your help.

I don’t know anymore how to go down text in css ? because I do it in my html with
which is not very great.

I’m sorry but I don’t understand what you’re trying to ask.

sorry my english is not perfect.

I would like to use the
tag in css instead but I don’t know how to write it?

Still not quite sure I understand. If you want to style something, you need to setup the appropriate selectors. You’ve got numerous examples in your css of the class selector.

I made a quick and dirty sample of the various selectors you could use

Here’s a page which does a decent job of explaining the common selectors at a pretty high level: https://www.freecodecamp.org/news/css-selectors-cheat-sheet/

That page has a link to an interesting css game which makes you put the selectors to use with examples and explanations on the side as well: https://flukeout.github.io/

1 Like

Thank you very much for your help, I will look at your links.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.