Jump to content

HTML work-around for IE


danimal5100

Recommended Posts

so I'm attempting to place certain images on a page in specific areas. I used CSS to place them using

Link{	position absolute; 			   left:1px;		top:350px; }

and this worked fine in Firefox but IE doesn't recognize this particular feature of CSS, anyone have any ideas for a work-around that would allow me to position objects so they'll appear the same on IE as they do in FF?

Link to post
Share on other sites

IE is a pile of crap, so you need to create another style sheet for IE and just mess around with your numbers until it displays correctly.Use a conditional comment to tell IE what style sheet to use along with your other style sheet.

<!--[if IE]><link rel="stylesheet" type="text/css" media="all" href="style_IE.css" /><![endif]-->

Link to post
Share on other sites

it just doesn't adjust the images at all. here's the code for the main page:

<html><title>Digipix</title><head><link rel="stylesheet" type="text/css" href="index.css" /></head><body><critterLink><a href = "Critters/page_one.html"><img src = "B_CRITTER_LINK.jpg"/></a></critterLink><floralLink><a href = ""><img src = "C_FLORALAND_LINK.jpg" /></a></floralLink> <farOutLink><a href = ""><img src = "B_FAROUT_LINK.jpg" /></a></farOutLink> </body></html>

and here's my CSS stylesheet.

body { background-image: url("A-HOMEPAGE.jpg"); 	   background-repeat: no-repeat;	 }critterLink{		position:absolute;		left:1px;		top:350px;	   }floralLink{		position:absolute;		left:750px;		top:325px;	  }farOutLink{		position:absolute;		left:570px;		top:150px;	  }

Link to post
Share on other sites

Well, I'm not sure if you are just shortening the code for us or not, but don't forget to put "div" in there.So:HTML-

<html><title>Digipix</title><head><link rel="stylesheet" type="text/css" href="index.css" /></head><body><div id="critterLink"><a href = "Critters/page_one.html"><img src = "B_CRITTER_LINK.jpg"/></a></div><div id="floralLink"><a href = ""><img src = "C_FLORALAND_LINK.jpg" /></a></div><div id="farOutLink"><a href = ""><img src = "B_FAROUT_LINK.jpg" /></a></div></body></html>

CSS-

body { background-image: url("A-HOMEPAGE.jpg");	   background-repeat: no-repeat;	 }#critterLink{		position:absolute;		left:1px;		top:350px;	   }#floralLink{		position:absolute;		left:750px;		top:325px;	  }#farOutLink{		position:absolute;		left:570px;		top:150px;	  }

Try that and see what happens.I'll bust on IE any chance I get, so don't take my attacks at IE seriously. :)

Link to post
Share on other sites

yep, I bust on IE often as well :)thanks that fixed it! I've just been getting into website design the last 2 months or so and have been getting most (if not all) of my information over at www.w3schools.com and they've never once had an example where I had to say

div id = "foo"

so I just figured everywhere someone said "this part of CSS is compatible with IE" I figured they were lieing lol. I do have another problem though, I'm also trying to display an image on another page which IE isn't allowing me to load for some reason. it's a standard jpg and here's the code (don't think I'm a crappy programmer b/c of the needless use of variables, I'm making this for a client who wants a very easily updatable website...she doesn't have the time nor the patience to learn HTML so I've been using variables to take store the pathnames to pictures)bah, sorry for being long-winded, here's the code:

<html><head><style type = "text/css">text {color: white}</style></head><script language = "javascript">var background = "brickwall.jpg";var pics = "1_pageone.jpg";</script><script language = "javascript">document.write("<body background = " + background + ">");document.write("<center>");document.write("<img src = " + pics + "/>");</script><script language = "javascript">document.write("</center>");document.write("</body>");</script></html>

for some odd reason the image will load fine into FF but IE just blows up at it, displaying the red-x of dooooomcan IE handle javascript?

Link to post
Share on other sites

with this line

document.write("<body background = " + background + ">");

if your variable had as value "image.jpg" you are writting this

<body background = image.jpg>

and it is not correct. '"' are missing! see hereanyway i didn't test if the problem stay solved but how i said is the right way.I supose that you will have some problems because if de visitor had javascript disabled nothing will be written.Why not use xml or other system to configure the page?

Link to post
Share on other sites

About the image not showing up, there can be various reasons for that. As I like to explain that :)IE does not load any images after a link was clicked. Then it displays a blank image with a red X in the upper left corner. Or just nothing. :)If the javascript that calls that image defined a new Image() object, then that could solve your problem, as an object, IE would load the image, but this is all I heard about it, I don't exactly know myself how to do that.

Link to post
Share on other sites

well since this is long gone..but I like dan..(i am also a dan..so i think i may understand the explaining :)) need to explain coz i think i get it..As PauloASilva said..you need to have quote marks..which you didnt have because it was just...document.write("<img src="+image+" />");so it would be <img src=pic.jpg> with no quotation marks..so you need to make use of the different quotation marks out there...and write like so.document.write("<img src=' "+image+" ' />" (space between quotation marks so you can see easier)so that it writes out as :<img src='pic.jpg' /> or swap the double quotations for single ones etc..Thankyou for reading (if you did..:))

Link to post
Share on other sites

Well I don't understand much of what you said about me :) But I understand about the quotes.Me myself would do like this:document.write("<img src=\"" + image + "\">");For a simple reason. If all strings in the language are double quoted, and I use PHP for that, I can implement variables directly in the string as PHP can only understand variables in double quoted strings. BUT, you can't double quote inside duoble quoted strings, so I use backslashes (to escape) for the inner ones. JavaScript can't ofcourse use variables inside strings that PHP can, but I program in the same syntax for neat reasons, and habituation.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...