I bet a bunch of you don’t realize that we can create the illusion of shapes by using 100% CSS. By utilizing the border property in creative ways, we can make some really interesting polygons. In this week’s screencast, we’ll figure out a way to create speech-bubbles without resorting to background images.
Most of us, by now, are familiar with using the “-moz-border-radius” and “-webkit-border-radius” properties to create rounded corners – or even complete circles – but there are other techniques to create more complicated shapes.
Traditional Speech-Bubble

blockquote#one {
width: 250px;
background: #e3e3e3;
padding: 25px;
position: relative;
}
#one .arrow {
width: 0;
height: 0;
line-height: 0;
border-top: 30px solid #e3e3e3;
border-left: 60px solid white;
border-right: 10px solid white;
position: absolute;
bottom: -30px;
right: 30px;
}
Note how the “bottom” property is the reciprocal of the “border-top” property.
Alternate

blockquote#two {
width: 250px;
background: #e3e3e3;
padding: 25px;
position: relative;
}
blockquote#two .arrow {
width: 0;
height: 0;
line-height: 0;
border-top: 40px solid #e3e3e3;
border-left: none;
border-right: 30px solid white;
position: absolute;
bottom: 60%;
right: -30px;
}
Yet Another

blockquote#three {
width: 450px;
background: #e3e3e3;
padding: 25px;
position: relative;
}
#three .arrow {
width: 0;
height: 0;
line-height: 0;
border-bottom: 25px solid #e3e3e3;
border-right: 50px solid white;
position: absolute;
top: -24px;
left: 20px;
}

Interesting Note
I’m typing this paragraph minutes before posting the tutorial. I learned something tonight. Did you know that, if you want your document to validate, you can’t place text directly into a blockquote? It needs to be nested within a parent element – like the <p> tag. Additionally, the validator didn’t like the fact that I used a span tag within the blockquote. It allows for a plethora of elements, but unfortunately not the span! Oh well; no big deal. Just replace it with a different element. It hardly makes a difference.

Pretty Nifty
I’m really eager to see how you guys have implemented this unique trick into your own projects. Send us links to your examples, via the comments. Thanks for watching. Next week, plan on learning something much more advanced. …I just need to figure out what! Until then.
- Follow us on Twitter, or subscribe to the NETTUTS RSS Feed for more daily web development tuts and articles.



Pingback: 50 Incredible Tutorials from the Tuts+ Network | rapid-DEV.net
Pingback: 10 Useful CSS Tutorials
Pingback: Nifty Shaped Pure CSS Tooltips | Ganda Manurung
Pingback: Free Resources to Help You Become a CSS Expert Designer, | guidesigner.net
Pingback: 250+ Resources to Help You Become a CSS Expert | X Design Blog
Pingback: 250+ Resources to Help You Become a CSS Expert | huibit05.com
Pingback: 20+ Sumber yang akan membuat anda menjadi CSS Master « Webdesigner Resource
Pingback: 99 Graphic Design Resources- A place for desginers |
Pingback: Best CSS |
Pingback: Become a CSS Expert, 250+ Resources | Amazing and Inspiring Design
Pingback: 250+资源帮助你成为一个CSS专家 - 唯创网站设计博客
Pingback: 155+ Mega CSS Roundup of Tools, Tutorials, Cheat Sheets etc. | tripwire magazine
Pingback: 185+ Very Useful and Categorized CSS Tools, Tutorials, Cheat Sheets | tripwire magazine
Pingback: 10 Tips to make your website load faster. « QuintalDesigns – Design blog and tutorials by Ryan Quintal
Pingback: 185+ Very Useful and Categorized CSS Tools, Tutorials, Cheat Sheets « qeqnes | Designing. jQuery, Ajax, PHP, MySQL and Templates
Pingback: From Photoshop to HTML - Часть 1 | K41
Pingback: 250+资源来帮助你成为一个CSS专家 | Jackchen Design 1984
Pingback: Enlaces interesantes | roabnotepad
Pingback: 250+ Resources to Help You Become a CSS Expert « RPL Class
Pingback: Simplify Web Development Using Ultimate CSS Cheats « CSS Tips