textAutospace style property
Specifies or returns the spacing rules between Western and Asian-based (such as Japanese and Chinese) characters.
In many Asian writing systems, such as Japanese and Chinese, there are ideographs that represent concepts rather than letters.
With the textAutospace property you have control over how spaces between ideographs and non-ideographic characters in are presented.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: text-autospace |
Possible values:
The type of this property is string.
One of the following values:
Inserts extra spaces between ideographic and non-ideographic (Latin-based, Cyrillic, Greek, Arabic, or Hebrew) text. | |||||||
Inserts extra spaces between ideographic text and numeric characters. | |||||||
Inserts extra spaces between normal (non-wide) parentheses and ideographs. | |||||||
Extends the width of the space character when it is adjacent to ideographs. | |||||||
No extra space is added. |
Default: none.
Example HTML code 1:
This example illustrates the use of the text-autospace property:
|
||||
<head> <style> .spaceNone { text-autospace: none; } .spaceIdeoNum { text-autospace: ideograph-numeric; } </style> </head> <body> <div>Autospace none: </div> <p class="spaceNone">1一 2二 3三 4四 5五 6六 7七 8八 9九 10十</p> <br /> <div>Autospace ideograph-numeric: </div> <p class="spaceIdeoNum">1一 2二 3三 4四 5五 6六 7七 8八 9九 10十</p> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the textAutospace property in JavaScript:
|
||||
<head> <script type="text/javascript"> function ChangeTextAutospace (selectTag) { // Returns the index of the selected option var whichSelected = selectTag.selectedIndex; // Returns the text of the selected option var autospaceValue = selectTag.options[whichSelected].text; var div = document.getElementById ("myDiv"); if ('textAutospace' in div.style) { div.style.textAutospace = autospaceValue; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <div id="myDiv">1一 2二 3三 4四 5五 6六 7七 8八 9九 10十</div> Change text-autospace value: <select onchange="ChangeTextAutospace (this);" size="5"> <option selected="selected" />none <option />ideograph-alpha <option />ideograph-numeric <option />ideograph-parenthesis <option />ideograph-space </select> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.currentStyle, htmlElement.runtimeStyle, htmlElement.style
HTML elements:
a, abbr, acronym, address, b, basefont, bdo, big, blockquote, body, button, caption, center, cite, code, col, colgroup, dd, del, dfn, dir, div, dl, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, html, i, input:button, input:file, input:password, input:reset, input:submit, input:text, ins, isindex, kbd, label, legend, li, listing, marquee, menu, nobr, 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, xml, xmp
Related pages:
color
font
fontFamily
fontSize
fontSizeAdjust
fontStyle
fontVariant
fontWeight
textAlign
textAlignLast
textDecoration
textIndent
textJustify
textKashidaSpace
textOverflow
textShadow
textTransform
textUnderlinePosition
font
fontFamily
fontSize
fontSizeAdjust
fontStyle
fontVariant
fontWeight
textAlign
textAlignLast
textDecoration
textIndent
textJustify
textKashidaSpace
textOverflow
textShadow
textTransform
textUnderlinePosition
External links:
User Contributed Comments