Skip to content

ara pehlivanian

Web Standards, Web Culture, Web Everything.™

Gimme a little base

Recently I’ve found myself in situations where I need to mess around with HTML documents for sites that I haven’t previously worked on. This means that I don’t have any of the document’s dependancies locally. Plus, some of these pages are dynamically generated, requiring that I install the appropriate environment on my machine in order to work with the file.

If you just want to play around with the HTML and you don’t want to go through all the hassle of setting up environments and copying over files here’s what you do:

  1. Copy the source of the page you want to edit into a local .html file.
  2. Insert the <base href="" /> tag into the document <head> with the original domain in the href attribute.

That’s it. Now when you view the local HTML file, all of the images, CSS links and so on will work.

Sphere: Related Content

  • Comments closed

Buy my book

The Art & Science of JavaScript / SitePoint
The Art & Science of JavaScript

Advertisement

Firebug - Web Development Evolved

Advertisement

Comments are closed.

Sorry, the comment form is closed at this time.

Skip to navigation

More stuff by Ara elsewhere on the web

    Snook Approved!

    © 2005-2008, Ara Pehlivanian.

    Stock photography courtesy stock.xchng. This site uses Akismet to catch spam (55,294 caught since May 2006) is hosted by DreamHost and powered by WordPress.