Click to See Complete Forum and Search --> : Rounded Borders on CSS
peteyb
09-25-2007, 11:55 AM
Hi all
I have been searching the Internet for a really good rounded borders system.
There are several methods with images and one called niftyCube that uses CSS and Javascript.
They are all very complicated and hard to work around unless you study every line of code to make sure you dont double code or overwrite a function with a new function.
The point of my thread is to discuss whether the WWW are looking to implemented a CSS border option called rounded e.g.
<style type="text\css">
div.main {
border: 1px red solid rounded;
}
</style>
wouldnt this just make life easier, surely it must be possible if you can have a border option!!!!!????
gizmo
09-25-2007, 12:20 PM
I didn't think this http://www.alistapart.com/articles/mountaintop/ was difficult to follow. However, the discussion, while interesting would only be hyperthetical and I can just see a different interpretation for each new version of a certain browser. :D ;)
pentace
09-25-2007, 02:44 PM
I'm on my phone so I don't have the link. But there is actually a page I found that explains how to make a true rounded css border with no images. Its nice but extremely work heavy. As far as making round borders an option they will never do it they still can't even get all browsers to use all functions as it is. But what could be done is use this page and maybe have the people that make prototype or another library implement it into their library so that it can be easly done
stymie
09-25-2007, 07:04 PM
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=iso-8859-1'>
<title>Rounded Corners Using CSS</title>
<style>
.outerDiv{width:300px; margin:50px auto;}
.innerDiv{height:300px; background-color:#f0f8ff; border-left:1px solid #808080; border-right:1px solid #808080;}
.rtop *,.rbottom *{display:block; height:1px; overflow:hidden;}
.r1{border-left:2px solid; border-right:2px solid; background-color:#808080; border-color:#808080; margin-left:7px; margin-right:7px;}
.r2{border-left:2px solid; border-right:2px solid; margin-left:5px; margin-right:5px;}
.r3{border-left:1px solid; border-right:1px solid; margin-left:4px; margin-right:4px;}
.r4{border-left:1px solid; border-right:1px solid; margin-left:3px; margin-right:3px;}
.r5{border-left:1px solid; border-right:1px solid; margin-left:2px; margin-right:2px;}
.r6{border-left:1px solid; border-right:1px solid; margin-left:1px; margin-right:1px; height:2px;}
.r7{border-left:1px solid; border-right:1px solid; height:2px;}
.r2,.r3,.r4,.r5,.r6,.r7{border-color:#808080; background-color:#f0f8ff}
</style>
</head>
<body>
<div class="outerDiv">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b><b class="r5"></b><b class="r6"></b><b class="r7"></b></b>
<div class="innerDiv">
</div>
<b class="rbottom"><b class="r7"></b><b class="r6"></b><b class="r5"></b><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
</div>
</body>
</html>
peteyb
09-26-2007, 05:35 AM
Ah guess its just wishful thinking!!!
I do like stymie method but again its a whole lot of code for something that SHOULD BE simple.
lohumihem
09-26-2007, 05:57 AM
try this . i tried it lots of time.
http://spiffycorners.com/
WebJoel
09-26-2007, 09:03 AM
Holding out hope for CSS3, which I beleive is supposed to include a method of creating 'round corner' on element use a declaration very similar to the one you suggested in first post.
In the meantime, the simplest method is to have an 'position:relative' container that has four 'position:absolute;' images, each respectively a 'corner' for the four edges. -A 'topleft', 'topright', 'bottomleft' and 'bottomright' would suffice.
Add "padding:foo:XXpx;" to the relative-positioned container whereby the value "foo:XXpx" is a number equal to or slightly greater than the height/width of the four courner images. This ensure that the content of the container is 'padded' away from the images so as to not over-write on top of them.
Here is an example:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title></title>
<style type="text/css">
* {border:0; padding:0; margin:0;}/* Set everything to "zero" */
p {font-size: 100%; line-height:1.0em; margin:16px 0 10px 0;}
html, body {min-height:100%; height:101%; padding-bottom:25px;
font:x-small Arial, Verdana, serif;
voice-family: "\"}\"";voice-family:inherit;
font-size:small;/*for IE 5.5 */}
html>body {font-size:small; height:auto;}/* Assist IE6 and under, 100% height */
font-size: small; voice-family: "\"}\"";
voice-family: inherit; font-size: medium;} /* Assist IE rendering height, keyword-font sizes, etc. */
h1, h2, h3, h4, h5, h6 {font-family: 'times new roman', arial, verdana, helvetica, serif; background-color:none;
font-style:normal; font-variant:normal; font-weight:normal; margin:14px 0 4px 10px;}
h1{font-size: 1.93em;}
h2{font-size: 1.72em;}
h3{font-size: 1.52em;}
h4{font-size: 1.42em;}
h5{font-size: 1.32em;}
h6{font-size: 1.21em;}
</style>
<style>
</style>
<script type="text/javascript"><!--
// -->
</script>
<link rel="shortcut icon" href="favicon.ico"><!-- path to your favicon -->
</head>
<body>
<div style="position:relative; width:500px; height:auto; border:1px solid silver; padding:40px 30px; margin:25px auto;" >
<h1>Level-1 Header</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Suspendisse egestas ultricies pede. Phasellus suscipit blandit risus.
Praesent nonummy. In erat. Duis nibh pede, accumsan eu, pulvinar et,
volutpat vel, elit. Curabitur nec dui sed nunc congue tempus. Nulla ac
dui ac libero fringilla nonummy. Maecenas ullamcorper sodales risus.
Vivamus pretium dolor. Proin eu turpis. Phasellus ut mauris non nulla
mattis luctus. Nunc porttitor dapibus sapien. In malesuada fermentum
metus. Nulla egestas, tellus a vestibulum pharetra, nunc purus auctor
lacus, ut semper purus ipsum eu velit. Praesent dui. Nulla accumsan
turpis at erat.</p>
<h2>Level-2 Header</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Morbi lacus felis, euismod at, pulvinar sit amet, dapibus eu, eros.
Etiam tellus. Nam vestibulum porttitor urna. Phasellus aliquet pretium
quam. Proin pharetra, wisi nec tristique accumsan, magna sapien pulvinar
purus, vel hendrerit ipsum tellus at ante.</p>
<img src="#" style="position:absolute; left:0; top:0; width:25px; height:25px; background-color:silver;" />
<img src="#" style="position:absolute; right:0; top:0; background-color:silver;" />
<img src="#" style="position:absolute; left:0; bottom:0; background-color:silver;" />
<img src="#" style="position:absolute; right:0; bottom:0; background-color:silver;" />
</div>
</body>
</html> BOLD is the relative-positioned container, and red are the four absolute-positioned images.
The container must be stated "position:relative;" in order for the "position:absolute;" images to be based on it, else they will be based upon the upper-left of the viewscreen.
This is possibly the easiest, most all-browser method to attain curved corners.
peteyb
09-26-2007, 09:42 AM
agh!!!! having to use images!!!!!
WebJoel
09-26-2007, 04:25 PM
Yet people keep upgrading to another busted M$ product and prevents Web Standards from progressing...
Wishful thinking --> http://www.w3.org/TR/2002/WD-css3-border-20021107/#the-border-radius -SOMEDAY! :D
>>sigh<<
peteyb
09-27-2007, 05:37 AM
when when when!!!!! when is CSS 3 to be released?
WebJoel
09-27-2007, 08:49 AM
Best guess is 'another 10 years at least'. IE doesn't even fully support CSS2 yet.
peteyb
09-28-2007, 11:43 AM
ah, monstersoft and their monopoly!!!