The Wrapper is the container that holds the theme’s elements. It is used for positioning and styling the theme as a whole. You’ll use the Wrapper to create the dimensions and background for the theme.
-
Add the following code below the Wrapper placeholder:
#wrapper { background-color: $bkColor; margin: 0 auto; max-width: 1000px; padding:0; position:relative;
-
Since the Banner, Content, and Footer sections all go inside the Wrapper, add the closing
}
(brace) for the#wrapper
just above the closing}
at the bottom of the file.The CSS above makes use of the SASS
$bkColor
variable to color the background of the wrapper, separating it from the background gradient. Most important, it sets the width and margins for the theme.As a design choice, the wrapper has been given a set width,
max-width: 1000px;
, and centered,margin: 0 auto;
, relative to the browser. This allows the gradient background to show when the browser is wider than themax-width
. If users view the theme in a larger display than themax-width
, they won’t be greeted with dead pixels on either side of the main content. You always want to keep the user experience in mind when designing the theme.Using the
max-width
property sets the width, while also allowing it to be flexible. In a later section of the Learning Path, this will let the theme scale down for smaller devices. Had thewidth
property been used instead, the width would be carved in stone. -
Save the file and navigate to the Welcome page and refresh it to see the changes.
Your theme should look like the following figure:
Now that the Wrapper for the content is styled, you can move on to the Banner next.