Shoutbox

CSS Question - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: CSS Question (/showthread.php?tid=52482)

CSS Question by Ash_ on 11-01-2005 at 11:12 AM

i want a box that is 700px wide and 500px high and centered, vertically and horizontally in the page. is this possible (without using tables) i want to strictly use Divs.

the vertical-align: attribute of css doesent work with divs.

any help is appreciated.


RE: CSS Question by Jhrono on 11-01-2005 at 11:23 AM

div.box {
width:700px;
height:500px;
margin:0 auto;
}

and at the code
<br>
<br>
<div align="center" class="box">
blabla
</div>

and use breaks <br> to "center" it

not actually sure if that noob shit will work

i'm actually at w3schools trying to learn something about it..


RE: CSS Question by absorbation on 11-01-2005 at 05:45 PM

quote:
Originally posted by Ash_
the vertical-align: attribute of css doesent work with divs.

It should and it does for me. Are you sure you have done it right. Did you test to see if your css is valid?

quote:
Originally posted by Johny
<br>

<br /> is the best way as it ends the tag.


RE: CSS Question by Kryptonate on 11-01-2005 at 06:00 PM

quote:
Originally posted by Johny

i'm actually at w3schools trying to learn something about it..
learn xHTML instead of regular HTML. xHTML is it's successor.
0 auto doesn't exist. Just give it a number and leave the auto.

The vertical align should work indeed.
RE: CSS Question by hmaster on 11-01-2005 at 06:24 PM

"CSS level 2 doesn't have a property for centering things vertically. There will probably be one in CSS level 3. But even in CSS2 you can center blocks vertically, by combining a few properties."
read more : http://www.w3.org/Style/Examples/007/center.html

Google has some good results:
http://www.google.co.uk/search?client=firefox-a&r...btnG=Google+Search

vertical-align will only work if its in a table and you are looking for pure css..


RE: CSS Question by Ash_ on 11-01-2005 at 09:07 PM

quote:
Originally posted by Johny
div.box {
width:700px;
height:500px;
margin:0 auto;
}

and at the code
<br>
<br>
<div align="center" class="box">
blabla
</div>

and use breaks <br> to "center" it

not actually sure if that noob shit will work

i'm actually at w3schools trying to learn something about it..

lol yeh, that's the easy part.

quote:
Originally posted by hmaster
"CSS level 2 doesn't have a property for centering things vertically. There will probably be one in CSS level 3. But even in CSS2 you can center blocks vertically, by combining a few properties."
read more : http://www.w3.org/Style/Examples/007/center.html

Google has some good results:
http://www.google.co.uk/search?client=firefox-a&r...btnG=Google+Search

vertical-align will only work if its in a table and you are looking for pure css..
hmm yeh i tried google but they all used tables or didnt work for me.
RE: CSS Question by lordy on 11-02-2005 at 06:22 AM

quote:
Originally posted by Absorbation


quote:
Originally posted by Johny
<br>

<br /> is the best way as it ends the tag.

<br /> is in XHTML, if you are using HTML then just use <br>

imo, use XHTML, it may be slightly harder (because you have to use CSS as well), but it makes for cleaner code