Make your text beautiful with CSS3
Styling web content with CSS3 properties can be quite a lot of fun.
This is what you can get with as little as a custom embedded font, text-shadow, CSS rotation and some background gradients:
Quite nice, huh?!
If you want do do this kind of text styling, all you have to do is get acquainted with some of the newer CSS properties. Apart from normal text styling, this mainly does the trick:
Embed a custom font with @font-face
If you want to use some special fonts, you can embed them into your stylesheet via the @font-face rule. The best way to do this: Head over to Font Squirrel and get yourself some nice @font-face kits. You can copy the font files into your website folder and then copy the CSS to your stylesheet.
Bevel your text with text-shadow
Modern browsers unterstand the text-shadow property, so you don’t have to add a browser specific prefix. I defined two kinds of text shadows, a brighter one for the highlight and a darker one for the shadow, like so:
body {
text-shadow: 3px 3px 0 #9b9073,-1px -1px rgba(255,255,255,0.5);
}
Rotate some portions of the text
As this is not yet an official standard, you’ll have to use the browser specific code to see this effect in Safari and Firefox:
In Firefox:
.rotated {
-moz-transform: rotate(-5deg);
}
And in Safari:
.rotated {
-webkit-transform: rotate(-5deg);
}
Note: It seems like Safari only rotates block level elements, so if you use the <span>-Element as CSS hooks, you’ll have to set them to display: block.
Highlight your content with a background gradient
body {
background: -moz-radial-gradient(center 50%,circle,#700 10%,#500 70%);
}
The code for Safari is a little more complicated:
body {
background: -webkit-gradient(radial, 50% 50%, 100, 50% 50%, 350, from(#700), to(#500));
}
Here you can see it in action.
Remember, this is was implemented as a demonstration of what’s possible in modern browsers. If you want to make an actual website like this, you would have to take care of less capable browsers and also, the contrast would probably be too low. If you’re not so much into dark colors, I have hidden an easter egg for you in the demo, just change the class of the <body>-Tag to “brown” with Firebug ;-)
If you want to have a look at another cool example of text styling, check out this website.
Ähnliche Artikel
Keine ähnlichen Artikel gefunden.
Hallo, ich heiße Birgit Zimmermann und blogge hier über Webdesign und Webentwicklung, aber auch über persönliche Dinge. mehr Info…
Blog durchsuchen
Beliebte Artikel
- Sind wir Designer oder Entwickler?
Roger Johansson macht sich in einem kürzlich erschienenen Artikel Gedanken über die passendste Bezeichnung für seine Tätigkeit und fragt in... - 10 der häufigsten Irrtümer über SEO
Die Suchmaschinenoptimierung ist ein wichtiger Teil jeder Online-Strategie, denn was nützt die beste Website, wenn sie nicht gefunden wird? Da... - Page Lists Plus – WordPress Plugin für elegante Page Forwards
Das nette kleine WP-Plugin Page Lists Plus von Tim Holt bietet einige Zusatzfeatures für die Links in Seitenmenus, wie Änderung...
Letzte Kommentare
Robert zu Sind wir Designer oder Entwickler?:
Hallo Birgit! Ich gestehe, weder mein schmächtiges Interesse an Fotografie, noch meine Liebe zu Pferd und/oder Natur, sondern trivialer Zufall
LuckyLuke zu Erstelle einen Hollywoodstern in Photoshop:
Vielen Dank ist ein sehr schönes Tutorial
Dennis zu Wenn sich im Halbschlaf…:
Wie süss! :) Was für höfliche Ebeneneffekte Du hast...
Letzter Tweet
01.02. 13:19
5-year-old analyzes logos on brand new: http://t.co/GLe0SKjo
Following:
Im Moment keine Follow-Liste. Vielleicht ist Twitter gerade überlastet ;)
follow me on twitter @bz_icehorse

















