October 2, 200917 yr Hi All I'll like your views on what, if any, the practice of floating all divs and spans left by default, would have with regards to browser compatibility? A colleague claims its the way forward but I'm not convinced, what do you think? Mike
October 2, 200917 yr I have seen web page code where every div has had float: left; but I'm not sure that it helps at all. It's extra code which in most cases doesn't do any harm. but most website coders don't bother; you should be able to code for all major browsers without adding it everywhere. A block element like a div or p tag will automatically go to the left of a line below unless it has a float and the previous element also has a float. A span tag is not a block element unless you make it block; span tags are designed to be used in the middle of some other inline element like text.
October 2, 200917 yr hmm, not sure about floating everything, suppose it wouldn't hurt, tho I'm not sure how IE6 would cope if you want things to stack properly you can use clear:left; as well
October 2, 200917 yr Author I have seen web page code where every div has had float: left; but I'm not sure that it helps at all. It's extra code which in most cases doesn't do any harm. but most website coders don't bother; you should be able to code for all major browsers without adding it everywhere. A block element like a div or p tag will automatically go to the left of a line below unless it has a float and the previous element also has a float. A span tag is not a block element unless you make it block; span tags are designed to be used in the middle of some other inline element like text. Do you think it go against w3c standards? Mike
Create an account or sign in to comment