Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Links to images


  • Please log in to reply
3 replies to this topic

#1 JUICYboy

JUICYboy

  • Members
  • 537 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Anaheim, Ca
  • Local time:08:30 AM

Posted 23 October 2011 - 09:59 PM

Hello...

I am working on a website layout and the question came out...

When referencing images on a website <img src="" alt="My Image">

is it better to reference a image from the begging of the

url(<img src="http://www.website.com/images/myimage.png" alt="my image" />)?

or

should we reference it from with in the server directory of that website(<img src="images/myimage.png" alt="my image" />).

I have seen the page sources of news and Bleeping Computer website and it seems that it is best to reference it from the url.

I just would like to get a second view from more experienced web developers!

Thank-you :busy:

BC AdBot (Login to Remove)

 


#2 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:11:30 PM

Posted 23 October 2011 - 11:24 PM

I tend to link the server folder in pages but use the full path if it's in an external css file or something similar.

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#3 NpaMA

NpaMA

  • Members
  • 635 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Memphis, TN
  • Local time:08:30 AM

Posted 24 October 2011 - 12:58 AM

It's really up to you. I'd say doing it via folder (ex: <img src="images/file.jpg">) would be better incase that domain ever changes. Or perhaps you change layouts on your site, you can still navigate the files locally or through a new URL without updating a ton of things in HTML codes.

#4 JUICYboy

JUICYboy
  • Topic Starter

  • Members
  • 537 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Anaheim, Ca
  • Local time:08:30 AM

Posted 24 October 2011 - 08:36 PM

Thank-you

Yea I was just trying to see which one is better or at least which should be the recommended :thumbup2: way.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users