PDA

View Full Version : (help) Webstandard - creating new html tags



Legolax
13 Nov 2009, 07:40 AM
Hello eveyone!

i'am having a problem while creating a new html element,

i want to create this tag: <fmProd> - this going to be a tag that will load an img from the database as an background img with links.

code example:

<fmProd style="background-image:url(Img/fotoEmpresa.jpg); cursor:pointer" onClick="location.href='index.asp'"></fmProd>

and the CSS tag declarition:

fmProd { width:329px; height:102px; background-color:#CCCCCC; margin-top:2px; float:left; background-position:center; }

well, it works fine for Firefox and Chrome, but i got a problem in IE, the browser cant read the new tag, and it dont show the image.

some one know why the IE cant render this new tag??
its my first time creating a new element.

and sorry for the bad english =x

Wickham
13 Nov 2009, 01:30 PM
You can't invent a new element but you can create an id or class:-
HTML markup:-

<div id="fmProd" style="background-image:url(Img/fotoEmpresa.jpg); cursor: pointer;" onClick="location.href='index.asp'"></div>

CSS

#fmProd { width:329px; height:102px; background-color:#CCCCCC; margin-top:2px; float:left; background-position:center; }

You could then put the background-image and cursor styles inside the CSS style instead of inside the markup.