Help - Search - Members - Calendar
Full Version: About src attribute.
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
jaykcon
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?
pandy
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.
jaykcon
What is the difference between "relative path" and "absolute path" when I insert an image using html?
Thanks
pandy
Threads merged.
pandy
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 .
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.