tags:

views:

129

answers:

4

I want to use CSS in Firefox to display a logo and a flash banner on my website.

The logo should be 250 X 250 and the banner 800 X 250. Both should be displayed in the same row.

Here's my current CSS:

#logo{
    background:#FFFFFF;
    position:absolute;
    left: 0px;
    top: 0px;
    width: 250px;
    height: 200px;
}

#Banner{
    background: #1071A6;
    position:absolute;
    left: 250px;
    top: 200px;
    width: 850px;
    height: 250px;
}

Unfortunately, the banner is being displayed at bottom of the logo.

Any suggestions about how to properly position these elements?

A: 

Here ya go

<html>
<head>
    <style type="text/css">

    #logo{
     background:#FFFFFF;
     position:absolute;
     left: 0px;
     top: 0px;
     width: 250px;
     height: 250px;
    }

    #Banner{
     background: #1071A6;
     position:absolute;
     left: 250px;
     top: 0px;
     width: 850px;
     height: 250px;
    }
    </style>

</head>
<body>
<div id ="logo"> 
</div> 
<div id="Banner">
</div>
</body>
</html>
BenB
banner is getting displayed below the logo. I want to get it displaye together. I mean in the same row. can u pls help...?
Flins
I dont use any container DIV.. all codes comes after body tag.<body><div id ="logo"></div><div id="banner"></div></body>Am new to programming.. Thnks for your patience an help...
Flins
+5  A: 

Make it:

#logo {
    background:#FFFFFF;
    position:absolute;
    left: 0px;
    top: 0px;
    width: 250px;
    height: 200px;
}

#Banner {
    background: #1071A6;
    position:absolute;
    left: 250px;
    top: 0px;
    width: 850px;
    height: 250px;
}

Should be top: 0px; on both.

Nimbuz
A: 

It could also be that his outside container is smaller than 1100 pixels in width. Need to take in condsideration margins and padding too.

Chris
I dont use any container DIV.. all codes comes after body tag. <body> <div id ="logo"> </div> <div id="banner"></div> </body> Am new to programming.. Thnks for your patience an help... Coul u pls help me to sort it out ??
Flins
A: 

I'd do the markup like this:

<div id="Header">
    <div id="Banner"></div>
    <div id="logo"></div>
    <div style="clear:  both;"></div>
</div> <!-- /Header -->

And the CSS like this.

#Header {
    width:  1120px;
}

#logo {
    position:  relative;
    float:  left;
    width:  250px;
    height:  200px;
    margin:  0;
    border:  1px solid blue;
}

#Banner {
    position:  relative;
    float:  right;
    width:  850px;
    height:  250px;
    margin:  0;
    border:  1px solid red;
}
Mark Biek
The borders are there just to make it easier to see where the divs are when they don't have any content in them.
Mark Biek