CSS
Cascading Style Sheets are used to define the presentation layer of websites. How CSS works is not always self-evident, so many of these articles explain various aspects of using CSS.
Centering button elements and input buttons
Some browsers don’t let you center button elements horizontally by assigning auto margins. Bug or not?
Styling ordered list numbers
How to use generated content to style the numbers of an ordered list separately from the rest of the list item.
Clipping text with CSS3 text-overflow
Sometimes you may find that a design forces you to clip content. Fortunately CSS3 offers a way of indicating that text has been clipped.
Controlling width with CSS3 box-sizing
The CSS3 box-sizing property can be incredibly useful when you want flexible widths on elements that also have padding and/or borders. And browser support is rather good.
The CSS3 Flexible Box Layout (flexbox)
The Flexible Box Layout Model allows us to align and distribute boxes vertically and horizontally as well as have boxes flex to use all available space.
Source order and display order should match
Using CSS to change the display order of content without also changing the order in the HTML source can cause accessibility issues and should be avoided.
Flexible height vertical centering with CSS, beyond IE7
Using display:table to center a page layout vertically works in most browsers. There is an unfortunate issue with some screenreaders to be aware of though.
Enterprise HTML, CSS and JavaScript explained
Explanations of why some of the bad practices that are made fun of at the Enterprise CSS/HTML/JS sites are bad practices.
CSS Validator to report vendor-specific extensions as warnings, not errors
The W3C CSS Validator is about to add an option where you can choose to have vendor-specific extensions reported as warnings rather than errors, making it easier to find real errors in your CSS.
Media queries, viewport width, scrollbars, and WebKit browsers
WebKit-based browsers do not include vertical scrollbars in the viewport width, which goes against the Media Queries specification and differs from Firefox and Opera.
Only use ems for the total width of em-based layouts
For em-based layouts, using ems to specify column widths can cause problems when text size is increased. Using percentages for columns width is often a better choice.
@font-face tip: define font-weight and font-style to keep your CSS simple
When using @font-face with typefaces that have multiple weights and styles it’s important to do it correctly, or your CSS will become unwieldy and browsers will have no fallback styles.
Controlling text size in Safari for iOS without disabling user zoom
How to prevent your website from having unreadably small text when it is first loaded in Safari on iOS and how to prevent auto-scaling of text when you change orientation from portrait to landscape on your iPhone/iPod/iPad
YUI Compressor and CSS media queries
Older versions of YUI Compressor have a bug that makes some media queries malformed after minifying, causing browsers to skip the rules within. There is a fix though.
How to create a 3-column layout with CSS
A tutorial that explains how to use the CSS float property to create layouts with three or more columns.
Beware of -webkit-text-size-adjust:none
Think very carefully before using -webkit-text-size-adjust:none since it will prevent people using WebKit-based browsers from resizing text. Needless to say, that is not user-friendly.
Tips for creating enterprise-level HTML, CSS and JavaScript
A set of sites making fun of worst practice front-end code commonly found on enterprise type sites and in large content management systems.
Parts of CSS3 in Internet Explorer now with CSS3 PIE
Progressive Internet Explorer uses Behaviors to emulate several of the most popular CSS3 properties like border-radius and box-shadow in IE versions 6-8.
Remember non-vendor-prefixed CSS 3 properties (and put them last)
When using CSS 3 properties that still have experimental implementations and use vendor prefixes, also include the non-prefixed version and put it after any vendor-specific properties in your CSS rules.
Minimise file size with the YUI Compressor TextMate Bundle
You can use the YUI Compressor TextMate bundle to make minifying your CSS and JavaScript files from within TextMate as easy as hitting a keystroke.
Page navigation
Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 | Page 7 | Page 8 | Page 9 | Page 10 | Page 11 | Page 12 | Page 13 | Page 14 | Page 15 | Page 16 | Page 17 | Page 18 | Page 19 | Page 20 | Page 21Subscribe / follow
Sponsors
Authentic Jobs
- Senior Interaction-UX Designer at Education First (London, United Kingdom, GB)
- Web developer, junior-level at E&E Publishing, LLC (Washington DC, Di, US)
- Ad Product Engineer - Quartz at Atlantic Media (New York, NY, Ne, US)
- PHP Developer at Bayshore Solutions (Denver (Broomfield), Co, US)
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost

