I'm trying to recreate a website and position the icons in a certain way. Currently I have a black nav bar on the left with icons. I want the black nav bar to extend all the way to bottom of the page and I also want the icons to be separated.
Here is the CSS code:
#left_nav {
border: solid black;
}
#left_nav i {
color: gray;
padding-right: 35%;
padding-left: 35%;
margin-top: 60%;
}
HTML code:
<div id="left_nav" class="grid_2 alpha">
<i class="ss-icon">home</i>
<i class="ss-icon">time</i>
<i class="ss-icon">user</i>
<i class="ss-icon">question</i>
<i class="ss-icon">play</i>
</div>
http://jsfiddle.net/fmpeyton/3L5YV/
A few things:
<i>
) cannot have a margin. You'll have to make the element a block level element via display:block;
CSS:
html, body{
height: 100%; // height declared so child #left_nav can expand to this height
}
#left_nav {
border: solid black;
height: 100%; // will expand to height of parent
}
#left_nav i {
display:block; // added display:block; to allow for margin
color: gray;
padding-right: 35%;
padding-left: 35%;
margin: 10px 0; // only available to block level elements
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.