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?
 
Gurvinder Pal SinghConnect With a Mentor Commented:
yes, you just have to absolute position that div inside the wrapper div at that position. Know what i mean?
0
 
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
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
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
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.