background preloader

Techniques

Facebook Twitter

Dive Into HTML5. Efficiently Rendering CSS. I admittedly don't think about this idea very often... how efficient is the CSS that we write, in terms of how quickly the browser can render it? This is definitely something that browser vendors care about (the faster pages load the happier people are using their products). Mozilla has an article about best practices. Google is also always on a crusade to make the web faster. They also have an article about it. Let's cover some of the big ideas they present, and then discuss the practicalities of it all. Right to Left One of the important things to understand about how browsers read your CSS selectors, is that they read them from right to left. ID's are the most efficient, Universal are the least There are four kinds of key selectors: ID, class, tag, and universal. #main-navigation { } body.home #page-wrap { } .main-navigation { } ul li a.current { } ul li a { } * { } #content [title='home'] #main-nav > li { } Even though that feels weirdly counter-intuitive...

Don't tag-qualify David Hyatt: Modern CSS Layouts, Part 2: The Essential Techniques - Smashing. Advertisement In Modern CSS Layouts, Part 1: The Essential Characteristics1, you learned that modern, CSS-based web sites should be progressively enhanced, adaptive to diverse users, modular, efficient and typographically rich. Now that you know what characterizes a modern CSS web site, how do you build one? Here are dozens of essential techniques and tools to learn and use to achieve the characteristics of today’s most successful CSS-based web pages. Just as in the previous article, we’re not going to be talking about design trends and styles; these styles are always changing. Instead, we’re focusing on the specific techniques that you need to know to create modern CSS-based web pages of any style. For each technique or tool, we’ll indicate which of the five characteristics it helps meet. To keep this shorter than an encyclopedia, we’ll also just cover the basics of each technique, then point you to some useful, hand-picked resources to learn the full details.

You can jump straight to: CSS3 Gradient Buttons. Last week I talked about Cross-Browser CSS Gradient. Today I'm going to show you how to put the CSS gradient feature in a good practical use. Check out my demo to see a set of gradient buttons that I have created with just CSS (no image or Javascript). The buttons are scalable based on the font-size. The button size can be easily adjusted by changing the padding and font-size values. The best part about this method is it can be applied to any HTML element such as div, span, p, a, button, input, etc. What Is So Cool About These Buttons? Pure CSS: no image or Javascript is used. Preview The image below shows how the button will display in different browsers. Button States normal state = gradient with border and shadow styles. hover = darker gradient active = gradient is reversed, 1px down, and darker font color as well.

General Styles For The Button The following code is the general styles for the .button class. Color Gradient Styles The code below is the CSS styling for the orange button. CSS3 Solutions for Internet Explorer - Smashing Magazine. Advertisement Experienced developers understand that CSS3 can be added to new projects with progressive enhancement in mind. This ensures that content is accessible while non-supportive browsers fall back to a less-enhanced experience for the user. But developers could face a situation where a client insists that the enhancements work cross-browser, demanding support even for IE6. In that case, I’ve collected together a number of options that developers can consider for those circumstances where support for a CSS3 feature is required for all versions of Internet Explorer (IE6, IE7, & IE8 — all of which are still currently in significant use).

Opacity / Transparency I think all developers are baffled at why Internet Explorer still fails to support this very popular (albeit troublesome) property. The Syntax You really only need the second line, which works in all versions of Internet Explorer. The Demonstration This is the same element without the opacity settings. The Drawbacks Box Shadow. Coding A HTML 5 Layout From Scratch - Smashing Magazine. Advertisement HTML5 and CSS3 have just arrived (kinda), and with them a whole new battle for the ‘best markup’ trophy has begun. Truth to be told, all these technologies are mere tools waiting for a skilled developer to work on the right project. As developers we shouldn’t get into pointless discussions of which markup is the best. They all lead to nowhere.

Rather, we must get a brand new ideology and modify our coding habits to keep the web accessible. While it is true HTML5 and CSS3 are both a work in progress and is going to stay that way for some time, there’s no reason not to start using it right now. So today we’re going to experiment a little with these new technologies. It’d be a good idea to have a read at some of these articles first: I’ll also assume you know the basics of HTML and CSS. Before we begin… There’s a couple of things you have to bear in mind before adventuring on the new markup boat. A word on Progressive Enhancement and Graceful Degradation 1. 2.

