html - CSS3 Pseudo :after horizontal scroll even overflow hidden -
i developing responsible page using bootstrap, <div>
content using :before
, :after
pseudo screen size. below code, working fine. horizontal scroll appearing, overflow hidden. please remove horizontal scroll.
css
.text_box{ background:#ff0000; width:1000px; height:200px; margin: 0 0 19px; padding: 20px 0 25px; position: relative; color:#ffffff; } .text_box:before{ background:#ff0000; display:block; width:100%; height:100%; overflow:hidden; position:absolute; top:0; left:-99%; z-index:-1; content:''; } .text_box:after { background: #ff0000; content: ""; display: block; height: 100%; overflow: hidden; position: absolute; right: -99%; top: 0; width: 100%; z-index: -1; }
html
<div class="text_box"> hello world !!! </div>
remove 100% width :after , :next class. update css below.
.text_box:before{ background:#ff0000; display:block; height:100%; overflow:hidden; position:absolute; top:0; left:-99%; z-index:-1; content:''; } .text_box:after { background: #ff0000; content: ""; display: block; height: 100%; overflow: hidden; position: absolute; right: -99%; top: 0; z-index: -1; }
Comments
Post a Comment