1. Trang chủ
  2. » Công Nghệ Thông Tin

javascript programmer''''s reference phần 9 potx

262 708 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 262
Dung lượng 1,73 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Availability: DOM level – 2 JavaScript – 1.5JScript – 5.0Internet Explorer – 5.0Netscape – 6.0 Property/method value type: String primitive CSS syntax: quotes: aValue Argument list: aVal

Trang 1

This property will be useful as an alternative to the style.left property which includes themeasurement units when a value is read back from it.

The value in this property will be an integer defined in pixel measurement units only This is

regardless of the settings of the measurement units in the CSS attribute Refer to the style.posLeftproperty for a more generalized value that can be operated on with different measurement units

See also: Element.offsetLeft, Layer.left, Measurement units,

Property/method value type: String primitive

CSS syntax: pixel-right: aValue

Argument list: aValue A positioning value

This object was added in version 5 of MSIE to complete the set of positioning properties alreadyavailable with the style object in earlier versions of MSIE

Objects can be positioned on screen with this property This value defines the location of the rightedge of a styled element The right edge includes padding, borders and margins around the object aswell as its content The position is located with reference to the next outermost (parent) container

This property will be useful as an alternative to the style.right property, which includes themeasurement units when a value is read back from it

The value in this property will be an integer defined in pixel measurement units only This is

regardless of the settings of the measurement units in the CSS attribute Refer to the

style.posRight property for a more generalized value that can be operated on with differentmeasurement units

See also: Measurement units, style.posRight, style.right

Trang 2

style.pixelTop (Property)

The pixel position of the top edge of the styled element

Availability: JScript – 3.0

Internet Explorer – 4.0Opera – 5.0

Property/method value type: String primitive

Argument list: aValue A positioning value

Objects can be positioned on screen with this property This value defines the location of the top edge

of a styled element The top edge includes padding, borders and margins around the object as well asits content The position is located with reference to the next outermost (parent) container

The value in this property should be reflected in the Element.offsetTop property

This property will be useful as an alternative to the style.top property which includes the

measurement units when a value is read back from it

The value in this property will be an integer defined in pixel measurement units only This is

regardless of the settings of the measurement units in the CSS attribute Refer to the style.posTopproperty for a more generalized value that can be operated on with different measurement units

See also: Element.offsetTop, Layer.top, Measurement units,

style.posTop, style.topstyle.pixelWidth (Property)

The pixel width of the styled element

Availability: JScript – 3.0

Internet Explorer – 4.0Opera – 5.0

Property/method value type: String primitive

CSS syntax: pixel-width: aWidth

Argument list: aWidth A sizing value

Although this is a read and write property, it is most likely to be useful for measuring the width of anobject to get a numeric value without the trailing px suffix that you get when enquiring the

style.width value

Trang 3

The value in this property will be an integer defined in pixel measurement units only This is

regardless of the settings of the measurement units in the CSS attribute Refer to the

style.posWidth property for a more generalized value that can be operated on with differentmeasurement units

See also: Measurement units, style.pixelHeight,

style.posHeight, style.posWidth, style.widthstyle.playDuring (Property)

Part of the aural style control suite that controls the mix between foreground and background

sound effects

Availability: CSS level – 2

DOM level – 2

Property/method value type: String primitive

JavaScript syntax: none myStyle.playDuring

CSS syntax: play-during: aControl

Argument list: aControl A mix control for background sounds

Foreground and background sound effects need to be controlled carefully and blended properly, sothat background noises such as music and sound effects do not distract from the speech

The values for this comprise a URI value and an optional controlling parameter The value should bespace-separated

The URI specifies an audio file to be downloaded and played in the background

The following keywords control how the background sound is mixed with any parent object's soundeffects:

❑ mix

❑ repeat

❑ auto

❑ none

The mix keyword combines any sounds already playing as defined by parent elements

The repeat keyword allows for the background sound to be looped as required to extend it to thesame length as the spoken content

The auto value allows the parent elements sound effects to be played without being interrupted bythis elements sounds

The none value turns off any sound effects inherited from parent objects only playing sounds

controlled by this object

Trang 4

❑ This is not yet supported by any of the browsers

See also: Aural style sheets

style.posBottom (Property)

A measurement unit independent positioning control property

Availability: JScript – 5.0

Internet Explorer – 5.0

Property/method value type: String primitive

CSS syntax: pos-bottom: aValue

Argument list: aValue A positioning value

This object was added in version 5 of MSIE to complete the set of positioning properties alreadyavailable with the style object in earlier versions of MSIE

Objects can be positioned on screen with this property This value defines the location of the bottomedge of a styled element The bottom edge includes padding, borders and margins around the object

as well as its content The position is located with reference to the next outermost (parent) container.This property will be useful as an alternative to the style.bottom property, which includes themeasurement units when a value is read back from it

The value in this property will be an integer defined in the measurement units defined by the CSSattribute Refer to the style.pixelBottom property for a more specialized value that can beoperated on unambiguously in pixel measurement units

See also: Measurement units, style.bottom, style.pixelBottom

style.posHeight (Property)

A measurement unit independent size control property

Availability: JScript – 3.0

Internet Explorer – 4.0

Property/method value type: String primitive

CSS syntax: pos-height: aHeight

Argument list: aHeight A sizing value

Trang 5

Although this is a read and write property, it is most likely to be useful for measuring the height of anobject to get a numeric value without the trailing measurement unit suffix that you get when

enquiring the style.width value

The value in this property will be an integer defined in CSS attribute defined measurement units only.Refer to the style.pixelHeight property for a more specialized value that can be operated onunambiguously using pixel values

See also: Measurement units, style.height, style.pixelHeight,

style.pixelWidth, style.posWidthstyle.position (Property)

A flag to indicate relative or absolute positioning of an element

Availability: CSS level – 2

DOM level – 2JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

- myStyle.position = "absolute"

JavaScript syntax:

- myStyle.position = "relative"

CSS syntax: position: aControl

Argument list: aControl A positioning control

In MSIE, this value returns a floating point value reflecting the current value of the position attributefor the styleSheet object

You can define other values for this according to the available keywords:

Trang 6

The fixed keyword is defined in the CSS standard to mean that an element object should be

positioned with respect to the display window

The normal keyword is equivalent to the CSS defined static keyword and applies to objects whoseposition is controlled by the text flow These can be block or inline structured objects

❑ The fixed keyword is not yet properly supported in MSIE

❑ Netscape 6.0 does not support the normal keyword although it supports the functionally identicalstatic keyword

See also: Document.layers[], Dynamic positioning, Measurement

Property/method value type: String primitive

Argument list: aValue A positioning value

Objects can be positioned on screen with this property This value defines the location of the left edge

of a styled element The left edge includes padding, borders and margins around the object as well asits content The position is located with reference to the next outermost (parent) container

This property will be useful as an alternative to the style.left property which includes themeasurement units when a value is read back from it

Trang 7

The value in this property will be an integer defined in the measurement units defined by the CSSattribute Refer to the style.pixelLeft property for a more specialized value that can be operated

on unambiguously in pixel measurement units

See also: Element.offsetLeft, Layer.left, Measurement units,

Property/method value type: String primitive

Argument list: aValue A positioning value

This object was added in version 5 of MSIE to complete the set of positioning properties alreadyavailable with the style object in earlier versions of MSIE

Objects can be positioned on screen with this property This value defines the location of the rightedge of a styled element The right edge includes padding, borders and margins around the object aswell as its content The position is located with reference to the next outermost (parent) container

This property will be useful as an alternative to the style.right property which includes themeasurement units when a value is read back from it

The value in this property will be an integer defined in the measurement units defined by the CSSattribute Refer to the style.pixelRight property for a more specialized value that can be

operated on unambiguously in pixel measurement units

See also: Measurement units, style.pixelRight, style.right

style.posTop (Property)

A measurement unit independent positioning control property

Availability: JScript – 3.0

Internet Explorer – 4.0

Property/method value type: String primitive

Trang 8

CSS syntax: pos-top: aValue

Argument list: aValue A positioning value

Objects can be positioned on screen with this property This value defines the location of the top edge

of a styled element The top edge includes padding, borders and margins around the object as well asits content The position is located with reference to the next outermost (parent) container

This property will be useful as an alternative to the style.top property, which includes the

measurement units when a value is read back from it

The value in this property will be an integer defined in the measurement units defined by the CSSattribute Refer to the style.pixelTop property for a more specialized value that can be operated

on unambiguously in pixel measurement units

See also: Element.offsetTop, Layer.top, Measurement units,

Property/method value type: String primitive

CSS syntax: pos-width: aWidth

Argument list: aWidth A sizing value

Although this is a read and write property, it is most likely to be useful for measuring the width of anobject to get a numeric value without the trailing measurement unit suffix that you get when

enquiring the style.width value

The value in this property will be an integer defined in CSS attribute defined measurement units only.Refer to the style.pixelWidth property for a more specialized value that can be operated onunambiguously using pixel values

See also: Measurement units, style.pixelWidth,

style.posHeight, style.width

Trang 9

style.quotes (Property)

A list of quotation marks to use for progressively quoted content that may have nested quotation marks

Availability: DOM level – 2

JavaScript – 1.5JScript – 5.0Internet Explorer – 5.0Netscape – 6.0

Property/method value type: String primitive

CSS syntax: quotes: aValue

Argument list: aValue A string to use for quoting text

If you specify quotes, you should indicate pairs of quotes Each quote should be enclosed it its ownset of delimiters, which then allows multiple characters to be used for each quotation symbol

You can alternatively use the value none or inherit

style.removeExpression() (Method)

An MSIE extension for managing style controls

Availability: JScript – 5.0

Internet Explorer – 5.0

JavaScript syntax: IE myStyle.removeExpression(aProperty)

Argument list: aProperty The name of the property whose expression is to

be removed

This is part of the MSIE support for managing style expressions With this method, you can remove

an expression that was previously defined with the setExpression() method

See also: Element.getExpression(),

Element.removeExpression(),Element.setExpression(), style.getExpression(),style.setExpression()

Trang 10

Property/method value type: String primitive

JavaScript syntax: IE myStyle.renderingIntent

CSS syntax: rendering-intent: aControl

Argument list: aControl A rendering intent specifier value

As yet, this is still being worked on Early drafts suggest the following keywords will be available:

Property/method value type: String primitive

JavaScript syntax: none myStyle.richness

CSS syntax: richness: aValue

Argument list: aValue A voice quality control value

This control affects the animation, sometimes called brightness or stridency, in the voice

The value 50 is used as the default and with this setting the voice will sound as if it's normal

Reducing this value makes the voice more mellow and soft Extremely low values might almost bewhispered

Trang 11

Increasing value to 100 makes the voice very forceful, almost shouting.

The value can be specified as a floating point value to control the richness very finely

The behavior of the spoken voice when controlled by the aural style properties does very muchdepend on the in-built speech capabilities of the platform The Macintosh already supports a veryversatile and realistic voice synthesizer as an integral component of its operating system It would beinteresting to experiment with this if it were integrated with a usable browser

Warnings:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets, style.pitchRange

style.right (Property)

A positioning reference point

Availability: CSS level – 2

DOM level – 2JavaScript – 1.5JScript – 5.0Internet Explorer – 5.0Netscape – 6.0

Property/method value type: String primitive

CSS syntax: right: aPosition

Argument list: aPosition A right coordinate value

A CSS-P positioning style attribute that controls the location of an element relative to its containingparent element The right edges of the two elements are used as the reference points

The value can specified in the usual pixel or fractional em-dash measurement units or the autokeyword can be used to let the browser do the positioning itself

The exact positioning is affected by settings for padding, border, margin and the position property

See also: Measurement units, style.bottom, style.left,

style.pixelRight, style.posRight, style.top

Trang 12

style.rowSpan (Property)

An indication of how many rows a table cell should span

Availability: CSS level – 2

Property/method value type: String primitive

JavaScript syntax: none myStyle.rowSpan

CSS syntax: row-span: aRowCount

Argument list: aRowCount A number of rows to span in a table

This is used when you want to create complex tables, and can be used as an alternative to nesting atable Avoiding nested tables is good because they can be quite unwieldy

This is related somewhat to the rowSpan property of the TD and TH objects and controls the samebehavior

See also: TABLE object, TD.rowSpan, TH.rowSpan

style.rubyAlign (Property)

An MSIE extension to support the alignment of ruby elements

Availability: CSS level – Proposed

JScript – 5.0Internet Explorer – 5.0

Property/method value type: String primitive

CSS syntax: ruby-align: aControl

Argument list: aControl An alignment control keyword

This controls the alignment of the ruby text with respect to the base text

The following keywords are supported:

Trang 13

style.rubyOverhang (Property)

An MSIE extension to support the alignment of styled elements

Availability: CSS level – Proposed

JScript – 5.0Internet Explorer – 5.0

Property/method value type: String primitive

JavaScript syntax: IE myStyle.rubyOverhang

CSS syntax: ruby-overhang: aControl

Argument list: aControl A definition of the kind of overhang to

displayThis defines the overhang of the ruby text with respect to its base text

The following keywords are accepted:

An MSIE extension to support the alignment of styled elements

Availability: CSS level – Proposed

JScript – 5.0Internet Explorer – 5.0

Property/method value type: String primitive

JavaScript syntax: IE myStyle.rubyPosition

CSS syntax: ruby-position: aPosition

Argument list: aPosition A specifier for where the ruby is to be placedThis defines the position of the ruby text with respect to its base text

The following keywords are accepted:

❑ above

❑ inline

Trang 14

style.scrollbar3dLightColor (Property)

Access to the scrollbar colors

Availability: JScript – 5.5

Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE style.scrollbar3dLightColor

CSS syntax: scrollbar-3d-light-color : aColor

Argument list: aColor A color value

This provides a means of reading or writing the color value for a scroll box and its scrollbar

The value is one of the usual color values

See also: Color names, Color value

style.scrollbarArrowColor (Property)

Defines the arrow color of a scrollbar

Availability: JScript – 5.5

Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE style.scrollbarArrowColor

CSS syntax: scrollbar-arrow-color: aColor

Argument list: aColor A color value

This is a color value specified in the normal way

See also: Color names, Color value

Trang 15

style.scrollbarBaseColor (Property)

Defines the base color of a scrollbar

Availability: JScript – 5.5

Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE style.scrollbarBaseColor

CSS syntax: scrollbar-base-color: aColor

Argument list: aColor A color value

This is a color value specified in the normal way

See also: Color names, Color value

style.scrollbarDarkShadowColor (Property)

Defines the dark shadow color of a scrollbar

Availability: JScript – 5.5

Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE style.scrollbarDarkShadowColor

CSS syntax: scrollbar-dark-shadow-color: aColor

Argument list: aColor A color value

This is a color value specified in the normal way

See also: Color names, Color value

style.scrollbarFaceColor (Property)

Defines the face color of a scrollbar

Availability: JScript – 5.5

Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE style.scrollbarFaceColor

Trang 16

CSS syntax: scrollbar-face-color: aColor

Argument list: aColor A color value

This is a color value specified in the normal way

See also: Color names, Color value

style.scrollbarHighlightColor (Property)

Defines the highlight color of a scrollbar

Availability: JScript – 5.5

Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE style.scrollbarHighlightColor

CSS syntax: scrollbar-highlight-color: aColor

Argument list: aColor A color value

This is a color value specified in the normal way

See also: Color names, Color value

style.scrollbarShadowColor (Property)

Defines the shadow color of a scrollbar

Availability: JScript – 5.5

Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE style.scrollbarShadowColor

CSS syntax: scrollbar-shadow-color: aColor

Argument list: aColor A color value

This is a color value specified in the normal way

See also: Color names, Color value

Trang 17

style.setAttribute() (Method)

A method for setting attributes in styles

Availability: JavaScript – 1.5

JScript – 5.0Internet Explorer – 5.0Netscape – 6.0

JavaScript syntax: - myStyle.setAttribute(aName, aValue)

aName The name of an attribute to set

JavaScript syntax: IE myStyle.setExpression(aName, anExpression, aLanguage)

aName The name of the property

removeExpression() method

The rules that are used to construct a style are comprised of multiple expressions You can use thismethod to assign a new value to an expression within a style item with that value being generated by

a callback to a script function

Given the rule might contain a line such as:

Trang 18

The value of the width parameter would then be defined by the result of calling the callBack()function in the JavaScript context.

The expressions are attached to style properties and can be executed in a variety of languages Thelanguage argument can be one of the following:

Style.size (Property)

Defines the size and orientation of a bounding box on a printed page

Availability: CSS level – 2

DOM level – 2

Property/method value type: String primitive

JavaScript syntax: none myStyle.size

CSS syntax: size: anAspectsize: aSize anAspectsize: aWidth aHeight anAspect

aSize When only one length value is specified,

the page is square

anAspect An aspect ration control

aWidth A page width

Printers may apply a non-printable margin area to the page, and the value you specify here must fitwithin it otherwise the content may be cropped when it is printed

Trang 19

The last parameter value is specified using one of the following keywords:

Property/method value type: String primitive

If the browser is equipped to utilize the platform's text to speech capabilities, this will cause thecontent of the element to be spoken out

Realistically, the element must have some textual content to speak The element is not going to makefor a very interesting spoken phrase if it is an image, although the ALT text of the image might beused if it is defined

The kind of speech is controlled with these keywords:

❑ none

❑ normal

❑ spell-out

The none keyword inhibits the text to speech capabilities

The normal keyword reads the word as best it can Sometimes this might use phonetic rules topronounce the word and this may sound strange

The spell-out keyword forces the content to be read out one letter at a time This may be morehelpful if there are complex words that the phonetic rules don't cope with very well, or if the content is aformula or other kind of algebraic expression This may also be useful for abbreviations or acronyms

Warnings:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets

Trang 20

style.speakDate (Property)

A format control that dictates the order in which date items are spoken

Availability: CSS level – 2

Property/method value type: String primitive

JavaScript syntax: none myStyle.speakDate

CSS syntax: speak-date: aFormat

Argument list: aFormat A date format to speak

Date values may need to be spoken in a manner appropriate to the context of the listener

This for example may require the order in which the date components should be spoken to managethe regional differences Typically the American English and UK English language variants exchangethe day and month values for example

The following keywords are supported to select an order for reading out the Day, Month and Yearcomponents of a date value:

❑ mdy

❑ dmy

❑ ymd

Warnings:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets

Property/method value type: String primitive

JavaScript syntax: none myStyle.speakHeader

CSS syntax: speak-header: aSwitch

Argument list: aSwitch A control for how often to speak table headers

Trang 21

When the contents of a table are being read out, it can become confusing if the table content is simplyread out cell by cell This property indicates how often the column headings should be read out prior

to reading the contents of each cell It supports the keywords once and always

The once keyword dictates that table column headings should be spoken once at the start of readingout the table

The always keyword mandates that the column heading be spoken immediately prior to each cell inthe row

Other keywords may be added to this property in due course to allow more flexible ways of readingout table headings

Warnings:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets

Property/method value type: String primitive

JavaScript syntax: none myStyle.speakNumeral

CSS syntax: speak-numeral: aType

Argument list: aType A manner in which to read numeric values

This property controls how numeric values are read out Long numeric values would normally beread out one digit at a time, but a year number might be read out as a compound string

The CSS2 standard dictates that the language for reading the numbers should be defined with theLANG=" " HTML tag attribute for the HTML tag that instantiates the object that this style applies to.The following keywords can be used with this property:

Trang 22

The digits keyword forces numeric values to be read out one digit at a time For example, 2000would be pronounced as "Two zero zero zero" if the spoken language is English.

The continuous keyword forces numeric values to be read out as a word or string of wordscompounded together For example, 2000 would be pronounced as "Two thousand" if the spokenlanguage is English

Warnings:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets

Property/method value type: String primitive

JavaScript syntax: none myStyle.speakPunctuation

CSS syntax: speak-punctuation: aType

Argument list: aType A manner in which to speak punctuation characters

For some textual content, it may be important that the punctuation is spelled out one punctuationsymbol at a time In other contexts it may be appropriate for the text-to-speech handler to use thepunctuation to control the phasing and intonation of the voice

The none and code keywords can be used with this property

The none keyword means that punctuation is interpreted and should affect the phasing of thespoken text

The code keyword forces the text-to-speech output to enumerate each punctuation symbol as it isencountered How this might affect the inflection and enunciation of the voice may be platformdependant

Warnings:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets

Trang 23

style.speakTime (Property)

Part of the aural style control suite that defines the format of time values and whether they are spoken

in 12 or 24 hour format

Availability: CSS level – 2

Property/method value type: String primitive

JavaScript syntax: none myStyle.speakTime

CSS syntax: speak-time: aFormat

Argument list: aFormat A format according to which time values

should be spoken

Spoken time values may be controlled with some very minimal keywords to determine whether touse a 12 hour or 24 hour clock for the basis of the spoken time The following keyword values areappropriate:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets

style.speechRate (Property)

Part of the aural style control suite that defines the rate at which the text is spoken out loud

Availability: CSS level – 2

DOM level – 2

Property/method value type: String primitive

JavaScript syntax: none myStyle.speechRate

CSS syntax: speech-rate: aSpeed

Argument list: aSpeed A speed at which the text should be spoken

Trang 24

The speech rate may be adjusted to provide a fast talking voice or a slower voice for more complexspoken content.

The property may have a numeric value assigned to indicate how many words should be read perminute This would be an average value on the grounds that some words may take longer to

pronounce than others The speech rate can be specified as a floating point value for very fine controlover the speech rate

There are also a set of keywords so you can specify a generic absolute value These are the keywordsthat are supported:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets, style.pause

style.stress (Property)

Part of the aural style control suite that defines the amount of inflection in the voice as items are spoken

Availability: CSS level – 2

DOM level – 2

Property/method value type: String primitive

JavaScript syntax: none myStyle.stress

CSS syntax: stress: aValue

Argument list: aValue A stress level for the speech

To make the spoken voice sound more interesting (and human-like), this property provides somecontrol over the stress or inflection in the voice as it reads the text contained in the element object

This property takes a numeric value, either integer or floating point with the value 50 being thenormal default Increasing the stress value of the voice will provide a greater variation in the way thatwords are enunciated A value of zero would make the voice sound dull and unexciting

Trang 25

❑ This is not yet supported by any of the browsers

See also: Aural style sheets

style.styleFloat (Property)

A property that allows styled elements to float

Availability: JavaScript – 1.5

JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

CSS syntax: style-float: anAlignment

Argument list: anAlignment A floating alignment control value

If you are flowing text around block-structured elements, this property provides some control overwhich side the block-structured element is aligned on

The following values can be assigned to this property:

❑ none

❑ left

❑ right

When the property is set to "none", the element will appear inline with the text at the position

determined by its location in the document source For small objects this means they will appear to besymbols within the text without casing any line break

The style.float and style.floatStyle properties are related

Trang 26

Property/method value type: String primitive

CSS syntax: table-layout: aType

Argument list: aType A kind of table layout to use

When you have a table in a document, it can take some time before the page content first appears.This is because the browser needs to traverse the entire table and load all its content, so that it canwork out the width and height of each cell and then sum them together to determine the overall size

of the table

This property provides a switch that enables the browser to use this normal technique or to use anaccelerated method, whereby it takes the attributes that are specified with HTML tag attributes andimmediately draws the table using those values

This property accepts the auto and fixed keywords

The auto keyword selects the normal table sizing and drawing method

The fixed keyword allows the HTML tag attributes controlling the size to be used to draw the tableoutline, and the widths of the first row of cells are used to set the width of each columns From there,the table can be lengthened to accommodate any textual content You should make sure that there isenough size information in the first row of the table to allow it to establish realistic column widths.This means the columns in the first row should have a width equal to or greater than the width of anyother cell in the remaining rows for optimum performance This is less important when the table onlycontains text, but may be a problem for tables that partially use graphical content

Trang 27

style.textAlign (Property)

Controls the horizontal alignment of text within the styled element

Availability: CSS level – 1

DOM level – 2JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

CSS syntax: text-align: anAlignment

Argument list: anAlignment A style of text alignment to use

Text alignment in the horizontal axis can be controlled with this property The style.verticalAlignproperty can be used to align objects vertically with respect to their parents

The following values are appropriate for this property:

The left value lines up the left edge of the text but leaves the right side ragged

The right value lines up the right side of the text and leaves the left side ragged

The justify keyword is intended to line up both the left and right sides nice and neatly, using spaceexpansion between words to use up the additional space

Warnings:

❑ The justify keyword is not defined in the CSS standard but is inconsistently supported acrossbrowsers and platforms In many cases, it may result in a left justified and ragged right appearancerather than the left and right justified effect you would have expected

See also: CAPTION.align, JSSTag.textAlign, style.textJustify,

style.verticalAlign, style.wordSpacing

Trang 28

style.textAutospace (Property)

Support for spacing control in ideographic languages used in Asia

Availability: CSS level – Proposed

JScript – 5.0Internet Explorer – 5.0

Property/method value type: String primitive

JavaScript syntax: IE myStyle.textAutospace

CSS syntax: text-autospace: aControl

Argument list: aControl One of the available keywords

This property accepts the following keywords:

Property/method value type: String primitive

JavaScript syntax: - myStyle.textDecoration

CSS syntax: text-decoration: aStyle

Argument list: aStyle A set of decorative properties for the text

Text decoration is often confused with text style In word processors you will commonly see italic andbold in the same menu as underline and strike-through In the context of a web browser they areseparated into fontStyle and text decoration

Trang 29

The following decorations can be applied:

You can apply several of these decorations as long as they are space separated in the string being assigned

To restore text decoration to its default state simply assign an empty string, "" It is also likely that thevalue "none" will cancel the text decoration too, at least on the MSIE browser

There are individual properties for each of these styles that you can use if you prefer Those

properties are controlled with a Boolean primitive value

Setting the properties to the value true will add that decoration to the text block

Setting the style.textDecorationNone property to true will automatically set the others tofalse and cancel the text decoration effect

See also: JSSTag.textDecoration, String.blink(),

String.strike(), style.textDecorationBlink,style.textDecorationLineThrough,

style.textDecorationNone,style.textDecorationOverline,style.textDecorationUnderline

style.textDecorationBlink (Property)

The blink attribute of the styled element

Availability: CSS level – Proposed

JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

JavaScript syntax: - myStyle.textDecorationBlink

CSS syntax: text-decoration-blink: aSwitch

Argument list: aSwitch A Boolean switch for the text decoration

This is a Boolean value that needs to be set to true or false to activate the styled appearance

Trang 30

❑ The MSIE browser does not support text blinking so even though the property is provided andsupported, its effects are ignored

❑ This property does not work on some versions of MSIE on the Macintosh platform

See also: String.blink(), style.textDecoration,

style.textDecorationNone

style.textDecorationLineThrough (Property)

A text decoration style

Availability: CSS level – Proposed

JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

JavaScript syntax: - myStyle.textDecorationLineThrough

CSS syntax: text-decoration-line-through: aSwitch

Argument list: aSwitch A Boolean switch for the text decoration

This is a Boolean value that needs to be set to true or false to activate the styled appearance

Warnings:

❑ This property does not work on some versions of MSIE on the Macintosh platform

See also: String.strike(), style.textDecoration,

style.textDecorationNone

style.textDecorationNone (Property)

A text decoration style

Availability: CSS level – Proposed

JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

Trang 31

JavaScript syntax: - myStyle.textDecorationNone

CSS syntax: text-decoration-none: aSwitch

Argument list: aSwitch A Boolean switch for the text decorationThis is a Boolean value that needs to be set to true or false to activate the styled appearance

Warnings:

❑ This property does not work on some versions of MSIE on the Macintosh platform

See also: style.textDecoration, style.textDecorationBlink,

style.textDecorationLineThrough,style.textDecorationOverline,style.textDecorationUnderline

style.textDecorationOverline (Property)

A text decoration style

Availability: CSS level – Proposed

JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

JavaScript syntax: - myStyle.textDecorationOverline

CSS syntax: text-decoration-overline: aSwitch

Argument list: aSwitch A Boolean switch for the text decoration

This is a Boolean value that needs to be set to true or false to activate the styled appearance

Warnings:

❑ This property does not work on some versions of MSIE on the Macintosh platform

See also: style.textDecoration, style.textDecorationNone

Trang 32

style.textDecorationUnderline (Property)

A text decoration style

Availability: CSS level – Proposed

JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

JavaScript syntax: - myStyle.textDecorationUnderline

CSS syntax: text-decoration-underline: aSwitch

Argument list: aSwitch A Boolean switch for the text decoration

This is a Boolean value that needs to be set to true or false to activate the styled appearance

Warnings:

❑ This property does not work on some versions of MSIE on the Macintosh platform

See also: style.textDecoration, style.textDecorationNone

style.textIndent (Property)

Controls the indentation of text within the styled element

Availability: CSS level – 1

DOM level – 2JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

CSS syntax: text-indent: aValue

Argument list: aValue An amount of text indentation

Text blocks can have the first line indented This might be applied to an element that is instantiated

by a <P> tag for example

Trang 33

The value is specified using the normal measurement units such as pixels or floating point fractionalem-dash values.

If you want to create a hanging indent effect, the first line can be moved leftwards by specifying anegative value in this property

Assigning a value of zero to this property restores it to its default condition with all lines being leftjustified identically

Warnings:

❑ Negative indents (sometimes called outdents or hanging indents) may not be supported correctly onall browsers on all platforms You may need to perform some experiments and platform testing toverify it works on your target user's browsers

❑ Some versions of MSIE on Macintosh do not properly support this feature

See also: JSSTag.textIndent, Measurement units

style.textJustify (Property)

Controls the justification layout of textual content within the styled element

Availability: CSS level – Proposed

JScript – 5.0Internet Explorer – 5.0

Property/method value type: String primitive

JavaScript syntax: IE myStyle.textJustify

CSS syntax: text-justify: aControl

Argument list: aControl One of the available control keywordsThe text justification can accommodate any of the following keywords:

Trang 34

style.textKashidaSpace (Property)

A means of controlling the Kashida expansion of an Asian font

Availability: CSS level – Proposed

JScript – 5.5Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE myStyle.textKashidaSpace

CSS syntax: text-kashida-space: aValue

Argument list: aValue A space scaling value

The value for this property can be specified as a percentage value or with the inherit keyword

style.textShadow (Property)

Controls artistic shadow effects for text in the styled element

Availability: CSS level – 2

DOM level – 2JavaScript – 1.5JScript – 5.0Internet Explorer – 5.0Netscape – 6.0

Property/method value type: String primitive

CSS syntax: text-shadow: aValueH aValueV aRadius, text- shadow: aColor aValueH aValueV aRadius,

aColor A color for the blur

aValueH A horizontal blur factor

aValueV A vertical blur factor

Argument list:

aRadius A blur radius

This is an alternative to using the visual filter effects in MSIE With this, you can add several shadows

to the text, each one having a different color The shadows can be vertically and horizontally offsetfrom the text on an individual basis This simulates the effect of the text being lit from several angleswith different light sources

Although the text shadows are layered with the text itself, when the Z order of the text is changedwith respect to other elements in the page, the shadows move with it as if they were in some kind oflayer group

Trang 35

The values for the one particular shadow are space separated and should be specified in the correctorder since several of them are length values and therefore they share the same namespace.

Each set of arguments for a shadow layer should be separated from the previous one by a comma sothere are two levels of delimiting going on

As an alternative, the keyword value none can be assigned to the property to deactivate shadowsaltogether

The arguments for each shadow layer are as follows and should be defined in this order:

❑ A color value (optional and may be omitted)

❑ The horizontal offset value in spatial coordinates

❑ The vertical offset value in spatial coordinates

❑ The blur radius value in spatial coordinates

If the color value is omitted, the color of the element object itself will be used This value may nothave been defined for the element object and may have been inherited from a parent containingelement object

Negative values can be used for the horizontal and vertical offset values

See also: Filter – Shadow(), Filter object, style.filter,

Property/method value type: String primitive

CSS syntax: text-transform: aControl

Argument list: aControl A text transformation to apply

Sometimes you may want to format a block of text for a heading It's likely you will want to modifythe capitalization as well as the appearance

Regardless of the actual upper/lower case combination of letters in the text block, they can be forced

to be displayed according to the case rules defined by this attribute

Trang 36

The following values can be assigned to this property:

A means of controlling whether the underline is placed above or below the text

Availability: CSS level – Proposed

JScript – 5.5Internet Explorer – 5.5

Property/method value type: String primitive

JavaScript syntax: IE myStyle.textUnderlinePosition

CSS syntax: text-underline-position: aControl

Argument list: aControl One of the available keywords

This style property accepts the above and below keywords

style.top (Property)

A positioning reference point

Availability: CSS level – 2

DOM level – 2JavaScript – 1.5JScript – 3.0Internet Explorer – 4.0Netscape – 6.0

Property/method value type: String primitive

- myStyle.top

JavaScript syntax:

- myStyle.top = yCoordinate

Argument list: aValue A positioning value

Trang 37

A CSS-P positioning style attribute that controls the location of an element relative to its containingparent element The top edges of the two elements are used as the reference points.

The value can be specified in the usual pixel or fractional em-dash measurement units or the autokeyword can be used to let the browser do the positioning itself

The exact positioning is affected by settings for padding, border, margin and the position property

See also: Measurement units, style.bottom, style.left,

style.pixelTop, style.posTop, style.rightstyle.unicodeBidi (Property)

Controls the bi-directionality of Unicode text within the styled element

Availability: DOM level – 2

JavaScript – 1.5JScript – 5.0Internet Explorer – 5.0Netscape – 6.0

Property/method value type: String primitive

CSS syntax: unicode-bidi: aControl

Argument list: aControl A setting for bi-directional Unicode text

This sets or returns the level of embedding within the bi-directional text drawing mechanism

The property can accept the following keywords:

Trang 38

Property/method value type: String primitive

CSS syntax: vertical-align: anAlignment

Argument list: anAlignment An alignment control value

The textAlign property controls the horizontal alignment, this property controls the vertical alignment.The following values can be assigned to this property to control text alignment within the element'sextent rectangle:

Trang 39

Property/method value type: String primitive

JavaScript syntax: - myStyle.visibility = aSwitch

CSS syntax: visibility: aSwitch

Argument list: aSwitch A visibility switch value

This controls the visibility of a DOM or HTML Element object It corresponds to the visibilityproperty of the Netscape Navigator Layer object but uses different keywords

The following keywords are appropriate for use with this property:

The inherit keyword allows a child element to be visible only when its parent is visible

If the child element is made explicitly visible or hidden then its visibility will be unaffected by itsparent element object The parent can be invisible, possibly being used for positioning control whilethe child is on display

The hide and show keywords are considered Netscape Navigator 4 and are deprecated Sincehidden and visible work even for layers, there is no need to ever use hide and show

The hidden and visible keywords mean the same thing as hide and show but are more portableacross browsers and the CSS standard

Property/method value type: String primitive

JavaScript syntax: none myStyle.voiceFamily

CSS syntax: voice-family: aFamilyName

Argument list: aFamilyName A list of voice family names

Trang 40

Most platforms that support spoken text will provide the facility to speak in a variety of alternativevoices This is somewhat similar to text being displayed on different fonts.

However, the available voices are not likely to be platform independent

Generic and portable family names have not yet been defined

You can stack these in the same way that fonts are defined using a left to right precedence rule Thefirst matching voice family will be used for the spoken text

Warnings:

❑ This is not yet supported by any of the browsers

See also: Aural style sheets, style.fontFamily

Property/method value type: String primitive

JavaScript syntax: none myStyle.volume

CSS syntax: volume: aValue

Argument list: aValue A volume setting for speech

This controls the loudness of the spoken text It can be specified with a numeric value which isassumed to be an absolute volume level in the range 0 to 100 and is assumed to be the percentage ofthe volume range for the platform

If a percent sign is added, the value inherited from the parent containing element object is multiplied

by that percentage for the child element's volume setting

In addition, these keywords are also supported for defining absolute values:

Ngày đăng: 12/08/2014, 19:21

TỪ KHÓA LIÊN QUAN