Connexion
One Laptop per Child Logo
Google Search
Google

LabsSphère Catégories
Css (9)
Php (8)
Javascript (11)
Xoops (5)
Divers (1)
Design (10)

The difference between width:auto and width:100%


Auteur : Roger Johansson | 456 Berea Street.com
Date : 2011-12-02T09:05:44+01:00
Lectures : 4

When adapting a layout for different viewport widths (a.k.a. responsive design) or media (like print), it's common to reset any float and width values on major layout blocks to linearise their display.



Unfloating a floated element is as simple as specifying float:none. Width doesn't seem to be quite as straightforward - lately I've come across several cases where people use width:100% to undo explicitly specified widths when they should be using width:auto instead. So here's a brief explanation of the difference.

Read full post

Posted in , .

Copyright © Roger Johansson






URL : http://labs.xoofoo.org/modules/planet/view.article.php/18610
Trackback : http://labs.xoofoo.org/modules/planet/trackback.php/18610

Les commentaires appartiennent à leurs auteurs. Nous ne sommes pas responsables de leur contenu.
Auteur Conversation