I want both the image and text centered horizontally and vertically. What is the best way to go about this? I have tried float but it doesn't seem to be working. See the above image for ideal result
HTML:
<div class="clearfix" id="one">
<img class="imac" src="imac.png">
<p1>
I want to work in Computer Design, changing the way people
interact with thoughtfully considered software and hardware
experiences.
</p1>
</div>
CSS:
#one{
background-color: #4E5B71;
width: 100%;
height: auto;
padding: 15px;
}
.clearfix{
overflow: auto;
}
p1{
font-family: AvenirNext-Regular;
font-size: 24px;
color: #FFFFFF;
line-height: 50px;
vertical-align: middle;
display: inline-block;
}
imac{
width: 100% auto;
height: auto;
float:left;
vertical-align: middle;
}