CSS: How to float 3 divs side by side for width:100% without messing up? -


i want put 3 div { width:33%; border: 3px solid #333;} aside within page. fails, if sum superior 100%.

how float 3 divs side side , occupying width:100% without messing ?

the borders not counted within div's box. add, , messing set, width : 3boxes * (33%+3px+3px), more 100%.

use :

.left {   float:left;    width:33.3%;   border: 3px solid #333; } .box-sizing { box-sizing: border-box; } 

see fiddle demo, can resize result box stays perfect. :)


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -