layoutGrid style property
Specifies or returns up to four separate layout-grid properties that specify the layout of text characters.
If you want to display characters that use a one or two-dimensional grid layout, such as Chinese and Japanese,
you can use the layoutGrid property to display them properly in web pages.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: layout-grid |
Possible values:
The type of this property is string.
Values in this order |
||||||||||||||||||||
|
Description of values:
Specifies or returns the size of the character grid for the layout of an element's text content. | |||||||
Specifies or returns the gridline value used for laying out Japanese or Chinese characters in a web document. | |||||||
Specifies or returns whether the text layout grid uses one or two dimensions. | |||||||
Specifies or returns the type of grid to be used for laying out Japanese or Chinese characters in a web document. |
Default: both loose none none.
Example HTML code 1:
This example illustrates the use of the layout-grid property:
|
||||
<head> <style> .example { layout-grid: both fixed 15px 15px; } </style> </head> <body> <div class="example">layout-grid: both fixed 15px 15px</div> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the layoutGrid property in JavaScript:
|
||||
<head> <script type="text/javascript"> function ChangeLayout () { var selectTags = document.getElementsByTagName ("select"); var layoutValue = ""; for (i = 0; i < selectTags.length; i++) { // Returns the index of the selected option whichSelected = selectTags[i].selectedIndex; // Returns the selected options values layoutValue += selectTags[i].options[whichSelected].text + " "; } var div = document.getElementById ("myDiv"); if ('layoutGrid' in div.style) { div.style.layoutGrid = layoutValue; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <div id="myDiv">Change the value of the layout-grid property</div> <br /> layout-grid-mode: <select onchange="ChangeLayout ();" size="4"> <option selected="selected" />both <option />none <option />line <option />char </select> layout-grid-type: <select onchange="ChangeLayout ();" size="3"> <option selected="selected" />loose <option />strict <option />fixed </select> layout-grid-line: <select onchange="ChangeLayout ();" size="6"> <option />5px <option />25px <option />40px <option />60px <option />auto <option selected="selected" />none </select> layout-grid-char: <select onchange="ChangeLayout ();" size="7"> <option />5px <option />10px <option />15px <option />30px <option />45px <option />auto <option selected="selected" />none </select> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.runtimeStyle, htmlElement.style
HTML elements:
a, abbr, acronym, address, applet, b, bdo, big, blockquote, body, button, caption, center, cite, code, col, colgroup, dd, del, dfn, dir, div, dl, dt, em, embed, fieldset, font, form, frame, h1, h2, h3, h4, h5, h6, hr, html, i, iframe, img, input:button, input:checkbox, input:file, input:image, input:password, input:radio, input:reset, input:submit, input:text, ins, isindex, kbd, label, legend, li, listing, marquee, menu, nobr, object, ol, p, pre, q, rt, ruby, s, samp, select, small, span, strike, strong, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tr, tt, u, ul, var, xmp
Related pages:
imeMode
layoutFlow
layoutGridChar
layoutGridLine
layoutGridMode
layoutGridType
rubyAlign
rubyOverhang
rubyPosition
textJustify
textKashidaSpace
unicodeBidi
layoutFlow
layoutGridChar
layoutGridLine
layoutGridMode
layoutGridType
rubyAlign
rubyOverhang
rubyPosition
textJustify
textKashidaSpace
unicodeBidi
External links:
User Contributed Comments