Jump to content
newcoder1010

How to put a color on an image

Recommended Posts

Hello,

<figure class="figure-about"><img src="../sites/default/files/imgs/Sky-Blue-House.jpg" alt="houses image"><figcaption class="figure-caption">For Sale. <a href="../contact_us" title="Contact us">Contact us</a> today!<br></figcaption></figure>

How can I put a specific color on top of the image?

Thanks!

Share this post


Link to post
Share on other sites

Using :before or :after for figure elements then content:"";

	figure{ position: relative;
	}
	figure:after {content:""; position:absolute; top:0; left:0; bottom:0; right:0;background: red; opacity: .5; z-index: 10;}
	

If you only want to have colour over img tag, wrap img tag with element such as span and target that element instead (figure > span ).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...