Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to center images and objects???

Status
Not open for further replies.

falled

Programmer
Nov 3, 2006
47
ES
Hi people,

I'm bulding a web and I'd like to design it for many resolutions as possible.

My first problem is that I want to load an Image as the web loads and the position depends on the resolution because I want to put it on the middle

any idea ????

Thank you all for your time

Sorry for my bad writting!!!!
 
It depends on how you want to place he image? Is it a standalone image, will it be a background? etc..

Look into CSS and alignment.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Is a standalone image, this is the problem

May be with javascript? I don't know how

Thank you for answer me
 
I know iF I put <center> before the object/image I can center it horizaontally but how can I do it vertically?????
 
I would set it as a background in a div that fills the browser window.

That way you have more control over it, and can make the rest of the website load over it.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
This is a good Idea but what if is an object?

And not all the browsers supports layers

But thank you for your answer
 
Almost all current browsers support DIV's and CSS. the ones that don't are such as small percentage its almost pointless to develop for them.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
There's no way to center an object with a all-sipported language? I mean
object.x.postion = browser.width / 2 - object.witdh / 2

That would be great xD, but I can imagine that don't exist
 
u can position the layer with respect to the left top corner of the browser...

:--------------------------------------:
fugitive.gif


All around in my home town,
They tryin' to track me down...
 
You could do it with JavaScript, but that would assume that your users have JavaScript enabled (not always true).
What else is going to be on the page with the graphic? I'd go with vacunita's background suggestion depending on your other elements...

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Thank you for your answers I'll try the layers first.

Happy new year!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top