set root folder

F

Fredo Vincentis

I can remember once reading that there was a way to set a "root folder" (or
something similar) for my HTML. So meaning: the browser automatically
searches in one particular folder for my files, without me having to specify
that folder in every src attribute.

Does anybody know what I am talking about and can refresh my memory on how
to achieve this?

Thanks!
 
R

rf

Fredo Vincentis said:
I can remember once reading that there was a way to set a "root folder" (or
something similar) for my HTML. So meaning: the browser automatically
searches in one particular folder for my files, without me having to specify
that folder in every src attribute.

Does anybody know what I am talking about and can refresh my memory on how
to achieve this?

The <base> element.

http://www.w3.org/TR/html4/struct/links.html#h-12.4

Cheers
Richard.
 
R

rf

Fredo Vincentis said:
Yeah! that's it. Thanks!

Just a thought: You are not hardcoding the absolute path, are you? This is
the usual reason for using a base element.

Bad: src="example.com/images/picture.jpeg"
Good: src="images/picture.jpeg"

Cheers
Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top