html - 1px white line when using 2D transforms -
i have image background image, , hovering on scale , rotate css 2d transforms. works fine, except white gap line of 1px, looks terrible. doesn't happen in chrome, browsers. i've tried following, without success:
- adding
-webkit-backface-visibility: hiddenimage div and/or wrapper - adding
-webkit-transform: translatez(0) scale(1.0, 1.0)image div and/or wrapper - trying different
displayvalues - trying different
positionvalues
i think problem persists when using overflow: hidden.
html:
<a href="#" class="article col-xs-4"> <div class="article-overlay"></div> <div class="article-content"> <h2>learn skills land dream job</h2> <h6>education / academy</h6> </div> <div class="article-image" style="background-image: url('assets/images/ed1.jpg')"></div> </a> css:
#main-content .education .article { display: block; height: 100%; position: relative; z-index: 1; padding: 0; text-decoration: none; overflow: hidden; } #main-content .education .article .article-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; transition: 0.5s; background-color: rgba(0, 0, 0, 0.5); } #main-content .education .article:hover .article-overlay { background-color: rgba(0, 0, 0, 0.35); } #main-content .education .article .article-image { width: 100%; height: 100%; position: relative; background-position: center; -webkit-transform: scale(1) rotate(0deg); transform: scale(1) rotate(0deg); transition: 0.5s; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; } #main-content .education .article:hover .article-image { -webkit-transform: scale(1.2) rotate(2deg); transform: scale(1.2) rotate(2deg); } #main-content .education .article .article-content { z-index: 3; color: #fff; position: relative; text-align: center; position: absolute; width: 60%; top: 50%; left: 50%; -webkit-transform: translate(-50%, -100%); transform: translate(-50%, -100%); } #main-content .education .article .article-content h2 { text-transform: uppercase; font-weight: 700; font-size: 22px; letter-spacing: 1px; line-height: 40px; position: relative; padding-top: 20px; margin: 0; } #main-content .education .article .article-content h2:before { content: ""; display: block; width: 150px; height: 6px; background-color: #bedb39; position: absolute; top: 0; left: 50%; margin-left: -75px; } #main-content .education .article .article-content h6 { font-weight: normal; text-transform: uppercase; font-size: 16px; position: relative; padding-top: 20px; margin: 0; } #main-content .education .article .article-content h6:before { content: ""; display: block; width: 150px; height: 2px; background-color: #fff; position: absolute; top: 0; left: 50%; margin-left: -75px; } live demo:
ok, becouse of z-index, clear z-index #main-content .education .article , can set z-index .logo , .social-icons example 20 bringing front.
#main-content .education .article { display: block; height: 100%; position: relative; padding: 0; text-decoration: none; overflow: hidden; } #header .logo, #header .social-icons { z-index: 20; }
Comments
Post a Comment