javascript value for inline-block

admin

Administrator
Staff member
I want to use a javascript to change the css display property of div elements from none to inline-block.

I am successfully using the syntax:
document.getElementById( 'id' ).style.display = 'none';

but the following do not work:
document.getElementById( 'id' ).style.display = "inline-block";
document.getElementById( 'id' ).style.display = 'inlineBlock';
document.getElementById( 'id' ).style.display = 'inline-block';

What is the javascript version of the inline-block value for the display property?There is no such value "inline-block" for the display property. Information on the display property (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/visuren.html#propdef-display">http://www.w3.org/TR/REC-CSS2/visuren.h ... ef-display</a><!-- m -->)You can have inline or block but an element cant be both.Originally posted by Mr Herer
You can have inline or block but an element cant be both.
Actually inline-block is a part of CSS 2.1: <!-- m --><a class="postlink" href="http://www.w3.org/TR/2003/WD-CSS21-20030915/visuren.html#display-prop">http://www.w3.org/TR/2003/WD-CSS21-2003 ... splay-prop</a><!-- m -->

From W3.org: inline-block This value causes an element to generate a block box, which itself is flowed as a single inline box, similar to a replaced element. The inside of an inline-block is formatted as a block box, and the element itself is formatted as a replaced element on the line.

I can imagine that conforming browsers would use "inlineBlock," as most multi-word, hyphenated CSS properties and values are converted to interCase format in JavaScript.Originally posted by toicontien
Actually inline-block is a part of CSS 2.1: <!-- m --><a class="postlink" href="http://www.w3.org/TR/2003/WD-CSS21-20030915/visuren.html#display-prop">http://www.w3.org/TR/2003/WD-CSS21-2003 ... splay-prop</a><!-- m -->

Whoa, I guess I missed that. I sit corrected.
 
Back
Top