vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   positioning something in the center of the screen with css (https://vborg.vbsupport.ru/showthread.php?t=74591)

sabret00the 01-18-2005 02:48 PM

positioning something in the center of the screen with css
 
how would i go about doing this, always wondered how and never ever knew bar creating a table but that's long. :(

wheres all the html guru's :(

Tekton 01-18-2005 11:21 PM

You could put it in a container if you're talking about a whole page...
div#container
{
margin-left: auto;
margin-right: auto;
width: 50em;
}

or you could use "text-align: center;" would work in some cases...

sabret00the 01-19-2005 08:24 AM

will that vertically align it center too? as the left right bits a doddle it's the vertical aligning that's the problem.

Tekton 01-19-2005 11:41 AM

vertical-align: middle;

I believe is what you're looking for then.

WetWired 01-19-2005 01:11 PM

You may need to give the body element height:100% to center its contents vertically with a vertical-align, and for this to work in IE, you need to be sure to give your page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
or another doctype specifier that tells it to use its better CSS interpretation at the top (it needs to be the topmost line in the document, before <html>), otherwise it interprets it differently and it won't work.

Natch 01-19-2005 07:02 PM

And for browsers to not use "quirks mode" rendering, your doctype definition needs to be comlete (including the URI of the referenced doctype) otherwise it's llike having no doctype at all.

Dean C 01-19-2005 08:18 PM

<a href="http://www.jakpsatweb.cz/css/css-vertical-center-solution.html" target="_blank">http://www.jakpsatweb.cz/css/css-ver...-solution.html</a>

WetWired 01-19-2005 11:47 PM

Actually, that depends on the doctype. That particular one does not need a URL to work propperly.

sabret00the 01-20-2005 07:10 AM

thanks all, you been a great help :)


All times are GMT. The time now is 02:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00998 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete