Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Both of these elements are extensively used in modern HTML together with CSS. The only real difference is that:

  • span elements have the built in display : inline-block

  • div elements have the built in display : block

If you change the display property of a span to be block you can make it behave like a div. Likewise if you change the display property of a div to be inline-block then you can make it behave like a span.

We do exactly that experiment here.

So in the interests of simplicity and avoiding features it makes sense to just use <div> tags and combine it with CSS. There is less abstraction which means one needs to think through the problems more thoroughly.

  • No labels