Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Graphics & Design Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-24-2004, 06:12 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default CSS Absolute positioning

I have an image that has 100px width and 123px height, I would like to have it placed permanently in the bottom right corner of the page. How can I do this with CSS Absolute positioning? I would like to use % to account for all screen resolutions. The problem is that it uses the top & left edges of the image as the point to position accordingly, so if you set the left and top style attributes to 100% it moves the image off of the bottom right corner of the screen. How can I get it to take into account the size of the image and place the bootom & right edges on the edge of the screen exactly?
Any help would be appreciated.
Thanks,
Dennis
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #2 (permalink)  
Old 01-24-2004, 06:29 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Not so!
You can use the bottom and right edges to postion absolutely as well, wclew.
But beware, when you postion 'absolutely, you take an element out of the 'flow', which means that you have to design with other properties to account for things that will then render and appear in rthe same postion in the page.

Mayhaps you can give me an example of the page to work with. I would love to teach you some posiyioning skills, and learn to use them better myself in the process.
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #3 (permalink)  
Old 01-24-2004, 06:56 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default Thanks Mik

Thanks Mik, I didn't know you could set the bottom & right. I'm not concerned about interupting the page flow, I want the image to float above everything else. I will give it a higher z-index. I will appreciate any help you'll give. I will send you the page later, I have to finish the image first.
Thanks again,
Dennis
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #4 (permalink)  
Old 01-24-2004, 07:10 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Okay,wclew.
I learned how to use CSS from the links on this pagr - it is the secret to my success!

http://glish.com/css/

here is about box positioning
http://www.thenoodleincident.com/tut...ment/text.html

and finally: ATTENTION ALL CSS DESIGNERS!

http://www.mezzoblue.com/css/cribsheet/

By going through the steps on this page, a person can learn CSS and build a page, learning the order of approach.

I know of one other page that is very, very good for ALL the box/positioning scenario's, it is much easier to understand than anything above, but I can't find it at the moment.
I will get it and be back for you, wclew.

Oops hahaha!
Weposted at the same time.
I see you have what you need, and you do not have to worry about the z-index. If it is positioned absolutely, it will stay 'on top'.
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #5 (permalink)  
Old 01-24-2004, 07:43 PM
ranjan's Avatar
WebProWorld Pro
 

Join Date: Sep 2003
Location: CA
Posts: 174
ranjan RepRank 0
Default Style your body instead

Use the image as the background image of the body

body {
background-image:file_with_path.jpg);
background-position: right bottom;
background-repeat: no-repeat;
}
__________________
ranjan | Macromedia Certified Dreamweaver MX Developer
http://www.dreamlettes.net - a dreamweaver resource
http://www.ranjan.ws - got blog?
http://www.total-impact.com - a web design community
Reply With Quote
  #6 (permalink)  
Old 01-25-2004, 05:59 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default More help

OK, guys. I tried both suggestions and have gotten mixed results. How do I get the image to stay in the bottom right corner as you scroll the page?
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #7 (permalink)  
Old 01-25-2004, 06:07 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

What bromser?
But if you use ' position:fixed ' it will stay there and everything will scrool over it
body {
background-image:file_with_path.jpg);
background-position: right bottom fixed;
background-repeat: no-repeat;

}


Also, check the last link that I posted in the other thread here, por "Positioning"

Here is a tutorial all about positioning: http://www.brainjar.com/css/positioning/
But it notes that IE6 does not support fixed positioning. That is news to me.

Here is the other link I provided, as ranjan says, "At the risk of being redundant" (love it :o)
http://www.d.umn.edu/itss/support/Tr...esign/css.html
It is a big links page to every kind of CSS tutorial, there is a 'positioning' category, etc. It is fantastic!
Come back to this topic and post if it still isn't working for you, I still have some suggestions to try next.
Just be sure to give us the 'DTD' that you have in the top of your 'head', ie.-before the first <html> tag...
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #8 (permalink)  
Old 01-25-2004, 07:20 PM
WebProWorld Member
 

Join Date: Jan 2004
Location: Colorado
Posts: 59
disciple RepRank 0
Default

#bottomright {
position: absolute;
width:100px;
bottom: 0px;
right: 0px;
}

This will work as long as you don't have to scroll the page. If you have to scroll the page then I believe that you will need a little javascript to keep it in place.
__________________
Christian Web Hosting
Digitals
Reply With Quote
  #9 (permalink)  
Old 01-25-2004, 07:55 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default stay put

Thanks guys.

Quote:
Originally Posted by disciple
#bottomright {
position: absolute;
width:100px;
bottom: 0px;
right: 0px;
}

This will work as long as you don't have to scroll the page. If you have to scroll the page then I believe that you will need a little javascript to keep it in place.
I tried this before and it does scroll. How can I keep from scrolling?
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #10 (permalink)  
Old 01-25-2004, 07:59 PM
WebProWorld Member
 

Join Date: Jan 2004
Location: Colorado
Posts: 59
disciple RepRank 0
Default

body{
font-family: Trebuchet MS,Arial,sans-serif;
color: #333333;
margin: 0px;
padding: 0px;
background: fixed url(picture.gif) bottom right no-repeat;
}
__________________
Christian Web Hosting
Digitals
Reply With Quote
  #11 (permalink)  
Old 01-25-2004, 08:01 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default stay on top

Quote:
Originally Posted by mikmik
What bromser?
But if you use ' position:fixed ' it will stay there and everything will scrool over it
body {
background-image:file_with_path.jpg);
background-position: right bottom fixed;
background-repeat: no-repeat;

}
I'm having troubl getting this style to work, I'm using IE 6.0. Can I make this look like it's above everything else?

