I found an interesting article on digg about using rollovers in CSS w/o javascript. (http://www.creativepro.com/story/howto/25816.html) I've been thinking about Rounded corners using only 1 image for a while now. Here's my solution:
CSS
HTML
I just grabbed a circle image off of google images (this one: http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/circleCofG1.gif)
*NB my calculations are based on a 50x50px circle adjust appropriately.
*NB2 Turn the white part transparent for greater flexibility
I wanted to use 1 image because it saves on user download (1 image vs 5). I appreciate any/all feedback (pos/neg) I know the HTML looks a little "ugly" would greatly appreciate if anyone has an idea to combine the three top and bottom divs
If you want to make a tab design, just include the top (or bottom) divs
See it in action:
CSS
Code:
.box_text{text-align:center; width:200px; height:150px; background-color:cyan; color:white; clear:both;}
.ul{background-image: url('corner.gif'); background-repeat: no-repeat; height: 25px; width: 25px; float:left;}
.ur{background-image: url('corner.gif'); background-repeat: no-repeat; height: 25px; width: 25px; float:left; background-position:-25 0;}
.up{height:25px; width:150px; background-color:cyan; float:left;}
.bl{background-image: url('corner.gif'); background-repeat: no-repeat; height: 25px; width: 25px; float:left; background-position:0 -25}
.br{background-image: url('corner.gif'); background-repeat: no-repeat; height: 25px; width: 25px; float:left; background-position: -25;}
.bt{height:25px; width:150px; background-color:cyan; float:left;}
HTML
Code:
<div class="box">
<div class="ul"></div>
<div class="up"></div>
<div class="ur"></div>
<div class="box_text">
Test
</div>
<div class="bl"></div>
<div class="bt"></div>
<div class="br"></div>
</div class="box">
I just grabbed a circle image off of google images (this one: http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/circleCofG1.gif)
*NB my calculations are based on a 50x50px circle adjust appropriately.
*NB2 Turn the white part transparent for greater flexibility
I wanted to use 1 image because it saves on user download (1 image vs 5). I appreciate any/all feedback (pos/neg) I know the HTML looks a little "ugly" would greatly appreciate if anyone has an idea to combine the three top and bottom divs
If you want to make a tab design, just include the top (or bottom) divs
See it in action: