CSS Positioning Best Practices

CSS Positioning Best Practices

with Bill Weinman

 


Web designers and coders will be introduced to techniques to improve their results in CSS Positioning Best Practices. Beginning with a brief review of CSS, instructor Bill Weinman demonstrates how to position elements on a page using CSS instead of tables. He then goes step by step through the process of using CSS positioning to lay out pages that have traditionally been laid out using HTML tables. Exercise files accompany the course.
Topics include:
  • Understanding style sheets and levels of inheritance
  • Learning how to use CSS units of measure in page layout
  • Laying out content on a page using absolute, relative, float, and fixed positioning
  • Using CSS positioning to place menus, buttons, graphics, and columns precisely on a page
  • Using templates to improve workflow
  • Creating a full working web site, step by step

show more

author
Bill Weinman
subject
Web, Web Design
software
CSS
level
Intermediate
duration
2h 32m
released
Aug 07, 2009

Share this course

Ready to join? subscribe


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:00(Music playing.)
00:04Hi! I'm Bill Weinman and welcome to CSS Positioning Best Practices.
00:08In this course I'll show you how to use CSS positioning techniques instead of
00:12HTML tables to layout a webpage.
00:14The first part of this course is a brief review of CSS so that we have
00:18a good starting point.
00:19Then we'll discuss the different techniques used to position objects in a
00:21webpage using CSS instead of tables.
00:24The second part is a case study where we'll go through the process of creating
00:28a real website using CSS for all the formatting and positioning.
00:32If you are a Web designer or a coder working with HTML or XHTML and CSS, either
00:36directly or with a WYSIWYG editor, the techniques and practices you will see in
00:40this title will significantly improve your workflow.
00:43I have been a working programmer for over 25 years and have been working in the
00:47Web domain since the web began emerging in the early 90s.
00:49I use these techniques and practices in my own work and I'm excited to share
00:54these insights with you now.
00:56So let's get started with CSS Positioning Best Practices.
Collapse this transcript
Using the exercise files
00:00If you are a Premium member of the lynda.com Online Training Library, or if you are
00:04watching this tutorial on a DVD ROM, you have access to the Exercise Files used
00:09throughout this title.
00:10This is the Exercise Files folder and you'll see there are three sub-folders,
00:15one for each chapter of the title.
00:18In the first chapter, there is a number of HTML files and an external CSS file,
00:23and you can use these files to follow along as I describe these features of CSS.
00:29In the second chapter, where I talk about the CSS positioning properties, again,
00:34there is HTML and CSS files and some other assets, which you can use to follow
00:39along as I describe these features.
00:42Finally, in the Chapter 3 folder, Website, this is the complete website and all
00:49the steps that I use along the way for building this website.
00:53You can use these files for following along.
00:55And in each sub-folder, during each lesson I'll explain how to use the files in that folder.
01:01So as you follow along you'll be able to create the website along with me,
01:06comparing your results with the ending file in the folder.
01:10And again, in each lesson I'll explain how to use the files in that folder.
01:15So that's how the exercise files are organized.
01:18If you are a monthly subscriber or an annual subscriber to lynda.com and you
01:22don't have access to the Exercise Files, you can still follow along with
01:26your own assets.
Collapse this transcript
Choosing a text editor
00:00As you are working with HTML, and XHTML, and CSS, and other computer code
00:06kinds of things, you are going to want to be using a text editor and not a word processor.
00:13So here's the difference.
00:15A word processor formats text.
00:18It has italics, and it has bold, it has columns, and it has graphics,
00:23and all kinds of stuff.
00:25As you type in your text, it's not just saving the text.
00:29It's also saving all of this formatting information, what we in the biz call
00:32meta information, along with the text.
00:36So when you are editing code, like HTML, or XHTML, or CSS, or a language like
00:42Perl, or PHP, or C, or anything that's supposed to be just plain text, then you
00:48need a text editor that is not a word processor.
00:50If you use a word processor to do the exercises in this course, it will not work.
00:56You need to be using a text editor.
00:58Here are your choices.
01:00If you are on a Mac, and I use a Mac at home, and so I happened to use BBEdit.
01:04BBEdit is a fantastic text editor.
01:07It is not free, but it has many, many cool and useful features, and
01:12I personally love it.
01:14Like I said, it's not free.
01:15The same people that make BBEdit make TextWrangler and TextWrangler is free and
01:21it has almost all the features of BBEdit.
01:24It's actually a great text editor and if you don't want to spend the money on
01:28BBEdit, go ahead and get TextWrangler and you will find that it works great for you.
01:32If you are on a PC, and I work on a PC often, and when I do I use Notepad++.
01:38I used to use another text editor that I had paid for, that was not free, that
01:42was a great text editor, and over the years Notepad++ has eclipsed this other
01:47pay-for text editor and Notepad++ is free.
01:51It has many, many fantastic and useful features and the text editor that I'm
01:55using in this course, on this video,is Notepad++.
01:59So there you have it. You must use a text editor, a plain text editor;
02:03you cannot use a word processor for this purpose and here are a couple of good choices.
02:08For the Mac, you have BBEdit and you have TextWrangler, which is free, and is
02:13almost all of BBEdit, and you have Notepad++ for the PC environment.
Collapse this transcript
1. CSS Overview
Reviewing CSS linking and setup
00:00CSS stands for Cascading Style Sheets.
00:03This is the technology that's used to format and position web pages.
00:07In this first part of our course, we are going to have an overview of CSS so
00:10that we are on the same page and we have a good foundation in the syntax and the
00:15features of CSS in general.
00:17We'll finish off this first part of the course with a good overview of the
00:21positioning techniques, in particular in CSS.
00:25For this part of the course we are going to have our screen setup like this,
00:29with a text editor at the top and a Web browser at the bottom.
00:32And in the text editor at the top we'll have this style sheet, we'll have some
00:36XHTML, and in the Web browser we'll have that same document.
00:41So here we have XHTML, and it links this style sheet in, using this link statement.
00:48And this is how the link statement works.
00:50It has the link keyword, it has the relationship of the linked document, which
00:54is a stylesheet, it has the type, which is text/css, and it has href, which is the
01:00location of the document, external.css.
01:03Here we have external.css and this has the actual CSS style sheet.
01:08So if we change something in this style sheet, like for instance here the
01:11background-color, if we want to make that white, put in the code for white,
01:16which is fff.
01:17Let's save it and reload in the browser, now we have that white background in the browser.
01:23So this is the setup we'll be using during the overview of CSS in the first
01:27part of this course.
01:29Let's go ahead and get started.
Collapse this transcript
Understanding levels of inheritance
00:00The word Cascading in the name Cascading Style Sheets refers to inheritance.
00:05This is how one element inherits its properties naturally and organically from
00:10the elements that surround it.
00:12In other words, here in this Cascading Style Sheet, we see that we have the
00:15background color is this yellow color, the text color is this brown color, and
00:22so all the text in the document is brown, and all the background in the document
00:27is yellow, because the heading, choose these elements here, and the paragraphs,
00:33these elements here, they inherit their properties from the body and then they
00:39override whatever it is that's specified in their styles.
00:43And so the body has this Helvetica font.
00:46But both the heading and the paragraphs, they overrides this with their own fonts.
00:51For example, if I wanted to change the background color for just the headings,
00:58I would insert a background color property here and that will now override the
01:06background color from the body.
01:08Without that, it was inheriting the background color from the body.
01:11So if I save this and reload it in the browser, we'll see that the headings now
01:15get their own background color, which is distinct from the body, because that's
01:20being overridden now, just like the font is being overridden.
01:23Without this, it inherits that property from the background.
01:27Go ahead and save and reload, and now it's yellow again.
01:30You can do this on a smaller level of granularity by changing just a word in a paragraph.
01:36All of the words in this paragraph are inheriting their properties from the
01:39surrounding paragraph, but I can change the properties of one word using the <span> tag.
01:51<span> and close that there.
01:53The <span> tag is an inline level element that's used to apply style to something
01:59in an inline context.
02:01We'll talking more about span and div later, and how they're used.
02:05But here I can insert a style, and I can say font-weight: bold,
02:08and so this will override the natural normal font-weight of the rest of the paragraph.
02:14Then it'll keep all of the other properties.
02:17It will keep the font family.
02:19It will keep the color from the body.
02:21It will keep the background color from the body.
02:23It will keep the font-family from the paragraph.
02:25Go ahead and save that and reload in the browser and you see that that word is bold.
02:29Everything else is just as it is in the rest of the paragraph.
02:33So this is in a nutshell how inheritance works.
02:36Elements inherit their properties from the other elements that they're enclosed within.
02:41So the body is wrapped around the entire document.
02:43Everything inherits from the body.
02:45The words in a paragraph inherit from the paragraph and you can use other
02:48elements like span and div to create your own context for properties to inherit.
02:54We'll see more about that in a later lesson.
02:56So this is in a nutshell how inheritance works in CSS.
Collapse this transcript
Understanding levels of style sheets
00:00There are three major levels of Style Sheets in CSS and one is applied first,
00:06and then another, and then another.
00:07So the external style sheet is applied first.
00:11And so here we have a document with an external style sheet that's specified
00:15here in this link element.
00:19And if we wanted to, we could have another Style Sheet in the document inside
00:23the head element using the <style> tag.
00:29And we could put a style in here for example, if we wanted another style for
00:33paragraphs, say we want our paragraphs to be a bluish color.
00:38We could put that in here.
00:39Say color and that will make our paragraphs a little bit bluish.
00:47But that's applied on top of the styles that are already in the external style sheet.
00:51You have the font, you have the line- height, those are already in the style sheet,
00:55and then this color blue is applied on top of that.
01:00So first the external style sheets are applied and then any style sheets that
01:06are inside the head element.
01:08And finally, if we wanted to apply style down here, we could apply style to a
01:14particular element using the style attribute.
01:17This is not to be confused with the <style> tag.
01:19The <style> tag goes in the head element.
01:22The style attribute can be an attribute to any element in XHTML.
01:27And so maybe I'll use a different color just for this paragraph here, make it a
01:33little bit green, I'll save that and reload.
01:38Now this paragraph down here is green and this one is still blue.
01:42And so the styles are applied in order.
01:44First the external style sheet and then the <style> tag inside the head
01:51element and then any styles that are applied to particular elements using
01:56the style attribute.
01:58So these are the levels of style sheets in CSS.
Collapse this transcript
Apply styles with SPAN and DIV
00:00There are two special elements in XHTML that are used specifically for applying
00:05style to parts of a document.
00:07These are span and div.
00:11We've seen span already.
00:12Let's look at it again here.
00:14If I wanted to change the style of just part of this paragraph, I would use a <span> tag.
00:20Span is a container, and so it has a beginning tag and an end tag, like that.
00:27And then you can apply style using the style attribute like this and
00:33say font-weight: bold,
00:36and that applies the style to this portion of the paragraph.
00:43And there we have some bold text there.
00:46<span> is an inline level tag and what that means is that it works inline with
00:53other inline level elements. For example, text.
00:57Span is usually used inside of a paragraph or some other inline context.
01:03Div is a block level element.
01:06And so if I want to apply a style to a block, say for instance both of these
01:12elements here this heading and this paragraph, I would use <div>.
01:21Div is block level.
01:22It is not inline level.
01:24You cannot use a div inside of a paragraph.
01:28It will break the paragraph apart because it's block level.
01:32It's not really legal inside of a paragraph.
01:34Inside of a paragraph only inline level content is allowed.
01:37Div is block level.
01:39It can enclose other block level elements like headings and paragraphs.
01:43And so, if I want to say change the color of this entire block, I can say
01:48<div style= "color:
01:52#006"> make it bluish.
01:57And save that and reload over here, and now this block including this heading
02:04and this paragraph are both blue, and that's because of this <div> around them.
02:10It's a block level element and you're able to change the style for a block.
02:15So that is, in a nutshell, span and div.
02:17<span> is inline level, <div> is block level, and these are two tags that are
02:22specifically designed just for applying style.
Collapse this transcript
Relating styles to the HTML document with selectors
00:00selectors are used in CSS to apply a style to elements in the document.
00:06For example, this is a selector here, this is the Body selector, this is h1
00:11selector, and these selectors select tags in the XHTML document.
00:17So this Body selector will select the body element here and everything within
00:24that body element, all the way to the end of tag at the bottom of the document,
00:28will be covered by this style and will have this style applied to it.
00:32So, that's why the background color is yellow and the text color is brown.
00:38This h1 tag applies to all the h1 elements and so these h1 elements have that
00:43font to them, because that selector is a tag selector, and it selects all the h1
00:48tags in the document.
00:51There's another type of selector here, this is called a class selector, and
00:56you see that it has this period at the beginning of it.
00:58And that's what makes it a class selector.
01:01This is applied by using the class attribute on an element in the document.
01:05For example, if I use this class here, I can say class="first", and save that.
01:13When I reload the document, we'll see that that paragraph gets an indent there,
01:17because this first style has its text indent set to 2 ems and we apply this
01:25class selector to that element.
01:28A class selector can be applied over-and-over in a document.
01:31I could apply it to this h1 element here, and that h1 element will now also get
01:39an indent, and there we see that h1 element also got indented.
01:46If I take this class selector and make it more specific, I can combine tag
01:50selector with the class selector.
01:52Let's say p.first and now this will only apply to p elements that have the first class.
02:01So if I reload now, this h1 element won't get it anymore, but the p element still does.
02:07So that's combining a tag selector with a class selector.
02:12So class selectors can be more specific by applying them to a particular tag.
02:18I could make a different class selector for the h1 element and give it a
02:25different attribute entirely.
02:27I could say color blue.
02:30And if I save that then this one here, which is h1 with the first class, will
02:39become this blue color.
02:41So those are class selectors.
02:44On the other hand we have something called ID selectors.
02:48ID selectors can only be used once.
02:52So now, we have this h1 element with an ID selector that says amtp and
02:57that makes it blue.
02:59So if I save this, of course, this won't be blue anymore because we're not using
03:04that selector over here. We're still using that first class.
03:08Instead, if I say id="amtp", now this heading will get the blue color.
03:18More commonly, the ID selectors are used with div, and they are used for sections.
03:23So, I can say here I can say div id="amtp", and come down to the end of the amtp
03:31section and say close div and save that.
03:36But my ID selector has this h1 next to it, so now I need to make this div.
03:42Now, this entire section will be blue, because I've used a div with an ID selector.
03:48ID selectors can only be used once. class selectors can be used over-and-over.
03:53Like for instance this highlight here, I can use this highlight in several
03:57places in the document if I want to.
04:00I can highlight this word using a span.
04:14Now then I can copy this and use it in several places.
04:19Using that copy and paste feature on my keyboard, Ctrl+C and Ctrl+V on a PC, or
04:25Command+C and Command+V on a Mac.
04:28Highlight this word here, and I can even highlight a word maybe down in this paragraph.
04:40When I save that and reload it in the browser, we've applied this style on
04:44different places, using the class selector.
04:48So that's what class selectors are for.
04:49Class selectors are for something that's going to be used over-and-over.
04:53For something that's just going to be applied once, you want to use an ID selector.
04:58ID selectors get used once, class selectors can be used multiple times, and
05:02tag selectors are for selecting all like tags in a document.
Collapse this transcript
Understanding units of measure in CSS
00:00There are several different units of measure available in CSS and we are going
00:03to cover the most common of them here.
00:06First one I want to talk about is color, and so here we have a color specified.
00:11This # sign means that it's going to be a hexadecimal color and it's in three parts,
00:16Red, Green and Blue, RGB, and these are hexadecimal numbers.
00:21There are two ways to specify hexadecimal numbers. There is the three-digit way
00:26and there is the six-digit way.
00:28The six-digit way is probably more common.
00:30I tend to like to use the three-digit version.
00:33The six-digit version looks exactly like this and so the three-digit version is
00:39just the six-digit version with the numbers doubled.
00:42This is exactly the same color.
00:44If I reload the document, you will see no change, but if I wanted to, I could
00:48say 6f3005, and we would get a slightly different color, not much.
00:59And it's hard to see the difference, and so that's why frankly I tend to use the
01:03three-digit version.
01:04The six-digit version has more resolution and it might be more accurate if
01:09somebody is designing something and wants a very specific color.
01:12I tend to use the three-digit version.
01:14I'll call this 630 and save that.
01:18Another way to specify color of course is to name the colors. There are a number
01:23of named color that are built into CSS, and there are even more that are built
01:27into most browsers, and you can pretty much specify any color you can think of,
01:31and the browser would probably know what it means.
01:34But if you want to just keep it to the major ones, you can say red and save that
01:39and you will get a red, or you can say green, and save that and we'll get a
01:46green, and you can say blue of course.
01:52And reload and get blue, and black and white are also universally supported.
02:00There is white. It's hard to see.
02:02And black, should be a little bit easier.
02:07 And there we go.
02:12So, those are the units of measure for color. Put this back the way that it was,
02:17and save and reload, and there we are.
02:20Another type of unit of measure is when we talk about text, and this is commonly used.
02:26If I come over here and specify a font size, I can specify this in points, I can
02:33say 12 points, and we'll get a more or less 12 point size on my screen here,
02:39which looks like pretty close to what I had already.
02:42Actually 12 points is the default on most browsers, so I'll say 10 points, so
02:46we can see a difference, and reload, so that's ten points.
02:50You can also measure it in pixels, and say 10 pixels, save that and reload it,
02:58and so that's 10 pixels which is very small, or I can measure it in percentage
03:03where I can say 110% or 120%.
03:08And that will make it 120% larger than the default.
03:13Reload and that's 120% relative to the default, which is apparently 12 points.
03:20Likewise, the line-height is measured in percent here, relative to the size of the font.
03:25I could put that line-height instead in points and say it's going to be 20 points
03:31and get a different line-height.
03:33Oh, that's probably about the same. It moved a little bit, but let's do
03:37something so we can see a little better.
03:39Say 25 points, and we'll see there it gets bigger.
03:44And so these things can be measured in points, they can be measured in
03:48percentages, or they can be measured in pixels.
03:53It's also common to measure line-height in exs. I can say 3ex and an ex refers to
04:02the height of a lower case letter x, so that's the 3ex height there and
04:08I'll make my font size the default again and save that and reload.
04:13So when speaking of text, it's often common to use exs and ems.
04:17em is the width of a capital letter em, which is about twice the size of an ex,
04:27so if I reload here, we have a much larger line-height.
04:29em and exs are often used for text.
04:33They are often actually used for both height and width.
04:37Although exs in typography, they are more commonly used to measure height, and
04:41ems are more commonly used to measure horizontal space.
04:45And finally, we can use pixels and put this back to where it was, which I think was 140%.
04:53Save that and reload.
04:57And we can talk about pixels a little bit here.
05:00Of course, you can specify your font size in pixels. What I'm going to do here
05:05is I'm going to put a border around the paragraphs, so that we can see the
05:08dimensions of the paragraph a little bit and work with that.
05:16This will create a one pixel thick, solid, black border.
05:20It's nice and easy to see, and so we now have that border around the paragraph,
05:26and I'm going to set the width of the paragraph using pixels.
05:33I will go ahead and save that and reload, and now we have a 300 pixel wide paragraph.
05:39And this will allow me to talk a little bit about some different dimensions
05:42that we have. Of course, you have seen the measurement with pixels and we can
05:46see how that works.
05:47I want to talk about margins and padding real quick.
05:51The margin happens on the outside of the box and the padding happens on the
05:55inside of the box, so this black line represents what's called the content box.
05:59For a paragraph, it's really simple to understand.
06:02It's the width and height of the paragraph.
06:04Now, if I add some padding to this, and let's say I want to add padding of 15
06:12pixels, we'll be able to see that.
06:13That will add 15 pixels to the inside of the box pushing out the box all around.
06:23There we go.
06:24The margin adds space to the outside of the box, so if I say margin, well,
06:30we have a margin up here already.
06:32Let's just use that and I'll just change this to say 15 pixels all around.
06:38Go ahead and save that and reload.
06:41Now we have 15 pixels on the outside of the box as well.
06:44So, added space on all four sides around the box.
06:49So, margins are outside of the content box, and padding is inside of the content box.
06:54So, one thing worth noting here, and I'm going to go ahead and undo, put my
06:58margins back to the way it was, save that.
07:02Margins and padding are specified in four directions and so if I say I want
07:085 pixels on the top and 10 pixels on the right and 15 pixels on the bottom,
07:15and 20 pixels on the left, so they are always specified clockwise,
07:20 top, right, bottom and left.
07:23Clockwise starting at the top with four numbers.
07:26So, I'll save that and reload and we see that now we have this 5 pixels at the
07:31top, 10 pixels on the right, 15 pixels on the bottom, and 20 pixels on the left.
07:36So, there are two shortcuts that are common.
07:38One we have already seen, which is to just say one number, and then that will
07:43happen all the way around, and so now it will be 20 pixels all the way
07:46around, all the same.
07:48Another is to use two numbers and the first number represents top and bottom,
07:53and the second number represents left and right.
07:55So, let me say 40 pixels left and right.
07:57We'll save that and reload and now we have wider on the sides and narrower on the top.
08:03So, these are shorthands.
08:05You have the one number shorthand, which can just make the same amount all the way around,
08:10and the two number shorthand, which is the same top and bottom, and
08:13then another number for right and left, and then using four numbers you can
08:17specify them all separately.
08:19Top, right, bottom and left, clockwise around the box.
08:24So, that's our units of measure and that's also about margins and padding and
08:29this is good to understand. We'll be using these techniques a lot later on.
Collapse this transcript
2. CSS Positioning Properties
Using absolute positioning
00:00There's basically four kinds of positioning in CSS.
00:03Absolute, Relative, Float and Fixed.
00:07In this lesson we're going to talk about absolute positioning.
00:10Here on the screen we have four content boxes.
00:13The outer one has this border around it and it's this dark blue, and contained
00:18within that are three absolutely positioned columns of text.
00:23Each of these are a different color for illustration purposes and their position
00:27using absolute positioning.
00:29So let's take a look at that in the source document.
00:33Here we have an XHTML document and here is our content boxes in the XHTML.
00:38The outer box is this outer div and contain within it are three boxes with text
00:44in them, and these are named first, second and third, and the outer boxes named
00:48outer and this is with id selectors.
00:52So here's the CSS and in this case we've put it inside the document in the
00:56style container and that's just for illustration purposes.
01:00Again, I would normally put this in an external style sheet.
01:04Here we have the outer box and you'll notice it has this position:
01:07relative, and the purpose of this is to qualify it as a containing block to
01:13contain the other positioned elements.
01:16Absolute positioning requires a containing block.
01:19If you don't provide it one, it will use the outer block of the document.
01:23The outer border of the window space in your browser will become that containing block.
01:30And so in this case we wanted to provide a containing block and in order for
01:33this to qualify as a containing block, it needs to be a positioned element and
01:38that means it needs to have a position property and that property needs to have
01:42a value of either relative or absolute.
01:44The default position property is called static, and you'll rarely ever use that,
01:51and that simply is exactly the same as having no position at all.
01:56So if I save this and reload this document, you'll see that these positioned
02:00elements will now be positioned relative to the outer frame of the browser.
02:05I'll go ahead and put that back and save it and reload in the browser and there we have it.
02:11So in order for this outer block to qualify as a containing block for
02:16positioned elements, it needs to have this position relative, or it needs to be
02:21positioned absolute.
02:22Reason positioned relative here, because we use positioned relative without
02:26any actual positioning,
02:28in other words it doesn't have a top or a left property, that makes it behave
02:32the same as if it had no positioning, but it's still qualifies, because it has this.
02:38It makes it qualify as a containing block for the absolute positioned elements.
02:43Now, the absolute positioned elements here, we have three of them, and they have
02:47a top property and a left property. In this case they are both 0, and the second one,
02:51the left is 250 pixels, and the bottom one, the left is 500 pixels, and
02:56this positions them absolutely relative to the containing block.
02:59So the word absolute simply means that the coordinates are absolute relative to
03:04the boundaries of the containing block.
03:07But they're still relative to that reference point.
03:10The containing block provides reference points for the absolute positioning.
03:15Each of these elements is exactly 250 pixels wide.
03:19We've provided a width of 220, and padding of 15 pixels all around.
03:23So if you add up the left and the right here, you get 30 pixels, and you add
03:26that to the 220, you get 250 pixels.
03:29So the total width of the element is 250 pixels, and so I positioned the second
03:34one 250 pixels from the left boundary of the containing block and I've
03:39positioned to the third one 500 pixels, which is two columns over from the
03:45left boundary of the containing block, and that's what gives us this positioning here.
03:50So we have 0, we have 250 pixels, and we have 500 pixels.
03:55This gives us this absolute positioning.
03:57Just one more thing I want to show you. If I move one of these blocks, I'm going
04:00to move the middle one over a 50 pixels here.
04:02I want to show you what happens.
04:04Make that 300 pixels over from the left boundary, I'll save it and reload, and
04:12you'll notice that now this right part of it is no longer visible, because it's
04:16hiding under this third block.
04:18The reason for this is the order in which they happen in the XHTML.
04:24Because the second block is before the third block is actually underneath it in
04:31that third dimension.
04:32It's a two dimensional document, but there is a phantom third dimension called
04:36the z-index, which is the property that defines which elements will appear above
04:41other elements if they happen to overlap.
04:43If I were to move this block and move it down here under the third block,
04:52I'll go ahead and save that, because they're absolutely positioned, it will still
04:56be in the same place.
04:57But it will now appear over this element on the screen.
05:00Now, if I don't want to actually move it, I'm going to hit undo a couple of
05:04times here, there we go.
05:06Instead, I can specify a z-index.
05:10So now they're in the original order.
05:12I'm going to specify a z-index here in the style, z-index: 1.
05:19Any z index at all will work, because the other ones don't have one.
05:22So that's puts them in the 0 z-index.
05:25I'll save this and reload, and now it's still over it.
05:30If I take that out, you'll notice it will go back to behind. Go ahead and reload
05:35over here, and now it's behind.
05:38So you can specify a z-index and if you specify a z-index for all of them,
05:41you can actually control what's in front of what.
05:43The higher numbered z-index appear in front of the lower number z-index.
05:48So that's absolute positioning, and those are the things you need to know about
05:52in order to use it in your documents.
Collapse this transcript
Using relative positioning
00:00In this lesson, we're going to talk about relative positioning with CSS.
00:05Relative positioning is not very good at laying out blocks of text.
00:08As you can see here, I have attempted to use relative positioning to create a
00:13three column document and it failed miserably.
00:16What relative positioning does is it position something on the screen in a
00:20different place than where it actually belongs to the document, and yet it lays
00:24out the rest of the document as if that object were right where it belonged and
00:29had not been positioned.
00:30Let me give you an example here in text.
00:33Now take this word BW Whois, and I'm going to move it off to the side, and
00:36you'll see that the rest of the document wraps around as if it were right where it belonged.
00:41Here we have our document.
00:45You'll notice we have the positioning in the CSS, in the style element, just
00:49like in the last one.
00:50We have our three blocks of text, first, second, and third, and that's what we
00:55were seeing on the screen.
00:57So I'm going to take this BW Whois word, and I'm going to put a <span> around it.
01:07So that I can apply some style just to that inline piece of text and
01:11I'm going to say position:
01:14relative and -100 pixels, and that's the left property.
01:21I'll go ahead and put in a semicolon.
01:24It's not required but I like to put it and save.
01:28And now we'll look at it in the document and you'll see that the word BW Whois
01:32now has moved all the way out of the content box and yet the rest of this
01:37document is wrapping around as if it was right where it belonged.
01:40That hasn't moved at all.
01:41All that's moved is those words.
01:43So that's what relative positioning does.
01:46It moves the place where it displays, while leaving the affective place in the
01:51document for other things to wrap around it and interact with it as if it was
01:54right where it belonged.
01:55The most common use of relative positioning is actually showing up here in our
02:01style sheet and it's to create an outer container that qualifies as a
02:06containing block for the purpose of positioning other elements and so as we
02:11saw in the absolute positioning document, I'll bring that up on the screen
02:14here so we can see that.
02:16In our absolute positioning example, we can put position relative in this
02:20outer containing block and that made it qualifies a reference point for the
02:25absolute positioning.
02:26You'll notice there is no top or left property here.
02:29So the positioning isn't actually moved.
02:32It doesn't actually move that containing box out of the place where it
02:35normally would display.
02:37Instead, it just exists to make this outer containing box qualify as a
02:43containing block for the absolute positioning.
02:45So this is the most common use of relative positioning in CSS.
02:50It's not very commonly used for actually moving things around on the screen.
Collapse this transcript
Using the float property for positioning
00:00In this lesson we are going to be talking about using float to position objects in CSS.
00:06In this first part we're going to show you the traditional use of float, which
00:09is to float an image and to have the text wrap around the image.
00:13So here we have a floating image and here's the text that wraps around it.
00:17This image is floating to the left and so the text naturally wraps around it to the right.
00:22So look at this in the document.
00:25So here is our XHTML document, we have the style inside of the <style> tag, and
00:32down here we have the text.
00:33So we have a div with an ID selector of textbox and an image with a class
00:39selector of floatLeft and the div wraps around all of this content.
00:44The image is the first item in the content and then after that we have the text.
00:50So the floatLeft class is right here and you see it just has a couple of items.
00:55It has the float property with the left value, and margin-right of 15 pixels.
01:01So that makes this image float off to the left and gives it this nice little
01:0415-pixel margin before the text that floats around it to the right.
01:09And the textbox, of course, has the background-color and the width of 750 pixels
01:14because we have 720 plus the left and right padding.
01:17It has this border and it's centered on the page.
01:21So that's this object here and all of the image and the text is all
01:25contained within that.
01:26Now, if I wanted the text to float to the right, I could use my floatRight class
01:35and you'll notice up here we have both the floatLeft and the floatRight and
01:40the only difference is that the value for the float property is right and the margin
01:44is now on the left instead of the right.
01:46So if we save that and reload in the browser, you'll see that the image now
01:49floats to the right and the text wraps around it to the left and around and
01:54that margin is now there on the left side of the image.
01:57Now if we want the text to not wrap, the way that we accomplish that is by
02:02using a clear property.
02:05So I'm just going to take this, I'm going to go down here to the paragraph and
02:08I'm going to say style= and let's say "clear: right".
02:15So this will make the paragraph not wrap around anything that's floating to the right.
02:21Save this and reload.
02:24Now that paragraph clears the object that's floating on the right. Of course,
02:28the heading is still wrapping around, but the paragraph is not and that's
02:34because of that clear property.
02:37If I change the clear property to say clear left and then it will only clear
02:40objects that are floating to the left.
02:42I'll save that and so it won't clear anymore.
02:46Now the text is wrapping around again because the clear property specifies the
02:51left value and this object is floating on the right.
02:55I could say clear both, which will make it clear anything that's floating on the
03:00left or the right, and then it's clearing again.
03:05So that in a nutshell is the float property as it applies to an image.
03:09But the other useful aspect of the float property is to use it on columns of text.
03:15Here we have our three-column document again and this time, we are using float
03:18to make these three columns.
03:19And this is actually very, very simple to do and this is the technique that we
03:23are going to be using to build the website.
03:25This is the most common way to make columns of text using CSS
03:30positioning instead of tables.
03:32Here we have our same document that we've had before and we have the three
03:36columns of text, and the ID properties, first, second, and third.
03:41And the ID of the outer div is called outer.
03:45And up here is the style sheet.
03:47Notice that there are no position properties at all.
03:51Instead, all we have here is the outer box, just has its dimensions and
03:55its centering and such.
03:57And each of these columns of text has float: left, float: left,
04:02and float: left.
04:04So what this does is really quite simple.
04:07This first block is floated to the left and so anything after it will wrap
04:11around starting on the right and so the second one appears to the right because
04:16the left one is floating.
04:18But the second one also has float: left
04:20and so anything after it, will wrap also to the right.
04:24So the third one is also to the right of it because of the float: left there.
04:29So you can stack as many columns as you want.
04:31This is an example with three, and they have to fit in the containing box.
04:35That's the only limitation.
04:37So you just make sure that they fit and voila, you have it.
04:41So this is the most common way to make columns using CSS positioning instead of
04:46tables for layout, and this is what we'll be using in our example website.
Collapse this transcript
Using fixed positioning
00:00In this lesson, we are going to talk about the fixed positioning technique and
00:04here's an example of it here.
00:06I have the browser in the bottom-half of the window this time with the text in
00:09the top-half and that way we can show the window scrolling.
00:12So as you see, when I scroll the browser here, this image stays fixed in the
00:19bottom right-hand corner of the browser window.
00:21In fact, if I scroll side-to- side, it does the same thing.
00:25It stays fixed there.
00:26It's a fixed number of pixels from the right and the bottom of this view window.
00:30So you'll notice when the bottom scroll bar disappears the image moves down.
00:36So it remains this fixed number of pixels from the bottom.
00:39So here's how that's accomplished up here in the text editor.
00:41Let's see in the style section. I have the style sheet.
00:45Image fixed image.
00:47That's an ID selector and we have position: fixed, right: 15 px, bottom: 15 px.
00:54So that's the number of pixels from the right and from the bottom.
00:57So that positions it relative to the right and bottom boundaries of the viewing portal.
01:04Now down here in the XHTML, you'll see here is the image as ID equals fixed
01:09image and the rest of it is just a normal image tag.
01:12So if I want to move it, just come up here to the style and I'll say left: 15 px.
01:19I'll save that and reload and the image moves over here to the left side.
01:26Likewise, it just stays fixed and I can do this, change bottom to top, and that
01:33will be in the left to top.
01:39That's how that works.
01:40Likewise, I can do this with text, and I've set up a style for doing this with text.
01:45Right here, I've created a textbox.
01:48It's 200 pixels wide, and it's positioned five pixels from the top and five
01:53pixels from the left.
01:54So we move the image out of the way here, I'll move that to the right top for now.
01:59I'll save that and reload and now the image is over there so we can play with
02:05that upper-left corner.
02:07So this one is called fixed text and it's a div ID selector.
02:12So I just take some of my text, I'm going to take it right out of the middle here.
02:15I'm going to take this AMTP right out of the middle and I'm going to put this div here.
02:20ID equals fixed text and close the div down here.
02:25And I might want to spell this correctly and I'll just save that and I'll take
02:35this AMTP right out of the middle of this document and instead it'll have BW
02:39Whois and then writing, because fixed elements do not appear anywhere in the
02:46flow of the document.
02:47They are outside of the flow, they are outside of the wrapping, they are outside
02:50of all of that relativistic layout and instead they just float.
02:55And so hit reload and now we have Whois, we have the writings, and AMTP is up
03:00here in that corner and you notice as we scroll, it stays right where it's put
03:08and it actually extends over the bottom of the window if I bring this up so that
03:12it doesn't do that anymore.
03:13Of course, we don't have scroll bars anymore because it's larger than anything else.
03:17But you'll notice that it doesn't create the scroll bars itself.
03:20Scroll bars don't happen until I start impacting the rest of the text and
03:27of course that doesn't scroll.
03:28This is a technique that's sometimes used for menus on web pages and you'll see
03:31the menus stay in your viewport even when you scroll the page and so it's
03:35commonly used for that.
03:37So that is the fixed positioning model and that concludes our discussion of CSS
03:45positioning and now we'll go into the next chapter where we'll build a website
03:49using the techniques we've learned here.
Collapse this transcript
3. Building a Web Site with CSS Positioning
Exploring the finished web site
00:00So in this chapter, we are going to build this website.
00:04This is a website that was designed by a guy named James Williamson, who also
00:08wrote all of the clever and witty copy.
00:11It's a mock up of what would be a surf shop website and it has a number of
00:16features here that we'll be coding up in CSS and using positioning for.
00:21We have this header up here, which has a Contact button and has this main menu,
00:28and then it's got all these images along the right.
00:33It has a main content area on the left and a sidebar content area on the right
00:38and down here at the bottom, it's got a little bit of copyright text and legalese.
00:45And then there is a product page called Gear and it has a sub-menu for the
00:50different types of gear, and it has a little This month's special, and so this
00:54all gets laid out with CSS and a Lifestyle page.
00:58It has another type of menu up here, and it's got some ordered list text down
01:03there and a Videos page, we'll get a little warning from Flash. I'll explain
01:09that when we get to it in the website.
01:11And this has a video that's linked in from YouTube, which I think is a great way
01:15to post a video on your website.
01:17If you don't have another way of delivering the content. They'll give you
01:20this lovely little Flash Player and they'll host the video content on the
01:24website, saving you money.
01:26And so this is the website. Like I say, it's been designed for us, all of these
01:30assets, all of these images and everything has been provided.
01:34Often times, when I'm asked to build a website, all of the assets will already
01:37be built for me, or at least most of the design work will be done and I'll just
01:41have a little bit of Photoshop jockey work to do.
01:44This is not an unusual way to do it. We'll have all of the text provided for us,
01:48and all of these different graphical assets, and we'll build up the website, and
01:52this is really the focus of this course, concentrating on how to do the layout in
01:55CSS, in places where otherwise, you might have used the tables.
01:59So that's our task, if we choose to accept it. Let's go head on and get started.
Collapse this transcript
Building a document header
00:00Okay, so we are going to go ahead and build this website now.
00:03I want to take a moment and talk about the process that we are going to use to do this.
00:07We have on the screen here is the finished website and I'll keep this up in this
00:12tab here so we can refer back to it.
00:14We're using this as a reference so that we can build something that
00:18looks exactly like this.
00:21And in the other tab here, there is nothing there now.
00:23That's the tab that we'll be working in as we build the various elements of the website.
00:28In the text editor, we have our beginning place and we have our beginning.css
00:34and in the Exercise Files folder, there is a separate folder for each lesson in
00:40the chapter and each lesson is on its own video, and within each lesson folder,
00:47you'll see there is usually a beginning place for the HTML and a beginning place for the CSS.
00:53And this will change a little bit as we go on and I'll discuss how and why it
00:57changes as we go on.
00:59But this is what you need to know for now.
01:01This beginning.html is where we are starting and this beginning.css is where
01:05we are starting in the ending.css.
01:07And the ending.html is more or less where you are going to end up.
01:11Your HTML should be functionally identical to what you see, though if there's a little bit
01:15of spacing difference here and there that is not going to break the bank as they say.
01:19But you want your ending place to be functionally the same or as what is in that file.
01:24So we're going to begin here now and you'll be able to see the process as we do
01:28this first lesson, which doesn't really have a lot of code.
01:31It's mostly about the process.
01:33So the first thing we are going to do, every single time, is we're going to save
01:36out the file using Save As in your text editor, and in this case I'm going to
01:41save it as header.html because that's what we are going to end-up with at the
01:47end of these first few lessons.
01:49And that will go in the same folder where the existing beginning.html and ending HTML is.
01:54So this is this 02-header folder. You'll notice our path up here at the top
01:58of the text editor.
02:00It's Exercise Files/03- Website/02-header/beginning.html.
02:05So you want this to be in the same folder.
02:07There is the Exercise Files, Website, 02-header, save that file out, and then
02:13with the CSS, it's always going to be called main.css.
02:19So I want to Save As the css and do the same thing with that.
02:25And now we have main.css and header. html and so the first thing we are going to
02:30do here, this is our starting place template, and this is our XHTML template,
02:37and so it's just a starting place.
02:39And I use this template so I don't have to type all the stuff out every time I
02:42create a new document and it's all there and it's all correct.
02:45I want to start up here and I'm going to create a link tag in the head.
02:51So this goes within the head element and I'll create a link tag and this is to
02:55link into our external CSS.
02:57link and so href is the location of the CSS file and then rel is the
03:08relationship, which is stylesheet, and the type is always text/css.
03:19And so we'll save that and then we'll change the title.
03:23So it says Welcome to Groundswell.
03:32And save. I'd like to save as I go along.
03:35And in the body, there is going to be a div. This is our outer div for the
03:43entire document and that will end down here for the ending body tag.
03:53I'd like to put in a comment.
03:56So as the document gets big, it's easy to see what's what.
04:02So you'll be able to find that at the top and know which is which.
04:06And then instead of this here, I'm going to have a div id = header and a
04:14div for that and likewise a comment.
04:19And so that is what we are going to put our HTML file for now.
04:22I'll go over here to the CSS.
04:24We'll put in some starting styles.
04:27I'd like to have some comments.
04:36So these are global default styles.
04:39I'll start with the body style.
04:44
04:49That's just a starting place. I don't typically ever use the default font family
04:54but I'd like to have one in there just in case.
05:10And so that's our background and you'll notice that the path has this dot dot at
05:14the beginning of it.
05:15That's because image paths in a CSS style sheet are relative to where the style
05:20sheet is located, not relative to where the document is located.
05:24And you'll notice when main.css is in the CSS folder, if we want to reference
05:28the images folder, you have to go up a level first and then to the images folder
05:32and so this dot dot does that.
05:38And so the margin 0 and padding 0.
05:41That allows the content in the body to butt up against the boarders of the Web browser.
05:47Now I'll default for the paragraphs and other text elements.
06:00Just give them a reasonable margin.
06:04Likewise, I don't usually use those but it's nice to have them just as a starting place.
06:11And now the outer div and this wraps around the rest of the page.
06:45And this creates our space for the outer page and it also puts our banner at the top of
06:50the page so we can position things over it, and so our banner at the top of the page
06:54is actually in a background.
06:55Let me go ahead and save this and show you on the page.
06:58This graphic up here, this says Groundswell and it has all of the navigational
07:02elements on top of it.
07:04That's actually the background image and that's the background image right there,
07:08and we also have this fff to give us a white background for all of our text
07:13and the no-repeat means that the banner image will not repeat as a
07:18background normally would.
07:19It'll only get displayed that once, and so we have the white background which
07:24will go over the rest of the space.
07:26So if we go ahead and load this document in the browser now, in this tab, which
07:30has nothing in it. I'll go ahead and take this header.html and drag it out
07:34there at the browser.
07:36And there we have our background, and you don't see the background image yet
07:40because the div doesn't have any vertical size.
07:43So there isn't anything there yet to be able to see.
07:46If I go in here in the CSS and I just give this temporarily just give it some
07:50vertical height and we know that that image is 110 pixels high.
07:55So I'm just going to say 200 pixels, so you can see the end of the image and you
07:59can also see the white comes into play there and we'll reload in the browser
08:04and there you have it.
08:05And so this background here, that's the background image in the body, and this
08:11is that outer div and it has that banner in it at the top. I guess we'll take
08:16out that height and go ahead and put in the header here.
08:22I am going to make another section and say div#header.
08:34And so the header div is going to have some height and position relative.
08:42Now position relative without any other positioning information, that makes it
08:48qualify as a containing block, so that we can do some other positioning relative
08:54to its fixed position on the page.
08:57So we'll go ahead and save here and reload the document and now we should just
09:01see the header because that header div now has height and it has the width based
09:06on the containing block, which is the outer div.
09:10So this outer div gives it the width and because this header is contained within
09:14and inherits that width and then its height is 110 pixels.
09:17So 770x110 is the size of that image, and so we can see that image.
09:22The image is the background of the outer div.
09:24The header does not have any content at this point.
09:27So that is what we are doing in this lesson and so we have our outer div,
09:32we have our div for the header, we are ready to start putting elements on the
09:36header and we have setup our basic CSS.
Collapse this transcript
Placing a contact button
00:00Continuing in the process of building our website, in this lesson we are going
00:04to setup this Contact button up here at the top.
00:06So let's get started.
00:08Here we have our beginning.html in the contact lesson folder and our beginning.css.
00:14So we'll start by doing our Save As. File > Save As.
00:19We are going to save this as header.html, and our CSS we'll save as main.css.
00:29So we are going to be working inside this header div container and we'll start
00:35with the div for the Contact button.
00:37So we have div id= "contactButton" and we'll close that div.
00:49Inside of that we'll put the contact link:
00:52a href= and have the mail to link.
01:04title="contact us" and it will say Contact Us.
01:13This is all very interesting because the way this is done, it's just a regular
01:17text link, and if we go look at this now in the browser...
01:20So we drop this into the browser.
01:22You will notice that it's just a regular link.
01:26It's got text, it's blue, and it's got the underline, and that's what it looks
01:30like without the style.
01:32When we apply the style, it's going to look like this with the image.
01:34So the reason for that is that for browsers that are text-oriented browsers and
01:39don't have graphics and don't support CSS, they'll still see a link and they'll
01:43be able to click on it.
01:44When we do our style, we won't see it and it will look all cool like
01:49it's supposed to look.
01:49So let's go ahead and do that.
01:50So we are going to put in the contact link in the style sheet.
02:04We'll start by selecting the contactButton div.
02:32And so we'll go ahead and save that and now when we look at it, we'll see that
02:37that contact link gets moved over.
02:40And there it is and that's where it's going to belong.
02:42Now we'll set it up so that it displays the image.
03:01These kinds of selectors are called pseudo-element selectors and what they
03:05are is they are special selectors that just select for an element in a particular state.
03:10So these are special states for anchor elements, so link and visited are the
03:14default states for a link that has or has not already been visited.
03:18So this is its default state when it doesn't have a hover over it.
03:23We'll set up the hover and active next.
03:32So those were the dimensions of the image.
03:37This changes it from an inline element to a block element.
03:47That text-indent, that takes the text and moves it off to the left 1000 ems,
03:52which is way off to the left so it'll never be seen.
03:55So just for browsers that support CSS, which is most visual browsers, that link
04:01will become invisible.
04:24Okay, let's talk about this background property at this point.
04:27You notice there is an URL and this is for the image and it says
04:31contact_icon_dual.gif, no-repeat left top.
04:36So what we've done here is we set this up so that it aligns at the left and top of the image.
04:41So when I save this and we go look at it in the browser, you'll see the
04:45image will show up.
04:46And because our viewport window is just that size, it's the size of half of the
04:50graphic, but it's the full size of this image, we aligned it at the left top,
04:54all we see is that part of it.
04:56When I do the hover selector, you'll see that when you hover over it, it will
05:01show the other image.
05:02This is really clever, and you'll see what I mean here in a moment.
05:07So I'm going to go ahead and copy and paste here.
05:11Copy and paste, and then I can just change this to active and this to hover.
05:19So these are the two other states of the a element,
05:23so these are the pseudo-element selectors for the hover state and the active state.
05:27And I'll just say background-position:
05:32left bottom.
05:36So all that does is in that hover state is it changes this left top to be left bottom.
05:42So when I save that, we bring it up in the browser, reload, when I hover over this,
05:47you see that it changes the image and looking at the image,
05:51that's the bottom half of the image.
05:54So we see the top half of the image in its normal state and when I hover the
05:57mouse over, we see the bottom-half of the image.
06:00So that's just a clever way to make rollovers work using CSS.
Collapse this transcript
Laying out a main menu
00:00In this lesson, we are going to go ahead and set up this menu here.
00:05This is our main menu for the whole site.
00:08You see it has these lovely little rollovers and it's positioned over here on the header.
00:13So we'll go ahead and get started.
00:15In our text editor, we have where we left off in the last lesson and we have
00:19there beginning.html and beginning.css out of the 04-menu folder in our Exercise Files.
00:26So we'll start by doing our Save As.
00:28I'm just going to save this as header. html, and our CSS, we'll save as main.css.
00:37All right, the first thing we are going to do here is we are going to insert the
00:43HTML for our header.
00:58So there is the div for positioning our mainMenu and inside here we have an unordered list.
01:07Again, this is so that it looks nice for browsers that don't support the
01:12graphical or the CSS.
01:18There's four line items.
01:20So I'm going to go ahead and paste that into four places.
01:25So I use copy and paste a lot.
01:28This saves a lot of typing.
01:37Put in this home.html here and this one is going to have class equals current.
01:45That's the way that we specify which one of these links is the current page.
01:52So we are going to start by laying out the Home page.
01:54On the Gear page, that one will be the current and on the Lifestyle page, that
01:58one will be the current.
01:59Here, the Home is the current.
02:01So it's just a place to start.
02:03So I'm going to do my copy and paste here again.
02:07Copy and paste and this one will be Gear, and this one is not current.
02:14 This is gear.html.
02:22So that is going to be a lot like the other two.
02:24So I'll go ahead and paste that into the other two places.
02:30So we have Lifestyle and that's lifestyle.html and videos, and so save.
02:45So this is the HTML for our main menu.
02:48If we go ahead and look at this in the browser now, drag this header.html
02:54into the browser, you see that it's all in text and it even pushed the whole div down.
02:59So what we are going to do is we are going to change the way that works in the CSS.
03:04So for browsers that don't have the CSS, they will see this.
03:07We are going to go ahead and change it using CSS.
03:11So the first thing we are going to do is we are going to create our main menu
03:15section using a comment.
03:30We'll set up our mainMenu div.
03:41This is position: absolute, and
03:46left: 320px, and bottom: 0.
03:54So this lines it up 0 pixels from the bottom whereas our contact link is
04:00lined up at the top.
04:02Then our unordered list is going to be set up for no list style
04:15and no margin and no padding.
04:22The line items likewise are going to float left and have no margin or padding.
04:44So what this does is very interesting to see.
04:49Reload this in the browser.
04:51This is still the unordered list, but it's not acting like a list, because it
04:55has no list of style and each of these elements is right up against each other,
05:00because we have taken out all their margin and padding.
05:02We've positioned it 320 pixels from the left.
05:05The style's none, so there is no bullets or anything.
05:08The line items are each floating left and remember what happens when you
05:11float items next to each other, floating them left, is they are just all
05:15right up against each other.
05:17So this sets it up for what we are going to do next.
05:21Now this is a selector that selects the a
05:29element in its link state when it's inside of an li, when it's inside of this mainMenu div.
05:35So that targets just this one set of links.
05:40So in our XHTML that targets these a hrefs, because they are inside of the
05:46context of this mainMenu.
05:50So that's how that selector works.
05:52We'll go ahead and copy and paste, because our next one is going to be
05:57visited pseudo-element.
06:02So just like up here, we are setting up for the link and the visited for our
06:08main style for this.
06:10So we have the font-family, which is Trebuchet MS or sans-serif.
06:20So this will select this Trebuchet MS font if you have it and if you don't,
06:25it will select whatever your default sans-serif is. Display:
06:29block makes it into a block element.
06:31Color is white, text-decoration:
06:39none and that turns off the underlining that's normally done on links. Padding:
06:470 15px 0 30px.
06:53So that's starting at the top and going clockwise.
06:56It's top, right, bottom, and left.
06:59That's our padding.
07:00It just lines up the text to match the image that's going to be in the
07:05background of this element.
07:07We have margin-right: 10px
07:14and line-height: 25px.
07:19So all that's about lining up the text in the image.
07:22We are already done all of these measurements so I know that it works.
07:43All right, so this finishes setting it up and we are using a very
07:47similar technique here.
07:49This nav_rollover has the two images in it.
07:52Let me go ahead and show you that.
07:53We will create a tab here by pressing Ctrl+T on my browser.
07:58It'd be Command+T if you are on Mac.
08:00I'm going to go ahead and find this nav_rollover right there.
08:04You see that it's got the two images in it.
08:07It's got the top image and it's got the bottom image.
08:09So in this case, we are starting with the bottom image.
08:12So we are lining at the left bottom and we'll use the top image for the rollover version.
08:17We'll go ahead and take a look at this in the browser right now, reload, and
08:21there is our images.
08:22So it loads those images and it uses them as a background and then we just have
08:26the text from the unordered list.
08:30So the image is this one and it's got the little flower and the text is just
08:34showing up right there. There it is.
08:36Now our rollover will use the other image and it will dim the text.
08:43So let's just ahead and do our copy and paste here.
08:52So this will change the color of the text to this mustard color.
09:00And background position, we know this trick already.
09:03It will now be left and top.
09:10We have to change these pseudo- element selectors to be hover and active.
09:17Hover is when the mouse is hovered over and active is when you are actually
09:20clicking on the link.
09:21So go ahead and take a look at this in the browser now.
09:25We have, see, it uses the darker image and the mustard colored text.
09:33So that's exactly how it is in here.
09:36So now all that's left is to make this current style, and that is
09:41accomplished like this.
09:59So that moves our margin up by 5 pixels.
10:04It changes the height to 30 pixels.
10:24And that selects that different image
10:30and the different text color, the grey text color and a little bit of text positioning here.
10:37So go ahead and save that and when we reload, you will see that the current one
10:46now has this other look to it, but you will notice that my cursor is still
10:49changing to a pointer, like it's a link and when we look at this one, it doesn't do that.
10:54So we have one more style to add which will make that happen.
10:59Go ahead and copy this selector and paste it down here and add the hover
11:06pseudo-selector
11:10and cursor: default.
11:14That makes the cursor not change on the link.
11:18Reload and now we see the cursor doesn't change on the link.
11:21It actually does have a link, but it links to its own page.
11:27So that's okay, but that makes that all work just like that.
11:32So now we've created our main menu and we can go ahead and work on the rest of
11:38the page that we are going to use for our template in creating all of the rest
11:42of the pages in the site.
Collapse this transcript
Creating a layout template pt. 1: Main body area
00:00Continuing in the development of our website, in this lesson we are going to
00:04insert this middle banner, I call this the ID banner, and we are going to set up
00:10the styles for this left hand side.
00:11Where we are going to towards at this point is we are going to towards creating
00:15our template that we'll use for creating the rest of the site.
00:18So I'm not going to put content in here. We are going to set up the main styles
00:21for it, and then in the next lesson we'll do the Sidebar.
00:25Here in the text editor, we have the beginning.html and beginning.css from the
00:3105-layout-left folder in your exercise files, so we'll go ahead and start with
00:36our Save As, and we are going to call this one template.html, because that's
00:40what we are going to end up with at the end of these few lessons here.
00:46And in the CSS we'll go ahead and Save As, main.css.
00:57And we'll start by putting in the XHTML.
01:00This is the simple part, and under the header, we need to go ahead and make a
01:05<div> for the middle banner,
01:12close the <div>, and then do for the content.
01:28Go ahead and make a comment for that one.
01:34There will be some distance there.
01:36And a <div> for the main content.
01:48So that's the left column.
01:49It's the main content.
01:56And we'll just put in some default text here.
02:06We're using our template.
02:16So indent this a little bit. I'm using a feature in my editor that will indent a
02:22block of code for me.
02:24Most good editors have something like this.
02:26In this editor it's the Tab key, so I can tab over and it will indent and I can
02:32Shift+Tab and it will move back.
02:34I like to indent things in my code so I can tell what is related to what and so
02:41I find that to be a useful practice, all right.
02:46Now, let's go ahead and position this using CSS.
02:51Scroll down here to the bottom, and create a new section with a comment.
03:03All right, that's a little space to work, and so that selects the main content
03:15ID selector, and this is going to float left, and we'll have a width of 430 pixels,
03:25and a margin of 0, and a padding of 0 on the top and bottom,
03:36and 15 pixels on the left and right.
03:39I will talk a little bit more about that later.
03:43What my reasoning is for setting this up this way, and then main content,
03:47p, this would be our default paragraph style for everything within the left hand column.
03:55Font family, it's Georgia, and Serif.
04:01So we'll use the Georgia font if that's available.
04:03Otherwise it will pick the default Serif font, which is usually Times
04:07Roman looking thing.
04:09font-size is .9 em,line-height is 1.4 em, color is black, and margin is 1ex and 0.
04:29So that's up and down, top and the bottom margins will be 1ex and the left
04:36and right will be 0.
04:38So what we are doing here is we're using this padding from the main content div.
04:42This padding on the right and left of 15 pixels, we are using that in place of
04:47margins in the paragraph.
04:49My reasoning there is that as we set up other elements like Heading elements and
04:54things like that, we also give them a 0 margin, especially on the left and they
04:59will line up perfectly every time.
05:02This just is an easy little shortcut to having your margins look right on the page.
05:07So I'm using the padding of the outer content box to set up what looks like a
05:13margin for the text elements.
05:15So a little trick I do, and I find that it works very, very well.
05:19So I'm going to set up my Heading elements.
05:21I'll go ahead and use my copy and paste feature here to duplicate that a few
05:29times, so I don't have to type it over and over and over, and there is our 1
05:35through 4 Heading levels, and they will have a font family of Trebuchet MS,
05:45Sans-Serif, and so that will use Trebuchet MS if it's available on the client
05:55system, and otherwise it will pick the default Sans-Serif font, and now finally
05:59I'm going to set up the header elements, and these are just from what I know I'm going to need.
06:11So the h1 is going to have a font size of 1.6 em, font weight:
06:18 bold of course.
06:22So our main headings, color is 1b9d95, and these colors were picked for me
06:30by the designers, margin, and that often happens, the designers will pick colors for you.
06:36It's a good thing too.
06:38Programmers should not be allowed to be pick colors.
06:42Bad things happen if the programmers pick the colors.
06:44I am kidding of course, because like most programmers, I consider myself a designer.
06:53And here is our h2 element, font size 1.2 em, color 3c3809.
07:08Actually I'm very impressed with the design of this site.
07:10I like it very much.
07:14Margin .4 ex and 0.
07:16So here in both of these cases you will notice that our margins, top, right,
07:23bottom and left, so the right and the left here is 0.
07:27In this case, the top and bottom is the 4 ex and the right and left is 0.
07:31So that's just going to make these heading levels all line up perfectly on the
07:36left hand side with this padding from the outer div.
07:39I have got one more to do here, which is the Main Content, h4.
07:43I'm just going to copy and paste this one, and change it a little bit.
07:50This will be h4, font size is 1.1 em, and the color is gray, the font weight
08:01will be bold, and the margin is 1 ex on the top, 0 on the right minus .2 ex on
08:15the bottom, and 0 on the left. Get rid of this extra semicolon there.
08:20It shouldn't hurt me anything. but it's messy. Save that.
08:23So that's the upper styles for the left column content on our website.
08:28Let's go ahead and take a look at what we've got so far here.
08:31Go ahead and drag this template.html into our browser, and there we have it.
08:37Now you will notice that the background here is still gray.
08:41What's happened is that our main content box did not extend out over the text
08:49here, and the reason for that is that this is a floating block, and so what we
08:54have to do is a little trick to get that Main Content box to extend out, so that
08:59we have the white background.
09:01There is a couple of things that will happen as a result of that.
09:04One is that the left and right columns will both extend to the same link.
09:09We want them both to extend to the same place.
09:11So here is the trick.
09:13This works really well, and you will run into this whenever you are using
09:16floating columns is that at the end of this outer content box, and this is part
09:23of the reason for this outer content box, I'm going to put in the paragraph.
09:27It's going to be an empty paragraph.
09:29It will be like that and it will have a class = clear, and so I'm going to
09:35create a class now in the CSS.
09:38And you will see what I mean when I do this.
09:41I'm going to create a little section here that will go at the bottom.
09:47Call it my favorite words, miscellaneous styles.
09:57It's fun to say and fun to spell.
10:01.clear, clear both, and so all the style does is it clears floating objects at
10:11the bottom and that's what this is for.
10:13And we are going to use it actually just once in this document, and there it is.
10:16We have an empty paragraph.
10:18So we are using this XHTML shortcut for an empty element, and class = clear.
10:24So all this does is it creates that anchor at the bottom of the floating objects.
10:31So we'll go ahead and reload now, and viola!
10:35Our outer content box now extends, pass our content, and we have content all
10:42styled exactly how we set it up.
10:44There is one more piece missing here, isn't there?
10:47If we look here, we have this middle banner, and we just want to make sure
10:50we get that in there.
10:51That's very quick and easy to do, and here is our div that we created for it.
10:56We just want to put in the image now.
11:21Save that and go ahead and look at it in our browser now, and there we have it.
11:28So we have now we're matching well, we have our middle ID banner, and that
11:34changes with each page.
11:35That's why I call it the ID banner, and we have our main content.
11:39So that's our left column and we'll set up our right column in the next lesson.
Collapse this transcript
Creating a layout template pt. 2: Sidebar area
00:00Continuing in our development of this website, I'm going to now setup the
00:05right-hand column and that will become a part of our template.
00:10So here is our text editor again and we have our beginning HTML and
00:14the beginning.css from the layout-right folder.
00:18We'll go ahead and do our Save As, which will save this as template.html and
00:26the CSS will become main.css.
00:34We'll go ahead and put in the right column in the XHTML. This is real easy.
00:41So it gets its own div inside of the content and outside of the main content.
00:50So I call this sideBar.
00:54
00:58You'll notice that I capitalize the second words in my selectors.
01:02This type of capitalization is called CamelCase where the first letter is lower
01:07case, and then each succeeding word has a capital letter.
01:11The reason I do this is because in CSS selectors can have letters and numbers
01:17and underscores, but they cannot have dashes or spaces or anything like that.
01:21And I personally dislike underscores.
01:23A lot of people like them.
01:24They think they look like spaces that are just underlined.
01:26I just don't like them, and so I use CamelCase instead, and this allows me to
01:31have multi-word identifiers, and have a clear distinction between the words.
01:38So this is my personal style, different people do this in different ways.
01:42So inside of the sideBar here, we have h3.
01:44h3 is used for the headings in our sideBars and h3 is not used in the main
01:54content, and this allows us to keep that distinct and it also allows the search
01:58engines to prioritize the blocks of text in the document, giving the sideBar
02:04lower priority and the main content higher priority.
02:11And that's placeholder for our content in the sideBar and I'm going to go ahead
02:16and indent that a little bit, and that is-- it goes in the template.html file.
02:22Now in the main.css, let's scroll down here towards the bottom and right in here
02:28we'll setup for our sideBar.
02:38And we'll go ahead and put some styles in here.
02:44The sideBar div will have the float: right and width: 265 pixels.
02:56Padding. So it's same trick with the padding, 10 pixels from the right, and the left, 0
03:03on the top and bottom, margin 0, and border-left:
03:12solid, gray and 1 pixel.
03:20So what this does, there is a couple of things in here I want to talk about.
03:23First of all, I'm floating right and not floating left.
03:25We know that we can't float left, and it will show up right next toward to the
03:30other one, but by floating right, I ensure that the right margin is lined up
03:34with the right side of the containing block. Width is 265.
03:39That was calculated before, with padding and margin we understand, and this
03:42border left, this is lovely.
03:44Let me show you this in the browser.
03:47You'll notice that this vertical line extends down to the bottom of the sideBar
03:52no further, and that's because that border is attached to the sideBar and not
03:57attached to the main content.
03:58If I made a right border on the main content, it will go all the way to the
04:01bottom of the page, and so I wanted it to come just to the bottom of the sideBar
04:06and I think that looks good.
04:08So that's why that border left is on the sideBar.
04:13I'll go ahead and setup our paragraphs and headings.
04:17So this selects our paragraphs and the sideBar only and we can have font family.
04:25We use the Trebuchet Sans-serif
04:32for the sideBar of main body text.
04:40Font-size is .8 em, the line-height is 1.2 em, the color just a little bit off white, [00:04:53.8] margin 0 0 3 ex and 0, and so what this does is the margin at the top
05:05is zero, the right is zero, the bottom is 3 exs.
05:10So I put some space between the paragraphs and the left is zero and so that left
05:15again will lineup nicely with the padding on the sideBar div.
05:21And sideBar h3, this is our heading level that we use for our sideBar mostly.
05:28This is going to have the same font family.
05:31So I'm going to go ahead and just copy all of this, pressing Ctrl+C, you'll
05:35press Command+C on a Macintosh, and there we have that.
05:41And I'll just go and modify things instead, so it's 1 em for the heading, and
05:46the line-height, we don't have that.
05:49The color is this 1b9d95, and the margin is 1 ex on the top, 0 on the right,
06:04half an ex on the bottom, and zero on the left, and that will make it nice and
06:09tight against the paragraph.
06:10We give some space before the heading.
06:12So go ahead and save that, and load it up in the browser, and take a look.
06:17So I'll drag template.html from our layout-right folder into the browser, and
06:24there we have our sideBar.
06:25Now the ruler is going all the way to the bottom, because we don't have much
06:30difference in the height between the sideBar content and the main content.
06:34But when we do, that ruler will not go all the way to the bottom.
06:38So that setup, and in our next lesson we'll do the footer with the copyright
06:43information, and our template will be complete.
Collapse this transcript
Creating a layout template pt. 3: Footer content
00:00In this lesson, we're going to setup the bottom of the page, which has this
00:06copyright notice, and the privacy and terms links, and then we'll be ready
00:10with our template, and then we'll be ready to build the four separate pages of the website.
00:18So here in our editor, we have the beginning.html and the beginning.css.
00:24I'll go ahead and do our Save As, call this template.html, and this will
00:29actually be the template when we are done with this lesson.
00:33And the CSS will be called main.css,
00:42and we'll start by typing in the footer information down here.
00:48So this is way outside the outerDiv.
00:52We'll have a div with the footer.
01:02And this has a paragraph in it
01:06and that paragraph has a copyright notice, so that is XHTML entity that
01:12inserts a copyright symbol.
01:21You'll notice I have a couple of non- breaking space entities too. This is
01:26because the browser will take all the spaces that it encounters and fold
01:31them into one space.
01:32I actually want a little bit of space here.
01:35I want a little bit of air between this and the elements following it.
01:38You'll notice down here that there is some extra space in there between that
01:43and the privacy policy, and then there is a vertical bar, and the terms and conditions.
01:49It's hard to see the white, but that was intentional, because this
01:53isn't meant to be read.
01:54It's not suppose to compete with the content, and so it's there and it's
01:58readable, but it kind of fades out if you are not looking for it.
02:01Now we are going to have the links, a href, equals, and it would be Privacy Policy.
02:15The vertical bar and another link for the terms and conditions.
02:26And then I'll go ahead and put something in here. These pages aren't actually going to exist
02:32when we are done.
02:39Perhaps creating them is an exercise for the viewer, and there we go.
02:43That's our bottom content there.
02:45We'll go ahead and look at this in the browser, so you'll need some formatting,
02:52drag the template onto the browser, and there we have it.
02:55There is the text at the bottom. You can see that extra space there, after the
02:58copyright Groundswell Surf, and now let's go ahead and format it with the CSS.
03:02So we'll go down here to the bottom and we'll create a section in here.
03:15We have div, which has clear both,
03:22so that it's always at the bottom outside of the floating elements.
03:29Background is transparent. Again, we don't want any white background on this div.
03:35We want the background of the site to show through, margin, 0 auto, and
03:40that will center it, and padding is 5 pixels.
03:46That will give it a little bit of air around it.
03:50And the paragraph, and this will have the Trebuchet MS font, so we'll go
04:00ahead and insert that.
04:08font-size .75 em, so it's small but still readable.
04:13Color is white and the margin and padding are zero and we'll do that.
04:26And finally the anchors.
04:32We'll have this teal color, and no text declaration.
04:39Now save that and go ahead and reload in the browser, make sure it's what we want.
04:49The only thing missing is that it's not centered.
04:51So we'll go ahead and center that.
05:00And look at it in the browser and there we have it.
05:04So that's the footer information, we have the copyright notice, and that
05:09extra little space there.
05:11We have the privacy and the terms and conditions and now we have our template.
05:16We can go ahead and start building the website.
Collapse this transcript
Building a main home page pt. 1: Main body content
00:00So now we're going to start building the website.
00:02I'm going to start with the Home page, and this one is called home.
00:05You see it's called home.html, and we're going to start by filling in the
00:09content, on the main content panel, the left column on the page.
00:18Over here in our text editor, we have template.html because we're starting with
00:23the template and we have beginning.css.
00:26We also have home.txt, which is the text file that has all of the content
00:32for the left-hand side.
00:32So let's go ahead and do our Save As.
00:36This is going to get saved as home.html in the home-pt1 folder.
00:42We're in the home-pt1 folder in the Exercise Files.
00:46And the CSS will, of course, get saved as main.css.
00:55And we don't need to do a Save As on the text file, because we're not going
00:58to be changing that.
01:00So our first order of business is to go ahead and get the content in here.
01:05Now in this one, we're going to start with plain text and it's not
01:09HTMLified yet.
01:11And we're going to do the HTMLification.
01:14In later lessons, it's going to already be HTMLified because we only really need
01:19to see that process once.
01:21This is something that I commonly have to do when I'm given content by a client
01:24that has to go to a website.
01:26So I would like to show you to the process once but for the rest of the lessons,
01:29just for the sake of illustration, they will already be HTMLified.
01:33Go ahead and select all of this text, and on pressing Ctrl+C on my PC
01:38keyboard to copy it into my copy buffer and if you're on a Mac, you'll use
01:43Command+C. Over here in the XHTML file, we'll press Ctrl+V or Command+V on a
01:50Mac and there's the text.
01:53So I'm going to come up here to the top of it and start putting in the XHTML.
01:58Use h1 in the mainContent column and it's a paragraph.
02:05We have to close paragraph here.
02:07So I'm going to go ahead and copy and paste these to all the places where
02:11they belong.
02:12So we need one here and we need one here and we need one here.
02:18Scrolling down, this is a paragraph and this is a paragraph.
02:25These are the end paragraphs, copy that and paste here and paste here and
02:33here and here and here.
02:37So I'll use copy and paste a lot because it saves me effort.
02:46This is h2 and end h2 there.
02:52And this is h4 because h3 is used in the sidebar.
02:58So these will also get copy and pasted because these were all h4.
03:04I'll show you that in the browser in a moment.
03:09Close h4, copy, paste and paste.
03:17Save this and take a look at the browser here.
03:20So this is h1, this main heading here, and down here, we have an h2.
03:27This is h2 and all of these are h4, because h3 is used in the sidebar.
03:38Now we're going to do the unordered list.
03:41So this is <ul> and here is the closed ul down here, and each of these
03:48lines gets a <li>.
03:49We'll do a copy and paste,
03:56and do the end tag at the end there and copy and paste those.
04:07And that's the major HTMLification.
04:12We have some links we need to do though.
04:15Here's the link and do the end of the link.
04:21I get a little bit tricky here but hopefully, you can follow along.
04:27Select the actual URL and I'll cut that with Ctrl+X or Command+X on a Mac
04:35and paste it in there.
04:37So that's the quick and easy way to do that.
04:39A href equals quote, quote and close the tag.
04:44And the end tag here, but I select all of this part while I do that because I
04:47don't need that part.
04:50So that goes away when I start typing, and then this.
04:53I do a cut and a paste.
04:57We have one more link.
05:08Cut and paste, and so that gives us all of the XHTMLification that we need.
05:16Go ahead and select all of this
05:23and tab in and there we have it.
05:32So I'll save this and we'll go ahead and look at it in the browser.
05:40This is our template in the browser here.
05:42We'll go and drag the home.html into the browser and there we have it, and that
05:48is looking pretty good.
05:50There's a couple of things we need to do.
05:52We are going to start with the links.
05:55These are not how they're supposed to be.
05:58We'll look at the links in the target site.
06:04See that they have this lovely mustard color and they get the dashed underlines
06:08when we hover them and that looks pretty cool.
06:11We want that and so we're going to go ahead and do that.
06:14So we'll bring up our CSS.
06:19Now these links are going to be this way for most of the site.
06:24So we're going to put them in our global section.
06:28So this is our global style section and they're selected like this.
06:32#outerDiv a:link, #outerDiv a:visited and they have no text-decoration and
06:51they have this color.
06:57In the hover version,
07:04this is hover and active and this has a color of 566440
07:17and bottom border one pixel, dashed and also that color.
07:28So we'll save this.
07:29Our links should look how they're supposed to look.
07:34Reload and there we have our links exactly what they're supposed to look like.
07:39And look at them in the target site and there they are.
07:44Now the next thing we need to do with is this, unordered list.
07:49So here it is in ours and there it is on the target.
07:55You see it's a little smaller and the spacing is little different.
07:59So go ahead and put this in our CSS and that goes down at the bottom of our
08:06mainContent section, and about here.
08:11It has the ul for unordered list
08:17and it has the font-family of Georgia and serif.
08:26So if Georgia isn't found on the target machine, the default serif font will be used.
08:30It's of font-size of 0.9em and a margin:
08:370 0 1.4ex 0.
08:43I'll save this and we'll reload it in the browser.
08:47And then we see that this looks exactly how it's supposed to look, just like that.
08:54Now here's the problem.
08:57You didn't know there was a problem, did you?
08:58Well, there is one.
08:59If you're using Internet Explorer, you have already seen this problem and if
09:04you're not using the Internet Explorer, you need to know about it, because a lot
09:08of your audience is going to be using Internet Explorer.
09:11So here I've got Internet Explorer and I'm going to go ahead and load our page
09:19in Internet Explorer.
09:21See there. It looks lovely, except for that unordered list.
09:25So that unordered list is off against the side.
09:29It's actually even a little bit left of the side.
09:31And this is because Internet Explorer has a bug in the way that it deals with
09:36lists that are formatted by CSS and it is always had this bug in all of the
09:42versions that I can remember that support CSS up until now.
09:46As I record this, am in the year 2009 and Internet Explorer still has this bug
09:51many years after it's being supporting the CSS.
09:54So what we have to do because it's the 800- pound gorilla in the market, we have to support it.
10:00So here's what we do.
10:01We'll go ahead and on this left margin, which is the last one here, remember
10:07it starts at the top and goes clockwise, top, right, bottom, left, we'll go
10:12ahead and we put in 1em.
10:16And I'll save that and bring it up in Internet Explorer and we'll reload and we
10:23see that now it's reasonable.
10:25It's not as far over as maybe we would like but it's reasonable.
10:29And if we look in our Firefox and reload that, it's a little farther
10:35than we would like it off to the right, but it's okay.
10:37So what you have to do with these is just compromise.
10:40If you are going to style, the unordered lists and the ordered lists have
10:43the same issue, then you are just going to have to compromise on your formatting.
10:48So we have now built the main content column of our home page and in the next
10:54lesson, we'll go ahead and we'll do the sidebar.
Collapse this transcript
Building a main home page pt. 2: Sidebar content
00:00So now that we've built the main content for the homepage, we're going to work
00:05on the sideBar content.
00:08So here in our text editor, we're in the home-pt2 folder.
00:12Our Exercise Files. We have beginning. html, which has our main content in it,
00:18and still has a placeholder for the sideBar.
00:20And we have our beginning.css.
00:23So we'll go ahead and do our Save As, so this will be home.html,
00:33and in the beginning.css we'll call this main.css.
00:43We'll go ahead and copy and paste our content from the sideBar,
00:51pressing Ctrl+C on the PC keyboard.
00:54That would be Command+C on a Mac.
00:57And selecting a space where it's going to get pasted to in the home.html,
01:02pressing Ctrl+V or Command+V on a Mac.
01:05And I'll go ahead and put in our HTML.
01:09This is an image, and has width and height and alt text.
01:23And so this is the URL.
01:25So I'll go ahead and just I'm going to drag it with my mouse. A lot of editors
01:31allow you to do that.
01:33Other editors, you'll have to do a cut and paste, and the alt
01:40is going to say surfer.
01:48And we use h3 for the headings in sideBar
01:55and here we got a P and I'll go
02:00ahead and copy that into all the places where it needs to be.
02:11And I'll do an end <p> down here.
02:15Copy that in all the places that it needs to be.
02:20And then we have another image.
02:32And we have the image source, and the width.
02:43And the height.
02:46And the alt, we'll say surfboard.
02:55And this is going to be h3.
03:00And I'll go ahead and copy and paste that where it belongs.
03:04Copy and paste, and copy and paste, and we have one more image.
03:26I'll drag that, and drag that, and drag that.
03:34I'll go ahead and get rid of that.
03:38Now, all of these images are in the images directory.
03:41So I'll go ahead and put that in like that and I'll copy and paste all the
03:49places where that goes.
03:53And we should have content here. Oops!
03:56This doesn't belong there.
03:57It belongs there, and alt here is surfer.
04:01I'm just betting these are pictures of surfers.
04:03We'll look at them, and see if that needs to change.
04:08You can see that over here that's a surfer and that's a surfer.
04:12So that works out good.
04:19Looks like we also have a couple of links in here.
04:22I'm going to want to do our links.
04:24Yes, here is a link.
04:27It says check it out and that looks like it should be a capital C.
04:37I'm going to put the closing </a> there.
04:39Make that inside of the period, because that just seems to be the right way
04:43to do it, and cut and paste for that link, and let's see. Where do we have another link?
04:51Yeah, that link was already in there.
04:54All right, and here we have another link.
05:07I'm going to cut and paste and there we have it.
05:12So that is our HTML for the sideBar.
05:15We'll go ahead and tab that in, and take a look at it in the browser.
05:21Save, go into our browser, and drag the home.html into the browser,
05:34and there we have our sideBar content.
05:36Look at that, and notice that our links have picked up that styling, because
05:40we put it in the whole content <div>, and it looks like our image is neatly formatting.
05:47If we look over here in our reference website, we'll see that the images that
05:51are photographs have a border around them and they're all indented.
05:56And there is a border on this photograph down here too.
05:58So I want to put those styles in the style sheet.
06:07So coming over here to our style sheet, we'll go down to the bottom of the sideBar.
06:11There is the sideBar and I want to put this in at the bottom down here.
06:15And I'll say sideBar, which is our id selector for the sideBar, and we'll say image.
06:23So this will affect all images within the sideBar and we'll give them a little
06:27bit of a left margin 0 and 25 pixels.
06:33So that will make it 0 top to bottom, and 25 pixels on the left and the right.
06:38And if we save that, we'll see that all of our images are now indented properly.
06:45 And there they go.
06:47Now what we want to do is put a border on these photograph ones.
06:52So I'll go first into our XHTML and we'll create a class selector here
07:00and call it photo.
07:03And I'll go ahead and copy that and we'll put it in this one down here too.
07:10So we have class="photo" on the ones that are photographs, but not on the one
07:15that's a product picture, and we'll save.
07:22We'll go into our CSS and we'll create another selector sideBar image.photo.
07:33And this will have the border 1px solid and it will be this dark gray.
07:43And then we want a little bit of padding on the inside of the border.
07:46Remember that padding is on the inside of the border and margin is on the outside.
07:53We've already created our margin, and now we just need a little padding to give it
07:57that air between the image and the border.
08:02If we look over here, we'll see there is a little bit of space between the image
08:05and the border and we reload here, and we'll see that we have exactly that.
08:11So that's our sideBar.
08:13That was pretty easy, wasn't it?
08:14Now that we have that template and we have all these styles already in the style sheet,
08:18it's getting to be easier and easier to build the pages.
Collapse this transcript
Creating a page with a menu, graphics, and formatted links
00:00So now we are going to build the Gear page and this is the product page for the
00:06Groundswell surf shop.
00:08You will notice it has this menu here with the different types of products that
00:14are available and it has this month's specialties and it has got a sidebar.
00:22The sidebar is pretty much setup. We have had all of these types of elements
00:26before, so there won't be much work to get that going.
00:31So let's get started.
00:32Here we have our text editor and we are in the gear folder.
00:36We have the template and the beginning.css and the text.
00:41So in the template we'll go ahead and Save As.
00:44This will be gear.html and the css we'll save that as main.css.
00:57There is a couple of things we are going to do start with.
01:00We are going to change the title, which is going to be Groundswell Gear.
01:06So we'll just take out that part and we'll put in the word Gear and save.
01:12Now, in our menu, we are going to change the current from the Home to the gear,
01:23and so that will update the menu.
01:26Then our middle banner here is going to change from home to gear, and over here
01:33it will say check out our gear and the alt.
01:40So we'll save this and let's go take a look in the browser and see how we are doing.
01:44Go ahead and drag the gear.html,
01:52and we have the middle banner and our menu looks right.
01:57We have the ID banner there.
01:59It looks like we are all ready to go.
02:01It matches what's over here. Excellent!
02:06Now, we'll take our content and all of this part here and copy.
02:15Ctrl+C on the PC, Command+C on the Mac, over here, and paste that in right here.
02:23I'm going to go ahead and indent that.
02:28So this is already HTML-ified.
02:30We don't need to go through that exercise more than once.
02:33There are some elements here that are worth noting.
02:36So we'll save this and we'll go ahead and take a look at this in the browser and
02:40see what we are talking about and there we have it.
02:43Now, there is a little bit of formatting work to do here.
02:46We have the main content.
02:48This part here looks fine.
02:50This is supposed to be the menu with the images and so we'll see how to do that.
02:56Down here, this is supposed to be side by side with the formatting for that part.
03:02So let's go ahead and first we'll start with the menu here that's got some
03:07trickery involved, over here to our css, and down at the bottom of our
03:15main content for the sideBar, go ahead and enter a new section
03:22called gear subnavigation.
03:31We have a ul called gearSubNav.
03:39We'll see that in our XHTML here.
03:42That's this ul here.
03:48So we'll select that and we'll give it a width, and again, I have already
03:55measured some of this stuff, so it makes it go a little quicker in the movie.
03:59The margin, this is to center it, and list-style: none,
04:08so it makes it no longer a list. We have seen that trick before.
04:20I will select the li and it floats left and margin and padding set to 0.
04:29We have seen this trick before.
04:31Here comes the good stuff.
04:40Copy the selector, so we don't have to type it again, and make this the a and
04:47so this will select these anchor tags in here, these links.
05:00width: 70 pixels.
05:04That's the size of the image.
05:06Height is 20 pixels, font-family.
05:13This is one we haven't seen before.
05:15Orator, Std, Orator, sans-serif.
05:25So this Orator Std actually does exist on a lot of PCs out there and
05:30that's this font here.
05:37font-size: .9em, text-align: center,
05:45padding-top: 100 pixels.
05:50So that gives us room for the image up here.
05:54So this is formatting the text now and this gives us room for the image up there.
05:59Margin-right is 20 pixels, and that gives the space in between them.
06:12Border: none, and display: block.
06:20So that it makes it a block element.
06:22All right. So we'll go ahead and save this and you will see what we have done so far.
06:30There are some other steps to this, but there we have the space for them.
06:36See that this one wrapped around and that's because it doesn't fit, because it
06:39has this margin on the right of it.
06:41We have a selector in the last one that says last, and so we are going to go
06:48ahead and use that selector to get rid of that margin on the right.
07:04So that's the class selector, .last, and we just say margin-right: 0.
07:13Save that and reload in here, and now we have this formatting.
07:18We have space for the images.
07:20We look over here on the site as it's supposed to be, we have space for the
07:24images there, and now all we have to do is put in the images.
07:28Now, the images go like this.
07:34Go ahead and copy this selector, because we are going to use it, and instead of last,
07:40I'm going to have boards, and copy it and make four more of them.
07:48So we have boards and swimwear and wetsuits and etc.
08:02Save that and if you will notice we have all this classes. We have boards,
08:06swimwear, wetsuits and etc.
08:08You see this one has got two and that's how you do two classes in a
08:12class attribute in XHTML.
08:19Now, inside of this, we are going to put the image.
08:24So in this one we are going to put background url..images.
08:32We know about that. rollovers, because there is a subdirectory in there for these,
08:37board-off.jpeg and no-repeat, center top, semicolon.
08:47So we are going to copy all of this and I'm going to paste it in these.
09:00Just change the name from board to swim and wetsuit and sandals.
09:15Because this is what the images are called.
09:18Go ahead and save that.
09:20If we look at that in the browser now, there is our images.
09:24We don't have the rollovers yet, but you can see we are getting there.
09:28Now for the rollovers, this is really easy. We simply take all of this and copy it
09:35and paste it there.
09:42And we put in the hover pseudo selector.
09:52I'll paste that into each of these places.
09:55Then all of these that say off, I'm going to change them to on, on, on,
10:02on, and on.
10:06So when I save this and we reload, we see that this now looks exactly how
10:13it's supposed to look.
10:14You see the rollovers?
10:21And looking at it over here, that's exactly how it is.
10:26So that's how we do those rollovers.
10:29Next, we are going to setup this sales box and that's pretty straightforward.
10:39First, we have the floating image and we'll notice here that, get down here,
10:47we have this floating image, which has a class leftFloatImage, and so we'll create
10:53a section here for the gear sales box.
11:02All right. So it's img.leftFloatImage
11:10and float: left, padding:
11:1615 pixels.
11:18I'll go ahead and save this and take a look in the browser.
11:23There we have that image floating to the left and now we just need to do the
11:26style for this part and we are done.
11:32So we have this div id of gear description and that's going to float to the right.
11:40DivgearDesc, and that will float right.
11:47It has a width:
11:50260 pixels and a top padding of 20 pixels.
11:56So we'll save there and go ahead and look at it in the browser and that's
12:02exactly what it's supposed to look like.
12:05See it's down a little bit from the image.
12:07Now we need to format that heading.
12:20div#gearDesc h3.
12:27We have a font-family of Georgia, serif.
12:33font-size: 1.2em. Color is this color here, c47500.
12:45It has a bottom border.
12:53And padding on the bottom, .2em, and margin of 0.
13:02So we'll save here and reload in the browser.
13:06Now it's really starting to get to where we need it to get to.
13:11So the paragraph has to be in this font, all of these paragraphs get in this font,
13:16and then we have this pricing piece that looks like about it.
13:24div#gearDesc, this will be p and this simply has the font-family:
13:38Trebuchet MS, and sans-serif,
13:44and a font-size: 0.8em.
13:50Then the price paragraph, copy the selector.
14:00It has a price class selector.
14:06text-align to the right and font-size: 1.2em.
14:15Go ahead and save.
14:21Yes, there we go.
14:22So that looks exactly like what it's supposed to look like here.
14:29Line this up at the bottom of the page, we should have -- yeah, there we go.
14:33So now we just need to do the sideBar content and that should be
14:40really straightforward.
14:41I don't think there is any special formatting there at all.
14:43Go ahead and copy that and paste it in the document.
14:55Indent it, save, and load, and there we have our sidebar content.
15:06Now we are looking pretty much exactly like we are supposed to look.
15:10We have our rollovers here.
15:15We have our this month's special and that looks exactly like it's supposed to look.
15:23So that's our Gear page, and it was a bit of doing, but that's how it's done.
Collapse this transcript
Creating a page containing an ordered list
00:00So now we're going to setup the Lifestyle page for the Surfing Lifestyle.
00:06This is what it looks like.
00:08It has this little menu at the top.
00:10It has this ordered list down here.
00:12We'll be sure to check that in Internet Explorer.
00:15So, let's go ahead and get started.
00:18Here's our template and this is all in the lifestyle folder in the Exercise Files,
00:23and our beginning.css and the lifestyle.txt, so we'll do our Save As.
00:28This will be lifestyle.html and our beginning.css that becomes main.css and
00:42lifestyle.txt that doesn't need to get saved as anything.
00:45I can go ahead and put this in our copy buffer now, pressing Ctrl+C or
00:50Command+C on a Mac.
00:51Now before we do anything else, we're going to change the title, Groundswell
00:58Lifestyle, and we'll come down here and we'll move our current down to
01:06lifestyle, <class="current">, I'll need that other quote also, there it is.
01:16We'll change the banner to the lifestyle_banner. Go ahead and save.
01:24Let's load this up in the browser and see where we are.
01:26We still have our Gear page there.
01:29Drag the lifestyle.html and there we have it.
01:36Now we have the banner. We might want to change the alt text on the banner.
01:41That should say, live the lifestyle.
01:52Now let's paste in our content, which we already in our copy buffer, pressing
01:57Ctrl+V, or Command+V on a Mac, and there's the content.
02:05We'll tab that in and save and go ahead and take a look in the browser.
02:17Most of this is good.
02:18We just need to format this menu here.
02:27So, go up in here and take a look, and that is leftMenu, a class called leftMenu.
02:33So come over to our CSS and that's in the mainContent.
02:43Come down here and we'll put in a little section.
02:49main content left menu.
02:54In case we ever want to use it again.
03:00There is our selector, and it has the Trebuchet font-family.
03:16We'll set the margin-top to 0.
03:19It gets a styling for the anchor.
03:32So the color of that would be this color here.
03:38We used that color before.
03:39Then the hover changes the color.
03:43Copy and paste, hover and the color becomes b36b00 and border none, because
03:57otherwise it gets a border by default.
03:59That dashed border at the bottom.
04:01Just save this and look in the browser, and there we have our menu looking just
04:07how it's supposed to look there.
04:09That's for the left side.
04:10Let's go ahead and do the right side now.
04:11It's in our sideBar text.
04:17We'll copy, using Ctrl+C or Command+ C on a Mac, and put this down here in
04:23the sideBar.
04:26And the indent. Looks like we missed the end of the ol, so I'll just go ahead
04:31and add that here now.
04:34Be sure to have selected all of that when you select it, and see that
04:37I didn't select it in there.
04:38So I'll just type it in and we'll save, and go ahead and look at it in
04:45the browser.
04:46So, all this is fine except this ordered list here and so that needs to
04:50get formatted.
04:52So we'll go into the CSS and come down here in to the sideBar section, get to
04:57the end of the sideBar section, and we'll put in the sideBar ordered list
05:06formatting, and sidebar li formatting.
05:14So the ordered list is going to get this Trebuchet font-family, so I'm going to
05:17go ahead and copy that from up there, because that is easy to do.
05:23We have a font-size: 0.8 em, color.
05:30This is all supposed to be in the li, so I'll just move it down there.
05:34My mistake, it goes there.
05:37So, it's got the gray color, and the margin of 0.2 em up and down,
05:43 and 0.5 em right and left.
05:46Then in the outer ol element. There's just a margin here, 0.5 em, 0, 1.5 em, and 0.
05:57So top is 0.5 em, then right is 0, bottom is 1.5 em, and the left is 0.
06:05That lines things up on the left margin with that padding in the sideBar
06:11outer container.
06:12So go ahead and save this and take a look in the browser.
06:16There we have it.
06:17It looks just lovely.
06:20We really want to see is what it looks like in IE. Let's compare it to how it is
06:24in our reference site, and that looks about right.
06:27So let's go ahead and load up Internet Explorer, and see what we get there.
06:37Drag the lifestyle.html file into Internet Explorer, scroll on down, and yes,
06:45there the numbers are missing entirely; all we have are those periods.
06:49So, we can see that those numbers are entirely missing and we just have
06:53the periods.
06:54So the problem is that Internet Explorer and in the way that it uses CSS to
07:00format ordered list and unordered lists,
07:04it doesn't follow the specification.
07:06It has a bug and this bug has existed in every version of IE that I've
07:10tried that supports CSS.
07:13People talk about it on the Internet.
07:15It's a very well known bug.
07:17For some reason Microsoft has never chosen to correct it.
07:21So what you have to do is you have to satisfy the formatting requirements of
07:25Internet Explorer without making the other browsers too ugly.
07:29All the other browsers follow the standard and they all look exactly like
07:32Firefox does here, with this formatting.
07:35So what we have do is we just need to push this over to the right a little bit
07:39and make sure that it's not too far for Firefox, so that it looks reasonable
07:44in both browsers.
07:45It's never going to be exactly what you want in both browsers.
07:48So I'm going to go ahead and go back into our CSS.
07:53In this ordered list, in the right- hand number, which is the left margin,
07:59remember they're clockwise from the top, so it's top, right, bottom, and left.
08:04I'm going to put in one and a half ems.
08:06So I'll save that and come over here into Internet Explorer and load it up.
08:14Now, we can see the numbers, and it looks reasonable here.
08:18So I'll go over into Firefox and reload that.
08:24We can see that it moves over to the right a little bit farther than as I had liked,
08:28but it's still reasonable.
08:29So this is a reasonable solution here.
08:32We had to do the same thing you remember on the homepage, with this
08:35unordered list.
08:37So here we are on the Lifestyle page, dealing with this issue again with
08:41an ordered list.
08:42So our page is now done and that's our Lifestyle page.
08:46We have formatted all the pieces we have to format.
08:49You can see as we move along here, it gets easier and easier, because we're
08:52reusing a lot of the same styles.
08:54This is one of the powerful features of CSS is that as you go along building the site,
08:59you build up a library of styles, and those are reused over and over,
09:03saving you a lot of work and creating a consistent look for the website.
Collapse this transcript
Creating a page containing video
00:00Our final page in the website is the video's page and it looks like this.
00:04It has an embedded video in it that's embedded from YouTube.
00:08This is a very common way to do videos on websites these days.
00:12I want to show you how to do this well.
00:15You can embed videos with a number of different technologies.
00:17The advantage of using a service like YouTube is that they do the video
00:21hosting and they have this lovely player, this Flash Player, which has
00:26different features.
00:28It will do full screens.
00:30It works very, very well, and it's embeddable on your site with a minimum of
00:34trouble, and so it saves you the trouble of paying for the hosting of your
00:38videos and saves you the trouble of building or acquiring in some sort of a
00:43player that will work on a variety of platforms that YouTube player works on.
00:48All the different platforms that you need it to work on.
00:51So, this is the technique that we'll be showing you here.
00:54Let's go ahead and build the page.
00:59Here is our text editor and we have template.html, which we're going to save as
01:05videos.html and beginning.css, which we'll make main.css and the videos.txt,
01:11which has the text for the content on the main and sideBar, which is very
01:15little trouble, because we have created all these styles already.
01:18So let's go ahead and do our Save As.
01:20So we'll save the template as videos. html and the CSS gets saved as main.css
01:34and in the videos.txt, we don't need to do a Save As.
01:36So, we'll go ahead and change the title, which is Groundswell TV, and we make our
01:46current videos like that so that our menu works right, and the banner gets
01:54switched to videos,
02:02and the alt text says Groundswell TV.
02:07So we'll save all of that and take a look in the browser and make sure it's
02:13what we want, and grab the videos. html and drag it into the browser
02:23and there we have it.
02:24So, we have the main menu looking right and we have the ID banner all set up,
02:31 and we are ready to go with the content.
02:33So, let's go to the videos text and copy and paste, pressing Ctrl+C on my PC keyboard.
02:40That will be Command+C if you are on a Mac.
02:43And pressing Ctrl+V or Command+V to paste and I'll go ahead and tab this in and
02:50then we'll go ahead and get the sideBar content, because there is just really very
02:54little involved here on either of these.
02:54The fun part is going to be the YouTube part.
03:01Tab that in, go ahead and save, and load it up in the browser and take a look,
03:07and there we have it.
03:09Now, we just want to paste in that YouTube, so I have it loaded up here in my
03:13YouTube channel on YouTube.com, and over here is the Embed link and I'm going
03:19to bring up the Customize for the options.
03:22I'm going to show the options I had selected. These are not
03:24the default options.
03:26You want to uncheck the Include related videos unless you really want that and
03:30what that does is at the end of your movie it displays related videos in the
03:35browser and you want Show Border Off, which I think is the default, and
03:40I checked this Enable delayed cookies.
03:42Normally, YouTube will give your clients cookies and whenever they come to the
03:47site and they view an embedded video, they will get cookies in their browser,
03:50and some people don't like that and they don't really benefit them anyway.
03:54They benefit YouTube in many ways, but that's not my concern here.
03:58And so, what I do is I check this box and that means that the cookies will not
04:02be put in their browser until they actually get to the YouTube.com site.
04:06So, if they bring up YouTube.com, YouTube will give them cookies and
04:09they are expecting that.
04:10On your website, they don't really expect to get YouTube cookies and so
04:14they won't.
04:15Then I select the size. Now we would select the smallest size. You will notice
04:18that the embedding code here changes as I select different sizes.
04:23I select the smaller size and we are actually going to change that after
04:25we embed it.
04:26So, I'll go ahead and press Ctrl+C to copy and again that's Command+C on a Mac
04:33and then come over here to our text editor and it's going to go right here,
04:39and press Ctrl+V or Command+V, and look at the size of that thing that
04:43it pastes in there.
04:44This is gigantic. It's 456 columns out here and so we are going to fix that.
04:50Now you don't have to do this.
04:51This actually will work fine the way that it is.
04:54I find it unweildy and I do want to make some changes, so I'm going to go
04:58ahead and reformat this a little bit.
05:00This doesn't affect how it works, but it makes it easier for me to work with.
05:06So, I'm going to come out here and I'm going to take this end tag here,
05:10because there is no content at all, and I'm just going to make that an XHTML
05:14ending like that.
05:15I'm going to do that on each of these param end tags.
05:20Now, the space between the tags, this new line between the tags, gets ignored by
05:27the browser entirely.
05:28That doesn't put anything on the screen.
05:30It doesn't affect how it works at all.
05:33Go ahead and indent that a little bit, and likewise any formatting on the
05:40insides of these tags.
05:42I want to do that there and then close the object, and that is a container, and
05:51we'll go ahead and indent all of this, because that's a sweet thing to do and
05:55now this is all reformatted and it's still fully functional.
05:59Go ahead and save this and load it up in the browser and make sure
06:03it's working.
06:04Go to our page and reload. You will get this Flash Player security warning
06:11and this won't happen when you upload your website to a server.
06:14It's only happening because you are running it on your local computer.
06:17It's going out to the Internet to get the content, so Flash gives you the
06:22security warning and you can just say OK, and now because I waited so long to
06:27say OK, the Flash Player wants to make sure that there is not a problem and so
06:32it's giving you this warning here, because it says the script is running too slowly.
06:36But it's not really. We just waited a while to press that button.
06:38So, you can say no, you don't want to abort the script, and there we have it.
06:43So, you will notice that it's too big for the space, so we are going to fix that
06:48and also going to give it just a little bit of formatting around the video to
06:53make it look more like this, which is very nice and fits nicely in the space,
06:57and it's got a little margin at the bottom, and that's what we want.
07:01So, we'll go ahead and do this with some CSS and this will just go down here in
07:08our miscellaneous section, and say div#youtubeVideo,
07:18and we'll just put in a margin around it.
07:2320 pixels and zero, and 20 pixels and 30 pixels, and that will
07:29put some margin around that.
07:32Then in the XHTML, we'll put in a div around this
07:41with an id=youtubeVideo.
07:46I'm going to put in the end div down here and indent a little bit.
07:54And then finally I want to make the video a little bit smaller, so it fits on
07:57the screen, so I'm going to use some different dimensions here.
08:00I'm going to change this in the YouTube. This is the code that we copied and
08:04pasted from YouTube.com.
08:06I'm just going to change this to be 420 wide and 260 high.
08:10I have done this math already for you, so I know this fits.
08:18You have to change it in two places, and so we do that and then save, and
08:27go ahead and reload this in the browser.
08:29We'll get the security warning again, and just say OK, and there it is.
08:37See that fits just perfectly.
08:44I'm going to pause that.
08:45It looks exactly like it does in the reference site and we are done.
08:49So, that is our website.
08:52We have formatted all of the pages.
08:55They all look and work exactly like we need them to do and we have used CSS
09:00positioning instead of tables, so that our site will work well across platforms,
09:06and it will load up quickly, and it's easy to format and change around.
09:10A lot easier than working with tables.
09:12So our site is complete. I want to take a moment and thank
09:15Mr. James Williamson who designed the original version of this site, and wrote all
09:20the clever copy that you see here as well.
Collapse this transcript
Conclusion
Goodbye
00:00My goal for this course was to show you how to layout your web pages using CSS
00:04positioning, where you may have otherwise used the HTML or XHTML tables.
00:09I gave you a brief overview of CSS and then showed you its major
00:12positioning features.
00:13Then I took you step by step through the process of building a complete small
00:17website using CSS positioning in place of tables.
00:21I have really enjoyed creating this course for you and I hope it has been as
00:24useful for you as it has been fun for me.
Collapse this transcript


Suggested courses to watch next:

CSS for Developers (4h 2m)
Bill Weinman

CSS3 First Look (6h 34m)
James Williamson


XHTML and HTML Essential Training (4h 44m)
Bill Weinman


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 98,466 instructional videos.

start free trial learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 1,893 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.


site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked