Last inherited display property is inline but computed is block. How is this even possible?

Issue

I am styling an <input type="text"> element. I would like to let it have display:inline;. I did this by targeting this element in the last line of the css file that is called last. For some reason the element doesn’t take over the display:inline; property (see Firebug image below).

How is it even possible?

Firebug pic

Solution

Because your input element is floated left, the computed value of display is set to block according to the CSS specification.

Reference: http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo

Comment

I would not expect that using the !important declaration would over ride the computed value.

Answered By – Marc Audet

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published