-
[RESOLVED] Difference between "src" and "href" attributes.
Hi there guys can someone tell me the simple difference between "src" and "href" attributes??
Thanks.
-
Anchors use href, images use src.
-
SRC is used for referring an image file: src="goodpic.jpg" inside an image tag
href is used for referring a webpage: href="http://www.nameofwebpage.com" inside an anchor tag
-
Thanks for the reply.
so src is for the file location? and href is for web address?
-
src refers to image file
href refers to indicate the webpage.
-
 Originally Posted by amir786_z
Thanks for the reply.
so src is for the file location? and href is for web address?
No, both can use local or absolute (web) addresses. The difference is just formal. <a> used "href=", <img> uses "src=".
-
the src="" and href="" can b e used in many ways examples . . .
src="" used for a images example .swf .tiff .gif .png .jpg etc like so . . .
<img src="lol.png">
or you could embed a web page . . .
<embed src="http://example.com" height="500px" width="500px">
what about href used to make a link. . .
<a href="http://example.com">my site name</a>
and both used together as a clickable image. . .
<a href="http://example.com"><embed src="http://exapmle.com/lol.swf"</a>
or web page . . .
<a href="http://example.com"><embed src="http://exapmle.com" height="500px" width="500px"></a>
just use what's suitable for what you need XD
-
Thanks for the reply guys
-
Welcome Amir
Last edited by shymajones; 12-19-2012 at 11:55 AM.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks