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

Home Forums CSS image hover text help

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #183292

    hi guys,

    noob here.

    i would like the texts to appear on image hover.

    i want images to go dark(like 80% black) and have white texts appear on hover.

    i tried this tutorial which is exactly what i wanted to do, and i just couldn’t get it right. took me days and i’m giving up on it…

    is there any tutorial out there? or maybe quick tips on how to learn this?

    thx in advance!


    You say you’ve tried it.

    Could you show us in a example what you tried?…It doesn’t matter if it doesn’t work…we can work with broken code.


    try adding this to .imageHolder .caption

    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;
    padding: 20px; // for example

    If you add display: block; to the image then it will remove the tiny whitespace beneath it. Your black overlay box will then be the same size as the image.


    If you can access the code add a class to the image maybe, or target the element that wraps it. Something like this

    .imageHolder img {
      display: block;

    because img is an inline element by default, we’re removing the extra space inline elements have.

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