Enter your contact information.
Enter your project information.
Step 3Choose the PHP programmers you want to hire.
Compare Free PHP Quotes
Discover What’s New in CSS 4
*Attention PHP Programmers* - Add A Free Listing! Get more clients.
CSS 3 is still slowly making its way onto the web, but the World Wide Web Consortium (W3C), the governing body that oversees the development of web standards, is already plotting the future of CSS with CSS 4. The W3C recently released the first draft of CSS 4, adding dozens of new rules to make web developers’ lives easier.
The CSS 4 spec is brand new and no web browser actually supports any of these rules yet, but if you’re curious what the next few years will mean for CSS, the first draft offers a sneak peek at what’s in store for web developers.
The biggest news in the current draft of CSS 4 is support for the much-requested parent or “subject” selector. In CSS, rules are typically applied to the innermost selected element. That is, given the chain body header h1, the actual CSS rule will be applied to the h1 element at the end of the chain. CSS 3 offers no way to, say, style the header tag but only if it has an h1 child element. CSS 4 changes that.
CSS 4 includes a means of controlling which element in the selection chain is actually being styled. The easiest way to understand the “subject” selector is by example. Say you want to style a list (ul), but only when the user has clicked on an item in the list. You add a class “clicked” to the item (ul li.clicked) when the user clicks on it, but how do you style the whole list from that class?
With the subject selector it’s simple:
$ul li.clicked {
background: white;
}
The “$” means that the rule is applied to the ul, rather than the li.clicked as it normally would.
The dollar sign may not end up being the subject indicator and the exact syntax will likely change before the spec is finalized. But regardless of the way it ends up being implemented, the subject selector opens up a whole new realm of CSS possibilities.
Other highlights in CSS 4 include some new pseudo selectors like the :matches() pseudo-class which greatly simplifies the process of writing complex, nested CSS. For example, you could write:
:matches(section, article, aside, nav) h1 {
font-size: 3em;
}
The :matches() syntax eliminates the need to write out section h1, article h1 and so on. It’s handy for even simple nestings like the example above, but it becomes really powerful when you’re selecting elements that are two or three levels deep. For more info on :matches(), check out our earlier write-up on Mozilla’s :any() selector, which is the basis for :matches().
Also new in CSS 4 is the :local-link pseudo-class which allows you to style links based on domain. For example, you could style all internal links with a simple selector like a:local-link(0). The number refers to the amount of the local URL path to match. For example, if the current address is http://www.mysite.com/some/post/, a:local-link(0) would match anything point to http://www.mysite.com/, a:local-link(1) would match anything pointing to http://www.mysite.com/some/ and so on.
CSS 4 offers some handy pseudo-classes for styling user interface elements based on state, including :enabled, :disabled, :checked and half a dozen others.
For more info on what’s coming in CSS 4, check out the W3C spec (fear not, it’s surprisingly readable as specs go). Also worth a read is W3C WG member David Storey’s blog where he did a nice write-up on CSS 4, including a few things not covered here, like the awesome-sounding “time-dimensional pseudo-classes.”
[CSS pumpkin by mauricesvay/CC/Flickr]
See Also:
- Simplify Your CSS With the ‘any()’ Selector
- CSS ‘Paged Media’ Brings Book Smarts to the Web
- ‘Donatello’ Library Simplifies CSS 3 Drawings
- Simplify Your Stylesheets With CSSPrefixer
Wed, 26 Oct 2011 16:07:59 GMT
Tags: CSS, Web Standards,
*Attention PHP Programmers* - Add A Free Listing! Get more clients.
CSS
The Future of CSS: Finally, Sane Layout Tools
Woolly, the CSS sheep. HTML5 and CSS 3 offer web designers new semantic tags, fancy animations, server-side fonts and much more, but that’s not the end of the story. The next major development in web design will likely revolve around one of the thi
Quickly Create CSS 3 Animations with ‘Ceaser’
CSS 3 has some awesome new animation capabilities for web developers — rotating objects, fading them in and out and more — but writing the code is a bit more complicated than most CSS rules. To make your animating job a bit easier, developer M
Simplify Your Stylesheets With CSSPrefixer
Woolly, the CSS sheep. CSS 3 has some awesome new features, like 3D transforms, smooth transitions, border images and gradients. Since most browsers already support these features there’s no reason you can’t use them today, provided you grac
Web Standards
HTML5 for Web Developers
If you’ve ever tried to wrestled your way through the complexities of the HTML5 specification, we’ve got good news — there’s now a “web developer edition.” The main HTML5 spec can be overwhelming for web developers tryi
Microsoft, Mozilla Battle Over What Makes a ‘Modern’ Web Browser
Microsoft and Mozilla are trading barbs over the coming Internet Explorer 9. Microsoft has been touting its HTML5 support in IE9, claiming that it renders HTML5 better than Firefox (and Chrome, Safari and Opera). Mozilla then turned around and released an
HTML5 Will Be Done in 2014, What Comes Next?
Web developers were given a green light Monday to start using HTML5. Even though many are already using the still-unfinished language to code complicated web apps, the web’s governing body made the transition official by announcing that HTML5 will b
ABC Digital is a design studio based in Aotearoa New Zealand. We specialise in web design and development, graphic design / design for print, sound design and audio / soundtrack production.
Mapua, Tasman NZ
Web Design, Implementation, and Maintenance. PHP, Javascript, JQuery, MySql
Daphne, Alabama US
Full Service Web Design/Development/Hosting Company
Davenport, Iowa US
website creator chennai, web development firm chennai, product development in chennai, software developer in chennai, website designer in chennai, portal developing firm chennai SEO and SEM solutions
Chennai, Tamil Nadu IN
Pow: Simplify Ruby on Rails for OS X
Attention Ruby on Rails fans, 37 Signals — the folks who created Ruby on Rails — have pu
Chat Up the Web With the New Chrome 11 Beta
The Google Chrome team has pushed out a new beta release of the Chrome web browser, which adds suppo
Mozilla: Windows 8 a ‘Return to the Digital Dark Ages’
Mozilla calls the restrictions in Microsoft's coming Windows RT "an unwelcome return to the digital
Got Messy CSS? You’re not Alone
Woolly, the CSS sheep. You just got a new web design gig. There’s a blank CSS file staring ou
Tame Your CSS With ‘SMACSS’
Woolly, the CSS sheep. CSS is notoriously difficult to organize. The complexity of CSS selectors co
Article Tags
PHP Programmers Articles
Live Help Chat Software
Web Design Quote
Web Design