Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Make an image move w/ a div
Old 02-25-2006, 10:27 PM Make an image move w/ a div
Novice Talker

Posts: 10
Trades: 0
Hi everyone,

Again, I am fairly new to CSS. Vangogh helped me with my previous problem, but now I have a new dilemma. I have a page that's 775px wide that is centered in the browser window. I have an image that I want to be at the upper right corner of the 775px div, but not really inside of it--rather attached sort of to the right corner.

My problem is that when resizing the browser window to something very wide, the image moves to the left and covers up the text within the div. What I want is the image to stay fixed to the right corner of the div no matter how big the window gets.

Here's the page in question: http://www.thegrizshop.com and the pesky image is the grizzly bear on the upper right.

The stylesheet is http://www.thegrizshop.com/griz_stylesheet.css

Any advice would be appreciated. I tried a number of things (fixed positioning, relative, etc.) and can't seem to figure out what it should be. Positioning baffles me a bit.

Lynn
lynnp08 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-26-2006, 12:17 AM Re: Make an image move w/ a div
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Lynn I think the problem is in this code in the html:

HTML Code:
<div style="position:absolute; top:0px;left:700px;height:auto;z-index:2;">
<div id="grizzly"> <img src="http://www.webmaster-talk.com/images/griz7.gif"> </div>
     

  </div>
You shouldn't need the div with the style around the div with the imag. In fact you don't actually need either div. You can have the id on the img tag like:

<img id="grizzly" src="http://www.webmaster-talk.com/images/griz7.gif" />

Then for the css I would add position:relative on div#page and for img#grizzly you might have something like:

img#grizzly {position:relative; top:-20px; right:-20px}

I think that will work. I'm guessing on the number of px, but I wanted you to see you could use negative px which in this case will push the image of the grizzly up and to the right.

Like I said I think this will work. I didn't look through all your code thoroughly so it's always possible what I'm suggesting will throw a few other things off. If it doesn't work I'll take a closer look at the code and see what I can come up with.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by vangogh; 02-26-2006 at 12:39 AM..
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 02-26-2006, 12:51 AM Re: Make an image move w/ a div
Novice Talker

Posts: 10
Trades: 0
Vangogh,

Quite possibly, you might be a genius! That worked like a charm. I hope to someday understand this positioning thing a bit better, although I am leaps and bounds ahead of where I was a month ago.

Thanks again for your wonderful help!

Lynn
lynnp08 is offline
Reply With Quote
View Public Profile
 
Old 02-26-2006, 02:11 PM Re: Make an image move w/ a div
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Glad I could help and thanks for the compliment. The site's looking good and you know alot more about positioning than you think. It just takes some practice. With each new site you get a little more comfortable with it.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Make an image move w/ a div
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19588 seconds with 12 queries