Preview
Download

Secret Service Wars
Want to Advertise here? Contact Us


Home
Forums
Awards for You
Winners
Awards Won
About Us
Past Layouts
Past Updates


Site Rules
Site FAQ
Site Staff
Credits
Link to Us
Link Exchange
Linkage
Affiliation


Latest Contest
Previous Contest
Contest Winners
Mini Contests
General Rules


100x100 Icons
64x64 Icons
70x70 Icons
AIM Icons
Archived Icons


Signatures
Buttons
Banners
Wallpapers
Enter Signs
Hiatus Signs
LJ Headers
Friends Only Banners


Div Layer
Tables
iFrames
PopUp


Brushes
Extractions
Vectors
Icon Bases
Icon Creator


HTML Tutorials
CSS Turoials
Let's Make a Layout
Graphics Tutorials
Do's and Don'ts











Bassman Themes

Let's Make a Layout - iFrames!

This is the third edition of Let's Make a Layout. As stated in the others, a lot of the things I do in my tutorials are the pieces needed in order to make a layout in these Let's Make a Layout Tutorials we take all those pieces and we assemble them together in one place.
Here we take a layout image and we turn it into a layout.
This tutorial won't teach you how to make a layout image. I do have a tutorial for that but really it's based on tastes.
A very important note, if you use the image that I'm supplying to make your layout and use that image AS your layout, then you need to link back to me and give me the credit for the image, if you use this to code your layout give the credit... you can say you coded it because you did but please just give the credit to me for the help... you know "Thanks to LadyPSerenity for her tutorial 'Let's make a Layout'" that's really kinda polite. We've already found some places direct linking... don't do that. And when you do that now you get a little image that says you stole from us =P

Something that is extremely important here is that we understand the pros and cons of an iframe layout.
iFrames while handy when used to lower or limit load times of a webpage do not work correctly in all browsers. We already know Firefox doesn't allow the changing of the scroll bar. This can DRASTICALLY change the appearance of an iframe layout. It will make things look slightly if not completely tacky.
iFrames also can not be used alone. ... Well that's not true. They can be used alone but it's really just bad design. An iframe is an "Internal" Frame. Meaning it can be placed anywhere on the page, and moved around with other HTML code. For our purpose we're going to use tables to do it. Multiple iframes on a page if not done correctly CAN and WILL confuse Firefox browsers and they won't read right. Ie7 is the same it has some issues with iframes but most of which can be worked out.
On a personal level. I've done iframe layouts, multiple times. I've regretted it each time and switched back to doing tables and divs for my own sites. They are wonderful tools for blog sites or low maintenance sites, but for a sight with consistant changes, and frequent modifications to the layout... it's a bad idea.
Now Aaron tells me I shouldn't do an iframe layout tutorial because we both believe iframes when used incorrectly are completely and horrendously bad design. My common ground is that if it's going to be done it might as well be done right. Not saying that my way is the right way but I can at least point you in the right direction and you can figure out the rest from there.
Personal feelings aside let's make the layout.

This is the image we're going to use:

Remember this is a thumbnail, click to make it bigger.

