Click to See Complete Forum and Search --> : Getting Images To Right Top Of Page
KDEHOFF12112
07-09-2005, 09:14 PM
How Do You Get Images To The Top Right Of A Web Page, Every Code I Have Looked At Puts It Everywhere But There.
I Have Images On Top Left, Center, Bottom Left, Bottom Right But No Matter What I Can Not Get An Image To Top Right Of Page, Please Help!!!!!
Thank You
Kdehoff
buntine
07-09-2005, 10:04 PM
Create your image element and link it to a CSS class:
<img scr="yourImage.jpg" class="top_right" alt="Some alternate text" />
Your CSS class can look like this:
img.top_right
{
position: absolute;
top: 0px;
right: 0px;
}
Regards.
Hi -
You could also use css so that it's a background image. There's a value in this shortcut version that you can play with - I'd suggest tweaking the % which are for top, left placement of the image:
div.contain{
width:750px; margin:0 auto;
background:black url("mypath/image.ext") no-repeat 0% 0%;}
Where you're listing the following values w/ just sp. betw. them -
- background color [will appear if the image doesn't / is slow-loading]
- url(if using an image) [be sure to get the right path!]
- repeat, no-repeat, repeat-x or repeat-y [for hz. & vt.]
* not shown but would go here -
- fixed or scroll [for body tag only in IE if you want a fixed bkgnd.]
- top, right, bottom, left, bottom center, center...or play with the %
[for placement of the image within its container element]
If you're not used to using internal or external styles yet, you could also try it as an inline one:
...
<body style="background:#dac581 url("image.ext") repeat-y fixed 80% 0%;">
<rest of tags>
...
Good luck,
El
BeachSide
07-15-2005, 04:01 AM
Create your image element and link it to a CSS class:
<img scr="yourImage.jpg" class="top_right" alt="Some alternate text" />
Your CSS class can look like this:
img.top_right
{
position: absolute;
top: 0px;
right: 0px;
}
Regards.
Ya but even if you do that it still won't be at the "top" of the page. There will still be a space above the image
You need to clear the margin that is up there...
html, body { margin: 0; }
shaynedominguez
07-26-2005, 11:46 PM
i have this pic that i want at the top of my page, i got that, i just want it centered and to resize automatically for every browser. How can i do that