Search code examples
htmlcssborder

CSS 3 specials rounded corners in borders


How can I realise this special corner in my border with CSS3

enter image description here

This is what I got now:

http://jsfiddle.net/hashie5/nDv5k/

<aside>
<h2>Product in de kijker</h2>
<h3>Mobiele telefonie</h3>
<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.</p>
<a href="#" class="btn btn-runa">Ga verder</a>

    aside {
    border: 1px solid #CCCC00;
    border-radius: 10px;
    padding: 5px 20px 20px 20px;
    width: 290px;
    margin: 50px;
}
body {
    font-family:"Trebuchet MS";
    color: #333333;
    background-color: #FFFFFF;
    font-size: 14px;
    line-height: 150%;
}
h1 {
    font-size: 30px;
    color: #1F668C;
    line-height: 120%;
    font-weight: normal;
}
h2 {
    font-size: 22px;
    color: #CCCC00;
    line-height: 120%;
    font-weight: normal;
}
h3 {
    font-size: 22px;
    color: #1E678E;
    line-height: 120%;
    font-weight: normal;
}
h4 {
    font-size: 20px;
    color: #1E668C;
    line-height: 120%;
    font-weight: normal;
}
h5 {
    font-size: 14px;
    color: #CCCC00;
    line-height: 120%;
    font-weight: bold;
}
.btn-runa {
    background: none;
    background-color: #CCCC00;
    color: #FFFFFF;
    text-shadow: none;
}

Solution

  • Please refer this [jsFidde][1] [1]: http://jsfiddle.net/nDv5k/18/

    Html

    <aside>
        <div class="top">
        <h2>Product in de kijker</h2>
        </div>
        <div class="middle">
        <h3>Mobiele telefonie</h3>
        <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.</p>
        <a href="#" class="btn btn-runa">Ga verder</a>
        </div>
        <div class="upper-left"></div>
        <div class="bottom-left"></div>
        <div class="bottom-right"></div>
    </aside>
    

    CSS

    aside {
        width: 290px;
        margin: 50px;
        position:relative;
    }
    .top{
        padding: 5px 20px 20px 20px;
        border-top: 1px solid #CCCC00;
        border-left: 1px solid #CCCC00;
        border-top-left-radius: 10px;
        width: 224px;
        height:75px;
        top: -1px;
    }
    .middle{
        padding: 5px 20px 20px 20px;
        margin-top:-19px;
        border-bottom: 1px solid #CCCC00;
        border-left: 1px solid #CCCC00;
        border-right: 1px solid #CCCC00;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
        width: 289px;
        
    }
    .upper-left {
        border-right: 1px solid #CCCC00;
        border-top: 1px solid #CCCC00;
        border-top-right-radius: 10px;
        width:15px;
        height:25px;
        top: 0px;
        left:262px;
        position:absolute;
        z-index:10;
    }
    .bottom-left {
        border-left: 1px solid #CCCC00;
        border-bottom: 1px solid #CCCC00;
        border-bottom-left-radius: 10px;
        width:20px;
        height:25px;
        top: 25px;
        left:277px;
        position:absolute;
        z-index:10;
        background:#fff;
    }
    .bottom-right {
        border-right: 1px solid #CCCC00;
        border-top: 1px solid #CCCC00;
        border-top-right-radius: 10px;
        width:35px;
        height:31px;
        top: 50px;
        left:295px;
        position:absolute;
        z-index:10;
        background:#fff;
    }
    

    It's not a good way of coding but i didn't know another way

    Using image also is not a good idea in 2013 but you can try that too..