School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,578 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,221 people online right now. Registration is fast and FREE... Join Now!




pain in the butt possitioning issue

 

pain in the butt possitioning issue, need some help with posititions

Torroes_prime

15 Jun, 2009 - 01:02 PM
Post #1

D.I.C Head
**

Joined: 7 Jun, 2009
Posts: 71


My Contributions
Okay, so I'm putting my control bar in a <div> that is static positioned at the top of the browser and I need it to line up with the Main Div which will contain the actual page material.
Here's what I'm talking about:
IPB Image

Now, I have 2 problems.

1) There's space ontop of the control bar. How do I get rid of it?
2) How can I make sure the control bar will always line up with the middle of the page?
==> Right now I've got the <div> container set to left indent of 12.75% and it shows up fine on my laptop, but I switch to my desk top and it's too far to the left.

Here's the code:

CODE

   <link href="bull.css" rel="stylesheet" type="text/css" />
<style type="text/css">
   .controls   {width: 945px; height: 321px;}

#Controls   {position: fixed; left: 12.75%; Top: 0%}
</style>
</head>
<body style="BACKGROUND-IMAGE: url(RB-bg.jpg); BACKGROUND-POSITION: 50% 0%">
<div id="controls" Class="controls" align="center">
<img src="Control-bar.png" alt="Raging Bull Fan Production Control Bar" width="945" height="321"
  usemap="#controls" style="border-width: 0" />


User is offlineProfile CardPM
+Quote Post


gregwhitworth

RE: Pain In The Butt Possitioning Issue

15 Jun, 2009 - 01:32 PM
Post #2

(this).problem + "sucks";
Group Icon

Joined: 20 Jan, 2009
Posts: 1,131



Thanked: 82 times
Dream Kudos: 50
Expert In: HTML, CSS, Web Design

My Contributions
Do the following:

CODE


html {
    text-align: center;}

#controls {
    width: 800px;
    margin: 0 auto;}



By setting a width, the browser will take that width and figure out the remaining space and center it.

--

Greg
User is offlineProfile CardPM
+Quote Post

Torroes_prime

RE: Pain In The Butt Possitioning Issue

15 Jun, 2009 - 01:39 PM
Post #3

D.I.C Head
**

Joined: 7 Jun, 2009
Posts: 71


My Contributions
okay, what did I do wrong? all that did was shift all the divs on the page over to the left. and drop the Main div way down.

CODE

<style type="text/css">
   .controls   {width: 945px; height: 321px;}
html {text-align: center;}
#controls {width: 800px;    margin: 0 auto;}
</style>

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 08:20AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month