Hi I have a question that has been bodering me for a while.I have seen many developers that when they try to position block level elements on the same line they use both:
float:left
display:inline
I myself only use display:inline-block for this and I get the same effect.A couple a weeks ago a developer suggested that I should use the above code but when I asked why he diden’t answer.
If that developer is right then why should I use the above code?What is the difference?
display:inline-block isn’t supported on IE7 and below and a few other old browsers. I guess if you are supporting older browsers, you would need to use what the other developer suggested in conditional stylesheets.
Otherwise, it’s just a hack that people are still using because it’s what they already know, even though display:inline-block is better. The reason he didn’t answer you about why is because he doesn’t have a good answer, his answer would likely be simply ‘because that’s how I do it’.