September 2, 201411 yr I am trying to get to grips with dividers and how their widths work. I have done a lot reading on this so I don't really have a question I just want some clarification if that's ok. Lets say for example a screen size is of 1000px and I create a div of 900px, does this mean there will be white space of 100px from the end of the div to the browser? Going off the same example if I was to centre the div of 900px within the browser/window of 1000px does this mean there will be white space of 50px on either side of the div? Again using the 1000px screen size as the example, if I was to create a div, lets say called "container", and I set the width to 90% does that mean there will be 5% of white space on either side of the div to the browser/window? If I was to contract the window so it would now be say for example 800px does that mean there will still be 5% of white space from either side of the div to the browser/window? I would really appreciate any answers, thanks very much.
September 2, 201411 yr I am trying to get to grips with dividers and how their widths work. I have done a lot reading on this so I don't really have a question I just want some clarification if that's ok. Lets say for example a screen size is of 1000px and I create a div of 900px, does this mean there will be white space of 100px from the end of the div to the browser? Yes. Going off the same example if I was to centre the div of 900px within the browser/window of 1000px does this mean there will be white space of 50px on either side of the div. Yes. Again using the 1000px screen size as the example, if I was to create a div, lets say called "container", and I set the width to 90% does that mean there will be 5% of white space on either side of the div to the browser/window? If I was to contract the window so it would now be say for example 800px does that mean there will still be 5% of white space from either side of the div to the browser/window? Yes and yes.
September 2, 201411 yr Yes to all. Unless you have borders or padding on your elements. Borders and padding will be added to the elements actual with and height unless you have specified a box-sizing property with a value of "border-box".
September 3, 201411 yr Yes to all. Unless you have borders or padding on your elements. Borders and padding will be added to the elements actual with and height unless you have specified a box-sizing property with a value of "border-box". And you should always have your box-sizing set to border-box. It's much more intuitive and sensible than content-box model. In the rare use case that you want an element rendered in content box you can just specify content-box for that particular element group.
September 17, 201411 yr The "px and %" is more are less same. When we are giving the value as "px", its not give proper responsive while redirecying the site into mobile view. But we are giving the "%" value, its given proper responsive.
September 17, 201411 yr The "px and %" is more are less same. When we are giving the value as "px", its not give proper responsive while redirecying the site into mobile view. But we are giving the "%" value, its given proper responsive. Aside from the fact this post is now almost a month old, what you have said is wrong, the others have explained it to the op already
September 30, 201411 yr width:100px;is denote the pixel size of total display pixel size(1024x760) width:100% is denote the pixel size in presentage.
Create an account or sign in to comment