The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> About src attribute.
jaykcon
post Sep 10 2009, 10:41 PM
Post #1





Group: Members
Posts: 8
Joined: 17-August 09
Member No.: 9,459



I have a confusion with the src attribute. When I insert images in my web site using html, what is more correct with the src attribute: to write the relative location of the image on the root directory or write the URL address of that image? Which is the real difference?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies(1 - 4)
pandy
post Sep 10 2009, 11:24 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,403
Joined: 9-August 06
Member No.: 6



Technically there is no difference. The browser will resolve a relative URL to the full URL anyway.

I think few people use the full URL though. Relative or root relative URLs are more usual. Use what you find most handy.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jaykcon
post Sep 14 2009, 10:29 AM
Post #3





Group: Members
Posts: 8
Joined: 17-August 09
Member No.: 9,459



What is the difference between "relative path" and "absolute path" when I insert an image using html?
Thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 14 2009, 11:48 AM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,403
Joined: 9-August 06
Member No.: 6



Threads merged.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 14 2009, 11:48 AM
Post #5


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,403
Joined: 9-August 06
Member No.: 6



QUOTE(jaykcon @ Sep 14 2009, 05:29 PM) *

What is the difference between "relative path" and "absolute path" when I insert an image using html?


It's URL, not path. Typically path means system path, as c:\blah\blah.... (and corresponding on other OSes than Windows). URLs begin with http:// or resolves to URLs that begin with http:// .


Also see http://htmlhelp.com/faq/html/basics.html#relative-url .
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 20th October 2019 - 07:30 AM