It shows that you are unregistered. Please register with us by clicking Here
Go Back   Blogring.net - The Premier Myspace & Xanga Community > Tutorials > Tutorials -Web Layouts

Tutorials -Web Layouts Tutorials that explain how to make website/ xanga layouts.

Reply
 
LinkBack Thread Tools Display Modes

Old 10-24-2005, 05:08 AM   #1 (permalink)
I got 1,500 posts!

 
xYunaxFantasiesX's Avatar
 
xYunaxFantasiesX is offline
Join Date: Jul 2004
Posts: 2,933
xYunaxFantasiesX
Points: 3,348.00
WARNING: It’s best to know basic HTML before attempting to read through and understand this tutorial. A good idea is to also read [Only registered and activated users can see links. ] before you read this.

Thanks to Snaple for the idea. ^_^

-----------------------------------------------------------------------------------------------

If you know basic HTML, you’ll see a lot of codes like this:

Code:
<div style="width: 500px; height: 500px; margin-top: 235px; margin-left: 60px; font: normal 8pt arial; color: #000000; background-color: #FFFFFF; border: 1px solid #000000;">
The part we’ll be focusing on here is the "style" part.

What is style? Style shows how things will look on your layout. It sets the font, color, border, background color, background image, etc. for your layout.

Let’s say you’re coding a Xanga layout, and you’re making your own custom modules. For each section, you have a specific header and a specific layout of the section. It gets annoying to have to type out the style of the section and/or header every time you have a new section. Plus, it’s easy to make typos that mess up the whole look of the layout, and you have to spend hours going through your code, trying to find the mistake. That’s where stylesheets come in.

Stylesheets, often referred to as CSS, are a way to make your codes clean, neat, and easy to read. They organize all the information into one stylesheet, so that you don’t have to type it all out every time you have a new div.

A stylesheet looks like this:

Code:
<style type="text/css"> stylesheet stuff go here </style>
<style type=”text/css”> shows the beginning of the stylesheet, and </style> shows the end of the stylesheet. Everything that goes between the two tags is part of the style.

Now let’s take a sample code.

Code:
<style type="text/css">
.body 
{background-color: #FFFFFF;
background-image: url(urlhere);
background-repeat: repeat-y;
background-position: center;

scrollbar-arrow-color: #000000;
scrollbar-track-color: #FFFFFF;
scrollbar-face-color: #FFFFFF;
scrollbar-highlight-color: #000000;
scrollbar-shadow-color: #000000;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-darkshadow-color: #FFFFFF;}
</style>
Look familiar? These specify the scrollbar colors and the background image and colors of the main site. The .body part of the code means this applies to the entire site. It's what I call the title. (Sorry, I don't know the actual term for it.)

Everything after .body is put in brackets ({ and }). This is a must. Everything in a stylesheet (except the title) must go in between those brackets. Notice that each aspect is separated by a semicolon ( ; ). This is also a must. If you don’t put the semicolon between each aspect, the stylesheet won’t work.

Now let’s look at something a bit more complicated. We’re getting into assigning classes now.

I often use this code in my layouts:

