Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to create a Medium.com like featured image effect

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #197606
    viveknath322
    Participant

    I would like to create an image effect like in Medium.com’s. There, images have a slight blackish overlay. How I can achieve this using CSS?

    #197607
    Paulie_D
    Member

    There’s several ways to do this…

    What have you tried?…A simple Google search for “CSS image overlay” would probably yield many, many options.

    #197609
    Shikkediel
    Participant

    They have a very indirect approach but it looks like they’re using a pseudo-element like done here (happened to just made that) :

    http://ataredo.com/

    #scene:before {
    content: "";
    width: 100%;
    height: 80%;
    position: absolute;
    top: 10%;
    left: 0;
    background-color: hsla(0, 0%, 10%, 0.55)
    }
    

    Positioning is a bit specific for the site here (so less relevant).
    The image itself is set as the background.

    #197611
    Paulie_D
    Member

    I just looked at Medium.com and I can’t see any image overlays…but perhaps I’m missing something.

    #197612
    Shikkediel
    Participant

    Wanted to post the same comment but I noticed it shows on subpages :

    One such link

    #197613
    Paulie_D
    Member

    Hmmm…same principle but on looking at the example (thanks BTW) they’re not even using an inline image (which I would have thought they should since it ‘feels’ like content to me.

    Instead they have a div (with content) overlaying another div which has a background image.

    Odd…but perhaps it’s the way they feed the ‘data’ into the page.

    #197614
    Shikkediel
    Participant

    Strange indeed, I think the url for the image is taken from the data attribute of the parent and then dynamically converted to an actual link to the file on cloudfront. Quite circumventive altogether.

    #197648
    viveknath322
    Participant

    Actually, I tried a plugin for wordpress named Display Featured Image for Genesis(https://wordpress.org/plugins/display-featured-image-genesis/).

    I’m trying to add a colour overlay in featured images like in WPMUDEV blog
    See this http://premium.wpmudev.org/blog/custom-fonts-css/

    #197932
    Sara Cope
    Participant

    Check out the post Design Considerations: Text on Images if you haven’t already.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.