CSS max-height not working

The problem is your browser. Maybe you could wrap this div in another div that has the fixed height of 25px. Of course this wouldn’t be exactly the same as max-height. An article about a solution. Edit: According to Microsoft it should work in IE7+. Have you set an appropriate doctype? If not IE7 uses an old … Read more

Fully responsive HTML5 video

Use width and max-height on the <video> element:  Run code snippetExpand snippet http://jsfiddle.net/fHG69/ Also, you’re missing a semicolon after background-color. When absolutely positioning an element to fill the screen, I prefer to set top, bottom, left, and right instead of setting height and width.

How to make a div 100% height of the browser window

There are a couple of CSS 3 measurement units called: Viewport-Percentage (or Viewport-Relative) Lengths What are Viewport-Percentage Lengths? From the linked W3 Candidate Recommendation above: The viewport-percentage lengths are relative to the size of the initial containing block. When the height or width of the initial containing block is changed, they are scaled accordingly. These units are vh (viewport … Read more

Can I apply a CSS style to an element name?

You can use the attribute selector,  Run code snippetExpand snippet Be aware that it isn’t supported in IE6. Update: In 2016 you can pretty much use them as you want, since IE6 is dead. http://quirksmode.org/css/selectors/ http://reference.sitepoint.com/css/attributeselector

Specify multiple attribute selectors in CSS

Simple input[name=Sex][value=M] would do pretty nice. And it’s actually well-described in the standard doc: Multiple attribute selectors can be used to refer to several attributes of an element, or even several times to the same attribute. Here, the selector matches all SPAN elements whose “hello” attribute has exactly the value “Cleveland” and whose “goodbye” attribute has exactly the … Read more

difference between css height : 100% vs height : auto

height: 100% gives the element 100% height of its parent container. height: auto means the element height will depend upon the height of its children. Consider these examples: height: 100% #innerDiv is going to have height: 50px height: auto #innerDiv is going to have height: 10px