# CSS - Rounded Corners w/ padding applied

**URL:** <https://forum.kirupa.com/t/css-rounded-corners-w-padding-applied/204825>\
**Category:** web dev\
**Created:** [October 23, 2006, 8:50pm UTC](https://forum.kirupa.com/t/css-rounded-corners-w-padding-applied/204825 "2006-10-23T20:50:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bladeMX](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@bladeMX](https://forum.kirupa.com/u/bladeMX)\
**Post date:** [October 23, 2006, 8:50pm UTC](https://forum.kirupa.com/t/css-rounded-corners-w-padding-applied/204825/1 "2006-10-23T20:50:29Z")

</div>

Thought this would be really easy to do, but everytime I apply padding elements go wacky.

```auto
<!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" />
<title>Untitled Document</title>

<style type="text/css">

.roundcont {
	width: 250px;
	background-color: #f90;
	color: #fff;
}

.roundcont p {
	margin: 0 10px;
}

.roundtop { 
	background: url(http://kalsey.com/tools/css/rounded/images/tr.gif) no-repeat top right; 
}

.roundbottom {
	background: url(http://kalsey.com/tools/css/rounded/images/br.gif) no-repeat top right;
}

img.corner {
   width: 15px;
   height: 15px;
   border: none;
   display: block !important;
}

</style>

</head>

<div class="roundcont">
   <div class="roundtop">
	 <img src="http://kalsey.com/tools/css/rounded/images/tl.gif" alt="" 
	 width="15" height="15" class="corner" 
	 style="display: none" />
   </div>

   <p>Lorem ipsum dolor sit amet, consectetur adipisicing 
   elit, sed do eiusmod tempor incididunt ut labore et 
   dolore magna aliqua. Ut enim ad minim veniam, quis 
   nostrud exercitation ullamco laboris nisi ut aliquip 
   ex ea commodo consequat. Duis aute irure dolor in 
   reprehenderit in voluptate velit esse cillum dolore eu 
   fugiat nulla pariatur. Excepteur sint occaecat cupidatat 
   non proident, sunt in culpa qui officia deserunt mollit 
   anim id est laborum.</p>
  
   <div class="roundbottom">
	 <img src="http://kalsey.com/tools/css/rounded/images/bl.gif" alt="" 
	 width="15" height="15" class="corner" 
	 style="display: none" />
   </div>
</div>	

<body>
</body>
</html>

```

Any help greatly appreciated.

---

<div class="post-metadata">

**Author:** ![aldomatic](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@aldomatic](https://forum.kirupa.com/u/aldomatic)\
**Post date:** [October 23, 2006, 8:56pm UTC](https://forum.kirupa.com/t/css-rounded-corners-w-padding-applied/204825/2 "2006-10-23T20:56:40Z")

</div>

padding where? looks fine to me

---

<div class="post-metadata">

**Author:** ![bladeMX](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@bladeMX](https://forum.kirupa.com/u/bladeMX)\
**Post date:** [October 23, 2006, 9:13pm UTC](https://forum.kirupa.com/t/css-rounded-corners-w-padding-applied/204825/3 "2006-10-23T21:13:58Z")

</div>

[QUOTE=al-do;1983877]padding where? looks fine to me[/QUOTE]

Doh!

In the element below:

```auto

.roundcont {
	width: 250px;
	background-color: #f90;
	color: #fff;
      padding: solid 25px #CCC;
}

```

---

<div class="post-metadata">

**Author:** ![aldomatic](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@aldomatic](https://forum.kirupa.com/u/aldomatic)\
**Post date:** [October 23, 2006, 9:16pm UTC](https://forum.kirupa.com/t/css-rounded-corners-w-padding-applied/204825/4 "2006-10-23T21:16:14Z")

</div>

```auto

.roundcont p {
margin: 0 10px;
padding:25px;
}

```

add it there insted.

---

<div class="post-metadata">

**Author:** ![bladeMX](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@bladeMX](https://forum.kirupa.com/u/bladeMX)\
**Post date:** [October 23, 2006, 9:40pm UTC](https://forum.kirupa.com/t/css-rounded-corners-w-padding-applied/204825/5 "2006-10-23T21:40:05Z")

</div>

[QUOTE=al-do;1983891]

```auto

.roundcont p {
margin: 0 10px;
padding:25px;
}

```

add it there insted.[/QUOTE]

Thank you for the quick response. By the way, love the icon.

I’ve been using that example to apply corners to this design below:  
[http://www.majikmedia.com/template2/](http://www.majikmedia.com/template2/)

I’ve tried placing the corners in the container tag, but because of padding in the tag it doesn not seem to apply.

Is it possible to have the corners in the same element where padding is applied, or will they not inherit?

Thanks again for your response.

---

<div class="post-metadata">

**Author:** ![aldomatic](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@aldomatic](https://forum.kirupa.com/u/aldomatic)\
**Post date:** [October 23, 2006, 9:45pm UTC](https://forum.kirupa.com/t/css-rounded-corners-w-padding-applied/204825/6 "2006-10-23T21:45:35Z")

</div>

well if your using just a solid color you could use this [LINK](http://www.html.it/articoli/niftycube/index.html)
