lundi 21 août 2017

Top banner word overlay alignment issues

I am trying to create a sort of top banner with words over the image background with a transparent bordered background, but unfortunately, I can't seem to get it aligned properly. It leans all the way to the right end of the page. Any ideas?

Here is a sample of my code and as you will see I tried to reset the margin of the bor class thinking it might help but it didn't really do anything. I also tried resetting the margin for other parts of the code but nothing worked. Maybe it's the positioning but I can't seem to get it to 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">&mdash;News Feed&mdash;</h1>
            <br>
            <hr>

            <div class="image">
                <center><span class="bor">
                    <h2>Weekly<b>Report</b></h2>
                    <br>
                    <h4>Catch up on all the latest news regarding the world</h4>   
                </span></center>
            </div>

        </div>
</div>



Aucun commentaire:

Enregistrer un commentaire