Place an h2 title above my cart?

They are font-awesome icons so head to the font awesome site and download font-awesome or get the link for your head code to link directlky.

Once you’ve added support for the font-awesome icons then go through your css and everywhere you have used the universal selector to select a font-family you should remove it and apply it to the html element only. Using the universal selector (*) means that you kill inheritance and the font awesome styles are over-ridden.

Don’t use the universal selector as a reset as its overkill and breaks inheritance which is the foundation of Cascading styles sheets,

You can see that they are now showing in my codepen.

ok thank you again for your help.
if I copy your will it work for me?

I thought of one thing because I can’t get by with this css if you agree we could make a temviewer so that you can see my code what do you think?

Yes it will work but you also need the link to font awesome. It’s in the head of my codepen linked to a CDN but you really should get the link direct from font awesome as they require your email. Or alternatively download the whole thing.

The issue in your css is that you have used the universal selector to set a certain font on every element. As font awesome is a font based icon set you are overriding their font rules and cancelling inheritance. You can copy my css and it should work for you.

Unfortunately you will have to try and share the code here as the forums are for everybody to see and learn.

I would suggest that you use codepen (it’s free) to build your examples and to share code as it’s a pain to keep copying and pasting code just to get a working version to debug.

Alternatively upload your code online so we can see the actual page. :slight_smile:

Good morning,
Thanks for your help.
I tried again and added the line in the head and it still doesn’t work:

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>B.S.A Onligne</title>
    <link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">

    <script src="https://kit.fontawesome.com/236c56896e.js" crossorigin="anonymous"></script>

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap"
        rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/team.css">
    <link rel="stylesheet" href="css/price.css">
</head>

I don’t see the link to font-awesome icons that code.

This is the one from my example.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">

However I notice in that code you posted above you have another set of icons called remix being loaded here:

<link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">

You are using those icons here:

<div class="icons">
          <a href="#"><i class="ri-twitter-fill"></i></a>
          <a href="#"><i class="ri-facebook-box-fill"></i></a>
          <a href="#"><i class="ri-instagram-fill"></i></a>
   </div>

You could always use those icons in your footer rather than loading yet another library to do it?

You also need to remove the css I mentioned a couple of times now and this following code will kill both your remix and font-awesome icons/.

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

Find the above code and remove it and never use it again :slight_smile:

it works my steps in google chrome in ie it works.

I also see that my Facebook icon is square and not round, is this normal?

Here is all my code:

A Pen by Christophe (codepen.io)

even in terms of police games with ie it’s prettier I find my steps in chrome.
I would like to have the same font result as in ie

You need to look through the remix documentation and choose the icons you need.

I had a quick look (although I’ve never heard of this icon set before) and they have a round version.

<a href=""><i class="ri-facebook-circle-fill"></i></a>

Do you mean the text looks better in the IE browser? I assume you mean Edge as IE has died.

Browsers may handle text differently but it may be down to your browser settings also so is not something you can always control. Maybe you can post a screenshot of the problem so we can see the difference. :slight_smile:

Thanks for your help.

Here are the two captures one with Edge and the other chrome with Edge and Mozilla the character set is better and I would like to have the same rendering with chrome.

On the other hand, in Chrome I don’t have the Facebook, Instagram icons…

I show you in two posts because new users here can only insert one media per post

chrome

and here is the second post with Edge

Edge

Edge and Chrome look the same to me here from your codepen. Are you testing the codepen or is this your real page you have the screenshots from?

If it’s a real page then try clearing the cache in Chrome because this is what I see in your codepen.

As this is a learning exercise I must again point out the following rules from your codepen that make no sense. You have repeated almost the same rules a number of times (in each stylesheet).

* {
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
    box-sizing: border-box;
    border: none;
    outline: none;
    color: #fff;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
    text-decoration: none;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
    text-decoration: none;
}

The only difference being that you changed the font family so only the last font family is active for the whole page.

You only need one set of those rules and it should be the first rule in the first stylesheet. However as I have said a number of times using the universal selector in that way kills inheritance and the only global rule you want from that lot is this:


* {
    padding: 0;
    margin: 0;;
}

Of course even that is overkill and will break a lot of form elements. Most people usually use a reset stylesheet instead and address elements by name. As you don;t have enough experience to do that I suggest you change the above to these rules instead.

html,
body {
  scroll-behavior: smooth;
}
html {
  box-sizing: border-box;
}
*,
*:before,
*:after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Space Grotesk", sans-serif;
  font-size: 62.5%;
  background: #000;
  color: #fff;
}
a {
  text-decoration: none;
  color: #fff;
}