Quote:
Originally Posted by mikmik
Come back to this topic and post if it still isn't working for you, I still have some suggestions to try next.
Just be sure to give us the 'DTD' that you have in the top of your 'head', ie.-before the first <html> tag...
Belive it or not, I don't have a DTD line. I'm using an old FP version that is hacking my CSS so I'm just using notepad right now.
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #12 (permalink)  
Old 01-25-2004, 08:04 PM
WebProWorld Member
 

Join Date: Jan 2004
Location: Colorado
Posts: 59
disciple RepRank 0
Default

body{
font-family: Trebuchet MS,Arial,sans-serif;
color: #333333;
margin: 0px;
padding: 0px;
background: fixed url(picture.gif) bottom right no-repeat;
}

This should work with or without a dtd.
__________________
Christian Web Hosting
Digitals
Reply With Quote
  #13 (permalink)  
Old 01-25-2004, 08:13 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default doesn't work

Quote:
Originally Posted by disciple
body{
font-family: Trebuchet MS,Arial,sans-serif;
color: #333333;
margin: 0px;
padding: 0px;
background: fixed url(picture.gif) bottom right no-repeat;
}

This should work with or without a dtd.
I can't get this to work either. I wonder if it is my browser.
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #14 (permalink)  
Old 01-25-2004, 08:16 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default Oops

Oops, never mind. I had a typo that caused the problem. It works great. Thank you!
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #15 (permalink)  
Old 01-25-2004, 08:21 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default Now

Now, is there a way to also get an image to stay in the top left corner while it scrolls? Have both stay put?
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #16 (permalink)  
Old 01-25-2004, 08:36 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

body{
font-family: Trebuchet MS,Arial,sans-serif;
color: #333333;
margin: 0px;
padding: 0px;
background: fixed url(picture.gif) bottom right no-repeat;
}
Then make another one like this!
body{ background: fixed url(picture.gif) top left no-repeat;
} (Now you are a css 'hacker' lol)
Quote:
Belive it or not, I don't have a DTD line. I'm using an old FP version that is hacking my CSS so I'm just using notepad right now.
It probably means that your page will render id 'standard html 4.01 transitional if you don't have a DTD, you naughty guy LOL
You are just a troublemaker LOL
The reason I asked is that it can affect how the browser 'renders' the code.
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #17 (permalink)  
Old 01-25-2004, 08:40 PM
WebProWorld Member
 

Join Date: Jan 2004
Location: Colorado
Posts: 59
disciple RepRank 0
Default

Are you are trying to get one in the top left AND one in the bottom and not have either one of them scroll with the browser window? If so I don't think it's possible with just css.

But I have been wrong before. :-)
__________________
Christian Web Hosting
Digitals
Reply With Quote
  #18 (permalink)  
Old 01-25-2004, 11:45 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default tried

Quote:
Originally Posted by mikmik
body{
font-family: Trebuchet MS,Arial,sans-serif;
color: #333333;
margin: 0px;
padding: 0px;
background: fixed url(picture.gif) bottom right no-repeat;
}
Then make another one like this!
body{ background: fixed url(picture.gif) top left no-repeat;
} (Now you are a css 'hacker' lol)
I tried to do this and it didn't work. It just gave me whichever one I listed last. I tried having 2 body tags to go with them but that didn't help either. Any more ideas?

Quote:
Originally Posted by mikmik
You are just a troublemaker LOL
You got that right, buddy! ;o)
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #19 (permalink)  
Old 01-25-2004, 11:47 PM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default

Quote:
Originally Posted by disciple
Are you are trying to get one in the top left AND one in the bottom and not have either one of them scroll with the browser window?
Yes, that's exactly what I want. Any ideas?
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #20 (permalink)  
Old 01-26-2004, 12:23 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Could you try this:

html{ background: fixed url(picture.gif) top left no-repeat;
}

body{
font-family: Trebuchet MS,Arial,sans-serif;
color: #333333;
margin: 0px;
padding: 0px;
background: fixed url(picture.gif) bottom right no-repeat;
}
Html is actually the 'root' element of the browser window, and this is a handy way to do a lot of basic formatting.
I hope this works. Just remember that the 'body' will inhereit from 'html', and may be a reason if this doesnt work.

We can also try individual div's with transparency too if this does not co-operate.
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #21 (permalink)  
Old 01-26-2004, 12:27 AM
wclew's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: Iowa
Posts: 196
wclew RepRank 0
Default

Quote:
Originally Posted by mikmik
Could you try this:

html{ background: fixed url(picture.gif) top left no-repeat;
}

body{
font-family: Trebuchet MS,Arial,sans-serif;
color: #333333;
margin: 0px;
padding: 0px;
background: fixed url(picture.gif) bottom right no-repeat;
}
Nope, that didn't work either. I just got the body part to show up.
__________________
"Go sell crazy someplace else, lady! We're all stocked up here."
- Jack Nicholson in "As Good As It Gets"

Affordable Iowa Custom Web Design
Reply With Quote
  #22 (permalink)  
Old 01-26-2004, 02:54 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

wclew wrote
Quote:
Nope, that didn't work either. I just got the body part to show up.
Dang!
Make sure that you don't have a background color specified in your 'body' or it will cover up anything that is 'under' it ie. 'html'. Put bg-color in there (html).
I am going to make a page for myself ro experiment on, I have twice now, found ou