Affiliates
Home Log In About Me Subscribe! Friends Feedback Design Home
About

Online Alias: S. Majere
Real Name: Sarah
DOB: 16/9/88 (24)
Zodiac: Virgo
Occupation: Student
Education: B.A. in English & Journalism
Currently Studying: Radiotherapy & Oncology
Enjoys: Running, designing, studying, reading, superheroes & goldfish
Gender: She-Elf
Status: In a relationship



Xanga Designs

Myspace [Archived]

Tutorials

Sitely

This site is purely for personal use. Designs, codes and tutorials are free to all to use. Credit is always appreciated! Original image from Kaki-tori and further design and CSS by S. Majere.

About this Entry
Posted by: S_Majere

Visit S_Majere's Xanga Site

Original: 10/1/2007 11:42 AM
Views: 18417
Comments: 13
eProps: 23

Read Comments
Post a Comment
Back to Your Xanga Site



Monday, October 01, 2007

 

< - -Coding a DIV Layout - - >

I'm at university right now, sitting in the huge library computer suite, trying to kill the next five hours before my first lecture. As this is something I've been meaning to do for a while now, I've decided to spend a few hours walking you through the coding of a DIV layout.


Requirements:

You must have at least a basic knowledge of HTML.

Microsoft Notebook in order to manipulate your code.

