Disallow too many floats
Pages 49
- Home
- About
- Avoid un anchored hovers
- Beware of box model size
- Build System
- Build System Integration
- Bulletproof font face
- Command line interface
- Contributing
- Developer Guide
- Disallow !important
- Disallow @import
- Disallow adjoining classes
- Disallow box sizing
- Disallow duplicate background images
- Disallow duplicate properties
- Disallow empty rules
- Disallow IDs in selectors
- Disallow negative text indent
- Disallow non alphabetical
- Disallow outline:none
- Disallow overqualified elements
- Disallow qualified headings
- Disallow selectors that look like regular expressions
- Disallow star hack
- Disallow too many floats
- Disallow underscore hack
- Disallow units for zero values
- Disallow universal selector
- Disallow unqualified attribute selectors
- Don't use too many font size declarations
- Don't use too many web fonts
- Headings should only be defined once
- IDE integration
- Ignoring parts of CSS during linting
- New Release
- Require all gradient definitions
- Require compatible vendor prefixes
- Require fallback colors
- Require properties appropriate for display
- Require shorthand properties
- Require standard property with vendor prefix
- Require use of known properties
- Rules
- Rules by ID
- Source Code
- Unit Tests
- Using in a Node.js Application
- Working with Rules
- Show 34 more pages…
Clone this wiki locally
The float property is the most popular method of achieving columnar layouts using CSS. During the course of a project, more and more float elements are used to create ever-different layouts throughout a page or site. This leads to fragile CSS that is easy to break if one aspect of the layout changes.
Frequently, using too many floats is a sign that your project would benefit from a grid system. CSS grid systems standardize columnar layouts using CSS classes. Some popular grid systems are:
- 960gs
- Blueprint
- OOCSS Grids
- YUI Grids
- [Twitter Bootstrap] (http://getbootstrap.com)
Using one of these grid systems can greatly reduce the amount of CSS code you need to write by hand.
Rule Details
Rule ID: floats
This rule is aimed at reducing complexity by watching how many times float is used. It warns when float has been used more than 10 times. This amount of floats usually indicates that there are a lot of columnar layouts being defined and that a grids system would be a better choice for your CSS.
Additional Reading
Automated linting of Cascading Stylesheets