I want the 'William Marchesi' and 'Contact' Text centered vertically with the 'Contact' Button on the right of the header. When I try a float: right
, the contact text moves so that it is higher than the 'William Marchesi' text.
html {
height: 100%;
background-repeat: no-repeat;
background-color: green;
}
body {
font-size: 87.5%;
/* Base font size on 14px */
font-family: sans-serif;
line-height: 1.5;
text-align: justify;
margin: 0 auto;
padding: 0;
}
a {
text-decoration: none;
color: inherit;
}
.header div {
margin: 0 auto;
width: 70%;
clear: both;
padding: 0;
}
.header {
background-color: #FCFCFC;
width: 100%;
padding: 0;
margin: 0 auto;
/*height: 5em;*/
}
.heading,
.contactButton {
display: inline-block;
padding: 0;
margin: 0;
vertical-align: middle;
line-height: 3em;
height: 3em;
font-family: 'Nunito', sans-serif;
}
.heading {
font-size: 3em;
padding: 0;
margin: 0;
}
.contactButton {
font-size: 2em;
text-align: right;
padding: 0;
margin: 0;
float: right;
}
<body class="body">
<div class="header">
<div>
<h1 class="heading">William Marchesi</h1>
<a class="contactButton" href="#contact">Contact</a>
</div>
</div>
</body>