<! A few highlights: CSS Techniques I Wish I Knew When I Started Designing Websites - Dec 18 2009 By Tim Wright and TJ Kelly CSS is the best thing to happen to the web since Tim Berners-Lee. It’s simple, powerful, and easy to use. But even with all its simplicity, it hides some important capabilities. All designers at some point in their career go through the process of encountering a weird display issue, searching for a resolution, and discovering a trick, technique, or hack could have saved them hours of frustration—if they had only known when they started. We’ve put together a list of the most frustrating and time-consuming CSS headaches and, more importantly, their solutions (along with examples and further resources). Resets & Browser Inconsistencies Not all browsers are created equal. The early stages of resets, designers dealt with differing margin and padding values, using a global reset: inputbuttonhr These elements were excluded because their cross-browser differences are so vast that you would have to completely unstyle them to create a "bulletproof" element.

<! Learn CSS Positioning in Ten Steps: position static relative abs. 1. position:static The default positioning for all elements is position:static, which means the element is not positioned and occurs where it normally would in the document. Normally you wouldn't specify this unless you needed to override a positioning that had been previously set. 2. position:relative If you specify position:relative, then you can use top or bottom, and left or right to move the element relative to where it would normally occur in the document. Let's move div-1 down 20 pixels, and to the left 40 pixels: Notice the space where div-1 normally would have been if we had not moved it: now it is an empty space.

It appears that position:relative is not very useful, but it will perform an important task later in this tutorial. 3. position:absolute When you specify position:absolute, the element is removed from the document and placed exactly where you tell it to go. Let's move div-1a to the top right of the page: What I really want is to position div-1a relative to div-1. Footnotes 10. 7 New Essential CSS 3 Techniques Revealed | tripwire magazine. There are several new and exciting functions and features being thought up for CSS3: text-shadow, box-sizing, opacity, multiple backgrounds, border-radius, border-image, etc… This article presents 7 New CSS3 techniques that every web designer and developer should be aware of.

CSS3 for sure will leads to greater flexibility and make effects that was previously complex and difficult to create much easier. Unfortunately it is not currently all the leading browsers that support CSS3. In some cases other techniques are available making our life easier while waiting for CSS3 to break through and these will be briefly covered as well. Advertisement Be aware that CSS3 features are not yet accessed directly in most browsers and in some it is not even implemented at all, ex. Border Radius: Create rounded corners There are many ways to create rounded corners on boxes. The good news is that W3C has offered some new options in CSS3. See working example here. Anti-aliased Rounded corners with JQuery. Have a Field Day with HTML5 Forms.

Forms are usually seen as that obnoxious thing we have to markup and style. I respectfully disagree: forms (on a par with tables) are the most exciting thing we have to work with. Here we’re going to take a look at how to style a beautiful HTML5 form using some advanced CSS and latest CSS3 techniques. I promise you will want to style your own forms after you’ve read this article. Here’s what we’ll be creating: The form. Meaningful markup We’re going to style a simple payment form. The person’s details The address details The credit card details We are also going to use some of HTML5’s new input types and attributes to create more meaningful fields and use less unnecessary classes and ids: email, for the email field tel, for the telephone field number, for the credit card number and security code required, for required fields placeholder, for the hints within some of the fields autofocus, to put focus on the first input field when the page loads A good foundation The unstyled form Form controls.

Liquid, Fluid and Elastic Layout Templates, Tools and Frameworks. In recent years, screen resolutions are getting both bigger (large monitors) and smaller (in the mobile sense), as such, a static or fixed web layout may no longer be deemed completely viable. Maybe its time to change. Liquid, fluid and elastic layouts, have as many supporters as fixed layouts, despite what ever your feelings are on these styles of layouts, having some knowledge on adapting a site to liquid or elastic would most definitely be a plus in your arsenal. In this article you will find a collection of starter and basic fluid/liquid and elastic layouts, CSS frameworks and some useful tools to help you with your next project.

Tiny Fluid Grid Inspired by the 1kb Grid, the Tiny Fluid Grid is a super simple fluid layout generator. Its download comes with a index.html with demo code, and the grid.css containing the CSS for the grid that you have created. Gridinator – Fixed, Elastic and Fluid Layouts The concept for GRIDINATOR is to allow for easy creation of custom, grid-based layouts. Hardboiled Web Design by Andy Clarke. 50 New Useful CSS Techniques, Tools and Tutorials - Smashing Mag. Advertisement Over the last years we’ve got a pretty good understanding of what CSS does, how it works and how we can use it for our layouts, typography and visual presentation of the content. However, there are still some attributes that are not so well-known; also, CSS3 offers us new possibilities and tools that need to be understood, learned and then applied in the right context to the right effect.

