Solved

circular borders

Posted on 2011-09-06
10
293 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now