Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: Hide a column when the width decreases

Tags:

css

Check out: http://thinkvitamin.com/

As you decrease the browser size, at some point the right column simply disappears. Pretty nice downgrading, and this makes for quite a flexible design. I do not see, however, any special CSS going on. Is this Javascript, or can this somehow be achieved with CSS only?

like image 681
user852091 Avatar asked Jul 28 '11 23:07

user852091


People also ask

How do I hide an entire column in CSS?

Usually, to hide an element from view, you use the 'display' property and set it to 'none'. But CSS also has a property called 'visibility', which hides elements in a different way. In particular, we use 'visibility: collapse' here, which is designed especially for hiding table columns and rows.

How do I fix td width in CSS?

Using width attribute: The <td> tag has width attribute to control the width of a particular column. By assigning a numeric value to this attribute between 0 to 100 in terms of percentage(or you can use pixel format). We can restrict the column width up to that much percentage of the table's total width.


1 Answers

This is being done with pure CSS, namely with CSS3's Media Queries.

The spec: http://www.w3.org/TR/css3-mediaqueries/

A tutorial: http://webdesignerwall.com/tutorials/css3-media-queries

Browser support: http://caniuse.com/css-mediaqueries (works "everywhere" except IE8 and lower)

like image 162
thirtydot Avatar answered Sep 20 '22 12:09

thirtydot