I just found out that floating an element will also make it a block, therefore specifying a float property and display:block is redundant.
(What would happen if you tried to specify display:inline and float:left? )
Are there any other examples of redundant combinations to watch out for? block & width ? etc,
Is there a tool that can check for such things?
Yes,
display: blockis redundant if you’ve specifiedfloat: left(orright).display: inlinewill not make any difference, because settingfloat: leftforcesdisplay: block“no matter what”:http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo
To summarize said table:
float=display: block.However, your specific example of
float: left; display: inlineis useful in one way – it fixes an IE6 bug.Some examples:
position: absolute, thenfloat: noneis forced.top,right,bottom,leftproperties will not have any effect unlesspositionhas been set to a value other than the default ofstatic.I don’t think so. It’s not something that is ever needed, so I can’t see why anybody would have written such a tool.