Is it possible to make a
But when it is re-sized you will loose complete div if less than 50px;
div 50px less than 100% in pure CSS? I want the <div> to be only 50px less than 100%. I don't want any JavaScript.
Yes you can. Without using the IE's
expression(), you can do that in CSS3 by using calc().div {
width: 100%;
width: -webkit-calc(100% - 50px);
width: -moz-calc(100% - 50px);
width: calc(100% - 50px);
}
But when it is re-sized you will loose complete div if less than 50px;
BEST SOLUTION :
A DIV automatically takes its parent's width. So there is no need to define any
width. Normally would simply write it like this:div{
margin-right:50px;
}
http://jsfiddle.net/Nw3yd/6/
http://jsfiddle.net/Nw3yd/3/
No comments:
Post a Comment