LuckY07
12-17-2007, 12:01 PM
I don't understand how the following 'rounds' a box. I understand the idea
of using r1,r2,r3,r4 to make a corner, but i am not seeing how 'rtop' for example creates a right-top-corner.. r1 = 5px and as r2, r3 this gets progressively smaller, which would appear to be the BOTTOM-right, can someone explain how this creates the TOP-RIGHT corner?
heres how i am seeing the top-right corner mentally:
-----
---
--
-
-
XHTML >>
<div class="container">
<b class="rtop"><b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b></b>
CONTENTS GOES HERE
<b class="rbottom"><b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b></b>
</div>
CSS >>
.container {background:#ccc; color:#fff; margin:0 15px;}
.rtop, .rbottom{
display:block;
background:#fff;
}
.rtop *, .rbottom *{
display: block;
height: 1px;
overflow: hidden;
background:#ccc;
}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{
margin: 0 1px;
height: 2px
}
btw, i got this code from:
http://www.myneatsite.com/articles/rounded-corners-box-css.php
of using r1,r2,r3,r4 to make a corner, but i am not seeing how 'rtop' for example creates a right-top-corner.. r1 = 5px and as r2, r3 this gets progressively smaller, which would appear to be the BOTTOM-right, can someone explain how this creates the TOP-RIGHT corner?
heres how i am seeing the top-right corner mentally:
-----
---
--
-
-
XHTML >>
<div class="container">
<b class="rtop"><b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b></b>
CONTENTS GOES HERE
<b class="rbottom"><b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b></b>
</div>
CSS >>
.container {background:#ccc; color:#fff; margin:0 15px;}
.rtop, .rbottom{
display:block;
background:#fff;
}
.rtop *, .rbottom *{
display: block;
height: 1px;
overflow: hidden;
background:#ccc;
}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{
margin: 0 1px;
height: 2px
}
btw, i got this code from:
http://www.myneatsite.com/articles/rounded-corners-box-css.php