Using Margins
Margins are commonly styled to control the space between elements. You'll have noticed that there's always a certain amount of space, by default, around content displayed in web browsers (visible in Figure 11-1). This can be controlled by changing the margin values in the body element (see Example 11-1).
Example 11-1. Setting margin values for the body element
body {font: 14px Verdana, Arial, Helvetica, sans-serif; color: white; background-color: black; margin-top: 0; margin-left: 0; border: 2px solid white;}h1 {font-size: 24px; color: orange;}h2 {font: italic 20px Georgia, Times, serif; color: #999; text-indent: 15px;}
NOTE
You'll see that I have no length value such as px or em after my 0. That's because a 0 value requires ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access