html - Top banner word overlay alignment issues -
i trying create sort of top banner words on image background transparent bordered background, unfortunately, can't seem aligned properly. leans way right end of page. ideas?
here sample of code , see tried reset margin of bor class thinking might didn't anything. tried resetting margin other parts of code nothing worked. maybe it's positioning can't seem work.
css .full{ min-height: 100%; background-color: white; /*background-image: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.3) 90%), url("america/cservice.jpeg");*/ /*background-blend-mode: lighten;*/ padding-top:25px ; color: #5a5a5a; /*color: black;*/ padding-bottom: 20px; text-align: center; align-items: center; border-top: 5px solid rgba(0, 0, 102, 0.5); border-bottom: 5px solid rgba(0, 0, 102, 0.5); font-family: "palatino linotype", "book antiqua", palatino, serif; } .image{ width: 100%; height: 280px; background-image: url(america/news2.png); background-size: cover; background-repeat: no-repeat; position: relative; padding-top: 20px; padding-bottom: 20px; } .bor { position: absolute; border: 5px solid; border-color: rgba(255, 255, 255, 0.5); padding-top:; padding-bottom:; background-color: rgba(133, 133, 173, 0.4); margin-left: 0px; margin-right: ; } h2 { position: absolute; width: 100%; color: black; font-size: 40px; padding-top: 85px; } h4 { position: relative; width: 100%; color: white; font-size: 30px; padding-top: 155px; font-stretch: ultra-expanded; } b{ border: 5px solid black; padding-right: 25px; padding-left: 25px; margin-left: 20px; margin-right: 20px; color: white; font-weight: 900; font-size: 40px; } html <div class="full"> <div id="section"> <h1 class="text-center">—news feed—</h1> <br> <hr> <div class="image"> <center><span class="bor"> <h2>weekly<b>report</b></h2> <br> <h4>catch on latest news regarding world</h4> </span></center> </div> </div> </div>
here working example:
.full{ min-height: 100%; background-color: white; /*background-image: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.3) 90%), url("america/cservice.jpeg");*/ /*background-blend-mode: lighten;*/ padding-top:25px ; color: #5a5a5a; /*color: black;*/ padding-bottom: 20px; text-align: center; align-items: center; border-top: 5px solid rgba(0, 0, 102, 0.5); border-bottom: 5px solid rgba(0, 0, 102, 0.5); font-family: "palatino linotype", "book antiqua", palatino, serif; } .image{ width: 100%; height: 280px; background-image: url(america/news2.png); background-size: cover; background-repeat: no-repeat; position: relative; padding-top: 20px; padding-bottom: 20px; display: block; margin: 0 auto; } .bor { position: absolute; border: 5px solid; border-color: rgba(255, 255, 255, 0.5); padding-top:; padding-bottom:; background-color: rgba(133, 133, 173, 0.4); left: 0; right: 0; } h2 { position: absolute; width: 100%; color: black; font-size: 40px; padding-top: 85px; } h4 { position: relative; width: 100%; color: white; font-size: 30px; padding-top: 155px; font-stretch: ultra-expanded; } b{ border: 5px solid black; padding-right: 25px; padding-left: 25px; margin-left: 20px; margin-right: 20px; color: white; font-weight: 900; font-size: 40px; } <div class="full"> <div id="section"> <h1 class="text-center">—news feed—</h1> <br> <hr> <div class="image"> <center><span class="bor"> <h2>weekly<b>report</b></h2> <br> <h4>catch on latest news regarding world</h4> </span></center> </div> </div> </div> you had issue, because .bor class had absolute position. means have specify position within it's parent, using top, bottom, left or right properties.
hope helps!
Comments
Post a Comment