Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a background-image on the first section of my site however there is padding-top on that section in order to seperate the first title from the navbar. Is there a way I can get the background image to over ride the top padding?

Thanks

HTML

<nav>

        <a href="#getting-his-start"><b>Getting his Start</b></a>&nbsp;&nbsp;
        <a href="#cinematic-revolution"><b>Cinematic Revolution</b></a>&nbsp;&nbsp;
        <a href="#experimental-phase"><b>The Experimental Phase</b></a>&nbsp;&nbsp;
        <a href="#logos-made-to-last"><b>Logos Made to Last</b></a>&nbsp;&nbsp;
        <a href="#the-nect-big-thing"><b>The Next Big Thing</b></a>&nbsp;&nbsp;
        <a href="#his-influence-today"><b>His Influence Today</b></a>&nbsp;&nbsp;

    </nav>

    <section class="start">

        <h2 id="getting-his-start">Getting his Start</h2>

CSS for background image

.start {
background-image: url(../images/goldenarmamend.png);
background-position: top right;
height: 100%vh;
width: 100%vw;

}

CSS for h3 to have space above

h3 {
font-size: 1.5em;
margin-top: 3em;
margin-bottom: 0.7em;
text-transform: uppercase;

}

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
255 views
Welcome To Ask or Share your Answers For Others

1 Answer

Add a margin-top instead of padding-top and move the title up with negative margin top. IF you can share code snippet on that section can give a exact answer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...