CSS Display Inline-Block Primer Tutorial

CSS Display Inline-Block Primer Tutorial

CSS Display Inline-Block Primer Tutorial

The CSS property “display” is enormously useful for us here at RJM programming. The way we most commonly use it is in the form (for element ID=eleid) …


<style>
#eleid { display: none; }
</style>

… to make element “eleid” be invisible (and whitespace it would have occupied is squished up, as distinct from “#eleid { visibility: hidden; }” … as you can see that is useful. Now, putting that element “eleid” back to being visible can be achieved via …

For “block” elements (eg. “table”, “iframe”) For “inline” elements (eg. :”span”, “a”)
CSS
<style>
#eleid { display: block; }
</style>

<style>
#eleid { display: inline-block; }
</style>
Javascript
document.getElementById('eleid').style.display='block';

document.getElementById('eleid').style.display='inline-block';

… but the other day we stumbled on an incredible by-product of this topic. We accidentally did …


<style>
* { display: inline-block; }
</style>

… and we were gobsmacked by the result. So today we’ve written a “proof of concept” web application for you to see for yourself how display_inline_block_example_combobox.htm‘s “proof of concept” web application works …

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>