As I delve into the realm of CSS, my current mission is to replicate the captivating cards showcased on this particular website. Utilizing Font Awesome icons has become a pivotal aspect of this endeavor. For instance, let's take a look at this card:https://i.sstatic.net/yK7G8.png
The primary objective that I aim to achieve with these cards is ensuring they automatically resize by concealing the icon when the window size is altered, just like this:https://i.sstatic.net/qFiH0.png
In an attempt to mimic the CSS code from the original website and adapt it for my usage, I have encountered a stumbling block which rendered the setup as shown here:https://i.sstatic.net/4hhXV.png
While I successfully managed to hide the icon when the container shrinks too much, aligning the icon with the text remains an unresolved mystery to me. To illustrate, you can view the example on jsfiddle.
body {
font-family: 'Roboto', sans-serif;
background-color: #44484c;
}
.small-box {
border-radius: 0.25rem;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
display: block;
margin-bottom: 20px;
position: relative;
}
... (remaining CSS code)
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<link href="" rel="shortcut icon" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" integrity="sha512-HK5fgLBL+xu6dm/Ii3z4xhlSUyZgTT9tuc/hSrtw6uzJOvgRr2a9jyxxT1ely+B+xFAmJKVSTbpM/CuL7qxO8w==" crossorigin="anonymous" />
... (remaining HTML/JS code)