Skip to content

Instantly share code, notes, and snippets.

@playerzero
Created October 8, 2010 22:16
Show Gist options
  • Save playerzero/617661 to your computer and use it in GitHub Desktop.
Save playerzero/617661 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Background border-radius fringing example</title>
<style type="text/css">
/* 960.gs reset.css */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
/* 960.gs text.css */
body{font:13px/1.5 'Helvetica Neue',Arial,'Liberation Sans',FreeSans,sans-serif}a:focus{outline:1px dotted}hr{border:0 #ccc solid;border-top-width:1px;clear:both;height:0}h1{font-size:25px}h2{font-size:23px}h3{font-size:21px}h4{font-size:19px}h5{font-size:17px}h6{font-size:15px}ol{list-style:decimal}ul{list-style:disc}li{margin-left:30px}p,dl,hr,h1,h2,h3,h4,h5,h6,ol,ul,pre,table,address,fieldset{margin-bottom:20px}
/* real styles */
body {
background: #eee;
}
.item-wrapper {
position: relative;
width: 700px;
margin: 60px auto;
}
.item {
position: relative;
width: 700px;
overflow: hidden;
background: #fff;
border-radius: 20px;
-moz-border-radius: 20px;
}
.item-wrapper .author {
position: absolute;
top: 20px;
left: -50px;
border: 5px solid white;
border-width: 5px 5px 10px 5px;
line-height: 0;
z-index: 3;
-webkit-box-shadow: 0 0 4px #666;
-moz-box-shadow: 0 0 4px #666;
box-shadow: 0 0 4px #666;
-webkit-transform: rotate(3.39227220466deg);
-moz-transform: rotate(3.39227220466deg);
transform: rotate(3.39227220466deg);
}
.item .status-shade {
/* padding: 20px; */
/* background: rgba(255, 255, 255, 0.8); */
background: #b8c073 url(http://s.twimg.com/a/1285870286/images/themes/theme6/bg.gif) no-repeat;
opacity: 0.2;
position: absolute;
top: 0;
left:0;
width: 100%;
height: 100%;
}
.item .status {
position: relative;
padding: 20px;
margin: 20px;
background: white;
border-radius: 20px;
-moz-border-radius: 20px;
background: #fff;
}
.item .summary {
margin: 0 0 1em;
font-size: 1.5em;
line-height: 1.5em;
}
/*
* border-radiuses for the boxes with backgrounds
*/
#two.item,
#three.item, #three .status-shade {
border-radius: 20px;
-moz-border-radius: 20px;
}
</style>
</head><body>
<div class="item-wrapper">
<a class="author" href="http://twitter.com/markpasc"><img src="http://a3.twimg.com/profile_images/1094090023/headface_normal.jpg" width="48" height="48"></a>
<div id="three" class="item">
<div class="status-shade">
</div>
<div class="status">
<p class="summary">@<a href="http://twitter.com/jeremyleeking">jeremyleeking</a> i did add border-radius to the inner element, but its background is translucent so together it has bad pixel fringing</p>
<div class="footer">
<a href="http://twitter.com/markpasc/status/26696884392" class="relativedatestamp" title="Thu Oct 07 16:46:05 +0000 2010">07 Oct 2010 4:46 <small>PM</small></a>
by
<a href="http://twitter.com/markpasc">Mark Paschal</a>
</div>
</div>
</div>
</div>
</body></html>
@playerzero
Copy link
Author

.status-shade is now an empty div positioned absolutely. added a wrapper around .item to accommodate .author since overflow: hidden is in use making the photo get clipped (there may be a way around this but taking it out removes top/bottom background padding).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment