WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > Placing an image to the left of a Div?

Reply
  Thread Tools Display Modes
Old 11th July 12, 08:26 AM   #1
Pinktober
WLC Member
 
Pinktober's Avatar
 
Join Date: Jul 2012
Location: Big Apple
Posts: 7
Default Placing an image to the left of a Div?

Float property not working. I'm using float alone. I wasn't sure about setting margins/padding without knowing if it's necessary using float and in what manner.


The Div I have is in the center of the page and static. There is about 500px of free space between the div and the background page. In that free space, I want an image.

Placing the image within the div doesn't allow me to move it outside the div's borders as far as I know.

I'd like to know how to align an image to the left of a div.

All help appreciated.
Pinktober is offline   Reply With Quote
Old 11th July 12, 12:19 PM   #2
chrishirst
Banned
 
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
Default Re: Placing an image to the left of a Div?

set it to float: left;

To have it display "outside" push it over the parent element outer edge with position: relative, a negative left property and a higher z-index.
chrishirst is offline   Reply With Quote
Old 11th July 12, 08:27 PM   #3
Pinktober
WLC Member
 
Pinktober's Avatar
 
Join Date: Jul 2012
Location: Big Apple
Posts: 7
Default Re: Placing an image to the left of a Div?

Code:
<IMG STYLE="position: relative; LEFT:-300px; float: Left; z-index:300; WIDTH:384px; HEIGHT:625px" SRC="http://img232.imageshack.us/img232/9020/sidebarj.png">

Did what was asked. Made the image relative with a negative left property.
Set it to float left with a high z index.

The result?

The image still says within the div and does not float outside the div. It pushes all text within the div to the right while it floats left.

What am I doing wrong? Here's a photo of what's happening.

http://img338.imageshack.us/img338/542/whatswrong.jpg
Pinktober is offline   Reply With Quote
Old 17th July 12, 03:37 AM   #4
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,141
Default Re: Placing an image to the left of a Div?

Give me a live link please, and I'll see if I can find the issue.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:25 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyright© 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.