CSS Background Image Positioning

Hi all,

Is it possible to position a background image to TOP (Absolute position) and RIGHT to Relative?

OR use top:-6px right  ?

Thanks
error77Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shinesh PremrajanEngineering ManagerCommented:
It depends upon to which element you have set the background image. If its block level elements like div, li or p then its possible.

If there is anything other then these let us know,

Hope this helps
0
Gurvinder Pal SinghCommented:
yes, off course

background-position:right top;

http://www.w3schools.com/css/pr_background-position.asp

0
error77Author Commented:
I'm trying this code below but unless the div is wrapper around other div's the background image won't show.

Any ideas why please?

Here are my tests ... see the text comments:

attached below


<div style="background: url(bg-image.png) no-repeat; position: absolute; right: 0; top: 37px;">This does appear but no image</div>

<div style="background: url(bg-image.png) no-repeat; position: absolute; right: 0; top: 37px;">
<div>Some content here and the image DOES appear why?</div>
</div>

Open in new window

0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Gurvinder Pal SinghCommented:
where have you used the background-position property?
0
error77Author Commented:
Both positions are right ... I need to TOP example to work but only the Bottom example works.
0
error77Author Commented:
You can see what I'm trying to do here:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_26939904.html

Sample image attached
0
Gurvinder Pal SinghCommented:
but why can't you just use the position-background property? it will make your life very simple
0
error77Author Commented:
because position top right returns relative and in that case the top would have to be -6px

Know what I mean?
 
0
Gurvinder Pal SinghCommented:
yes, you just have to absolute position that div inside the wrapper div at that position. Know what i mean?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
error77Author Commented:
Kind of working but seems to be on top of my other div's  .... I've added z-index:0; to it but no effect :o/
0
Gurvinder Pal SinghCommented:
please share your code or better the live internet link.
0
error77Author Commented:
Here is the code ... cannot share a live link as it's not live.
<div id="header">
    <div id="logo"></div>
</div>
<div style="background: url(bg-image.png) no-repeat; position: absolute; right: 0; top: 37px; width:544px; height:526px; z-index:0;"></div>
<div id="main">
 	
<br />

    <div id="content">
	
        <h1>title</h1>
        
        Content Here
    </div>
</div>

Open in new window

0
Gurvinder Pal SinghCommented:
this is not helping. Please share the screenshot
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.