In this round-up we present fresh useful articles about less-known CSS 2.1 and CSS3 properties as well as an overview of recently published CSS techniques, tools and tips for designers and web-developers. Please stay tuned: next week we will present the second part of this article, featuring fresh CSS3 techniques, tools and resources. Learn About Obscure CSS Properties The Little Known font-size-adjust PropertyEver wanted to use fallback fonts on your CSS with different aspect ratios without them looking huge (or tiny)? Useful CSS Techniques Useful CSS Tools, Tips and Advice CSS 3, Please! Hardboiled hCards. 5 Tools For Integrating HTML5 Video in Your Website. This series is supported by Rackspace, the better way to do hosting.

Learn more about Rackspace's hosting solutions here. No matter where you sit in the HTML5/Flash debate, the fact is, more and more mobile or low-powered devices are being shipped either without or with very minimal support for Flash video. Web developers who design sites that utilize video need to be cognizant of this reality and design and build their sites accordingly.

While it's great that video hosting services like Vimeo and YouTube support HTML5 and that solutions for larger sites are available from places like Encoding.com and Brightcove, that still leaves users who want to host their own video content — but don't necessarily use a platform like Brightcove — in a bit of a predicament. After all, in a perfect world, everyone who visits a website should be able to view video, whether they are on a desktop or on an iPhone. Here are a few of the solutions currently available that we particularly like: 1. 2. 3. 4. 5. How to Make an HTML5 iPhone App. By Alex Kessinger You’ve been depressed for like a year now, I know. All the hardcore Objective-C developers have been having a hay-day writing apps for the iPhone. You might have even tried reading a tutorial or two about developing for the iPhone, but its C—or a form of it—and it’s really hard to learn.

I don’t want to say that you should give up on the objective: you can get it eventually. You can create a native app that lives with all the other apps, and for the most part, it’s going to be a pitch-perfect imitation. You can do this with the skill set you probably already have: HTML(5), CSS, and JavaScript. I’ll show you how to create an offline HTML5 iPhone application.

Offline? What am I talking about when I say "offline"? The app should be as functional as it can when it is offline, just like normal native mobile apps. This is a tutorial specifically for iPhones but most of these techniques apply to all phones that have HTML5-capable browsers. Prework About the App Application Cache <! 5 Must Read Presentations about CSS Coding – woorkup.com. Hack for CSS3 Supporting Browsers. Hack for CSS3 Supporting Browsers Posted By Estelle Weyl on April 6, 2010 Implementing CSS3 features in your CSS file can be complex. You have to make sure that the CSS you’re feeding to FF3.5+, Chrome, Opera and Safari are not being read by FF2, IE6, IE7 and IE8. There’s a simple hack to make sure that your CSS3 is fed only to browsers that support it… it’s forward compliant and it’s valid markup. selector:nth-of-type(1n) To target all browsers that support CSS3, and hide from the IEs, simply add :nth-of-type(1n) to your selector.

In the above example, we’ll end up with white text on a white background, with the letters being defined by the drop shadow. :nth-of-type(1n) basically means “every”. For example, I have a row of images with captions going across a page. The images look fine in IE, but look cool in FF3.6 Do make sure that the new CSS3 property is generally supported before using this hack. About The Author Estelle Weyl My name is Estelle Weyl. Using CSS3 Transitions, Transforms and Animation. CSS Specificity And Inheritance - Smashing Magazine - StumbleUpo. Advertisement CSS’ barrier to entry is extremely low, mainly due to the nature of its syntax. Being clear and easy to understand, the syntax makes sense even to the inexperienced Web designer.

It’s so simple, in fact, that you could style a simple CSS-based website within a few hours of learning it. But this apparent simplicity is deceitful. If after a few hours of work, your perfectly crafted website looks great in Safari, all hell might break loose if you haven’t taken the necessary measures to make it work in Internet Explorer. Understanding a few often overlooked concepts is also important. Two of these concepts are specificity and inheritance. The notion of a “cascade” is at the heart of CSS (just look at its name). Please consider reading our previous related article: CSS Specificity: Things You Should Know 1. Style sheets can have a few different sources: There is also the ! Knowing this, let’s look at the final order, in ascending order of importance: 2. Getting back to the !

3. 4. 5. CSS in Depth: Floats and Positions | Spyre Studios. How to: CSS Large Background. Selectors Level 3.