

We won't need to use flexbox too much for our website, but it's important to think about flexbox as it's considered the most modern, proper way to position small bits of content on a website. When we apply flexbox to a container it will automatically lay the items out along a straight line (horizontally) and then we can get into more detail with other flexbox properties. When we use flexbox on a container element this element becomes a flex container and all the elements within it become flex items. So while the box model helps explain the spacing around HTML elements, flexbox will allow us to move these elements into place. FlexboxĬSS gives us a set of properties made especially to help us with our website's layout. We can see that padding has been added only to the left and a thick blue border covers all four sides of the content. However, if we want to style one side of an element we can do that too. We can apply a value to all four sides at once in our CSS through padding, border, and/or margin. The CSS box model describes the spacing of these boxes.Įach box has four sides. HTML elements are a bit like rectangular boxes. This added styling on such a major element should be included in our CSS document before any other elements that are nested within main.

We will be adding styles in this lesson to main, for example. Generally speaking, it's best to order our CSS declarations in the order they take place on the page. Proper organization will make it easier for us to find all the pieces within our file, making it easier to change and add things later on. Keeping a CSS document organized is very important. We’ll cover some positioning basics and talk about what sort of CSS properties are used for layout.
#WEBDESIGN FOR KIDS HOW TO#
In this first section we will look at how to stay organized. There are a few things we need to know before jumping right into layout. The files for this course can be downloaded here and don't forget to ask any questions you have in the comments section at the bottom of this page. To remind yourself, take a look at the website we’re building. We'll be adding to both our HTML and CSS files to do so. This is where we put all our elements exactly where we want them on the screen. Welcome to the sixth lesson of our Web Design for Kids series, CSS Layout!
