I know if i want a div to fit the screen, it should be width: 100% - but what do i do if i want it to always have 10px space on the left and 10px on the right - then the div should fit the rest? Thanks, in advance.
How do you mean, no code? I haven't got a load of code or anything, it's just a simple div with a black background. What is a universal reset?
Since browsers give different values for either margin or padding, so resetting it to 0 will make it more consistent across browsers.
Exactly. Though what does *{} do? And if i wanted say a whole 'container' to be 10px from the sides, not just the <p> tags - what would i do?
The * selector targets all elements and applies a margin and padding of 0 to them. For your second question, just remove the selector for paragraphs and put it directly on the container.
Thanks very much! +rep I like to know how/why things work. How come it still fits the screen, even though you haven't put width: blabla? EDIT: Sorry i have to spread rep.
Because it's a block-level element, and block-level elements take up the full width of their parent element (and the parent element in this case has no padding/margin so it fills the screen).