hello,
i want to create image class like this
<img src=http://www.webdeveloper.com/forum/archive/index.php/"images/xxx.gif" /> into <img class="xxx" />
but can't find anywhere in css to specify src for img
is css can do this? like specify background-image
thanxxCan you use a div tag, specify dimensions, and put it as a background-image?
daveYou could use a javascript function to do that, in the head put:
<script language="javascript" type="text/javascript">
funtion img(name){document.write("<img src='http://www.webdeveloper.com/forum/archive/index.php/images/"+name+"' />");}
</script>
and then on your page put:
<script language="javascript" type="text/javascript">
function(xxx);
</script>
But I assume you want a quicker way of writing you img tags, so the js version kind of defeats the point because it's very long and won't work for some people.<img src=http://www.webdeveloper.com/forum/archive/index.php/"image.gif" alt="Alt text">
and
<img class="image" alt="Alt text">
Whats the difference?
SRC for image is an image attribute. Its specified in HTML, not in CSS.
Image is an HTML element, background is a style property of an element. Hence the former is in HTML while the latter is in CSS.ummm...
i want to set the img like this:
<img src=http://www.webdeveloper.com/forum/archive/index.php/"../images/smile.gif" width=xx height=xx />
so with class just like this
<img class="smile" />
actually i want to make all my html files and my forum to recognize
into <img src=http://www.webdeveloper.com/forum/archive/index.php/"../images/smile.gif" />
how to do this?
i see many forums can put and conver it to image automatically
can javascript do this?
thanxxehh this forum also turn into images
how to do that??You can use a div and add a background image to it if you don't want to use "img src" etc.
Forums replace key code like colons and brackets into smileys by parsing the code first. If the correct punctuation is found, then the code replaces it with the link to the image.
You can disable this in posts with the third tick below the box when you type in your message. Otherwise you can get smileys in code examples where you don't want them!Basically, forums like this do the following (thru some server-side script)
if (smilies are turned on)
{
replace all : ) with <img src=http://www.webdeveloper.com/forum/archive/index.php/"smilingface.gif" width="15" height="15" alt=: )">
}I could probably write a script for you that would search through a string and replace all : ) with but if I were you I'd ask this again in the js forum because you'll get a faster response.thanx lavalamp, i know script to parsing code like nkaisare said
at first i think forum can do the conversion automatically
(change all : ) into smile image)
so i want to make my html do just like that
but if the only way to do it by parsing code,
i'll use normal img tags then since i haven't made any forums for now
thanx a lot guys!
i want to create image class like this
<img src=http://www.webdeveloper.com/forum/archive/index.php/"images/xxx.gif" /> into <img class="xxx" />
but can't find anywhere in css to specify src for img
is css can do this? like specify background-image
thanxxCan you use a div tag, specify dimensions, and put it as a background-image?
daveYou could use a javascript function to do that, in the head put:
<script language="javascript" type="text/javascript">
funtion img(name){document.write("<img src='http://www.webdeveloper.com/forum/archive/index.php/images/"+name+"' />");}
</script>
and then on your page put:
<script language="javascript" type="text/javascript">
function(xxx);
</script>
But I assume you want a quicker way of writing you img tags, so the js version kind of defeats the point because it's very long and won't work for some people.<img src=http://www.webdeveloper.com/forum/archive/index.php/"image.gif" alt="Alt text">
and
<img class="image" alt="Alt text">
Whats the difference?
SRC for image is an image attribute. Its specified in HTML, not in CSS.
Image is an HTML element, background is a style property of an element. Hence the former is in HTML while the latter is in CSS.ummm...
i want to set the img like this:
<img src=http://www.webdeveloper.com/forum/archive/index.php/"../images/smile.gif" width=xx height=xx />
so with class just like this
<img class="smile" />
actually i want to make all my html files and my forum to recognize
into <img src=http://www.webdeveloper.com/forum/archive/index.php/"../images/smile.gif" />
how to do this?
i see many forums can put and conver it to image automatically
can javascript do this?
thanxxehh this forum also turn into images
how to do that??You can use a div and add a background image to it if you don't want to use "img src" etc.
Forums replace key code like colons and brackets into smileys by parsing the code first. If the correct punctuation is found, then the code replaces it with the link to the image.
You can disable this in posts with the third tick below the box when you type in your message. Otherwise you can get smileys in code examples where you don't want them!Basically, forums like this do the following (thru some server-side script)
if (smilies are turned on)
{
replace all : ) with <img src=http://www.webdeveloper.com/forum/archive/index.php/"smilingface.gif" width="15" height="15" alt=: )">
}I could probably write a script for you that would search through a string and replace all : ) with but if I were you I'd ask this again in the js forum because you'll get a faster response.thanx lavalamp, i know script to parsing code like nkaisare said
at first i think forum can do the conversion automatically
(change all : ) into smile image)
so i want to make my html do just like that
but if the only way to do it by parsing code,
i'll use normal img tags then since i haven't made any forums for now
thanx a lot guys!