Using font awesome in codepen

It’s working, you just are using the wrong font-awesome class. Line 19 should be <span class=”fa fa-search”></span>. See this updated CodePen Note: You can also add CDNs in the CodePen settings so you don’t have to include it inline in your html.

HTML not loading CSS file

I am completely stumped as to why this doesn’t work. It seems the HTML file can’t load the CSS for some reason, even though both are in the same directory. Any idea what might be the problem? index.html style.css The above doesn’t work. Adding the css inline in index.html works fine though

Can you use if/else conditions in CSS?

Not in the traditional sense, but you can use classes for this, if you have access to the HTML. Consider this: and in your CSS file: That’s the CSS way to do it. Then there are CSS preprocessors like Sass. You can use conditionals there, which’d look like this: Disadvantages are, that you’re bound to pre-process your stylesheets, and that … Read more