A banner image, preferably designed by yourself (we don't want any copyright issues here).

I'd appreciate a link back from your (hopefully div-layouted) site.


Right then, a brief introduction to DIV layouts:

A DIV layout refers to a certain type of either HTML and/or CSS code that overlays an existing website template. Think of a DIV layout as a sort of tablecloth that goes over your original site pages. A DIV itself is a portion of code, it can be a box of text, an image or a title that is specifically positioned on your site using a pixel measurement. The code is contained with <div> and </div> tags.

DIV layouts have something called DIV classes or DIV ID's. These are used as a sort of reference back within a code as they will specify something (your text type, background image etc) that you need not type out all over again. For example, if I had a DIV class like this one:

.h1{

width: 410px;
height: 10px;
font: bold 9px smallfonts;
font-weight: bold;
font-size:9px;}

in which 'h1' represents my 'header' for my website; I can use a shortcut tag like this:

<DIV class="h1"> This is my header  </div>

which will automatically give my header text the properties I have specified in the h1 class.

This is an extremely useful trick that layout designers use. You should familiarise yourself with this concept as we'll be seeing DIV classes within the code I am going to show you.


Site Title, Alignment and Banner Image:

The first part of our Xanga DIV overlay code specifies what your website is called, what banner image you will use and the alignment of it.

When naming your website, it is important that you leave the two quote symbols ' ' either side of your site name and make sure you do not use these mid way through (for example, you can't have plurals as your site name so 'Sarah's Xanga' won't work).

Next you will specify the positioning of your banner image. You can have a <div align="left"> a <div align="center"> or a <div align="right"> website. This will move your entire site to the left, center or right. Be aware that the 'center' alignment tag will only work properly on Internet Explorer and is not Firefox friendly. I'm working on this.

You can change how far away your banner image is from the top and sides of your screen by specifying a pixel difference. For example, in this code I will give you a margin-top: -20px; which shifts your page up by 20 pixels. A minus number will move your image up and a positive number will move your image down.

The same sort of thing goes for your margin-left and margin-right properties. A positive number will move your site away from the margin and a negative will move it towards it. You'll need to understand this in order to position your modules later on.  

Assuming you have a ready banner image, you must direct link to this in your code. That means uploading your image to a server such as imageshack.us and copying the direct link you recieve.

So all this gives us:

</Layout Name Here/>

</Layout Code Provided by S. Majere @ A Touch Of Destiny [xanga.com/s_majere]. All rights reserved. Layout Designed By [YOUR NAME] @ [xanga.com/YOURSITE] **KEEP THIS CREDIT INTACT**/>


<script type='text/javascript'>
document.title = ('Your Site Title Here'); </script>

<div align=left>

<div style="position:static; margin-left:0px;margin-top: -20px;border:

0px solid #000000;background: #A3A3A3;

<head>
< http-equiv="Content-Type content="text/html; charset=iso-8859-1">
</head>
<table id="Table_01" border="0" cellpadding="0" cellspacing="0">

<TR><TD>

<IMG SRC="YOUR BANNER IMAGE URL HERE">

</TR></TD>

</div>

</body>


Repeating Background Image and Text

Still with me? Good. Now we move on to your background image. You might be wondering why we refer to this as a repeating background image. Well, it repeats itself, obviously. You can tell this image how to repeat - will it repeat on one axis only, will it start from the top, will it be left aligned? etc. The useful thing about repeating images is that nomatter how long your blog entries are, or how stretched your page is, your repeating background will copy itself to match.

Your repeating image can just be a block of color, but with a DIV layout it is usual for a designer to choose to 'crop' his banner image and use the very bottom of it as a repeating background. I will give you an example of this:

This is my main banner image: Clicky.

And this is my repeating background which I have cropped: Clicky.

See how cool that is? Just remember to align your background image to be the same as your banner. Either left, center or right aligned.

So now we're onto text. This is, as with all site specifications, entirely up to you to choose which font family to use. I personally find that Verdana gives the clearest text; but you can choose Georgia, Small Fonts, Times New Roman and a whole load of other defaults. It's best to stick with the Windows Defaults - find them all here - as other systems may not recognise or have correct software to interpret anything custom or fancy.

You are also given options on what your bold, italic and underlined text will be like too; as well as how your links will look.

So this gives us:

<style type="text/css">

</Edits Your Repeating Background Properties/>


body {
scrollbar-track-color: #333333;
scrollbar-face-color: #595959;
scrollbar-shadow-color: #676767;
scrollbar-highlight-color: #676767;
scrollbar-darkshadow-color: #676767;
scrollbar-3dlight-color: #000000;
scrollbar-arrow-color: #cccccc;

background-image: url("IMAGE URL HERE");
background-position: left;
background-color: #A3A3A3;
background-repeat: repeat
}

</Edits Your Text/>

.left, .blogbody, table.footer, .standard, .leftmodulefontcolor, td, p {
font: normal 10px verdana;
line-height:11px;
color: #AEADAD;
letter-spacing:0px;
text-align:left;
}

</Edits Bold Text/>

.blogbody b, .standard b, p b, strong {
font-weight: bold;
color: #686868;
}

</Edits Italic Text/>

i, em {
font-weight: italic;
color: #000000;
}

</Edits Underlined Text/>

u {
text-decoration: underline;
color: #8B1413;
}

</Edits Links/>

a:link, .footernav.link, a.footernav:link, a.footernav:active {
color:#B3B3B3;
font: normal 10px verdana;
line-height:13px;
background-color:#;
}

</Edits Visited Links/>

a:visited, a.footernav:visited, {
color:#B3B3B3;
font: normal 10px verdana;
line-height:13px;
background-color:#;
}

</Changes Color Of Links When You Hover Over/>

a:hover {
color:#686868;
font: normal 10px verdana;
line-height:13px;
}

</Edits Any Dropdown Menus or Buttons/>

input, select, textarea, .textfield, .button {
border: 1px double #6C7B8B;
font: normal 10px verdana;
font-size: 10;
background-color: #000000;
letter-spacing:0px;
color: #ffffff;
}

</Centers Footer. Ignore This/>

table.footer TD {
text-align: center;
}


Module Headers and Modules

Modules are basically just those little boxes of text or links that go straight down the side of a site. Most sites have them, as they're used for storing personal information, navigation links, music etc.

Here we go back to the idea of DIV Classes. The following are the module and module header classes:

</Edits The Dates On Your Blog Entries/>

div.blogheader{
width: 410px;
height: 10px;
font: bold 9px smallfonts;
font-weight: bold;
font-size:9px;
letter-spacing: 1px;
text-transform:uppercase;
color:#969595;
text-align:left;
padding-left:0px;
background-image: url("IMAGE URL HERE");
border-bottom: 0px dashed #969595;
background-position:  left;
background-repeat: no-repeat;
}

</Edits Your Module Headers/>

.smHeader {
font: bold 9px smallfonts;
font-weight: bold;
color: #B3B3B3;
letter-spacing: 1px;
text-transform: uppercase;
line-height: 15px;
text-align: center;
padding-right: 1px;
padding-left:15px;
width: 242px;
background-image: url("IMAGE URL HERE");
border: 0px solid #000000;
background-position: left;
background-repeat: no-repeat;
background-color: none;
}

</Edits Your Modules/>

.smModules {
font: normal 9px verdana;
width: 242px;
color: #969595;
line-height:15px;
letter-spacing:0px;
text-align:left;
background-position: bottom center;
background-color: transparant;
border: 1px solid #000000;
padding-left:4px;
text-align:justify;
text-transform: none;
display:block;
}


Blog Width and Module Positioning

Right, now listen closely. Blog width is something that you'll have to check not once, not twice but three times within your code. Each width must be the same or your blog will not be the right size. The first pixel width you need to check is that of your DATES. The width for this one can be found in the div.blogheader class (look for the hint - 'Edits The Dates On Your Blog Entries').

The second is in the example below, in your table.blogbody ('Defines Blog Width')

The last can be found at the very end of our coding ('Edits Your Blog')

You'll also need to position your modules. This is using the pixel distance idea I told you about earlier.

So all that gives us:

</Defines Blog Width/>

table.blogbody {
width:410px;
border-bottom: 1px solid #1B202A;
}

table.footer {display: none;}
.mainleft {
width: 0px;
padding: 1px;
}

</Edits Entry Divider/>

hr {
border: 1px dashed #969595;
}
#pnlEnabled table, #htmleditor, #lblTimeZone, #pnlEprops, #rblEprops {

width: auto !important;
}

</Edits Left Margin Of Blog/>

table.blogbody tr td {
width:0px;
padding: 0px;
}

table.left, td.mainleft, table.navigation, table.search, #SearchBar1_pnlYouAreHere {display: none;}</style>


</Specifies Where Your Modules Are/>

<div style="margin-left: 200px; margin-top: 0px; width: 240px; height: 1000px; overflow: visible;">


Module Content and Blog

Nearly there! This last little bit of code shows you how all the div classes play a role when you put whatever you want into your modules. The only thing to watch here is making sure you have the right number of end </div> tags to the right number of <div class="whatever"> tags. If you don't, your modules will either go off and play somewhere to the extreme of your screen, hide your blog or disappear entirely.

The last div class is your blog itself. This does not need a </div> tag as your blog entries are the content located within your div class. If you closed the div, your blog entries wouldn't show!

So this is your module content script:

<div class="smHeader">Contact Info</div>
<div class="smModules">
<p><br>


<b>Hotmail:</b> s.majere<br>
<b>Yahoo:</b> s.majere <br>
<b>Myspace:</b> <a href="http://www.myspace.com/s_majere">S. Majere</a><br>
<b>VF:</b> <a href="http://www.vampirefreaks.com/u/s_majere">S. Majere</a>


<br><br>
</div>


<div class="smHeader">About Me</div>
<div class="smModules">
<p><br>


<b>Name:</b> S. Majere<br>
<b>DOB:</b> 16/09/88 (18)<br>
<b>Music:</b> Dark core, gothic, hard rock, metal, alternative folk.<br>
<b>Movies:</b> Advent Children, 28 Days Later, Batman Begins, Blade I, II & III.<br>
<b>Loves:</b> Storms, bats, web-design.<br>
<b>Loathes:</b> Emos, whiners and idiots.

<br><br>
</div>


<div class="smHeader">News</div>
<div class="smModules">
<p><br>

Anything in here.

<br>
</div>

<div class="smHeader">Blogrings</div>
<div class="smModules"><p>
<br>

<a href="http://www.xanga.com">Blogring</a><br>
<a href="http://www.xanga.com">Blogring</a><br>
<a href="http://www.xanga.com">Blogring</a><br>
<a href="http://www.xanga.com">Blogring</a><br>
<a href="http://www.xanga.com">Blogring</a><br>
<a href="http://www.xanga.com">Blogring</a><br><br>


</div>

<div class="smHeader">Modules</div>
<div class="smModules">
<p><br>


'Keep your friends close, and your enemies - closer.'<br><br>


'Whatever we see or seem, is but a dream within a dream.' -<b>Edgar Allen Poe</b>


<br><br></div>

<div class="smHeader">Chatterbox</div>
<div class="smModules"><br>
<p>

Your flooble chatterbox code in here.


<br><br>
</div>

<div class="smHeader">Credits</div>
<div class="smModules">
<p><br>
<b>Layout:</b> <A href=http://www.xanga.com/YOURSITE>Your Name
</a><br>
<b>Codes:</b> <a href="http://www.xanga.com/s_majere">S. Majere</a><br><br>

</div></div>

</Edits Your Blog/>

<DIV style="position:static;
margin-top: 0px;
margin-left: 0px;
width: 410px;
BACKGROUND-COLOR: transparent">

You can find the entire dummy test code here.

Confused? I check this site every evening so leave me a message if you need help. However, I will not help people out with everything; please limit queries to specific fields.

S. Majere x

 

 Posted 10/1/2007 11:42 AM - 18417 Views - 23 eProps - 13 comments

Give eProps or Post a Comment

13 Comments

Visit Purple_Harlequin's Xanga Site!

WOW.

Thanks so much for this, but I'm still a bit confused as to why my nav links are above the header image.. o_O

I'll send you the code tomorrow, I've spent too long working on it that I'm exhausted.

Nighty night!

xxxx

Posted 10/5/2007 10:09 PM by Purple_Harlequin Xanga True Member - recommend - reply

these dint work !
liiiiike,
yeh.
i wanna make one where u can put navigation ON A PICTURE..
andddd, put a pic anywhere on the site.
o.o
Posted 12/9/2007 9:35 PM by Anonymous - recommend - reply

Visit S_Majere's Xanga Site!

Of course it works. I wouldn't post it otherwise.

You're talking about Image Maps.

Posted 12/9/2007 10:28 PM by S_Majere - recommend - reply

can u message me please?
Jus click on message user er whatever.
i rly need some help.
Id so appreciate it.
Posted 12/9/2007 10:40 PM by Anonymous - recommend - reply

Visit cubanstyle125's Xanga Site!
Wow i am so confused my image dirent show up so like it's really messed up i dont no what happend please help me please, i'll put the code on my weblog entry so you can see it.
Posted 12/15/2007 5:28 AM by cubanstyle125 - recommend - reply

Visit cubanstyle125's Xanga Site!
Oh and i dont even no were the navigation is.
Posted 12/15/2007 5:31 AM by cubanstyle125 - recommend - reply

Visit PicturesqueDesignsx3's Xanga Site!

Eh, good morning!

 I've been trying to align my DIV repeatively, but I still can't figure out how to align my modules and blog. Do you mind helping me out?

||-Poletto||

Posted 12/31/2007 7:20 AM by PicturesqueDesignsx3 - recommend - reply

Visit lennes_lays_yuna3's Xanga Site!
hey have u got an actual layout code tutorial (so everything is replaced wiht username and layout title etc) that i can use cos i am unsure on how to set out the actual codes u set on here ^^ that wud be great if u  cud help me thanks alot xx (this is lennes_layouts so plz reply to me on there xx
Posted 2/24/2008 12:27 PM by lennes_lays_yuna3 - recommend - reply

Visit firefly_layouts's Xanga Site!

« Wow.. did anyone leave a good cmmt about this?

---I guess I'll start the trend.---

This tutorial was great. Thank you so much for making it. 5 stars.

Posted 3/16/2008 11:56 PM by firefly_layouts - recommend - reply

Visit immortal_x's Xanga Site!
okay, im not sure whats going on but i cant seem to get it to work. I get to the part of blog width and module positioning, but when I try to preview it there is a big space at the top that wasnt there before I entered the code. please help? my page"
Posted 7/2/2008 9:11 PM by immortal_x - recommend - reply

Visit albelxfayt's Xanga Site!

This tutorial is probably one of the most clearest ones out there. I mean, the ones I look at only tell me what to do, not what each section means.

So thank you, very much!

~Yayoi-chan

Posted 9/20/2008 5:26 AM by albelxfayt - recommend - reply

Visit soul_starr's Xanga Site!
pretty good tutorial :]

but i've got a question. how can you position your whole layout to the right of the page ? xP
Posted 12/5/2008 5:47 PM by soul_starr - recommend - reply

Visit Pink_TeaCups's Xanga Site!

I'd really appriciate it if you told me how you linked your pages without signing up in a different screen name to link up?

x

Posted 2/15/2009 11:03 PM by Pink_TeaCups Xanga True Member - recommend - reply


Sign in to CommentChoose Identity
Give eProps (?)
Post a Comment
Add Link | Preview HTML comment help 
Profile Pic:
Default  |  Choose »  (?)

(?)

Back to S_Majere's Xanga Site!
Note: your comment will appear in S_Majere's local time zone:
GMT 0:00 (Greenwich Mean - Lisbon, Dublin, London)