Solved

rounded corners

Posted on 2010-11-20
10
462 Views
Last Modified: 2012-05-10
Hi,

How can I make rounded corners with border lines as blue and whole background as white for my data.
I want this to work with all browsers. I have found some articles using Google, but they all are for CS3 only. I cannot ignore IE6 and Safari

Please see image  
snap.bmp
0
Comment
Question by:sindhuxyz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 13

Expert Comment

by:dsmile
ID: 34180061
How about a div, span or table with blue border, size=1px and then 4 corners overlayed by 4 images that show corresponding blue corner? (http://web-graphics.com/mtarchive/001660.php)

Here's 25 ways to have round corner, you should take a look at this  http://www.devwebpro.com/25-rounded-corners-techniques-with-css/
0
 
LVL 13

Expert Comment

by:dsmile
ID: 34180077
This tutorial looks like what you need http://www.cssplay.co.uk/boxes/snazzy.html
0
 
LVL 82

Expert Comment

by:leakim971
ID: 34180083
You saw this ONE ?
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 5

Author Comment

by:sindhuxyz
ID: 34180309
@leakim971
ID: 34180083

I am exactly looking for this, border blue with background grey/white, can u please tell me source code for it?
0
 
LVL 5

Author Comment

by:sindhuxyz
ID: 34180507
Sorry for my mistake, @dsmile
is what I am looking for.

ID:  ID: 34180077

Can anyone provide me source for it?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34180560
Here is the 'old-fashioned' way to do it.  It uses a table and three images for top, middle, and bottom.  The quality and shape of the rectangle depends on your graphics program.  This version is for a fixed width table.  There are more complicated versions for variable width tables or screens.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Round Rectangle</title>
<style type="text/css">
<!-- 
.ttop {
	height: 22px;
	background-image: url(RoundRectTop.jpg);
	} 
.tmid {
	background-image: url(RoundRectMid.jpg);
	} 
.tbot {
	height: 22px;
	background-image: url(RoundRectBot.jpg);
	} 
-->
</style>
</head>
<body>
<h1>Round Rectangle Demo</h1>
<table border="0" cellpadding="7" cellspacing="0" summary="" width="274px">
<tr><td class="ttop"></td></tr>
<tr><td class="tmid">&nbsp;<br />
This is where the text goes.<br />
&nbsp;</td></tr>
<tr><td class="tbot"></td></tr>

</table>
</body>
</html>

Open in new window

RoundRectTop.jpg
RoundRectMid.jpg
RoundRectBot.jpg
0
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 34181623
NOTHING with rounded corners done with CSS is going to work for IE6 -- nothing!  And most CSS rounded corners wont work with IE7 either.  So if you want ALL BROWSER compatibility, you HAVE to compose the rounded box using images on the corners, as Dave has shown above.

Save yourself a LOT of CSS hassle and testing.  Only a composite image will work on all browsers.
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34181635
However, Dave's diagrams do not leave you room for text in the upper and lower areas.  The most complete way to do this is with images ONLY for the corners.  I will try a picture to show you --

               -------------------------------------------
     r.img  |     text in line w. image corners   |   r.img

 And the bottom is an inverse of this -- r.img above is just the rounded corner nothing else.

This can best be done with a 5 cell wide table, one for each rounded corner, one for the vertical line, and another for the text in between.
0
 
LVL 13

Expert Comment

by:dsmile
ID: 34181653
@sindhuxyz: go to http://www.cssplay.co.uk/boxes/snazzy.html, viewsource and grab the code.

This is the result
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head>


<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> Test Snazzy Borders</title>

<style type="text/css">

#xsnazzy h1, #xsnazzy h2, #xsnazzy p {margin:0 10px; letter-spacing:1px; padding:0;}
#xsnazzy h1 {font-size:2.5em; color:#fff;}
#xsnazzy h2 {font-size:2em;color:#06a; border:0;}
#xsnazzy p {padding-bottom:0.5em;}
#xsnazzy h2 {padding-top:0.5em;}
#xsnazzy {background: transparent; margin:25px 1em 100px 1em;}

.xtop, .xbottom {display:block; background:transparent; font-size:1px;}
.xb1, .xb2, .xb3, .xb4 {display:block; overflow:hidden;}
.xb1, .xb2, .xb3 {height:1px;}
.xb2, .xb3, .xb4 {background:#ccc; border-left:1px solid #08c; border-right:1px solid #08c;}
.xb1 {margin:0 5px; background:#08c;}
.xb2 {margin:0 3px; border-width:0 2px;}
.xb3 {margin:0 2px;}
.xb4 {height:2px; margin:0 1px;}

.xboxcontent {display:block; background:#ccc; border:0 solid #08c; border-width:0 1px;}


</style>
</head>

<body>

<div id="xsnazzy">
<b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>
<div class="xboxcontent">
<h1>Snazzy Borders</h1>
Grabbed from http://www.cssplay.co.uk/boxes/snazzy.html
</div>
<b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"></b></b>

<br class="clear"><br>

</body></html>

Open in new window

0
 
LVL 13

Expert Comment

by:dsmile
ID: 34193614
@sindhuxyz: have you seen http://www.cssplay.co.uk/boxes/snazzy.html on IE6 & Safari for yourself??? You asked for CSS, I gave you one working solution, but then you accept a none-solution. This is really ridiculous.

@scrathcyboy: with all due respect, see it for yourself once.
2010-11-23-09-49-51.png
snazzy-safari.png
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question