Is there a way to do an inverted rounded corner in CSS3, something approximately like the bottom left corner in the (crude) drawing below?
/-------\
| |
| |
| |
| ______/
|/ <---The left side is flush (straight), the slant should be rounded
Perhaps border-radius could be combined with this technique?
Edit: I'm not looking for a speech bubble, but rather just a way to curve the right side of the point on the bottom left.
Well, this is pure madness, but certainly there are ways to achieve this :-) not cross-browserly, but let's see:
Our mark-up:
<div id="bubble">
<p>This is madness!</p>
</div>
Our CSS:
#bubble {
width:200px;
height:100px;
border:1px solid #000;
-webkit-border-radius:20px;
-moz-border-radius:20px;
border-radius:20px;
}
#bubble p {
margin: 1em;
font-family:Comic Sans MS;/* well, madness it is! */
}
#bubble:before {
content:'';
border:20px solid;
border-color:#fff transparent transparent;
position:absolute;
top:110px;
left:25px;
z-index:2;
}
#bubble:after {
content:'';
border:20px solid;
border-color:#000 transparent transparent;
position:absolute;
top:111px;
left:25px;
z-index:1;
}
The result: http://jsfiddle.net/MrLWY/
I have only tested this in Firefox 3.6.3, but the idea is clear :-)
Here is take two:
#bubble {
width:200px;
height:100px;
border:1px solid #000;
position:relative;
-webkit-border-radius:20px 20px 20px 0;
-moz-border-radius:20px 20px 20px 0;
border-radius:20px 20px 20px 0;
}
#bubble p {
margin: 1em;
font-family:Comic Sans MS;
}
#bubble:before {
content:'';
width:20px;
height:20px;
background:#fff;
border-left:1px solid #000;
position:absolute;
top:100px;
left:-1px;
}
#bubble:after {
content:'';
-webkit-border-radius:20px 0 0 0;
-moz-border-radius:20px 0 0 0;
border-radius:20px 0 0 0;
border:solid #000;
border-width:1px 0 0 1px;
width:20px;
height:19px;
position:absolute;
top:100px;
left:0;
}
And the result: http://jsfiddle.net/ajeN7/
Perhaps this can be enhanced in many ways:
I cant comment yet, but so here's a new answer (in regard to Gryzzlys answer):
Gryzzlys first example didn't handle different background colors (for the background and bubble).
But the second one does. Here's an example with background colors applied:
http://jsfiddle.net/tGnfb/
(I also added border-radius properties so that it will render borders for other browsers than Firefox).
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