Is there a way that I can create a semi-transparent overly on my slider’s images only and not over the text? An example of the tint I want to use can be found on the second and third slider images. I would rather use a CSS overlay than create a tint on every image in a photo editor—not user friendly.
I dont think “overlay” is a CSS property. background:rgba(0,0,0,0.5); instead. Also remember to give your LI position:relative;
Covering your content may not cause problems with people who want to click on links tho… if what you have a COMMON background image on your CONTAINER element (lets say your UL), you could assign an background: rgba(0,0,0,0.5); to your LI …( or if your images are in the background of your IL) you could wrap the contents of the LI in a DIV and give the rgba background to the DIV.
Rather than overlay: rgba(0,0,0,0.5);, it should be background: rgba(0,0,0,0.5);, but you also have to add the content property for :before and :after. E.g.
It will. I think he’s saying that if you were to ever also use :after for something, the content property (content: ’ ') is needed for that pseudo element as well.
The :before and after pseudo classes work hand in hand with the content property. Without the content property there is no ''generated box" to style and so there will be nothing styled or added to the element.
Okay, that makes some sense. There were example of uses with :before that never had the use of :after, which is why I questioned it.
As for my situation, I’m not making much progress. The element I need to apply the code isn’t correct, as I want to apply it to the images and not necessarily the ‘li’. But even changing the focus of the element to #rev_slider_1_1 li img doesn’t seem to make much difference.
I think you misunderstood me a little there (or I misunderstood you)
You can use :before or :after as you wish (you don’t need to use both) but when you use any one of them they must have the content property added or there will be nothing to style.
Basically :before means put the content ( from the content property) before the existing content in the element and :after means put it after the existing content in that element (not before or after the element itself but before or after any content in that element). The content property itself creates the box that you use (think of it like adding a span at either the beginning or the end of an element).