Code:
<style type="text/css">
.module
{width: 500px;
height: 400px;
background-color: #FFFFFF;
background-image: url();
font: normal 8pt arial;
color: #000000;
line-height: 10pt;
border: 1px solid #000000;}
</style>
It doesn’t look so complicated at first. Until you get to coding the div of the module.

So your module div looks something like this:

Code:
<div style="overflow: auto; margin-top: ###px; margin-left: ###px;">
<b>About Me</b>
NAME: Blahh<br>
AGE: 264<br>
HOBBIES: picking on little kids<br>
EXPERTISE: being crabby<br>
DISLIKES: good kids</div>
That’s fine. Except when you look at it through a Xanga, the fonts will be default, the div won’t have a border; everything you detailed in the stylesheet isn’t going to show up. Why is that?

Well, the computer can’t tell that the code above is for your module. So even if you specify everything in the stylesheet, it’s not going to show up that way. What you need to do is link the stylesheet to the div.

Look at the stylesheet again. See where it says “.module”? We’re going to call that the div class.

Now go back to your module code. Insert class="module" before the style, so that it looks like this:

Code:
<div class="module" style="overflow: auto; margin-top: ###px; margin-left: ###px;">
That’s how you assign a class to a div. The "div class" part is the link between the stylesheet and the actual div. If you look at it through a Xanga again, it will be the width, height, font, color, etc. of what you have in the stylesheet. Neat, huh?

You can do the same thing for headers.

Code:
<style type="text/css">
.moduleheader 
{background-image: url(urlhere);
background-position: bottom center;
background-repeat: no-repeat;
font: bold 12px arial;
line-height: 20px;
color: #000000;
border: 0px solid #00000;}
</style>

<div class="module" style="overflow: auto; margin-top: ###px; margin-left: ###px;">
<div class="header">About Me</div>
NAME: Blahh<br>
AGE: 264<br>
HOBBIES: picking on little kids<br>
EXPERTISE: being crabby<br>
DISLIKES: good kids</div>
See what I mean? Now you’re linking the header into your code.

This works for anything. It can be the blogbody, the custom module, each section of the module, etc.

I hope this helped. Please feel free to ask any questions you might have.

--------------------------------------------------------------
tutorial copyright dreamstar7 @ blogring.net

<div align="center">
ONLY POST IF YOU HAVE A QUESTION OR SUGGESTIONS IN ADDITION TO THE TUTORIAL.
</div>
__________________

  Reply With Quote
Sponsored Links

Old 10-29-2005, 04:08 PM   #2 (permalink)
Senior Member
 
seamless is offline
Join Date: Oct 2004
Posts: 445
seamless
Points: 496.00
i just have a question about div layouts, for some reason i could never get the repeating background to align with my image 0_o

[Only registered and activated users can see links. ] <---if you look closely you could see it's slightly disaligned, it was teh best i could do,i spent an hour trying to adjust the size of it so it would go alone...

it was a layout i was working on months ago, i quit it because it got oo frustrating and the dates kept disapearing everytime i made adjustments =/, why is that?
__________________
http://www.blogupload.com/13578/join_now.gif
[Only registered and activated users can see links. ] - Join The Blog Topsite!
http://img105.imageshack.us/img105/1...tton1114bu.gif
The "Blogpoints Hogger" *shifty eyes*
  Reply With Quote

Old 11-01-2005, 01:11 AM   #3 (permalink)
I got 1,500 posts!

 
dreamstar7's Avatar
 
dreamstar7 is offline
Join Date: Jan 2005
Location: somewhere between heaven and hell
Posts: 2,157
dreamstar7
Points: 2,323.00
^ Ooh, I remember that one.

If you maximize your screen, it's aligned, but otherwise, it's not. The only solution I can think of is to put your image in a div, and have the repeating background in the div style.

Like this:
Code:
<div align="left" width="widthofimage" style="background-image: url(bgurlhere); background-repeat: repeat-y; background-position: left;">
<img src="imageurlhere" border="0">THE REST OF YOUR CODE (the module part, and the blog div) GO HERE. do NOT close this div. Otherwise it won't work.
^Hope that made sense.

There's one thing that goes wrong with this solution, though. It's that at the very bottom of the page, you have about 15px of blank space. Kinda annoying, but yeah. Not much you can do about it.
__________________
Something tells me I've been on this forum for way too long.
  Reply With Quote

Old 07-31-2006, 08:12 PM   #4 (permalink)
Senior Member
 
Lei_Hibiscus is offline
Join Date: Sep 2005
Posts: 260
Lei_Hibiscus
Points: 263.00
thanks I really understand this suff more now ^_^.
But I kinda don't get what the div class stuff is for....
__________________
There is so many stars in the sky but only one of them is you.

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
  Reply With Quote

Old 08-18-2006, 07:56 PM   #5 (permalink)
I got 1,500 posts!

 
dreamstar7's Avatar
 
dreamstar7 is offline
Join Date: Jan 2005
Location: somewhere between heaven and hell
Posts: 2,157
dreamstar7
Points: 2,323.00
It's to link the div to the stylesheet.

Whatever you've classed your div as, you can add something in the stylesheet with the same title as the class name. That way, you don't have to type out the div style every single time for custom modules and such.
__________________
Something tells me I've been on this forum for way too long.
  Reply With Quote

Old 12-25-2009, 12:33 PM   #6 (permalink)
Junior Member
 
oceanflorida320 is offline
Join Date: Dec 2009
Posts: 3
oceanflorida320 is on a distinguished road
Points: 131.56
HI
thank you so much for such a valuable script but problem is this we can't use it due to legislation.

Thanks
Regards
__________________
[Only registered and activated users can see links. ]
  Reply With Quote
Reply

Tags
assigning, class, css or stylesheets, intro

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT. The time now is 11:39 PM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0