Start learning with our library of video tutorials taught by experts. Get started
Viewed by members. in countries. members currently watching.
CSS enables you to control the look and layout of a web page much more precisely than you could with HTML alone, but it can be time-consuming to learn. In this workshop, expert developer Candyce Mairs makes styling a quick and easy process, walking you through the process of adding content to a web page and using CSS to position that content. Candyce explains CSS positioning concepts like the CSS box model, floats, and clears and demonstrates how HTML and CSS work together to create the look of your web page. By speaking the same language as the browser, you can learn to work with the browser to place content accurately and easily.
I want to give you a brief review of the original design that I am working to create, and also the box layout based on that design that I am building in the HTML and CSS piece. So right here, is my original design. It's a header and footer with three columns, which is exactly what my box view looks like. So I've created the header on the webpage at this point. Now what I want to do, is build the menu area.
So I'm going to start working towards building these three columns in the middle of the page. So I'll start with the menu box, and that's what I'm now going to create. I always start by creating in HTML, so here is my coding page. I have one div on the page, at this point. This particular div, is the header div. And what I'm going to do, is copy that div. I just did a right-click on that image, or you can go up to Edit > Copy or Ctrl or Cmd+C. And I'm simply going to copy that div and paste it below. I don't need the image.
What I'm going to do, is select that, and instead of having the image within that area, I'm just going to have it say menu. Just so I have a single word of text that's also going to become the name of my box. So of instead the div named Header, this one is going to be the div named menu. Let's take a look in the browser at what this looks like. So I will move out into Firefox. Here is my menu and my page so far.
Right now, if I click on FireBug which is a Firefox extension and I open up the body, you can see right now I have two divs within that body section. The first div is the Header. If I hover over the word div, it shows me the blue box up in this area of the page. So there's my header box, here's my menu box. Now notice a div by default, extends all the way across the page automatically.
So what I need to do, is create some information to prevent this from going all the way across the page. Because if it did go all the way across the page like it is now, there would be no room for the other two columns. But what I have done, is set up the HTML side of things for the box itself and then I can customize from there. So now that I have the menu box created, what I'm going to do, is replace the word menu with my actual navigational menu words.
So I'll go ahead and type those out. Now I'm going to keep them all lower case with simply a space in between. So I will say home, destinations, tours, news, packages, so these are going to become our actual navigation menu pages we're going to link to, and contact us. I'm only doing it lowercase with spaces in between, because I can move in and let CSS do the rest of the work for me.
And that makes it easier to maintain moving forward if I decide to change something. If I decide to change the name or any type of hyperlink, I can just type in the new word all in lowercase and it's automatically formatted to match all the other hyperlinks. So what I've just done, is created all of the HTML side of things that I need in order to work with this file. I'll go out, take a look at it in Firefox.
I'll close up FireBug here, and you can see it looks identical in the browser, to how it looks on my actual code view. So the next piece, is to try and modify and customize this menu, but I have the basic HTML pieces in place in order to do so. So that is how you build the HTML side first. Take a look at how it works in the browser, especially when you're just starting to work with CSS positioning. I always find it best and easiest to plug in the HTML pieces first. That way, I know what I need to customize when I get to the CSS side of things. So that is how you add the HTML piece for our navigation menu.
There are currently no FAQs about Exploring CSS Positioning.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.