12 Fun CSS Text Shadows You Can Copy and Paste
Typography is everyone’s favorite toy in web design. One particularly fun tool that CSS gives you to play with your type is text-shadow, which seems simple enough at first but can be used to create some remarkable effects with a little ingenuity and creativity. Today we’re going to run through several text-shadow examples that you can copy and paste for your own work. The Basic Shadow The text-shadow property is super easy to work with and works well across all modern browsers without even so much as a vendor prefix! Syntax The syntax for creating a simple text-shadow is shown below. text-shadow: horizontal-offset vertical-offset blur color; Putting this into action, here’s an example with a shadow that has been moved down two pixels and right four pixels with a three pixel blur and a color of black at 30% opacity. text-shadow: 2px 4px 3px rgba(0,0,0,0.3); Here’s the result of this code, a nice simple shadow that is quite appealing all by itself. Why rgba? Quick and Dirty Letterpress Hard Shadow
Un arrière-plan extensible intelligent
Certains sites affichent une (grande) image de fond qui s'adapte à toutes les dimensions de la fenêtre du navigateur, proportionnellement, sans la déformer. La réalisation de ce genre de prouesse n'est pas si évidente techniquement, contrairement à ce que l'on pourrait croire de prime abord. Comment fait-on ? Nous allons présenter ici deux méthodes parmi celles qui sont possibles : une entièrement en CSS , une autre basée sur jQuery. Exemples Pour avoir un aperçu de ce que l'on veut obtenir, voici quelques exemples utilisant ce principe : Simon & Comet Flavors me Piz'za-za Le point commun de tous ces sites est la mise en avant de leur background : il est fixe et c'est la pièce maîtresse de leur design. Le principe Comme vous venez de le remarquer, ce n'est pas qu'une simple image de fond qui s'adapte à la fenêtre : il n'y a aucune déformation, le ratio est toujours conservé et lorsque la fenêtre est vraiment étroite le fond est recadré. Préparation de l'image de fond La méthode CSS3 Le code HTML
Devin R. Olsen - Pure CSS Menu & Infinite Sub Menus
This pure CSS menu with infinite sub menus technique makes use of CSS2 selectors so it will not work in IE6 and below without help from JavaScript. With that said, this pure CSS menu with infinite sub menus technique will work in: IE7, IE8, FireFox, Safari Opera This pure CSS menu with infinite sub menus technique only uses 10 CSS rules making it EXTREMELY light weight. The CSS The HTML <ul id="nav"><li>Menu 1 <ul class="nav first"><li>Menu 1</li><li>Menu 2</li><li>Menu 3</li><li>Menu 4 <ul class="nav"><li>Menu 1</li><li>Menu 2</li><li>Menu 3</li><li>Menu 4</li></ul></li></ul></li><li>Menu 2</li><li>Menu 3</li><li>Menu 4</li></ul>
100 Great CSS Menu Tutorials
Aug 23 2011 Navigation is such an important part of your website. It’s how your visitors navigate to the main areas of your site and makes it easy for them to find your good content. CSS is of course the perfect language for designing beautiful navigation menus. It can be applied to any type of website and is very flexible. Today we would like to show you 100 of these tutorials; 75 horizontal CSS menu tutorials and 25 vertical CSS menu tutorials. Horizontal CSS Menu Tutorials 1. View Tutorial | Demo 2. View Tutorial | Demo 3. View Tutorial & Demo 4. View Tutorial | Demo 5. View Tutorial | Demo 6. View Tutorial | Demo 7. View Tutorial | Demo 8. View Tutorial 9. View Tutorial | Demo 10. View Tutorial | Demo 11. View Tutorial | Demo 12. View Tutorial | Demo 13. View Tutorial | Demo 14. View Tutorial & Demo 15. View Tutorial | Demo 16. View Tutorial | Demo 17. View Tutorial 18. View Tutorial | Demo 19. View Tutorial | Demo 20. View Tutorial | Demo 21. View Tutorial & Demo 22. View Tutorial | Demo 23. 24. 25. 26.
Word-Wrap: Force Text to Wrap
Today I'm going to talk about a rarely used but extremely useful CSS property, the word-wrap. You can force long (unbroken) text to wrap in a new line by specifying break-word with the word-wrap property. For example, you can use it to prevent text extending out the box and breaking the layout. This commonly happens when you have a long URL in the sidebar or comment list. Word-wrap is supported in IE 5.5+, Firefox 3.5+, and WebKit browsers such as Chrome and Safari. CSS: Word-Wrap Property (view demo) You can specify either normal or break-word value with the word-wrap property.
CSS Triangles
This post has been updated to include CSS triangles without markup via :before and :after pseudo-elements. I was recently redesigning my website and wanted to create tooltips. Making that was easy but I also wanted my tooltips to feature the a triangular pointer. I'm a disaster when it comes to images and the prospect of needing to make an image for every color tooltip I wanted made me rethink my redesign. Lucky for me, MooTools Core Developer Darren Waddell shared with me a great trick: CSS triangles. The CSS The secret to these triangles is creating giant borders to the two perpendicular sides of the direction you'd like the triangle to point. CSS Triangles with :before and :after The CSS examples above uses true elements but what if you don't want to add single triangles? The border side you add the color to is the opposite side of the arrow pointer. I don't know how I didn't know about this technique sooner!
Image Reflections with CSS
Image reflection is a great way to subtly spice up an image. The first method of creating these reflections was baking them right into the images themselves. Within the past few years, we've introduced JavaScript strategies and CANVAS alternatives to achieve image reflections without having to modify original images. The Webkit CSS The -webkit-box-reflect property accepts a value in the following format: -webkit-box-reflect: <direction><offset><mask-box-image> A sample usage of -webkit-box-reflect looks like: An involved CSS value but well worth the work. WebKit first implemented CSS reflections in 2008 and, to my knowledge, no other browsers have implemented a similar API. Be Heard Tip: Wrap your code in <pre> tags or link to a GitHub Gist! Older Accomplishing Common Tasks Using MooTools, jQuery, and Dojo III Newer Dijit's TabContainer Layout: Easy Tabbed Content
A Comprehensive Guide to CSS Resets
This guide examines the infinite-like variety of CSS resets created by web developers and designers across the world. While almost all of these CSS resets are generally provided free for public use (many through Creative Commons licensing), it is incumbent upon you to check the terms of use before putting them to use in your projects. This guide follows Part 1, where the history of CSS resets was discussed; you’re advised to read that before this one to get the most out of this guide. This is Part 2 of a three-part series of articles on the topic of CSS resets. In putting together this guide, the 2007 collection of resets by Jeff Starr — who, as an aside, has contributed articles on Six Revisions — was used as a jumping-off point. "Hard" Reset As discussed in Part 1 of this series, the original version of the "hard" reset was by web designer Andrew Krespanis: It wasn’t long before folks added border: 0; and outline: 0; to the list of properties, giving us: Poor Man’s Reset Siolon Reset
Gérer les débordements de contenu grâce à CSS - Alsacréations
Sommaire Précision : cet article se limite volontairement au dépassement de contenus et non à d'éventuelles erreurs de conception de design, de mauvaise gestion de la fluidité, ou à des débordements de blocs flottants. Préambule J'ai une mauvaise nouvelle pour vous : le Web n'est pas un média figé ou paginé tel que le média d'impression. Puisque - heureusement - il n'est plus possible de fixer la taille, voici un point sur les différentes techniques modernes permettant de canaliser les caprices de vos contributeurs… overflow: hidden : circulez, y'a rien à voir ! La propriété CSS2 overflow a été conçue pour administrer les débordements d'éléments au sein d'un bloc. A l'heure actuelle, le peu de valeurs prises en charge par cette propriété la rend quelque peu abrupte : soit le contenu est tronqué et masqué (valeur hidden), soit de laides barres de défilement apparaissent (valeur scroll ou auto). Voici comment mettre en œuvre cette propriété : Exemple (HTML) : Partie CSS : Compatibilité Conclusion