CSS3 Pushing the Limits
eBook - ePub

CSS3 Pushing the Limits

Stephen Greig

Partager le livre
  1. English
  2. ePUB (adapté aux mobiles)
  3. Disponible sur iOS et Android
eBook - ePub

CSS3 Pushing the Limits

Stephen Greig

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Push CSS3 and your design skills to the limit—and beyond!

Representing an evolutionary leap forward for CSS, CSS3 is chock-full of new capabilities that dramatically expand the boundaries of what a styling language can do. But many of those new features remain undocumented, making it difficult to learn what they are and how to use them to create the sophisticated sites and web apps clients demand and users have grown to expect.

Until now.

This book introduces you to all of CSS3's new and advanced features, and, with the help of dozens of real-world examples and live demos, it shows how to use those features to design dazzling, fully-responsive sites and web apps.

Among other things, you'll learn how to:

‱ Use advanced selectors and an array of powerful new text tools

‱ Create adaptable background images, decorative borders, and complex patterns

‱ Create amazing effects with 2D and 3D transforms, transitions, and keyframe-based animations

‱ Take advantage of new layout tools to solve an array of advanced layout challenges—fast

‱ Vastly simplify responsive site design using media queries and new layout modules

‱ Create abstract and scalable shapes and icons with pseudo-elements

‱ Leverage preprocessors and use CSS like a programming language within a stylesheet context

Don't pass up this opportunity to go beyond the basics and learn what CSS3 can really do!

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que CSS3 Pushing the Limits est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  CSS3 Pushing the Limits par Stephen Greig en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatik et Softwareentwicklung. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Éditeur
Wiley
Année
2013
ISBN
9781118652619
Édition
1
Part I
New Toys
Chapter 1 Advanced Selectors
Chapter 2 New Tools for Text
Chapter 3 New Tools for Backgrounds and Borders
Chapter 4 Into the Browser with CSS3 Filters and Blending Modes
Chapter 1
Advanced Selectors
Web designers commonly get into the habit of using only a very small collection of basic CSS selectors, most notably the id, class, and descendant selectors, because that’s all they need
or so they think.
It’s true that you can accomplish almost everything with the class selector, but why compromise your nice, clean markup by adding unnecessary classes when you can choose from a range of more practical and efficient alternatives?
CSS3 has brought with it a whole host of such alternatives, some of which are simply wonderfully convenient and others that can make you excitedly ponder all the possibilities! What? CSS3 selectors are exciting!
In this chapter, you will learn about the different types of selectors, from sibling combinators to nth-child expressions. With the help of practical examples, you’ll be able to understand precisely what they do and how you can put them to use. I’ll finish the chapter by combining many of the various selector types that will be described between now and then to create some truly advanced CSS selectors.
Child and Sibling Selectors
The child and sibling combinators are actually among the more mature features in the Selectors module; however, despite this they’ve had trouble in finding the same kind of mainstream attention as id and class selectors enjoy. It’s about time they got a little nudge into the spotlight.
Child Combinator
Generally speaking, the cascade aspect of CSS is awesome, but sometimes you just don’t need or want it. Have you ever found yourself undoing your own styles in a nested unordered list, for example? This is where the child combinator can help out. Consider this example:
nav ul {
background: blue;
border: 2px solid red;
}
nav ul ul {
border: none;
background: none;
}
If you find that you have to re-declare your styles to fight against the cascade, there is almost definitely a better way of going about the task. As shown in the following snippet, the child combinator allows you to select only the ul that is a direct child of the nav element so that the styles aren’t applied to any nested ul elements:
nav > ul {
background: blue;
border: 2px solid red;
}
Simple stuff, right? Even better, this capability is supported in all major browsers, including Internet Explorer 7!
A few of the selectors discussed in this chapter, including the child combinator, have been around for a while and were actually first defined in the CSS 2.1 selector specification. However, I still see a staggering number of experienced web designers who remain oblivious to their existence, opting to stick with their trusty class and descendant selectors.
Adjacent Sibling Combinator
The adjacent sibling combinator targets the sibling that immediately follows an element. This selector has a number of uses. One common use is when you need to target, for example, the first p element to follow an h1 or an h2 in your body text, as follows:
p {
margin-top: 1.5em;
}
h2 + p {
margin-top: 0;
}
Nice and easy, and a practical solution to targeting elements that could otherwise be really awkward to style, particularly if some of your markup is generated by a content management system.
Major browser support for the adjacent sibling combinator is universal, again including IE7+!
General Sibling Combinator
The general sibling combinator selector is similar to the adjacent sibling combinator, but more [wait for it]
general! Whereas the previous selector targets only the sibling that immediately follows an element, this selector targets any sibling that follows an element.
Consider the following example:
HTML
<h2 class=”important”>Everything below is very important</h2>
<p>This text is very important.</p>
<p>This text is also very important.</p>
CSS
h2.important ~ p {
color: red;
}
This selector targets all p elements that follow an h2 with a class of important, allowing you to apply a text color of red to all paragraphs under that particular heading.
If your first thought regarding this selector is anything like mine was, you probably are thinking “Hmm, pretty cool, but to be honest I can see this sitting at the bottom of the virtual toolbox gathering layers of virtual dust.”
The reality, though, is quite the contrary! In fact, the general sibling combinator will prove to be one of the most vital ingredients in some of the most complex solutions you will read about in this book. Keep an eye out for its return towards the end of this chapter.
The general sibling combinator is much newer than those discussed earlier. Although it is compatible with all major browsers, Internet Explorer supports it only from version 9.
Attribute Selectors
Another method of selecting elements is through HTML attributes, in terms of whether an element has a certain attribute applied to it and/or the value of the attribute.
All the following attribute selectors have full major browser support, including IE7+.
Selecting Based on the Existence of an HTML Attribute
You can use a selector to target only those elements that have a s...

Table des matiĂšres