4

I have not been successful in solving this so far, so i need help. What I am trying to do is have a background image fitting a tablet. Inside I have a table, as well as a top right logo, but now I am trying to have a logo that is transparent be on the background about only half of the screen.. the logo is an eagle, but i only want half of it on the background. the eagle has to be on top of the background (transparent) but also be behind the table.. ideas? Suggestions? Code wise?

To be basic, have a background image over another background image (transparent), and only cover half on screen.

Thanks

body { width: 100%; height:100%; display: -webkit-box; display: -moz-box; display: box; text-align:center;

background:url(1xx.png);
-webkit-background-size: cover !important;
-moz-background-size: cover;
background-size: cover;
font-family: Arial, Times New Roman, sans-serif;
font-size: 20px; 
z-index:0; }  body{   display: table;     width: 100%;    } .box {
width: 75%;
height:90%;

margin-left:auto;
margin-right: auto;
margin-top:auto;
margin-bottom: auto;
 }

James Monger
  • 10,181
  • 7
  • 62
  • 98
Sergio
  • 43
  • 1
  • 1
  • 5

3 Answers3

9

There are two options, either use the CSS3 multiple backgrounds:

background-image: url(eagle.png), url(background-image.png);
background-position: left top, center top;
background-repeat: no-repeat;

or position the eagle over the background using position:Absolute;

Lost Left Stack
  • 1,932
  • 13
  • 14
0

It's hard to distinguish what you're going for without seeing code but if I were to take a stab at giving you an answer I'd say to simply set your background using the body tag and then just under it set up a div that is absolutely positioned to the top. After that your content should act as normal.

Chad
  • 492
  • 5
  • 14
0

This solution is the same as @ChadP suggested, just some code here for you to look at. There's a lot of assumptions being made on my part as you don't have a lot of code to go off of.

http://jsfiddle.net/R4KUg/

CSS

body {
    background-image: url('http://lorempixel.com/1200/1200/');
    margin: 0;
}
header {
    height: 250px;
}
#eagle {
    background: transparent url('http://lorempixel.com/600/200/') no-repeat center center;
    height: 200px;
    width: 100%;
    position: absolute;
    top: 250px;
    opacity: 0.5;
}

HTML

<div id="eagle"></div>
<div id="wrapper">
    <header>
        <h1>A header</h1>
    </header>
    <table>
        <tr>
            <td>Column One</td>
            <td>Column Two</td>
            <td>Column Three</td>
        </tr>
    </table>
</div>
hungerstar
  • 21,206
  • 6
  • 50
  • 59