mga_ka_php Posted April 29, 2010 Share Posted April 29, 2010 if i set the width of my DIV to 100% and i added a padding and margin, the width increases. how do i solve that? which the width won't increase? thanks. Quote Link to comment https://forums.phpfreaks.com/topic/200125-100-width-padding-margin/ Share on other sites More sharing options...
n000bie Posted April 29, 2010 Share Posted April 29, 2010 You need to decrease the width of the div if you use padding. You can use padding in % also. So, if you use padding 2% then width of the div will be 96%. Quote Link to comment https://forums.phpfreaks.com/topic/200125-100-width-padding-margin/#findComment-1050356 Share on other sites More sharing options...
mga_ka_php Posted May 1, 2010 Author Share Posted May 1, 2010 any other solutions? Quote Link to comment https://forums.phpfreaks.com/topic/200125-100-width-padding-margin/#findComment-1051369 Share on other sites More sharing options...
Ken2k7 Posted May 2, 2010 Share Posted May 2, 2010 Well 100% is relative to the parent. Either give it a fixed width or wrap the div inside another div and give the parent div a fixed width, not a percentage. Quote Link to comment https://forums.phpfreaks.com/topic/200125-100-width-padding-margin/#findComment-1051816 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.