Slice and code a layout Tutorial



Info & Save:

Category:
CSS
Date added:
09-08-07
Level:
Intermediate/Advanced
Author:
Celox
Save to:
Delicious   Digg   Stumbleupon

Step 13:

Below the "}" of the footer add the following code. Again it contains explaning comments.

.left_top_bar{
background:url("images/lm_top.jpg");
width:203px;
height:38px;
/* We change the default page font to the following */
font-family:Arial, Helvetica, sans-serif;
text-align:center;
/* With line-height you can adjust the text or images in div's, I adjusted it to 28px which is perfect for this design */
line-height:28px;
/* change the color of the text so we can see it! Default text is darker because the main content and menu boxes have a light gray color so text needs to be dark obviously. */
color:#D9DEE2;
}
/* The rest is self explanatory */
.content_top_bar{
background:url("images/c_top.jpg");
width:555px;
height:38px;
font-family:Arial, Helvetica, sans-serif;
text-align:center;
line-height:28px;
color:#D9DEE2;
}
.right_top_bar{
background:url("images/rm_top.jpg");
width:202px;
height:38px;
font-family:Arial, Helvetica, sans-serif;
text-align:center;
line-height:28px;
color:#D9DEE2;
}

Step 14:

Your probably wondering what about the gradient images? Well if you followed this tutorial you know a bit about div's already and it probably won't be to hard for you to do it yourself. But me being Celox I'll show you how I would do it Happy .

Just make a new div like so

<div class="gradient"></div>

It'll look like this in the left container

<div id="left_container">
<div class="left_top_bar">LEFT TOP BAR</div>
left menu
<div class="gradient"></div>
</div>

If you need more just copy them. And if you need your text to be centered use a div that centers the whole deal at once, making you code cleaner.

The CSS looks like this for the gradient

.gradient{
background:url("images/gradient.jpg");
width:198px;
height:2px;
/* margin 2px so it doesn't hugs the text. If you use margin and have an image background and the width of that image in the divs width, you'll need to double the margin in this case 4, and get it off the width of the div.

So for example, when you have a margin of 2px, we have 4 extra px's in the div so the image doubles itself after 202px's, making the div's total width 206px's. So we take these 4px's margin off the total width of the div making the divs width 198px. */
margin:2px;
}

Well.. That's it for this slicing,CSS and xHTML tutorial, I hope you learned a lot here today.

See my live final result.
Download template, with images, CSS and HTML.

Shoutbox
Celox
The brand new site is up and running! There changed a lot around here, so many that I'll be posting a descriptive post on the blog tomorrow Happy I hope you all like the new version's redesign, the new features and what not. There are still some minor bugs those need fixing but I'll get on that in the very near future.
draw_dogs_101
Er... Wierd dogs msg me..
Celox
Hey Hey!
maycute_25
helow to celoxdesign
Celox
Added some new cool text effects, check 'em out! Especially check out the 3D Bulge text effect, it's again one of the best text effect tutorials on the web.
Celox
200 members \o/ let's get drunk! Happy
Celox
I've replied in the critique my graphics thread
Matt
Look at my spider man
Webpoll
Did the site improve with its new update?
Hell yeah!
Nah, I don't think so..
No idea, this is my first time here

Advertisements