But you really don't need that piece, that's just to show you what it looks like. Unlike with Div layouts where you can have ONE image, and a background (Isn't very nice to load times but you can do it) This one requires us to break the image up. (To crop it)
Now in the tables "Let's make a Layout" (Number 2) we talked about cropping the image into three pieces really. A top, bottom and a background. In an iframes layout it's a little more complicated and requires more crops. So to show you how I cropped this I made little previews of the slits.
However to follow along with this tutorial it'll be best if you use our crops because there are a lot of mentions of sizes and so we want you to have the sizes we have for ease of use.
This just gives you an idea of how we cropped it up.

So initially we took the image and cropped it into three pieces.

Remember this is a thumbnail, click to make it bigger. (See a better idea)

The red lines are where I made my seperations. I'm not an overly fancy person and I'm aware photoshop has a "Slicer" tool. I just like using the selection. I use a square selection and I select from the first red line up, then copy and paste it into a new image. (CTRL+C on a windows Machine then CTRL+N to make a new document in photoshop, then press enter as the size settings are right there for you, and then CTRL +V and you'll paste it in. Save it and you've got your first piece.) Then I right click inside the selection and click "Select inverse." Then holding down CTRL I deselect the bottom piece, from the second red line down. (there is a little - to tell you you're de-selecting)
Once again I copy and paste it into a new image. Finally I right click in the selected area and select inverse. I de-select the top part as it's selected again, and then copy and paste just the bottom part into the new image.
Before I had the slicer tool this is how I did it, so I like consistency and so I keep doing it this way. I'm sure this way I'm getting what I want. If you know how to use the slicer and perfer it by all means. This is just my method. ^_^

The middle piece however needs to be cropped again. So let's crop it into sections. Here it is.

Remember this is a thumbnail, click to make it bigger. (See a better idea)

Once again I made my seperations where the red lines are. this time it was a little more complicated as you often have to deselect the left side so that you're only getting the right side piece that you want. It's always best to just move the way you likely read. Left the right... of course some read right to left...
So the instructions on cropping are above.
However we do have one more crop to make. The link frame we're going to make has an image above it. So we need to isolate it to just the frame.
Which means....Our third crop!

This is the link area, (I don't need to thumbnails this!)

Only the bottom part is the frame so another crop is made to make it so we're only using the bottom part.

So now we need our pieces. I'm only going to do text links to them, open them up, and Save these to YOUR HARDDRIVE. Do NOT DIRECT LINK. You get a funky little image that says You're a thief when you direct link.
Anyway the pieces.

The Top Piece
Size: 700x142
The Bottom Piece
Size: 700x33
The Furthest Left Piece
Size: 53x325
The Link frame BG
Size: 127x281
The Main Frame (Content) BG
Size: 461x325
The Furthest Right Piece
Size: 35x325
The Seperating piece between the links frame and main frame
Size: 24x325
The Top of the links area.
Size: 127x44

Sizes are done in pixels.
Save these to your harddrive. (In a images folder which should be in the folder that you're making this layout in)

So now we have the images we need to start with the coding. There are programs that can be used to do the coding, but I perfer to use notepad myself, and it's great to learn using notepad(or the MAC equivalent to the free text editor). That way if you need to edit the code later, you know what you're doing. And you're not pampered. ^_^
So we're going to open up notepad now. (or MAC Equivalant to a free text editor)
First in notepad you need to add in the simple HTML beginnings

<html>
<head>
<title>Give your Page a Title here</title>
</head>
<body>

If you note, there are no properties defined in the body tag, most properties defined in the body tag are refused by Firefox, I hate firefox... personally but that's my personal opinion. I will however state that it's a widely used browser and it's best to code with most browsers in mind.
While we can't code with every browser in mind IE and Firefox are the most commonly used, so we code for them, and hope for the best with the rest. (well you can always download their browsers and check)

Remember when saving this you need to save it as filename.html replace file name with the name of the page. If it's your MAIN PAGE save it as index.html if it isn't save it as something that accurately links to what it's about. For example a links page would likely be links.html or a staff page may be staff.html
There are other versions you can save as such as .php or .htm but we're going with .html today

There will be a tutorial on using PHP in a layout, as using the php includes can often be VERY handy for updating. (Most free hosts however do not support PHP)

Now For my purposes I've called this site MiD Let's Make a Layout // There is No Cure ..//
The title of the page will show up in the window at the top and in your taskbar. As is seen below:


Once we have this we have the beginning of our layout, all our "fancy" codes will go into a style sheet. There are two ways to do a style sheet you can link to an outside one, or you can have an inline one. I perfer to link to them, cleaner code. Some people perfer inline as to have less pages uploaded on their site. (cleaner code is always a goal for me, makes it easier to find things later when you want to update. Sure someone can 'steal' your code, but honestly if they're doing that it means you did a good job)
For this, we're using an outside one.

This means our next line of code should look like this:

<link rel="stylesheet" href="style.css">

When doing this ENSURE that your path to your style sheet is correct. If your page is in a folder, for example my page is in the tools/letsmakealayout folder but my style sheet is in my root directory, then I would would make the line look like this <link rel="stylesheet" href="/style.css">
The / makes the system know to look into the root directory for the style sheet.
You can name the style sheet anything you want, I've named mine style. (If adding a style doesn't make sense go back to HTML 202 )
The link rel tag MUST go inside the header for the html file. <head> and the </head> Typically placing it under the title tag will work.

Now with our case of an iframe we're going to use tables and iframes together. You can use iframes on it's own but it won't exactly know where to position the frame, it'll just put it starting whereever in your code it is.
It's best to use things like tables and/or divs to do it.
We're using tables.

Once we have this, we're going to move into getting our images onto the page. You can code an entire site through style sheets(for this layout we're going to use a vast amount of the style sheet, it makes centering easier and more comprehensible in firefox).
We're going to code through a combination of style sheets and HTML. In this case we're going to make some of the dimensions and properties of our table in the style sheet.
The Style sheet in this case will involve a vast majority of our properties(And of course the small things to make things pretty), so we're going to finish up some HTML and then begin on the Style sheet.

A few things to note, I call this a "iframes" layout but we still use div layers and tables in it. As it helps with centering and making things work in the manor we desire them to.
Most of the time when you code a layout it's classified by what the MAIN component is. The main component of this layout is iframes, as it's built off of them, and if I removed them the layout wouldn't work.
In the case of the div layers, I could probably remove them and have the layout still work, but then I'd have to do a few more extra things to get it to work. And in the case of the table I could remove it... but it won't work out as well. It'll come out rather sloppy.

So onto the Next Part!

We're going to start by centering our "table" (The one we haven't created yet) and to do this we're going to use a div layer. So the next line of code is this:

<div align="center">

This code will simply center our text/table/page for us. We want a very centered table, after all anyone can align things to the left or right.

Alright so our notepad code looks something like this:

<html>
<head>
<title>MiD Let's Make a Layout // There is No Cure ..//</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div align="center">

Depending on what you titled your layout, where your style sheet is located things might vary a little, but the overall appearance should be this.

For the next Part... move onto the next page =P

Let's Make a Layout(Tables!) Part One :: Getting Started
Let's Make a Layout(iFrames!) Part Two :: Tables
Let's Make a Layout(iFrames!) Part Three :: iFrames!!!
Let's Make a Layout(iFrames!) Part Four :: CSS
Let's Make a Layout(iFrames!) Part Five :: Final Touches.