HTML / CSS: I'm Experiecing With Divs? -
code: http://pastebin.com/00nds6kn
i seeking put of on 1 page, in there no scrollbar present on browser when on page. have attempted set heights of divs percentage via css unsuccessful.
i unable remove small white gap between div "footer" , div "banner" containing image.
body { width: 100%; margin: 0px; background-color: #f5f5f5; } #container { height: 100%; } #navigation{ color: white; background-color: #292526; width: 100%; position: fixed; top: 0px; padding: 0.5% 0.5%; } #navigationleft { width: 24.5%; display: inline-block; vertical-align: middle; font-size: 180%; } #navigationright { width: 74.5%; display: inline-block; vertical-align: middle; } #navigation ul{ float: right; } #navigation ul li { display: inline; } #navigation { font-size: 120%; color: white; text-decoration: none; } #footer{ color: white; background-color: #292526; width: 100%; padding: 0.5% 0.5%; }
<div id="container"> <div id="navigation"> <div id="navigationleft"> <a href="#">visit clare ireland</a> </div><div id="navigationright"> <ul> <li><a href="#">home |</a></li> <li><a href="#">maps |</a></li> <li><a href="#">hotels |</a></li> <li><a href="#">appartments |</a></li> <li><a href="#">attractions |</a></li> <li><a href="#">essentials |</a></li> <li><a href="#">bars , clubs |</a></li> <li><a href="#">transport</a></li> </ul> </div> </div> <div id="banner"> <img src="http://i.imgur.com/vsirznz.jpg" alt="the cliffs of moher"/> </div> <div id="footer"> <p>placeholder</p> </div> </div>
to remove blank space above footer add #banner
element:
line-height: 0;
to remove scrollbars add css:
::-webkit-scrollbar { width: 0 !important }
edit
to have whole page fit within viewport of browser can calculate needed height of banner
since footer
, navigation
elements have fixed heights:
height: calc(100vh - 133px);
the above gives element 100% height of viewport, minus combined height of navigation
, footer
elements (approx 68.5px + 64.5px ~ 133px).
you can remove position: fixed
navigation
element since visible anyways.
view demo of here
Comments
Post a Comment