You are not logged in.

#1 2006-10-26 03:20:55

Eliatamby
Member
Registered: 2005-05-06
Posts: 80

Positioning images by co-ordinates in pure HTML 4.1

I'm very new and raw to HTML, but know the basics of image manipulation (i.e. align center) etc.

I'm wondering though if it's possible to specifiy an icon position by co-ordinates in a frame/window using pure HTML (ie no CSS or javascripting magic). 

E.g., I have a map of europe as a background, and I have button icons used to represent the cities.  Using cgi i have a program that decides which cities I want to show icons for.  I would like to then be able to display those icons in their positions on the map.

Is this possible?  I know there are co-ordinate positioning for image maps, but I haven't read anything about this...

Offline

#2 2006-10-26 03:55:47

aquila_deus
Member
From: Taipei
Registered: 2005-07-02
Posts: 348
Website

Re: Positioning images by co-ordinates in pure HTML 4.1

CSS:

position: absolute;
left: 100px;
top: 50px;

Offline

#3 2006-10-26 05:14:54

Eliatamby
Member
Registered: 2005-05-06
Posts: 80

Re: Positioning images by co-ordinates in pure HTML 4.1

thanks, is there away that doesn't use CSS?  Can I do it with layers?  The spec of the thing I'm working on for some reason says no CSS, even though it seems very tied into the w3c html 4.01 spec

Offline

#4 2006-10-26 05:25:36

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Positioning images by co-ordinates in pure HTML 4.1

No CSS in this day and age is a sign of pure stupidity somewhere in the chain of command. You can probably use inline styles and they'll never know its CSS.

If its a homework assignment, they probably want you to use an areamap instead of absolute positioning. My guess is you should use one anyway, since absolute positioning is going to utterly kill your resolution independence.

Dusty

Offline

#5 2006-10-26 12:02:25

aquila_deus
Member
From: Taipei
Registered: 2005-07-02
Posts: 348
Website

Re: Positioning images by co-ordinates in pure HTML 4.1

Eliatamby wrote:

thanks, is there away that doesn't use CSS?  Can I do it with layers?  The spec of the thing I'm working on for some reason says no CSS, even though it seems very tied into the w3c html 4.01 spec

The absolute positioning styles are supported by all the web browsers I know (including IE 6). You could use style="..." attribute in tags to avoid writing css file, but it would mean a lot of duplicated code.

The one who set this spec is obviously a noob who doesn't understand what CSS truely means. You have to better to convince him that he should define a list of browsers that this website will be compatible with, instead of making stupid rules like "no css".

PS: With layers you'd just have to use different styles, and it won't work with IE wink

Offline

#6 2006-10-26 12:05:35

aquila_deus
Member
From: Taipei
Registered: 2005-07-02
Posts: 348
Website

Re: Positioning images by co-ordinates in pure HTML 4.1

Dusty wrote:

If its a homework assignment, they probably want you to use an areamap instead of absolute positioning. My guess is you should use one anyway, since absolute positioning is going to utterly kill your resolution independence.

Not necessarily, he can still use pt or em for x/y coordinates. Or he could develop a high-level layout system like those used in GUI toolkits, by javascript and absolute positioning wink

Offline

#7 2006-10-26 13:22:08

torindan2
Member
Registered: 2004-07-15
Posts: 74

Re: Positioning images by co-ordinates in pure HTML 4.1

I can think of few scenarios (like mobile platform) which trully can't do correct rendering for everything you need.

Maybe the solution is to generate on server the image to be displayed (you are using CGI anyway) so if you have imagemagick on server you can use something like convert with -draw parameter,
or if your CGI is Perl, then there is Image:Magick perl module.

After you generate the image, if you need a sensitive map there is <MAP> tag in html (see a usage example here http://w3schools.com/tags/tag_map.asp)

So.. there is a solution for (almost) any problem.

Offline

#8 2006-10-26 13:24:33

fk
Member
From: Germany
Registered: 2006-04-29
Posts: 524

Re: Positioning images by co-ordinates in pure HTML 4.1

by the way : absolut positioning is the worst idea you can do .


Have you tried to turn it off and on again?

Offline

#9 2006-10-27 10:22:38

Eliatamby
Member
Registered: 2005-05-06
Posts: 80

Re: Positioning images by co-ordinates in pure HTML 4.1

thanks guys for all the suggestions and info.  Man, this whole HTML/XHTML/web browser features thing really seems daunting. 

The idea behind this assignment (it's the final part of a long long one), is that the total noobs can use basic HTML and not get completely owned by people with extensive web-devs using fancy css stuff.  You see part of this thing is aesthetic ("beauty") and it is partly competitive.  The levels of html experience in this course (about C ,data structures, and algorithms) varies, and I think to make the playing field somewhat level in this respect.  I've seen some pretty nice stuff done using CSS, but that's far beyond my ability to master in two weeks on my own, whereas there are guys in my course who have been operating their own web design businesses since the end of high school.   In fact I think last week was the first time I ever wrote any html using a text editor.  I'm sure when I was 13 I had a geocities site with nothing on it that I quickly lost interest in. 

Anyway, I spoke to my tutor today and he agreed that the no-CSS limitation is not realistic nor conducive to good web design/code practice, but I should just make do for the assingment.  Once it's handed in I will start to learn html the proper way.

I looked at image maps but I'm not interested in making the things clickable. I like the idea of using image magick actually, however I still don't quite understand the thing with absolute positioning.  Why exactly is this a problem?  Doesn't the resolution issue relate to anything that is located by co-ordinates on a page, relatively or absolutely?

Offline

Board footer

Powered by FluxBB