Jump to content

CSS Caption image AAARG


tooth-paste
 Share

Recommended Posts

Hope anyone can help with a none PW related issue. I thought this was going to be simple but in the mean time I'am pulling my hairs out.

I want to place text over an image. This I got working. See the included image and css. The problem is that I want the text to underline on mouse over.

<div class="image">
<img src="<?php echo $config->urls->templates; ?>img/image.jpg" alt="" />
<h2><span>Test</span></h2>
</div>
.image{position: relative;width:100%}
h2, .caption{position:absolute;top:0;left:3%;width:100%}
h2 span{font-size:15px;font-weight:normal;color:#fff;letter-spacing:-1px;background:rgb(0, 0, 0);background:rgba(0, 0, 0, 0.7);padding:2%}

post-2727-0-95617200-1455808176_thumb.pn

Link to comment
Share on other sites

Sorry, didn't look closely enough. I meant

h2 span:hover { text-decoration: underline; }

Though for that kind of styling you should always use classes or ids to avoid styling unrelated content. I'm assuming here that you want the text to underline when you hover over it. If you want to style the text on hovering over the image, it's a completely different topic.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...