How can I make text appear when hovering a picture that has already the hovering for transform?

Αντωνι Ως

HTML

<div class="feature" >
<img src="0308_WVenvirophotos1-water-pollutions.jpg" 
width="100%" height="100%"/></div>

CSS

.feature{

height:50%;
width: 60%;
float: left;
margin: 0.5%;
-webkit-transition: width 1s, height 1s, -webkit-transform 2s; 
transition: width 1s, height 1s, transform 2s; 
}

.feature:hover{

width: 800px;
height: 520px;
-webkit-transform: translate(,) ; 
transform: translate(,);
}

This code makes the picture larger when hovered. How can I make the text appear on hover as well?

richie

Using the pseudo element :before, you can do something like this:

.feature:hover:before {
  content:'Text Goes Here';
  font-size:20px;
  color:white;
  position:absolute;
  top:0;
  left:0;    
}

Essentially, we're adding the text to the element on hover by using the content property of :before .

Checkout a fiddle showing that here: http://jsfiddle.net/34p5xqmL/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to make a tolltip appear only when hovering over text?

How can I make the text invisible when hovering over a tex and pressing the mouse button?

make text appear when hovering on a specific list element

How to make labels appear when hovering over a point in multiple axis?

How to make the border appear when hovering over a button in Kivy

How can I make it so the dropdown menu stays there when I'm hovering on it?

How do I display a text when hovering on another text?

Using GNOME Paper theme: how do I make my dock appear when hovering on the left side of my screen?

How can I make a left side popup box when hovering element in HTML?

How can I make the element stay in its place with CSS when hovering

How can I get make element visible by hovering other element

How can I get the blue glow when hovering over a text input field?

How can I set my image's hover when hovering my text?

Make an element appear and make adjustments when hovering over another element

Change picture by hovering over text

How can I avoid CSS flickering when hovering over areas?

Unity - Make crosshair appear when hovering over object

Possible to make labels appear when hovering over a point in matplotlib?

How to make the background blur effect appear and disappear slowly when hovering over the box?

How can I make a element show when hovering over another element, and hide it if not. And make it take up space the entire time

When the button is a picture, the text also has a prescribed size and spacing. How to make the text appear in the middle of the picture through CSS?

How can i disabling scale of cursor by hovering <a>

How to display a button over a picture only when hovering it?

Can I make an Icon in a TableRow column change color when hovering anywhere in that row?

On Hovering an element,make another element appear

How to make NSTableView immediately display the IBeamCursor when hovering over a text cell?

How can a text can be moved with the mouse pointer on an image when hovering in css or html without using JQuery

How do I push the text when I am hovering over an image?

Changing cursor when hovering a text