/ Published in: HTML
sprite is 300px x 300px
/REVIEW OF POSITIONING: The first value is the horizontal position and the second value is the vertical. The top left corner is 0 0. Units can be pixels (0px 0px) or any other CSS units. If you only specify one value, the other value will be 50%. You can mix % and positions/
Expand |
Embed | Plain Text
/*---css--- sprite is 300px x 300px with 100px by 100px shapes*/ #nav{position: relative; top: 15px; max-height: 120px; left: -25px;} #nav ul {display: block; max-height: 100px;} #nav ul li { font-family: 'Arial Black', sans-serif; font-size: 15px; letter-spacing: 3px; text-decoration: none; text-transform: capitalize; line-height: 20px; text-align:center; } #nav ul li a {display: block; color: #fff; width: 100px; height: 100px; background: url("images/homepagenavsprite.png") no-repeat; float: left; } #nav ul li a span{display: block; margin-top: 35px; margin-left: 18px;} #nav li.home a, #nav li.home a:link, #nav li.home a:visited {background-position: 0 0; outline:0; } #nav li.home a:hover {background-position: 0 -100px;} #nav li.home a:focus, a:active {background-position: 0 -200px;border: none; outline:0;} #nav li.work a, #nav li.work a:link, #nav li.work a:visited {background-position:0 0; } #nav li.work a:hover {background-position: 0px -100px;} #nav li.work a:focus, a:active {background-position: 0 -200px;border: none; outline:0;} #nav li.blog a, #nav li.blog a:link, #nav li.blog a:visited {background-position:0 0; } #nav li.blog a:hover {background-position: 0px -100px;} #nav li.blog a:focus, a:active {background-position: 0 -200px; border: none; outline:0;} ------------html <div id="nav"> <ul id="navsprite"> </ul> </div>
You need to login to post a comment.
