Kayote
Kayote

Reputation: 15617

a href tag getting 0 height inspite of the attribute being declared

All,

On my website www.coutallure.com

There is a 'forgot password' div thats sitting right underneath the 'password' field at the bottom of the page.

Now, even though, I have specified the height & width of the div (id: fpass), the 'a href' tag inside this div doesnt inherit the height from the parent div (fpass).

I have specified the height & width of the 'a href' tag as well and as per the firebug, the height & width is being taken into consideration by the browser, however still, the height of the 'a href' tag remains zero!

Can anyone please enlighten me why this is the way it is, i.e. the height & width of the 'a href' tag is not the actual height & width being used by the browser?

Upvotes: 4

Views: 2548

Answers (1)

alex
alex

Reputation: 490203

An a element is inline by default, add display: block to make it listen to its dimensions.

An inline element won't listen to its dimensions set with CSS.

jsFiddle.

Upvotes: 10

Related Questions