Base in HTML

Posted on 2012-09-22
Last Modified: 2012-10-16

Can we specify a folder path instead of a URL?

Can the following work?

<base href="/images" />                //or this should be "" only

<img src="house.jpg" alt="This is my house"/>

Question by:JRawabi
    LVL 58

    Accepted Solution

    You can but IE doesn't like it - which makes it pointless doing it that way.
    LVL 11

    Expert Comment

    by:Amar Bardoliwala
    Hello jrawabt,

    it should work.

    Please look at following link to learn about absolute and relative paths.

    Hope this will help you.

    Thank you.

    Amar Bardoliwala
    LVL 50

    Expert Comment

    by:Julian Hansen
    To clarify your question

    Are you asking if the base ref can include a folder path or only a domain i.e. the following is valid

    If you mean just


    Then not sure what the objective is - you are trying to set a fixed base url to a relative path - why not just specify base ref as

    I think you need to maybe give more information on what you are trying to achieve.

    Author Comment


    Thanks for the reply.

    Just local folder like /images

    I am trying to fix a path not a url. Is that possible?


    Author Comment


    See my comment above. I want to use the base tag and use a local path not a url.

    <base href="/images" />  not a domain name.
    LVL 58

    Expert Comment

    As I said, it will not work in IE - you have to use the full url.

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
    This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
    In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
    In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now