I'm looking to add "outer" rounded corners to the selected sidebar item to give the effect that this item is "pouring" into the content well.
In my example below, I'd like the .top
to have a rounded bottom-right corner with a gray background, along with a similar top-right corner for the .bottom
. What do you think?
I'm using Twitter Bootstrap and LESS, if that makes it easier.
jsFiddle: http://jsfiddle.net/3YXb2/
Turn this:
Into this:
Markup:
<div class="wrapper">
<div class="sidebar">
<div class="top">
<p>Top</p>
</div>
<div class="middle">
<p>Middle</p>
</div>
<div class="bottom">
<p>Bottom</p>
</div>
</div>
<div class="container">
<p>Content</p>
</div>
</div>
CSS:
body {
margin:10px;
}
div {
margin:0;
margin-right:-4px;
padding:0;
display:inline-block;
vertical-align:middle;
}
.wrapper {
width:100%;
display:block;
border:1px solid;
}
.container {
background-color:gray;
width:70%;
height:300px;
}
.sidebar {
background-color:white;
width:30%;
height:300px;
}
.middle {
background-color:gray;
}
.top,.middle,.bottom {
width:100%;
height:100px;
display:block;
}
p {
padding:40px 0 0;
margin:0;
text-align:center;
}
Css3 offers the border-radius
property. However, please note that this is not available for IE8 or any version lower. There are available hacks; but they are just that: hacks.
Usage looks like this:
.sidebar {
background-color:gray;
width:30%;
height:300px;
}
.middle {
background-color:gray;
}
.top,.middle,.bottom {
width:100%;
height:100px;
display:block;
}
.top{
background: white;
border-bottom-right-radius:10px;
}
.bottom{
background: white;
border-top-right-radius: 10px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With