Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Now, at this point, we're ready to start creating some CSS rules for our layout. So in your text editor, let's choose File > Open. From the myWebsite directory, go into the css directory and open screen_layout_large.css. Now, inside of here, we're going to put our CSS rules for our large screen, which is also going to be used by default for browsers that don't support media queries. So under the comment here that says "global rules for all sizes," let's come in here and add a body tag. Beginning and ending bracket. What we're going to do in here is set the margin to 0 and the padding to 0.
This will make sure that the page container can touch the top, left, and rightmost areas of our window. Next rule we're going to create is going to target the anchor Link inside of the header area that we put a logo class on. So we're going to start with header, space, a.logo, beginning and ending bracket. Let's split that open. So anchor links by default have a display type of inline, which means the length or the height of the actual link is only as large as the content inside. Now, we created an empty anchor link for our logo, so we're going to give this dimensions.
So we're going to set the display type to block. This will make the anchor link behave more like a paragraph or a div tag. The next property we're going to set is going to be position. So we're going to set position to absolute. This will give us the ability to position the logo inside of the page container, which has a position set relative. Next property, we're going to set background- position, 0 pixels on the X and 0 pixels on the Y. Next rule, we're going to set background-repeat. We're going to set that to no-repeat.
Save your work. Let's come back out and look at this in a browser. When we hit reload, we'll now see that the page container now touches the top area of this window. If I come down here and collapse the window down, we'll see that the page container actually touches the rightmost area and the leftmost area as well. So taking off the margin and padding on the body tag allows the elements inside to touch the edge of the window. So now with those rules in place, next, we'll work on the heading area.
Get unlimited access to all courses for just $25/month.Become a member
119 Video lessons · 47314 Viewers
117 Video lessons · 34263 Viewers
113 Video lessons · 80255 Viewers
116 Video lessons · 70179 Viewers