quotes style property
8 | ||||
Specifies or returns the pairs of quotation marks for the 'open-quote' and 'close-quote' values of the content property.
Note: The quotes property is supported in Internet Explorer from version 8.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: quotes |
Possible values:
The type of this property is string.
One of the following values: | ||||||||||||||||||
|
Description of values:
String, represents the closing quotation mark. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
Produce no quotation marks for the 'open-quote' and 'close-quote' values of the content property. | |||||||
String, represents the opening quotation mark. | |||||||
Pairs of quotation marks for the 'open-quote' and 'close-quote' values of the content property. |
Default: none.
Example HTML code 1:
This example illustrates the use of the quotes property:
|
||||
<head> <style> .example { quotes: "<" ">" "[begin]" "[end]"; } </style> </head> <body> <q class="example">This is a <q>quoted element</q> in an outer quoted element</q> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the quotes property in JavaScript:
|
||||
<head> <style> .example { quotes: "<" ">" "[begin]" "[end]"; } </style> <script type="text/javascript"> function ChangeQuotation () { var selectTags = document.getElementsByTagName ("select"); var quoteValue = ""; for (i = 0; i < selectTags.length;i++) { // Returns the index of the selected option var whichSelected = selectTags[i].selectedIndex; // Concatenates the text of the selected option quoteValue += '"' + selectTags[i].options[whichSelected].text + '" '; } var quote = document.getElementById ("myQuote"); if ('quotes' in quote.style) { quote.style.quotes = quoteValue; // solve refresh problems on Opera quote.className = ""; quote.focus (); quote.className = "example"; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <q id="myQuote" class="example"> This is a <q>quoted element</q> in an outer quoted element </q> <br /> <select onchange="ChangeQuotation ();" size="6"> <option />' <option selected="selected" />< <option />( <option />| <option />“ <option />„ </select> <select onchange="ChangeQuotation ();" size="6"> <option />' <option selected="selected" />> <option />) <option />| <option />” <option />„ </select> <select onchange="ChangeQuotation ();" size="5"> <option />' <option selected="selected" />[begin] <option />{open} <option />„ <option /><first> </select> <select onchange="ChangeQuotation ();" size="5"> <option />' <option selected="selected" />[end] <option />{close} <option />„ <option /><last> </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, bdo, big, blink, blockquote, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, html, i, img, input:image, ins, isindex, kbd, label, legend, li, listing, marquee, menu, nobr, ol, p, plaintext, pre, q, rt, ruby, s, samp, select, small, span, strike, strong, sub, sup, table, td, textarea, th, tr, tt, u, ul, var, xmp
Related pages:
External links:
User Contributed Comments