logo and h1 heading appear on same line using html and css -
i want create webpage encountered problem in making logo appear near heading. have tried following code not produce expected results.
i have following code:
.line .box .header img { float: left; } .line .box.header h1 { position: relative; top: 1px; left: 10px; }
<div class="line"> <div class="box"> <div class="s-6 l-2"> <div class="header"> <img src="img/hrcimg.jpg" alt="logo"> <h1>united nations human rights council</h1> </div> </div> </div> </div>
you need increase width of .l-2
element.
setting element's width 100% result in layout title of question eludes to.
when reaching lower resolutions, you'll need adjust these styles accordingly structure maintained point.
once resolution reaches mobile proportions, consider displaying them in own lines. can done setting logo display block
width: 100%;
& height: auto;
, you'll need kill float
rule @ point.