I have such a html code:
<div id="outer">
<div id="inner"></div>
</div>
How can I make #inner div to have width 100% of #outer but minus 10px?
Here is my css:
#outer {
width: 100%;
max-width: 500px;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
NOTE
See ThirtyDot’s answer, as it does not impact the outer element’s width:
How to make div width almost 100%
The below will actually make the outer element’s width total the width plus the padding left and right values, which is not what the question is asking. Sorry for the confusion.
:)You could add a padding left and right of
5px(assuming you want the#innerto be10pxless total, not per side):http://jsfiddle.net/ZtaCM/
EDIT
Taking into account the
max-widthproperty, see this demo:http://jsfiddle.net/ZtaCM/1/