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

From Dev

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

From Dev

How can i make a custom made textbox appear when hovering over a button in wpf

From Dev

How to make text appear when hovering over an image that's inside an anchor tag and the anchor tag is inside a div?

From Dev

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

From Dev

When using custom cursors, how can you set the I-bar cursor when hovering over text?

From Dev

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

From Dev

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

From Dev

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

From Dev

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

From Dev

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

From Dev

Change picture by hovering over text

From Dev

How can I avoid CSS flickering when hovering over areas?

From Dev

How can I avoid CSS flickering when hovering over areas?

From Dev

Change picture when hovering with mouse

From Dev

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

From Dev

Changing cursor when hovering a text

From Dev

How do I make this infinite jquery animation end when the user is no longer hovering?

From Dev

How would I show text inside a span tag when hovering over a different element?

From Dev

How would I show text inside a span tag when hovering over a different element?

From Dev

How to make pattern by hovering with mouse

From Dev

How To Make CSS Animations Ease Back To Position When No Longer Hovering?

From Dev

how to make color change to white when hovering over button

From Dev

How can I maintain proper boundaries on CSS triangles when hovering with cursor?

From Dev

How can I modify the style when hovering over a combo's option?

From Dev

How can I maintain proper boundaries on CSS triangles when hovering with cursor?

From Dev

In Labview how can I change the mouse pointer when hovering over one of my boolean controls?

From Dev

How to change text color (and background) on nav bar links when hovering?

From Dev

How to scroll text within a div to left when hovering the div

From Dev

How to apply a transition effect to some text when hovering over an icon?

Related Related

  1. 1

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

  2. 2

    How can i make a custom made textbox appear when hovering over a button in wpf

  3. 3

    How to make text appear when hovering over an image that's inside an anchor tag and the anchor tag is inside a div?

  4. 4

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

  5. 5

    When using custom cursors, how can you set the I-bar cursor when hovering over text?

  6. 6

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

  7. 7

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

  8. 8

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

  9. 9

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

  10. 10

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

  11. 11

    Change picture by hovering over text

  12. 12

    How can I avoid CSS flickering when hovering over areas?

  13. 13

    How can I avoid CSS flickering when hovering over areas?

  14. 14

    Change picture when hovering with mouse

  15. 15

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

  16. 16

    Changing cursor when hovering a text

  17. 17

    How do I make this infinite jquery animation end when the user is no longer hovering?

  18. 18

    How would I show text inside a span tag when hovering over a different element?

  19. 19

    How would I show text inside a span tag when hovering over a different element?

  20. 20

    How to make pattern by hovering with mouse

  21. 21

    How To Make CSS Animations Ease Back To Position When No Longer Hovering?

  22. 22

    how to make color change to white when hovering over button

  23. 23

    How can I maintain proper boundaries on CSS triangles when hovering with cursor?

  24. 24

    How can I modify the style when hovering over a combo's option?

  25. 25

    How can I maintain proper boundaries on CSS triangles when hovering with cursor?

  26. 26

    In Labview how can I change the mouse pointer when hovering over one of my boolean controls?

  27. 27

    How to change text color (and background) on nav bar links when hovering?

  28. 28

    How to scroll text within a div to left when hovering the div

  29. 29

    How to apply a transition effect to some text when hovering over an icon?

HotTag

Archive