August 2015
Intermediate to advanced
312 pages
7h 3m
English
CSS3 gives incredible power for selecting elements within a page. You may not think this sounds very glitzy but trust me, it will make your life easier and you'll love CSS3 for it! I'd better qualify that bold claim.
You've probably used CSS attribute selectors to create rules. For example, consider the following rule:
img[alt] {
border: 3px dashed #e15f5f;
}This would target any image tags in the markup which have an alt attribute. Or, let's say we wanted to select all elements with a data-sausage attribute:
[data-sausage] {
/* styles */
}All you need is to specify the attribute in squared brackets.
The data-* type attribute was introduced in HTML5 to provide a place for custom data ...
Read now
Unlock full access