tags:

views:

69

answers:

3

Will the display property of an inline element change once a float property is applied? e.g. What will be the the display property of an anchor tag with float:left?

Also, what will happen with its parent display property, will it also change?

A: 

remember, though, that if you apply background/border stylings, the content will be floated out of the container, causing a 0-height box.

goldenratio
A: 

The Float property will not affect the Display property.

An anchor tag with float:left will probably have the display property as 'inline'.

Guess the float:left caused your anchor to move 'behind' one of your other elements on the left...

Try a higher z-index..

Immanuel
`float` will take it out of normal flow, not affect `display`.
random
+2  A: 

Will the display property of an inline element change once a float property is applied? e.g. What will be the the display property of an anchor tag with float:left?

The display property will be unchanged. If by ‘anchor tag’ you mean ‘A element’, then the display property would still be set to inline (by default).

Also, what will happen with its parent display property, will it also change?

The display property of the parent element will remain the same as well.

Mathias Bynens
So is it allowed to float inline elements? If you say so, then is it recommended?
Ed
Yes, this is allowed.
Mathias Bynens