CSS Equivalent of the “if” statement

No. But can you give an example what you have in mind? What condition do you want to check? Maybe Sass or Compass are interesting for you. Quote from Sass: Sass makes CSS fun again. Sass is CSS, plus nested rules, variables, mixins, and more, all in a concise, readable syntax.

How to import Google Web Font in CSS file?

Use the @import method: Obviously, “Open Sans” (Open+Sans) is the font that is imported. So replace it with yours. If the font’s name has multiple words, URL-encode it by adding a + sign between each word, as I did. Make sure to place the @import at the very top of your CSS, before any rules. Google Fonts can automatically generate the @import directive … Read more

CSS3 opacity gradient?

I am looking to create an effect like this, but my website has a dynamic background-color. Note that this example uses a white overlay, which does not work with different backgrounds. What I was hoping to do was to set up a CSS opacity gradient. This sort of works, but the code is too messy. … Read more

How to place two divs next to each other?

Float one or both inner divs. Floating one div: or if you float both, you’ll need to encourage the wrapper div to contain both the floated children, or it will think it’s empty and not put the border around them Floating both divs: