Image Positioning

J

Jerry Camel

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
 
W

WJ

Jerry Camel said:
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.

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.

John
 
M

mszanto

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

You have a couple of options:
1. You can put all the html code for your images on one line:
<img><img>
2. If it doesn't read well then you can do something like the
following:
<img
or
<img><
img>
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).
<table>
<tr>
<td><img></td>
<td><img></td>
</tr>
From what I remember from the W3C specs, line breaks are not supposed
to be replaced with spaces. Its a behavior of the browser's
implementation of HTML that you have to live with.


mike
 
J

Jerry Camel

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...

Thanks.

Jerry
 
M

mszanto

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.

mike
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top