How to fade an image with CSS without opacity?

You can’t fade the opacity of an element, without having what’s behind showing through. The site you linked to isn’t fading the opacity of the image, but introducing a translucent layer over the top with the text in. If you just want to fade the image, but not have the background show through, you could … Read more

What does “*” mean in CSS?

This is a common technique called a CSS reset. Different browsers use different default margins, causing sites to look different by margins. The * means “all elements” (a universal selector), so we are setting all elements to have zero margins, and zero padding, thus making them look the same in all browsers.

Float a div above page content

You want to use absolute positioning. An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is html For instance : To get it to work, the parent needs to be relative (position:relative) In your case this should … Read more

What is element.style and why is it overriding my css settings?

I have a popup that comes up over a blanket div that greys out the entire screen, but I don’t like its positioning. So I tried to manually enter left: and top: elements into my CSS, but when I look at Chrome’s console, there’s this element.style {} that’s overriding my code. I’ve searched my CSS … Read more

jQuery change class name

Using jQuery You can set the class (regardless of what it was) by using .attr(), like this: If you want to add a class, use .addclass() instead, like this: Or a short way to swap classes using .toggleClass(): Here’s the full list of jQuery methods specifically for the class attribute.

CSS float left not working right

DIV is a block element so you can give float or inline-block to your right div to take its actual width like this: EDIT: answer your comment below if you give float to the divs then you have to clear its parent like this :