Space between Div and Image tags [HTML] [SOLVED]

Alright, so I've tried virtually everything in the book, from margins to floating to block display, and nothing's worked. This is my code:

    ![zow](./ZOW.png)

    [ Home ](#)[ About ](#)[ Gallery ](#)[ Help ](#)[ Contact ](#)
    ![](./white.png)

I've tried a slew of things to no avail, though. Any help on this one?

6 Replies

What exactly are you trying to do and what's the problem?

Have you tried changing the

src="./ZOW.png"

to

src="ZOW.png"

without the leading "./"?

James

No, I have not tried changing the img src, but it'd seem irrelevant in this case. I should've put up a page of what I'm trying to accomplish, and it's now up here. I'm wanting the navigation tabs, when hovered over, to connect with the white on the bar below it, but there's an odd space in the way. Any further help on this?

Anchors, by default, are inline elements so their borders collapse differently. The simple fix is to add:

.nav a {
    display: inline-block;
}

In the couple of browsers I tested quickly, that appears to achieve the result you're going for. You can also make them 'display: block;', but then you need to float them.

-James

Ah, thank you very much irgeek, that worked perfectly! I'll keep that in mind for next time this happens.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct