Div tags

Div tags

Re: Div tags Posted by Loco on Sun Oct 23rd 2005 at 1:46pm
Loco
615 posts
Posted 2005-10-23 1:46pm
Loco
member
615 posts 121 snarkmarks Registered: Aug 29th 2003 Occupation: Student Location: UK
I'm building a site from scratch, and have been trying out div tags. It
all works fine, until I try and use vertical alignment which er...
won't. I'm trying to get it so the text in a div box is in the center
vertically, but I can't seem to get it to work. A lot of tutorials out
there say that the vertical-align tag isn't really supported, so how is
it done? I have already Googled this, before anyone asks. Any ideas?
My site
Re: Div tags Posted by azelito on Sun Oct 23rd 2005 at 2:00pm
azelito
570 posts
Posted 2005-10-23 2:00pm
azelito
member
570 posts 127 snarkmarks Registered: Aug 8th 2002 Occupation: Wierdness Location: Sweden
Not quite sure I understood your question but...

http://www.w3schools.com
"Azelito, stop being a f**king bitch. All I see you do is complain and insult people in your recent posts. We don't care, go find a razor you emo pansy..." -Windows98
Re: Div tags Posted by Underdog on Sun Oct 23rd 2005 at 2:19pm
Underdog
1018 posts
Posted 2005-10-23 2:19pm
Underdog
member
1018 posts 102 snarkmarks Registered: Dec 12th 2004 Occupation: Sales-Construction Location: United States
I can only code pages with HTML and that only at a beginner to intermediate level. (perhaps that makes me a full web page designer as well, huh Maze. with restrictions of course. :lol: )

I have no clue what you asked either. Sorry.

Good luck.
There is no history until something happens, then there is.
Re: Div tags Posted by Loco on Sun Oct 23rd 2005 at 2:29pm
Loco
615 posts
Posted 2005-10-23 2:29pm
Loco
member
615 posts 121 snarkmarks Registered: Aug 29th 2003 Occupation: Student Location: UK
Sorry, should have been more specific. I have div block - nice, shiny,
clean and empty. I need to shove some text in this (fine), but have it
centered vertically, and I have no idea how to do this.
My site
Re: Div tags Posted by Underdog on Sun Oct 23rd 2005 at 2:32pm
Underdog
1018 posts
Posted 2005-10-23 2:32pm
Underdog
member
1018 posts 102 snarkmarks Registered: Dec 12th 2004 Occupation: Sales-Construction Location: United States
There are no align right, or align left tags?

I suppose that I need to look up what you are asking because "div" is throwing me.

[edit] Found this. Didn't enlighten me one iota.

Good luck my friend.
There is no history until something happens, then there is.
Re: Div tags Posted by Loco on Sun Oct 23rd 2005 at 2:45pm
Loco
615 posts
Posted 2005-10-23 2:45pm
Loco
member
615 posts 121 snarkmarks Registered: Aug 29th 2003 Occupation: Student Location: UK
Thanks for the suggestions, but I've just about managed to crack it.

A set of div tags is used to create a block of text or content wherever
you want. For example, I'm using the following for the header block on
the website I'm building:

<div id=layer1
style="position:absolute; top:0; left:0; width:100%; height:200;
z-index:1; padding:0px; background-color:#000000;
background-image:url(img/bannerback.jpg);
layer-background-image:url(img/bannerback.jpg);"><br style="font-style: italic;">
<br style="font-style: italic;">
Title goes here<br style="font-style: italic;">
<br style="font-style: italic;">
</div>

What I wanted to do is edit the title so that it is vertically in the center of the block, rather than stuck at the top.

The solution is a little messy. Tables support vertical aligning, so I
have a mini invisible table within the div tags which vertically
centers the text. As I said - messy. Any other better methods?
My site
Re: Div tags Posted by Underdog on Sun Oct 23rd 2005 at 2:50pm
Underdog
1018 posts
Posted 2005-10-23 2:50pm
Underdog
member
1018 posts 102 snarkmarks Registered: Dec 12th 2004 Occupation: Sales-Construction Location: United States
Hmm, thats now as clear as Los Angeles on a mid summer day.

Can you post a link to a before/after so I can see it in action?

Sounds an awful lot like "tables" to me.
There is no history until something happens, then there is.
Re: Div tags Posted by Loco on Sun Oct 23rd 2005 at 3:02pm
Loco
615 posts
Posted 2005-10-23 3:02pm
Loco
member
615 posts 121 snarkmarks Registered: Aug 29th 2003 Occupation: Student Location: UK
Here's the before and after

http://bobloco.freeunixhost.com/before.php

http://bobloco.freeunixhost.com/after.php

Like I said - messy. divs are a bit like tables, only you aren't
limited by a giant box and they're a bit nicer to work with (most of
the time). I've only just started using them myself.
My site
Re: Div tags Posted by Crono on Sun Oct 23rd 2005 at 7:18pm
Crono
6628 posts
Posted 2005-10-23 7:18pm
Crono
super admin
6628 posts 700 snarkmarks Registered: Dec 19th 2003 Location: Oregon, USA
Divs are something else besides tables. Much easier to use them with dynamic content. Since you can label an entire part of the page a class and move it around as well as put it infront or behind other objects on the page. (even though you can do that with a table too)

If you want the same thing, but no break in the page, use a span tag.

You should be able to specify padding as "50%" and it will center in the middle. It's a little shadey sometimes. But it should work.
Blame it on Microsoft, God does.