Jasmine Website Starter Layout Styles
JWS template layouts are styled and controlled by properties that are added in the CSS file. These are either controlling the named HTML elements like in the Page Layout image, or by using div's that we added class names to which you can see further down the page in the Main image.
Page Layout
The visible part of a webpage is the body which as a rule is made up of three areas <header></header> <main></main> <footer></footer> we are using CSS Grids in the body to define these three areas.
Each of these areas are then using CSS flex properties to control the layout of the items within them.
You can now start learning about CSS Grids or Flexbox (flex) in our Doc's CSS Intro section, we also have links to further guides over on our Extras Page.
Header Layout
The most commonly found items in a header are a page title or company/organisations name, a logo and navigation containing links to other pages.
Our starter templates come with a header area that only contains a <h1> title for your webpage, as you will see in our Build Steps tutorial.
Though we realise for those who want to take these templates further and make your own single or multipage website, the ability to add a logo, navigation or both is needed. Which we cover in our Next Build Steps tutorial.
Main Layout
The Main is where you will find the bulk of content on a webpage.
The layout of this content in our templates is controlled using flex properties on class named div's e.g <div class="panel_full"> .
As you can see from the main diagram we have four different outer wrapping panel widths, full, half (47%), third (32%) and two thirds (62%) for either text & mixed content or images. Though as you can see the percentage widths are not precisely divided on the last three, this is to allow room for content spacing, preventing the panels touching or overlapping.
All these outer div's are referred to as the "parent element" they also need a second div inside them which is referred to as the "child element".
As you can see from the main diagram we also have a choice of these inner class named div's (or child elements) too, each designed to layout contents in different ways and purposes.
<div class="text_panel"> - Ideal for blocks of text this panel is designed to constrain the width of the text to 80 characters or less for easier readability and accessibility. As recommended by Web Content Accessibility Guidelines (WCAG).
<div class="contents_panel"> - This is a flexible panel that can be used for mixed image & text contents ideal for card layouts, plus making swim lanes as it's width isn't constrained and will stretch to the width of it's parent. We can adjust the layout of the contents in this panel with the addition of further classes on the individual items, as shown in the bottom panel of the main diagram.
With "cp_title" for adding to either a heading <h2> or a paragraph <p> that you want to take up the full width of the "contents_panel" with the text centered.
Then "cp_img" which can be added to a <img> element making it confined to 38% width of the panel and ideal for adding an image next to some text.
Lastly we have the "cp_text" designed to add text that sits beside an image it can be added to either a single <p> or to a <div> if you have multiple paragraphs to wrap and will constrain to 58% of the panels width.
Unlike the other wrapping div's these <div class="img_panel_full"> & <div class="img_panel_half"> are designed for displaying images inside only with a choice of two panel sizes. One for the half page width displaying images vertically and one for full page width displaying images horizontally, both panels will center and equally space your images too. Though if you are looking to make a small image gallery using the full width image panel will be ideal as you can add multiples of images which will just wrap around onto multi lines.
Footer Layout
The most commonly found items within a footer are copyrights, company/organisation address and contacts, social media links and additional navigation links to other pages.
Though our starter templates come with a footer area that only contains the options for social media icons, contact details and copyright. You can also add a logo or badge like the "Built on JasmineWS" we have as a download option to the footer inside <div class="copyrights">, by adding a <img> after the copyright <p>.
Style patterns
You asked and we listened, so check out our Style Patterns page for further layout pattern suggestions.
Page Last Edited: