peasepud
Programmer
- Jul 20, 2007
- 35
Hi,
I am busy creating a new site which has a centered container div of 840px, what Im trying to achieve is a logo appearing on the outside right of the container as if part of it is sitting underneath the container (it should look like this >
)
and can be found here >
It works on Firefx but on IE it appears off to the right hand side of the screen. Im also wary that on different screen resolutions its going to fall over.
What I have done is position the div containing the side of the badge (#badge) as part of the header but 853 px from the left therefore taking it outside the container.
Is there a better way to do this? Im still a novice at CSS compared to most on here so any help would be appreciated.
The relevant CSS is :
.container {
font-size: 1.2em;
background:#000000;
margin: 0 auto;
width: 840px;
border: 12px solid #333;
}
.header {
float: left;
width: 100%;
background: #000000 url(img/ttbanner4.jpg) no-repeat left;
font: normal 2.4em Verdana,sans-serif;
line-height: 150px;
text-align: center;
height:150px;
clear:both;
}
#badge {
position:relative;
left:853px;
top:18px;
width:160px;
height:250px;
background-image:url(img/badge2.png);
background-repeat:no-repeat;
}
And the HMTL:
<div class="container">
<div class="header">
<div id="badge"></div>
</div>
I am busy creating a new site which has a centered container div of 840px, what Im trying to achieve is a logo appearing on the outside right of the container as if part of it is sitting underneath the container (it should look like this >
and can be found here >
It works on Firefx but on IE it appears off to the right hand side of the screen. Im also wary that on different screen resolutions its going to fall over.
What I have done is position the div containing the side of the badge (#badge) as part of the header but 853 px from the left therefore taking it outside the container.
Is there a better way to do this? Im still a novice at CSS compared to most on here so any help would be appreciated.
The relevant CSS is :
.container {
font-size: 1.2em;
background:#000000;
margin: 0 auto;
width: 840px;
border: 12px solid #333;
}
.header {
float: left;
width: 100%;
background: #000000 url(img/ttbanner4.jpg) no-repeat left;
font: normal 2.4em Verdana,sans-serif;
line-height: 150px;
text-align: center;
height:150px;
clear:both;
}
#badge {
position:relative;
left:853px;
top:18px;
width:160px;
height:250px;
background-image:url(img/badge2.png);
background-repeat:no-repeat;
}
And the HMTL:
<div class="container">
<div class="header">
<div id="badge"></div>
</div>