css - Div with margin-left and width:100% overflowing on the right side -


i have 2 nested div's should 100% wide. unfortunately inner div textbox overflows , larger outer div. has left margin , overflows size of margin.

how can fix that?

<div style="width:100%;">     <div style="margin-left:45px; width:100%;">     <asp:textbox id="txttitle" runat="server" width="100%"></asp:textbox><br />     </div> </div> 

if don't 100%, textbox not 100% wide.

just remove width both divs.

a div block level element , use available space (unless start floating or positioning them) outer div automatically 100% wide , inner div use remaining space after setting left margin.

i have added example textarea on jsfiddle.

updated example input.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -