Solved

circular borders

Posted on 2011-09-06
10
296 Views
Last Modified: 2012-05-12
please see related question

want circular borders

like the picture in the related question

this is the 105x105 camera

http://filedb.experts-exchange.com/incoming/2011/09_w37/t495892/canon-550d.gif

and this is the border around the image with rounded edges

http://filedb.experts-exchange.com/incoming/2011/09_w37/t495891/border.jpg
<style>
#product{
	width:140px;
	height:190px;
	border:1px solid #CCC;	
	-moz-border-radius: 10px;
	border-radius: 10px;
	float:left;
	margin-right:20px;
}
#product:hover{
	width:140px;
	height:190px;
	border:1px solid #333;	
	-moz-border-radius: 10px;
	border-radius: 10px;
}

#product .title{
	color:#06C;
	font-weight:bold;
	text-align:center;
	margin:3px;
}
#product img{
	margin:5px 15%;
}
#product .price{
	text-align:center;
	margin-top:10px;
	color:#06C;	
}
</style>


<div id="product">
<div class="title">Camera</div>
<img src="images/canon-550d.gif" alt="Camera" />
<div class="price">$300</div>
</div>
<div id="product">
<div class="title">Camera</div>
<img src="images/canon-550d.gif" alt="Camera" />
<div class="price">$300</div>
</div>
<div id="product">
<div class="title">Camera</div>
<img src="images/canon-550d.gif" alt="Camera" />
<div class="price">$300</div>
</div>

Open in new window

0
Comment
Question by:rgb192
  • 5
  • 4
10 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 36491428
Sounds like you want rounded corners. If your going for CSS only it won't work in any version of IE except for 9.

For that I recommend PIE.htc.

http://css3pie.com/
#product img{
	margin:5px 15%;
border-radius: 5px;
-moz-border-radius:5px;
-webkit-border-radius:5px
}

Open in new window

0
 
LVL 30

Expert Comment

by:LZ1
ID: 36491435
Almost forgot. You'll need to specify an actual border too:

#product img{
        margin:5px 15%;
border-radius: 5px;
-moz-border-radius:5px;
-webkit-border-radius:5px
border:1px solid #999;
}

Open in new window

0
 

Author Comment

by:rgb192
ID: 36492309
I dont understand

want border go around the image and the words


what is the final css
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 18

Expert Comment

by:Eternal_Student
ID: 36494442
LZ1 has given you a solution ... for more information take a look at this:

http://www.the-art-of-web.com/css/border-radius/
0
 
LVL 30

Expert Comment

by:LZ1
ID: 36495144
If you want it to go around the image and words, then just change the selection in your CSS from:
#product img

to:
#product
0
 

Author Comment

by:rgb192
ID: 36514207
I think I did the replace wrong

because there is already a product img


#product {
        margin:5px 15%;
border-radius: 5px;
-moz-border-radius:5px;
-webkit-border-radius:5px
border:1px solid #999;
}
#product:hover{
  width:140px;
  height:190px;
  border:1px solid #333;  
  -moz-border-radius: 10px;
  border-radius: 10px;
}

#product .title{
  color:#06C;
  font-weight:bold;
  text-align:center;
  margin:3px;
}
#product img{
  margin:5px 15%;
}
#product .price{
  text-align:center;
  margin-top:10px;
  color:#06C;  
}
</style>


<div id="product">
<div class="title">Camera</div>
<img src="images/canon-550d.gif" alt="Camera" />
<div class="price">$300</div>
</div>
<div id="product">
<div class="title">Camera</div>
<img src="images/canon-550d.gif" alt="Camera" />
<div class="price">$300</div>
</div>
<div id="product">
<div class="title">Camera</div>
<img src="images/canon-550d.gif" alt="Camera" />
<div class="price">$300</div>
</div>

Open in new window

0
 
LVL 30

Accepted Solution

by:
LZ1 earned 500 total points
ID: 36514475
This?  We're not sure what you want it to look like, but here it is with the border around the image and price.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style> 
#product {
        margin:5px 15%;
border-radius: 5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border:1px solid #999;
}
#product:hover{
  width:140px;
  height:190px;
  border:1px solid #333;  
  -moz-border-radius: 10px;
  border-radius: 10px;
}

#product .title{
  color:#06C;
  font-weight:bold;
  text-align:center;
  margin:3px;
}
#product img{
  margin:5px 15%;
}
#product .price{
  text-align:center;
  margin-top:10px;
  color:#06C;  
}
</style>

</head>

<body>

<div id="product">
	<div class="title">Camera</div>
	<img src="images/canon-550d.gif" alt="Camera" />
	<div class="price">$300</div>
</div>
<div id="product">
	<div class="title">Camera</div>
	<img src="images/canon-550d.gif" alt="Camera" />
	<div class="price">$300</div>
</div>
<div id="product">
	<div class="title">Camera</div>
	<img src="images/canon-550d.gif" alt="Camera" />
	<div class="price">$300</div>
</div>

</body>
</html>

Open in new window

0
 

Author Comment

by:rgb192
ID: 36514787
this code works on firefox5 but not ie9
0
 

Author Comment

by:rgb192
ID: 36514789
internet explorer has square borders
0
 

Author Closing Comment

by:rgb192
ID: 36515861
this works for non ie browsers
so thank you.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FIELDSETs and LEGENDs in email markup 1 29
css icomoons will not display on page 14 33
Border and image sizing 5 28
Bottom border change 5 17
This article discusses four methods for overlaying images in a container on a web page
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

807 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