CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 8th, 2003, 10:24 AM
_venturax_ _venturax_ is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Aalborg, Denmark
Posts: 2 _venturax_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to _venturax_
CSS positioning

Im doing some web design, and i have used CSS to place elements. But its great as long as i use absolute positioning of elements.

I would like to know how to position all my elements centered on my page without loosing their alignment with eachother. Is it possible to do?

here's a snip of my css code
---
#HorisontalBar {
position: absolute;
top: 130px;
left:10px;
background-color:#FF0000;
width: 790px;
height: 20px;
border-color: #111111;
border-left: 1px solid;
border-right: 1px solid;
border-top: 1px solid;
border-bottom: 1px solid;
z-index: 2;
}
#VerticalBar {
position: absolute;
top: 0px;
left: 68px;
width: 43px;
height: 601px;
border-color: #111111;
border-left: 1px solid;
border-right: 1px solid;
border-bottom: 1px solid;
background-color:#00FF00;
z-index: 1;
}
---

the "bars" form a cross.

if i were to center this cross.. how? without losing their alignment?

Reply With Quote
  #2  
Old March 8th, 2003, 11:16 AM
madcat madcat is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 87 madcat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 24 sec
Reputation Power: 12
You could try wrapping both the elements within a <div> called 'wrap'. Make sure that 'wrap' is given a position: relative; or absolute; declaration. You might set the height and width to 100%, then set the elements you want positioned with margin-right: auto; - margin-left: auto; - or some combination like that. You'll need to fool with it, but something like that might get you started- just an idea.

The reason you give your 'wrap' div a relative position, is so that your positioned elements stay positioned the way you need them.
__________________
http://www.atlantaaudiology.com

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS positioning

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap