html - Text not disappearing properly -


css

#articlebottom {     width: 980px;     height: 250px;           }  .products{     width:980px;     margin:0px auto;     padding-left:20px; }  #articlebottom .imgwrap {     width:295px;     height:200px;     position:relative;     float:left;     margin:10px;     background:#333; } #articlebottom .imgwrap img {     position:absolute;     left:5px;     top:5px;     width:285px;     height:190px; }  #articlebottom .imgdescription1 {     position: absolute;     left:0;     letter-spacing: 2px;     background-color: rgba(255, 250, 250, 0.2);     color: rgba(255, 250, 250, 0.2);     font-weight:bold;     font-size:18pt;     line-height: 50px;     width:100%;     height:50px;     opacity: 0;     text-align:center;     text-transform:uppercase;     transition:opacity 500ms ease-in-out, color 20ms ease-in-out,height 500ms ease-in-out; }  #articlebottom .imgwrap:hover .imgdescription1 {     opacity: 1;     height:200px;     line-height:200px;     color: #1b9bff; } 

html

  <article id="articlebottom">                 <div class="products">                      <div class="imgwrap">                         <a href="products/camphor.aspx"  target="_blank"><img src="images/camphor_b.jpg" alt="polaroid" />                         <p class="imgdescription1">camphor</p></a>                     </div>                     </div> </article> 

fiddle

what i'm having:

  1. the text appears on center when hover , going top after hover

what need:

  1. when hover on image appropriate text shoould appear on center , need disappear on center of image itself

updated fiddle

the crucial part moving

    height:200px;     line-height:200px;     color: #1b9bff; 

from:

#articlebottom .imgwrap:hover .imgdescription1

to:

#articlebottom .imgdescription1

otherwise position of text set default/inherited value , set centred on hover, hence why hover state sees jump.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -