dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: DHTML
Expertise: Beginner
Sep 24, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Place Image in an Absolute Position

Question:

I've been using the Microsoft ActiveX image control to place my images in absolute positions on my Web page. However, I have run into problems with this image component on some PCs. I have tried to reregister the ISCTRLS.OCX, which contains this component, but this does not help. Can you give me an example on how to place an image in an absolute position without using an explicit ActiveX image component?

Answer:

You can use a DHTML-specific technique to position the image absolutely that will work with IE 4.x and up and Navigator 4.x and up, or any other browser that supports CSS absolute positioning (CSS-P or CSS2). Create an absolutely positioned DIV or SPAN section and place the image within this section. The section, including the image, will be positioned at the location you supply in the CSS style setting. For instance, this code would position the image at 100 pixels from the left and 100 pixels from the top of the browser document:

Unfortunately, this approach won't work for any browser that doesn't support CSS Positioning (or CSS2) such as IE 3.x—the ActiveX image control did work with IE 3.x.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date