Note that I removed this rule:

* {
    border: none;
    outline: none;
}

If you remove outline then you make it impossible for anyone to navigate with the keyboard. You must always set :focus rules which generally have an outline set by default. Also the border:none rule will break most form elements so is not a good rule to have under the universal selector.

1 Like

Good morning,

Many thanks again for your response.

Indeed, it was indeed the Chrome cache to empty and it works.

1 Like

Good evening,

I have a question, I tried to follow a little tutorial on the internet for a popup that opens on a button.
The problem is I don’t see how to integrate it into my existing button?

because I don’t want to change my css just open the popup with my existing buttons.

the line integrated into the tutorial that I followed

<button class="show-popup">Show Popup</button>

my code

<div class="box" style="--clr:#89ec5b;">
                <div class="content">
                    <div class="icon">
                        <ion-icon name="receipt-outline"></ion-icon>
                    </div>
                    <div class="text">
                        <h3>Billing</h3>
                        <p>Tous les documents en un seul endroit, avec une disponibilité illimitée.</p>
                        <p>Simple & Rapide !</p>
                        <a href="#">En savoir +</a>
                    </div>
                </div>
            </div>

You don’t show the script and css necessary to make a pop up work. The above is just html and will do nothing on its own.

If .box is your pop up then it will need to be hidden with css and then when you click a button a script would add a class to the pop up so that it can be revealed with css. You’d also need to specify where the pop up appears or if it’s a full screen modal pop up.

The basics would be that you add a js event listener to the button to detect when it’s clicked and then run some code to show the pop up as mentioned. You’d also need another button to close the pop up unless the initial button was a toggle.

Maybe if you point to the tutorial you were using it may give more idea as to what you are attempting.

Good evening,

Thank you for your reply.

I have my code with my 3 cards and on each button I would like to be able to do this

my card code below I don’t see how to do it so that when I click on <a href="#">En savoir +</a> I get the popup

    <div class="box" style="--clr:#89ec5b;">
                <div class="content">
                    <div class="icon">
                        <ion-icon name="receipt-outline"></ion-icon>
                    </div>
                    <div class="text">
                        <h3>Billing</h3>
                        <p>Tous les documents en un seul endroit, avec une disponibilité illimitée.</p>
                        <p>Simple & Rapide !</p>
                        <a href="#">En savoir +</a>
                    </div>
                </div>

To activate one popup you would just add the show-popup class to your anchor.

e.g.

<a class="show-popup" href="#">En savoir +</a>

You’d need to remove any styles from that demo that you don’t need and maybe like this:

However that will only work for that one button. If you want three buttons and three different popups then the code would need to be revised to take into account multiple popups and there would need to be logic to determine which popup to show.

You would need the js to loop through all the buttons and then ascertain which popup to show. This could be done by the href on the anchor pointing to the popup ID and the js will then work out which popup to show.

I’m a bit short of time today to give a full demo but may have time later this evening.

Good morning,

For me it will be complicated to do this, I understood to add the classes <a class="show-popup" href="#">En savoir +</a> for the rest I don’t see how to do it.

Ok here’s a bare bones example.

There are three popups and each has a unique id (i.e. “popup1” and “popup2” and “popup3”).

<div id="popup1" class="popup-container"> etc ...
<div id="popup2" class="popup-container">etc...
<div id="popup3" class="popup-container">etc...

The three links that activate the popup have an href that points to that unique id (#popup1,#popup2,#popup3).

<a class="show-popup" href="#popup1">Read More 2</a>
...
<a class="show-popup" href="#popup2">Read More 2</a>
...
<a class="show-popup" href="#popup3">Read More 2</a>

The js then looks like this:

const showPopup = document.querySelectorAll(".show-popup");
const closeBtn = document.querySelectorAll(".close-btn");

showPopup.forEach(function (popup) {
  popup.addEventListener("click", function () {
    var modalTarget = this.getAttribute("href");
    document.querySelector(modalTarget).classList.add("active");
  });
});
closeBtn.forEach(function (close) {
  close.addEventListener("click", function () {
    this.closest(".popup-container").classList.remove("active");
  });
});

Good evening,

Great thank you, it works, I would never have known how to do it myself.

There is just one problem the popup is behind the cards I think it’s the css?

You’ll need to raise the z-index on the pop up.

.popup-container {z-index:99}