Solved

What is causing my div to show up at the bottom rather than to the right?

Posted on 2013-05-30
4
266 Views
Last Modified: 2013-06-08
Attached is a screen shot where you can see some verbiage along the bottom. That verbiage is contained within a div that should be parked to the right of the grey column. Instead, it's running along the bottom and I don't know why.

Here's my stylesheet:

img.bg {
  /* Set rules to fill background */
  min-height: 100%;
  min-width: 1024px;
	
  /* Set up proportionate scaling */
  width: 100%;
  height: auto;
	
  /* Set up positioning */
  position: fixed;
  top: 0;
  left: 0;
}

@media screen and (max-width: 1024px) { /* Specific to this particular image */
  img.bg {
    left: 50%;
    margin-left: -512px;   /* 50% */
  }
}

#header {
position:relative;
margin:auto;
height:359px;
width:1000px;
z-index:3;
}

#body_tray {
position:relative;
width:1000px;
background-color:#000000;
margin:25px auto ;
}

#side_bar {
position:relative;
margin-top:-45px;
margin-left:5px;
width:312px;
height:700px;
}

#main_body {
position:relative;
height:35px;
background-color:#cccccc;
}

#footer {
position:relative;
width:1000px;
margin: 10px auto ;
text-align:center;
font-family: Helvetica, Microsoft Sans Serif;
font-size: 12px;
font-weight:bold;
color: #243987;
}

Open in new window


..and here's my html:

<IMG SRC="images/background_image.jpg" class="bg">
<div id="body_tray">
	<div id="header"><IMG SRC="images/header.png" usemap="#header" border="0"></div>
	<div id="body_tray">
		<div id="side_bar"><IMG SRC="images/left_column.png"></div>
		<div id="main_body">hello</div>
	</div>
	<div id="footer">The Rotary of Spring Hill & Thompsons Station | Spring Hill, Tennessee<BR><font size="1"><BR></font><A HREF="http://www.brucegust.com" target="_blank"><IMG SRC="images/brucegust_signature.png" border="0"></a><BR><BR></div>
</div>

Open in new window


It's the grey box with the word "hello" in it. I want that to the right of my "side_bar" div and I'm failing miserably.

Where am I blowing it?
Screen-Shot-2013-05-30-at-5.01.3.png
0
Comment
Question by:brucegust
4 Comments
 
LVL 12

Expert Comment

by:duttcom
ID: 39209619
A link to the site would be useful so it can be firebugged.
0
 
LVL 1

Expert Comment

by:manbehindthecurtain
ID: 39209621
Do the following changes to the #side_bar and #main_body work for you?

#side_bar {
position:relative;
margin-top:-45px;
margin-left:5px;
width:312px;
height:700px;

float:left; display:inline;
}

#main_body {
position:relative;
height:35px;
background-color:#cccccc;

    float:left; display:inline;
    width:681px;
    top: 0px;
    left: 0px;
}
0
 

Author Comment

by:brucegust
ID: 39209746
Here's a link to the live version: http://hihatwebdesign.com/smiles/header.php
0
 
LVL 9

Accepted Solution

by:
Ishaan Rawat earned 500 total points
ID: 39209939
Easiest way....

add float:left to the #side_bar and then modify your html to this..

<IMG SRC="images/background_image.jpg" class="bg">
<div id="body_tray">
	<div id="header"><IMG SRC="images/header.png" usemap="#header" border="0"></div>
	<div id="body_tray">
		<div id="side_bar"><IMG SRC="images/left_column.png"></div>
		<div id="main_body">hello</div>
                <div style="clear:both"></div>
	</div>
	<div id="footer">The Rotary of Spring Hill & Thompsons Station | Spring Hill, Tennessee<BR><font size="1"><BR></font><A HREF="http://www.brucegust.com" target="_blank"><IMG SRC="images/brucegust_signature.png" border="0"></a><BR><BR></div>
</div>

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now