There is a gallery, when you hover over an image, you need to darken it, and an inscription (description) appears on it in the center. On each image, the inscription will be of different lengths so the option with a fixed position does not fit, it is impossible to make it in the center of this image (margin: 0 auto; does not work).
.overlay{ position: relative; display: block; } .overlay .overlayed_text{ display: none; } .overlay:hover .overlayed_text{ display: block; background-color: #8c8c8c; filter: alpha(opacity=75); opacity: .75; position: absolute; width: 471px; height: 237px; } .overlayed_text span{ display: block; padding-top: 30px; padding-bottom: 30px; padding-left: 10px; padding-right: 10px; color: #fff; font-weight: bold; border: 2px #fff solid; text-align: center; position: absolute; }
<div class="overlay"> <a href="https://s3-us-west-1.amazonaws.com/powr/defaults/image-slider2.jpg" class="big"> <img src="http://www.irishcultureandcustoms.com/01News/18Surfer.jpg" alt="" title="小孝校袛袠携 小 携袪袣袠袦袠 袗袣笑袝袧孝袗袦袠"> <div class="overlayed_text"> <span>小孝校袛袠携 小 携袪袣袠袦袠 袗袣笑袝袧孝袗袦袠</span> </div> </a> </div>