Image Positioning

Discussion in 'ASP .Net' started by Jerry Camel, Oct 11, 2005.

  1. Jerry Camel

    Jerry Camel Guest

    I'm trying to create a simple menu bar across the top of the page. It's
    basically just a bunch of images stacked left to right. But the images
    don't touch each other as they should for a seamless presentation. Why is
    ASP (or IE or Visual Studio) putting some spacing between the images? And
    how do Iget rid of it? Thanks.

    Jerry Camel, Oct 11, 2005
    1. Advertisements

  2. How are you laying them out, with tables or CSS?
    Peter Rilling, Oct 11, 2005
    1. Advertisements

  3. Jerry Camel

    WJ Guest

    To achieve this technique, you will need to come up with a one single image
    across the page, then assign "hot-spots" on the image. I know Front page is
    famous for this trick.

    WJ, Oct 12, 2005
  4. Jerry Camel

    mszanto Guest

    Thats because each line break that separates your image tags in your
    html code causes a space to be inserted. For example:

    You have a couple of options:
    1. You can put all the html code for your images on one line:
    2. If it doesn't read well then you can do something like the
    In this case the line break doesn't insert a space because its inside
    the tag.

    3. You can embed your images inside a table (my preference).
    to be replaced with spaces. Its a behavior of the browser's
    implementation of HTML that you have to live with.

    mszanto, Oct 12, 2005
  5. Jerry Camel

    Jerry Camel Guest

    That worked. Now, how do I get Visual Studio to stop screwing the my
    formatting? I turned off the options for applying automatic formating, but
    it still keeps messing with the way I format my HTML...


    Jerry Camel, Oct 12, 2005
  6. Jerry Camel

    mszanto Guest

    Unfortunately, you're stuck with this behavior until the next release
    of VS due out soon. At least that's what I recall.

    Hindsight being 20/20, I'm kind of glad this problem exists because it
    forced me to abandon the Designer and to rely exclusively upon my HTML
    coding skills. It made me a better developer as a result.

    If you must rely upon the Designer, then you will need to use the
    <table> work-around. Just remember to set your cellpadding and
    cellspacing attributes to 0.

    mszanto, Oct 12, 2005
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.