1
I’m having trouble with an H1 and a link with class inside a div, which do not go up or down the way I want. I’ve tried to solve this using margin-top
and margin-bottom
, but I didn’t get the effect I crave. When I use these properties, it collapses. They stay within of an image, inserted via CSS Follows code:
.container {
width: 980px;
margin: 0 auto;
}
.hero-image {
background: url('http://i.imgur.com/uCRNEAF.jpg');
background-repeat: no-repeat;
padding: 100px;
text-align: center;
margin-top: 1.2em;
}
.hero-image h1 {
font-size: 28px;
font-family: 'Oswald', sans-serif;
text-transform: uppercase;
color: #ffffff;
margin-bottom: 0.5em;
}
/* Button */
.botao {
font-family: 'Oswald', sans-serif;
color: #ffffff;
text-decoration: none;
padding: 5px 10px;
background-color: #1989ca;
font-size: 0.9em;
border-radius: 4px;
}
<div class="container">
<div class="hero-image">
<h1>ESTE É MEU TÍTULO!</h1>
<a href="#botao" class="botao" title="Botão">HISTÓRIA</a>
</div>
</div>
What behavior are you looking for?
– Thiago Santos
Opa Thiago. It is the central alignment of this title of the H1 tag and the button below, but with a spacing between them. What I’m trying to do is put them both higher.
– user33070