Search completed in 1.11 seconds.
border-style - CSS: Cascading Style Sheets
the border-
style shorthand css property sets the line
style for all four sides of an element's border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...erty sets the line
style for all four sides of an element's border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...
style for all four sides of an element's border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 23 more matches
border-right-style - CSS: Cascading Style Sheets
the border-right-
style css property sets the line
style of an element's right border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...yle of an element's right border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...And 18 more matches
border-left-style - CSS: Cascading Style Sheets
the border-left-
style css property sets the line
style of an element's left border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...
style of an element's left border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...t border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...And 16 more matches
list-style-type - CSS: Cascading Style Sheets
moreover, because this property is inherited, it can be set on a parent element (commonly <ol> or <ul>) to make it apply to all list items. ...
...teractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the color of the marker will be the same as the computed color of the element it applies to. only a few elements (<li> and <summary>) have a default value of display: list-item. ...
...element it applies to. only a few elements (<li> and <summary>) have a default value of display: list-item. however, the list-
style-type property may be applied to any element whose display value is set to list-item. moreover, because this property is inherited, it can be set on a parent element (commonly <ol> or <ul>) to make it apply to all list items. ...
...And 15 more matches
list-style - CSS: Cascading Style Sheets
the list-
style css shorthand property allows you set all the list
style properties at once. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to list items, i.e., elements with display: list-item; . by default this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. ...
...s a pull request. note: this property is applied to list items, i.e., elements with display: list-item; . by default this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. ...
... note: this property is applied to list items, i.e., elements with display: list-item; . by default this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. ...
...And 15 more matches
@counter-style - CSS: Cascading Style Sheets
the @counter-
style css at-rule lets you define counter
styles that are not part of the predefined set of
styles. a @counter-
style rule defines how to convert a counter value into a string representation. @counter-
style thumbs { system: cyclic; symbols: "\1f44d"; suffix: " "; } ul { list-
style: thumbs; } the initial version of css defined a set of useful counter
styles. however, although more
styles were added to this set of predefined
styles over the years, this system proved too restrictive to fulfill the needs of worldwide typography. the @counter-
style at-rule addresses this shortcoming in an open-ended manner, by allowing authors to define their own counter
styles when the pre-defined
styles aren't fitting their needs. ...
... system specifies the algorithm to be used for converting the integer value of a counter to a string representation. negative lets the author specify symbols to be appended or prepended to the counter representation if the value is negative. ...
...nded to the marker representation. prefixes are added to the representation in the final stage, so in the final representation of the counter, it comes before the negative sign. suffix specifies, similar to the prefix descriptor, a symbol that is appended to the marker representation. suffixes come after the marker representation. range defines the range of values over which the counter
style is applicable. if a counter
style is used to represent a counter value outside of its ranges, the counter
style will drop back to its fallback
style. pad is used when you need the marker representations to be of a minimum length. for example if you want the counters to start at 01 and go through 02, 03, 04 etc, then the pad descriptor is to be used. for representations larger than the specif...
...And 14 more matches
ElementCSSInlineStyle.style - Web APIs
the
style property is used to get as well as set the inline
style of an element. when getting, it returns a css
styledeclaration object that contains a list of all
styles properties for that element with values assigned for the attributes that are defined in the element's inline
style attribute. see the css properties reference for a list of the css properties accessible via
style. the
style property has the same (and highest) priority in the css cascade as an inline
style declaration set via the
style attribute. setting
styles
styles should not be set by assigning a string directly to the
style property (as in elt.
style = "color: blue;"), since it is considered read-only, as the
style attribute returns a css
styledeclaration object which is also read-only. ...
...
style. the
style property has the same (and highest) priority in the css cascade as an inline
style declaration set via the
style attribute. setting
styles
styles should not be set by assigning a string directly to the
style property (as in elt.
style = "color: blue;"), since it is considered read-only, as the
style attribute returns a css
styledeclaration object which is also read-only. instead,
styles can be set by assigning values to the properties of
style. for adding specific
styles to an element without altering other
style values, it is preferred to use the individual properties of
style (as in elt.
style.color = '...') as using elt.
style.csstext = '...' or elt.setattribute('
style', '...') sets the complete inline
style for the element by overriding the existing inline
styles. note that t...
...pecific
styles to an element without altering other
style values, it is preferred to use the individual properties of
style (as in elt.
style.color = '...') as using elt.
style.csstext = '...' or elt.setattribute('
style', '...') sets the complete inline
style for the element by overriding the existing inline
styles. note that the property names are in camel-case and not kebab-case while setting the
style using elt.
style.<property> (i.e., elt.
style.fontsize, not elt.
style.font-size). a
style declaration is reset by setting it to null or an empty string, e.g., elt.
style.color = null. internet explorer requires setting it to an empty string, and does not do anything when setting it to null. ...
...And 13 more matches
font-style - CSS: Cascading Style Sheets
italic specifies that font-face is an italicized version of the normal font. oblique specifies that the font-face is an artificially sloped version of the normal font. ...
... italic specifies that font-face is an italicized version of the normal font. oblique specifies that the font-face is an artificially sloped version of the normal font. ...
... italic specifies that font-face is an italicized version of the normal font. oblique specifies that the font-face is an artificially sloped version of the normal font. ...
...And 11 more matches
<style>: The Style Information element - HTML: Hypertext Markup Language
the html <
style> element contains
style information for a document, or part of a document. it contains css, which is applied to the contents of the document containing the <
style> element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the <
style> element must be included inside the <head> of the document. in general, it is better to put your
styles in external
stylesheets and apply them using <link> elements. ...
...ve example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the <
style> element must be included inside the <head> of the document. in general, it is better to put your
styles in external
stylesheets and apply them using <link> elements. ...
... attributes this element includes the global attributes. ...
...And 10 more matches
font-style - CSS: Cascading Style Sheets
the font-
style css property sets whether a font should be
styled with a normal, italic, or oblique face from its font-family. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. italic font faces are generally cursive in nature, usually using less horizontal space than their un
styled counterparts, while oblique faces are usually just sloped versions of the regular face. when the specified
style is not available, both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use font-synthesis to control this behavior). ...
... italic font faces are generally cursive in nature, usually using less horizontal space than their un
styled counterparts, while oblique faces are usually just sloped versions of the regular face. when the specified
style is not available, both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use font-synthesis to control this behavior). syntax font-
style: normal; font-
style: italic; font-
style: oblique; font-
style: oblique 10deg; /* global values */ font-
style: inherit; font-
style: initial; font-
style: unset; the font-
style property is specified as a single keyword chosen from the list of values below, which can optionally include an angle if the keyword is oblique. values normal selects a font that is classified as normal within a font-f...
...perty is specified as a single keyword chosen from the list of values below, which can optionally include an angle if the keyword is oblique. values normal selects a font that is classified as normal within a font-family. italic selects a font that is classified as italic. if no italic version of the face is available, one classified as oblique is used instead. if neither is available, the
style is artificially simulated. oblique selects a font that is classified as oblique. if no oblique version of the face is available, one classified as italic is used instead. if neither is available, the
style is artificially simulated. oblique <angle> selects a font classified as oblique, and additionally specifies an angle for the slant of the text. if one or more oblique faces are available in...
...And 9 more matches
Alternative style sheets - CSS: Cascading Style Sheets
specifying alternative
style sheets in a web page provides a way for users to see multiple versions of a page, based on their needs or preferences. firefox lets the user select the
stylesheet using the view > page
style submenu. internet explorer also supports this feature (beginning with ie 8), also accessed from view > page
style. chrome requires an extension to use the feature (as of version 48). the web page can also provide its own user interface to let the user switch
styles. an example: specifying the alternative
stylesheets the alternate
stylesheets are commonly specified using a <link> element with rel="alternate
stylesheet" and title="..." attributes. ...
...m view > page
style. chrome requires an extension to use the feature (as of version 48). the web page can also provide its own user interface to let the user switch
styles. an example: specifying the alternative
stylesheets the alternate
stylesheets are commonly specified using a <link> element with rel="alternate
stylesheet" and title="..." attributes. ...
... feature (as of version 48). the web page can also provide its own user interface to let the user switch
styles. an example: specifying the alternative
stylesheets the alternate
stylesheets are commonly specified using a <link> element with rel="alternate
stylesheet" and title="..." attributes. ...
...And 8 more matches
border-bottom-style - CSS: Cascading Style Sheets
the border-bottom-
style css property sets the line
style of an element's bottom border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...e of an element's bottom border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...rder. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: the specification doesn't define how borders of different
styles connect in the corners. ...
...And 8 more matches
outline-style - CSS: Cascading Style Sheets
the outline-
style css property sets the
style of an element's outline. an outline is a line that is drawn around an element, outside the border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often more convenient to use the shorthand property outline when defining the appearance of an outline. ...
...nt, outside the border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often more convenient to use the shorthand property outline when defining the appearance of an outline. syntax /* keyword values */ outline-
style: auto; outline-
style: none; outline-
style: dotted; outline-
style: dashed; outline-
style: solid; outline-
style: double; outline-
style: groove; outline-
style: ridge; outline-
style: inset; outline-
style: outset; /* global values */ outline-
style: inherit; outline-
style: initial; outline-
style: unset; the outline-
style property is specified as any one of the values listed below. values auto ...
... none no outline is used. the outline-width is 0. dotted the outline is a series of dots. dashed the outline is a series of short line segments. solid the outline is a single line. double the outline is two single lines. the outline-width is the sum of the two lines and the space between them. ...
...And 8 more matches
border-top-style - CSS: Cascading Style Sheets
the border-top-
style css property sets the line
style of an element's top border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the specification doesn't define how borders of different
styles connect in the corners. ...
... line
style of an element's top border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the specification doesn't define how borders of different
styles connect in the corners. ...
...t's top border. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the specification doesn't define how borders of different
styles connect in the corners. ...
...And 7 more matches
transform-style - CSS: Cascading Style Sheets
the transform-
style css property sets whether children of an element are positioned in the 3d space or are flattened in the plane of the element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if flattened, the element's children will not exist on their own in the 3d-space. as this property is not inherited, it must be set for all non-leaf descendants of the element. ...
...stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if flattened, the element's children will not exist on their own in the 3d-space. as this property is not inherited, it must be set for all non-leaf descendants of the element. syntax /* keyword values */ transform-
style: flat; transform-
style: preserve-3d; /* global values */ transform-
style: inherit; transform-
style: initial; transform-
style: unset; values flat indicates that the children of the element are lying in the plane of the element itself. preserve-3d indicates that the children of the element should be positioned in the 3d-space. formal definition initial valueflatapplies totransformable e...
...t indicates that the children of the element are lying in the plane of the element itself. preserve-3d indicates that the children of the element should be positioned in the 3d-space. formal definition initial valueflatapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax flat | preserve-3d examples transform
style demonstration in this example we have a 3d cube created using transforms. the parent container of the cube faces has transform-
style: preserve-3d set on it by default, so it is transformed in the 3d space and you can see it as intended. we also provide a checkbox allowing you to toggle between this, and transform-
style: flat. in this alternative state, the cube faces are all flattened onto the ...
...And 6 more matches
CSSStyleRule.styleMap - Web APIs
working draft initial definition. ...
... working draft initial definition. ...
... working draft initial definition. ...
...And 5 more matches
column-rule-style - CSS: Cascading Style Sheets
the column-rule-
style css property sets the
style of the line drawn between columns in a multi-column layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the column-rule-
style css property sets the
style of the line drawn between columns in a multi-column layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the column-rule-
style css property sets the
style of the line drawn between columns in a multi-column layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...And 4 more matches
border-block-end-style - CSS: Cascading Style Sheets
the border-block-end-
style css property defines the
style of the logical block-end border of an element, which maps to a physical border
style depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-
style, border-right-
style, border-bottom-
style, or border-left-
style property depending on the values defined for writing-mode, direction, and text-orientation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rder-right-
style, border-bottom-
style, or border-left-
style property depending on the values defined for writing-mode, direction, and text-orientation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-
style'> values */ border-block-end-
style: dashed; border-block-end-
style: dotted; border-block-end-
style: groove; related properties are border-block-start-
style, border-inline-start-
style, and border-inline-end-
style, which define the other border
styles of the element. values <'border-
style'> the line
style of the border. see border-
style. formal definition initial valuenoneapplies toall el...
...tyle: groove; related properties are border-block-start-
style, border-inline-start-
style, and border-inline-end-
style, which define the other border
styles of the element. values <'border-
style'> the line
style of the border. see border-
style. ...
...And 2 more matches
border-block-start-style - CSS: Cascading Style Sheets
the border-block-start-
style css property defines the
style of the logical block start border of an element, which maps to a physical border
style depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-
style, border-right-
style, border-bottom-
style, or border-left-
style property depending on the values defined for writing-mode, direction, and text-orientation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rder-right-
style, border-bottom-
style, or border-left-
style property depending on the values defined for writing-mode, direction, and text-orientation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-
style'> values */ border-block-start-
style: dashed; border-block-start-
style: dotted; border-block-start-
style: groove; related properties are border-block-end-
style, border-inline-start-
style, and border-inline-end-
style, which define the other border
styles of the element. values <'border-
style'> the line
style of the border. see border-
style. formal definition initial valuenoneapplies toal...
...-
style: groove; related properties are border-block-end-
style, border-inline-start-
style, and border-inline-end-
style, which define the other border
styles of the element. values <'border-
style'> the line
style of the border. see border-
style. ...
...And 2 more matches
border-inline-start-style - CSS: Cascading Style Sheets
the border-inline-start-
style css property defines the
style of the logical inline start border of an element, which maps to a physical border
style depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-
style, border-right-
style, border-bottom-
style, or border-left-
style property depending on the values defined for writing-mode, direction, and text-orientation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rder-right-
style, border-bottom-
style, or border-left-
style property depending on the values defined for writing-mode, direction, and text-orientation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-
style'> values */ border-inline-start-
style: dashed; border-inline-start-
style: dotted; border-inline-start-
style: groove; related properties are border-block-start-
style, border-block-end-
style, and border-inline-end-
style, which define the other border
styles of the element. ...
...
style'> values */ border-inline-start-
style: dashed; border-inline-start-
style: dotted; border-inline-start-
style: groove; related properties are border-block-start-
style, border-block-end-
style, and border-inline-end-
style, which define the other border
styles of the element. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete values <'border-
style'> the line
style of the border. see border-
style. ...
...And 2 more matches
list-style-position - CSS: Cascading Style Sheets
the list-
style-position css property sets the position of the ::marker relative to a list item. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often more convenient to use the shorthand list-
style. note: this property is applied to list items, i.e., elements with display: list-item;. by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. ...
... note: this property is applied to list items, i.e., elements with display: list-item;. by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. ...
...ems. note that there is variance among browsers regarding behavior when a block element is placed first within a list element declared as list-
style-position: inside. chrome and safari both place this element on the same line as the marker box, whereas firefox, internet explorer, and opera place it on the next line. for more information on this, see bug 36854. syntax /* keyword values */ list-
style-position: inside; list-
style-position: outside; /* global values */ list-
style-position: inherit; list-
style-position: initial; list-
style-position: unset; the list-
style-position property is specified as one of the keyword values listed below. values inside the ::marker is the first element among the list item's contents. outside the ::marker is outside the principal block box. forma...
...And 2 more matches
border-block-style - CSS: Cascading Style Sheets
the border-block-
style css property defines the
style of the logical block borders of an element, which maps to a physical border
style depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-
style and border-bottom-
style, or border-left-
style and border-right-
style properties depending on the values defined for writing-mode, direction, and text-orientation. /* <'border-
style'> values */ border-block-
style: dashed; border-block-
style: dotted; border-block-
style: groove; the border
style in the other dimension can be set with border-inline-
style, which sets border-inline-start-
style, and border-inline-end-
style. syntax values <'border-
style'> the line
style of the border. see border-
style. formal definition initial va...
...lock-
style: groove; the border
style in the other dimension can be set with border-inline-
style, which sets border-inline-start-
style, and border-inline-end-
style. syntax values <'border-
style'> the line
style of the border. see border-
style. ...
... editor's draft initial definition ...
... editor's draft initial definition ...
border-inline-end-style - CSS: Cascading Style Sheets
the border-inline-end-
style css property defines the
style of the logical inline end border of an element, which maps to a physical border
style depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-
style, border-right-
style, border-bottom-
style, or border-left-
style property depending on the values defined for writing-mode, direction, and text-orientation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rder-right-
style, border-bottom-
style, or border-left-
style property depending on the values defined for writing-mode, direction, and text-orientation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-
style'> values */ border-inline-end-
style: dashed; border-inline-end-
style: dotted; border-inline-end-
style: groove; related properties are border-block-start-
style, border-block-end-
style, and border-inline-start-
style, which define the other border
styles of the element. values <'border-
style'> the line
style of the border. see border-
style. formal definition initial valuenoneapplies toall ...
...
style: groove; related properties are border-block-start-
style, border-block-end-
style, and border-inline-start-
style, which define the other border
styles of the element. values <'border-
style'> the line
style of the border. see border-
style. ...
...le. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-
style'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-end-
style: dashed; } results specifications specification status comment css logical properties and values level 1the definition of 'border-inline-end-
style' in that specification. editor's draft initial definition ...
border-inline-style - CSS: Cascading Style Sheets
the border-inline-
style css property defines the
style of the logical inline borders of an element, which maps to a physical border
style depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-
style and border-bottom-
style, or border-left-
style and border-right-
style properties depending on the values defined for writing-mode, direction, and text-orientation. /* <'border-
style'> values */ border-inline-
style: dashed; border-inline-
style: dotted; border-inline-
style: groove; the border
style in the other dimension can be set with border-block-
style, which sets border-block-start-
style, and border-block-end-
style. syntax values <'border-
style'> the line
style of the border. see border-
style. formal definition initial valuenonea...
...-inline-
style: groove; the border
style in the other dimension can be set with border-block-
style, which sets border-block-start-
style, and border-block-end-
style. syntax values <'border-
style'> the line
style of the border. see border-
style. ...
... editor's draft initial definition ...
... editor's draft initial definition ...
text-decoration-style - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if the specified decoration has a specific semantic meaning, like a line-through line meaning that some text has been deleted, authors are encouraged to denote this meaning using an html tag, like <del> or <s>. as browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation. ...
...e text has been deleted, authors are encouraged to denote this meaning using an html tag, like <del> or <s>. as browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation. when setting multiple line-decoration properties at once, it may be more convenient to use the text-decoration shorthand property instead. syntax /* keyword values */ text-decoration-
style: solid; text-decoration-
style: double; text-decoration-
style: dotted; text-decoration-
style: dashed; text-decoration-
style: wavy; /* global values */ text-decoration-
style: inherit; text-decoration-
style: initial; text-decoration-
style: unset; values solid draws a single line. double draws a double line. dotted draws a dotted line. dashed draws a dashed line. wavy draws a wavy line...
...no line. use text-decoration-line: none instead. formal definition initial valuesolidapplies toall elements. ...
...s to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax solid | double | dotted | dashed | wavy examples setting a wavy underline .example { -moz-text-decoration-line: underline; -moz-text-decoration-
style: wavy; -moz-text-decoration-color: red; -webkit-text-decoration-line: underline; -webkit-text-decoration-
style: wavy; -webkit-text-decoration-color: red; } css .wavy { text-decoration-line: underline; text-decoration-
style: wavy; text-decoration-color: red; } html <p class="wavy">this text has a wavy red line beneath it.</p> results specifications specification status comment css text decoration module level 3the definition of 'text-decoration-
style' in tha...
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:
stylesheet> element (or the equivalent <xsl:transform> element) is the outermost element of a
stylesheet. namespace declaration a pseudo-attribute required to identify the document as an xslt
stylesheet. typically this is xmlns:xsl="http://www.w3.org/1999/xsl/transform". syntax <xsl:
stylesheet version="number" xmlns:xsl="http://www.w3.org/1999/xsl/transform" id="name" extension-element-prefixes="list-of-names" exclude-result-prefixes="list-of-names"> entire
stylesheet </xsl:
stylesheet> required attributes version specifies the version of xslt required by this
stylesheet. optional attributes exclude-result-prefixes specifies any namespace used in this document that shou...
...-mode defines the default value for the mode attribute of all <xsl:template> and <xsl:apply-templates> elements within its scope. default-validation defines the default value of the validation attribute of all relevant instructions appearing within its scope. expand-text determines whether descendant text nodes of the element are treated as text value templates. ...
... attribute of all <xsl:template> and <xsl:apply-templates> elements within its scope. default-validation defines the default value of the validation attribute of all relevant instructions appearing within its scope. expand-text determines whether descendant text nodes of the element are treated as text value templates. id specifies an id for this
stylesheet. this is most often used when the
stylesheet is embedded in another xml document. input-type-annotations specifies whether type annotations are stripped from the element so the same results are produced whether the source documents have been validated against a schema or not. use-when determines whether the element and all the nodes that have it as ancestor are excluded from the
stylesheet. xpath-default-namespace specifies the n...
...re produced whether the source documents have been validated against a schema or not. use-when determines whether the element and all the nodes that have it as ancestor are excluded from the
stylesheet. xpath-default-namespace specifies the namespace that will be used if the element name is unprefixed or an unprefixed type name within an xpath expression. type required outermost element of
stylesheet. specifications specification status comment xslt 3.0the definition of '<xsl:
stylesheet>' in that specification. recommendation added the attributes default-mode, expand-text, and use-when. xslt 2.0 added the attributes xpath-default-namespace, default-validation, default-collation, and input-type-annotations and made all attributes except ...
stylesheet/style - Archive of obsolete content
experimental modify
styles using
stylesheet files or css rules. globals constructors
style(options) the
style constructor creates an object that represents
style modifications via
stylesheet file(s) or/and css rules.
stylesheet file url(s) are verified to be local to an add-on, while css rules are verified to be a string or array of strings. the
style created can be applied to a content by calling attach, and removed using detach. those functions are part of content/mod module. parameters options : object required options: name type uri string,array a string, or an array of strings, that represents local uri to
stylesheet. source string,array a string, or an array of strings, that contains css rules. those rules are a...
... detach. those functions are part of content/mod module. parameters options : object required options: name type uri string,array a string, or an array of strings, that represents local uri to
stylesheet. source string,array a string, or an array of strings, that contains css rules. those rules are applied after the rules in the
stylesheet specified with uri options, if provided. optional options: name type type string the type of the sheet. ...
... a string, or an array of strings, that contains css rules. those rules are applied after the rules in the
stylesheet specified with uri options, if provided. optional options: name type type string the type of the sheet. it accepts the following values: "agent", "user" and "author". if not provided, the default value is "author".
style properties source an array of strings that contains the css rule(s) specified in the constructor's option; null if no source option was given to the constructor. this property is read-only. uri an array of strings that contains the
stylesheet local uri(s) specified in the constructor's option; null if no uri option was given to the constructor. this property is read-only. type the type of ...
list-style-image - CSS: Cascading Style Sheets
the list-
style-image css property sets an image to be used as the list item marker. it is often more convenient to use the shorthand list-
style. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to list items, i.e. elements with display: list-item; by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. ...
...ve examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to list items, i.e. elements with display: list-item; by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. syntax /* keyword values */ list-
style-image: none; /* <url> values */ list-
style-image: url('starsolid.gif'); /* global values */ list-
style-image: inherit; list-
style-image: initial; list-
style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-
style-type will be used instead. formal definition initial va...
...image is used as the marker. if this value is set, the marker defined in list-
style-type will be used instead. formal definition initial valuenoneapplies tolist itemsinheritedyescomputed valuenone or the image with its uri made absoluteanimation typediscrete formal syntax <url> | none examples setting list item images html <ul> <li>item 1</li> <li>item 2</li> </ul> css ul { list-
style-image: url("https://mdn.mozillademos.org/files/11981/starsolid.gif"); } result specifications specification status comment css lists module level 3the definition of 'list-
style-image' in that specification. working draft extends support to any <image> data type. css level 2 (revision 1)the definition of 'list-
style-image' in that specification. r...
text-emphasis-style - CSS: Cascading Style Sheets
the text-emphasis-
style css property sets the appearance of emphasis marks. it can also be set, and reset, using the text-emphasis shorthand. /* initial value */ text-emphasis-
style: none; /* no emphasis marks */ /* <string> values */ text-emphasis-
style: 'x'; text-emphasis-
style: '点'; text-emphasis-
style: '\25b2'; text-emphasis-
style: '*'; text-emphasis-
style: 'foo'; /* should not be used. ...
...also be set, and reset, using the text-emphasis shorthand. /* initial value */ text-emphasis-
style: none; /* no emphasis marks */ /* <string> values */ text-emphasis-
style: 'x'; text-emphasis-
style: '点'; text-emphasis-
style: '\25b2'; text-emphasis-
style: '*'; text-emphasis-
style: 'foo'; /* should not be used. it may be computed to or rendered as 'f' only */ /* keyword values */ text-emphasis-
style: filled; text-emphasis-
style: open; text-emphasis-
style: dot; text-emphasis-
style: circle; text-emphasis-
style: double-circle; text-emphasis-
style: triangle; text-emphasis-
style: filled sesame; text-emphasis-
style: open sesame; /* global values */ text-emphasis-
style: inherit; text-emphasis-
style: initial; text-emphasis-
style: unset; syntax values none no emphasis marks. filled the shap...
...ld not specify more than one character in <string>. the ua may truncate or ignore strings consisting of more than one grapheme cluster. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ [ filled | open ] | [ dot | circle | double-circle | triangle | sesame ] ] | <string> examples h2 { text-emphasis-
style: sesame; } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification. candidate recommendation initial definition ...
CSSStyleRule.style - Web APIs
the cssrule.
style property is the css
styledeclaration interface for the declaration block of the cssrule. syntax
styleobj = cssrule.
style example function stilo() { alert(document.
stylesheets[0].cssrules[0].
style.csstext); } // displays "background-color: gray;" notes the declaration block is that part of the
style rule that appears within the braces and that actually provides the
style definitions (for the selector, the part that comes before the braces). ...
StyleSheet.parentStyleSheet - Web APIs
the parent
stylesheet property of the
stylesheet interface returns the
style sheet, if any, that is including the given
style sheet. syntax objref =
stylesheet.parent
stylesheet example // find the top level
stylesheet if (
stylesheet.parent
stylesheet) { sheet =
stylesheet.parent
stylesheet; } else { sheet =
stylesheet; } notes this property returns null if the current
stylesheet is a top-level
stylesheet or if
stylesheet inclusion is not supported. specifications specification status comment css object model (cssom)the definition of '
stylesheet: parent
stylesheet' in that specification. working draft ...
CSS Counter Styles - CSS: Cascading Style Sheets
css counter
styles is a module of css that lets you define your own counter
styles. reference properties counter-increment counter-reset at-rules @counter-
style system additive-symbols negative prefix suffix range pad speak-as fallback guides using css counters describes how to use counters to number any html element or to perform complex counting. specifications specification status comment css counter
styles level 3 candidate recommendation initial definition. ...
filter - CSS: Cascading Style Sheets
age. the value of radius defines the value of the standard deviation to the gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur. the lacuna value for interpolation is 0. the parameter is specified as a css length, but does not accept percentage values. ...
... to the gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur. the lacuna value for interpolation is 0. the parameter is specified as a css length, but does not accept percentage values. ...
...into each other, so a larger value will create more blur. the lacuna value for interpolation is 0. the parameter is specified as a css length, but does not accept percentage values. ...
...And 59 more matches
Style System Overview - Archive of obsolete content
style system
style sheets & rules ↓ rule tree ↓
style context interface
style sheets & rules nsi
styleruleprocessor and nsi
stylesheet describe in c++ what a css
stylesheet can do nsi
stylerule describes in c++ what a css
style rule can do main implementations are for css, but we have other implementations in c++ that: do what css can't do do things faster than css would css
style sheets at basic level, sheet is collection of rules other special things: @import, @media, @namespace, etc. a rule is a selector and a declaration block. a declaration block is a group of declarations. a declaration is a property and a value. ...
... rule applies to matched elements. “cascaded” value for property + element: if 0 rules matching the element have the property: some properties inherit and some properties use initial value. inherited: 'font-size', 'color', etc. ...
... rule applies to matched elements. “cascaded” value for property + element: if 0 rules matching the element have the property: some properties inherit and some properties use initial value. inherited: 'font-size', 'color', etc. “reset”: 'border', 'background', etc. ...
...And 45 more matches
Applying styles and colors - Web APIs
« previousnext » in the chapter about drawing shapes, we used only the default line and fill
styles. here we will explore the canvas options we have at our disposal to make our drawings a little more attractive. you will learn how to add different colors, line
styles, gradients, patterns and shadows to your drawings. colors up until now we have only seen methods of the drawing context. if we want to apply colors to a shape, there are two important properties we can use: fill
style and stroke
style. fill
style = color sets the
style used when filling shapes. stroke
style = color sets the
style for shapes' outlines. color is a string representing a css <color>, a gradient object, or a pattern object. we'll look at gradient and pattern objects later. by default, the stro...
...fill
style and stroke
style. fill
style = color sets the
style used when filling shapes. stroke
style = color sets the
style for shapes' outlines. color is a string representing a css <color>, a gradient object, or a pattern object. we'll look at gradient and pattern objects later. by default, the stroke and fill color are set to black (css color value #000000). note: when you set the stroke
style and/or fill
style property, the new value becomes the default for all shapes being drawn from then on. for every shape you want in a different color, you will need to reassign the fill
style or stroke
style property. the valid strings you can enter should, according to the specification, be css <color> values. each of the following examples describe the same color. ...
...the resulting image should look something like the screenshot. there is nothing too spectacular happening here. ...
...And 34 more matches
Mozilla Style System Documentation
see also the
style techtalk for more complete although less detailed documentation.
style context management a
style context (class ns
stylecontext, currently also interface nsi
stylecontext although the interface should go away when all of the
style systems can be moved back into the layout dll) represents the
style data for a css formatting object. in the layout system, these formatting objects are described as frames (interface nsiframe), although a pair of frames represents table formatting objects. the css specification describes formatting objects that correspond to elements in the content model and formatting objects that correspond to pseudo-elements. ...
...ystem, these formatting objects are described as frames (interface nsiframe), although a pair of frames represents table formatting objects. the css specification describes formatting objects that correspond to elements in the content model and formatting objects that correspond to pseudo-elements. ...
...matting objects. the css specification describes formatting objects that correspond to elements in the content model and formatting objects that correspond to pseudo-elements. (mozilla has a bunch of its pseudo-elements that are not in the css specification.) we also create
style contexts for some things that are not css formatting objects: text nodes and placeholder frames. these three types of
style contexts correspond to the three ways of creating a
style context: nsiprescontext::resolve
stylecontextfor, nsiprescontext::resolvepseudo
stylecontextfor, and.nsiprescontext::resolve
stylecontextfornonelement there is also a fourth method, nsiprescontext::probepseudo
stylecontextfor, which creates a
style context only if there are
style rules that match the pseudo-element. this is useful for the pseu...
...And 32 more matches
system - CSS: Cascading Style Sheets
if the algorithm specified in the system descriptor is unable to construct the representation for a particular counter value, then that value's representation will be constructed using the fallback system provided. ...
...es */ system: cyclic; system: numeric; system: alphabetic; system: symbolic; system: additive; system: fixed; /* combined values */ system: fixed 3; system: extends decimal; this may take one of three forms: one of the keyword values cyclic, numeric, alphabetic, symbolic, additive, or fixed. the keyword value fixed along with an integer. the keyword value or extends along with a @counter-
style name. cyclic cycles through the list of symbols provided. once the end of the list of symbols is reached, it will loop back to the beginning and start over. this system is useful for simple bullet
styles with just one symbol, or for
styles having multiple symbols. at least one symbol must be specified in the symbols descriptor, or the counter
style is not valid. fixed defines a finite ...
...also an optional <integer> can be specified after the the system, as the value of the first symbol. if this integer is omitted, value of the first integer is taken as 1. symbolic cycles through the provided list of symbols. ...
...And 24 more matches
CSP: style-src - HTTP
the http content-security-policy (csp)
style-src directive specifies valid sources for
stylesheets. csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. syntax one or more sources can be allowed for the
style-src policy: content-security-policy:
style-src <source>; content-security-policy:
style-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal...
......
...ce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or
styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or
style. when generating the hash, don't include the <script> or <
style> tags and note that capitalization and whitespace matter, including leading or trailing whitespace. see unsafe inline script for an example. in csp 2.0, this applie...
...And 23 more matches
Using the Stylesheet Service - Archive of obsolete content
the examples in this document are all written in javascript using xpcom. using the api the string "chrome://myext/content/myext.css" in the examples below is just an example. replace it with the url of the css file you want to load. you can replace user_sheet with agent_sheet or author_sheet, depending where in the css cascade you want the sheet to be placed. ...
... the examples in this document are all written in javascript using xpcom. using the api the string "chrome://myext/content/myext.css" in the examples below is just an example. replace it with the url of the css file you want to load. you can replace user_sheet with agent_sheet or author_sheet, depending where in the css cascade you want the sheet to be placed. ...
...cument are all written in javascript using xpcom. using the api the string "chrome://myext/content/myext.css" in the examples below is just an example. replace it with the url of the css file you want to load. you can replace user_sheet with agent_sheet or author_sheet, depending where in the css cascade you want the sheet to be placed. see the css specification for more details. ...
...And 18 more matches
Box-shadow generator - CSS: Cascading Style Sheets
et" data-topic="height" data-type="add"></div> <div class="ui-slider-input" data-topic="height" data-unit="px"></div> </div> </div> </div> <div id="output" class="category"> <div id="menu" class="menu"></div> <div class="title"> css code </div> <div class="group"
style="border-top-left-radius: 0;"> <div class="output" data-topic="element" data-name="element" data-prop="width height background-color position=[relative] box-shadow"> </div> <div class="output" data-topic="before" data-name="element:before" data-prop="content=[""] position=[absolute...
...s.max - this.min; var offset = this.pointer.clientwidth + 4; // border width * 2 if (pos < 0) pos = 0; if (pos > width) pos = width; var value = pos * delta / width | 0; var precision = value % this.step; value = value - precision + this.min; if (precision > this.step / 2) value = value + this.step; if (this.snap) pos = (value - this.min) * width / delta; this.pointer.
style.left = pos - offset/2 + "px"; this.value = value; node.setattribute('data-value', value); notify.call(this); } var setvalue = function setvalue(topic, value) { var slider = sliders[topic]; if (value > slider.max || value < slider.min) return; var delta = slider.max - slider.min; var width = slider.node.clientwidth; var offset = slider.pointer.clientwidth; var pos = (val...
...ata-value', value); notify.call(this); } var setvalue = function setvalue(topic, value) { var slider = sliders[topic]; if (value > slider.max || value < slider.min) return; var delta = slider.max - slider.min; var width = slider.node.clientwidth; var offset = slider.pointer.clientwidth; var pos = (value - slider.min) * width / delta; slider.value = value; slider.pointer.
style.left = pos - offset / 2 + "px"; slider.node.setattribute('data-value', value); notify.call(slider); } var setmousetracking = function setmousetracking(elem, callback) { elem.addeventlistener("mousedown", function(e) { callback(e); document.addeventlistener("mousemove", callback); }); document.addeventlistener("mouseup", function(e) { document.removeeventlistener("mousemove"...
...And 18 more matches
font - CSS: Cascading Style Sheets
that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties). though not directly settable by font, the longhands font-size-adjust and font-kerning are also reset to their initial values. constituent properties this property is a shorthand for the following css properties: font-family font-size font-stretch font-
style font-variant font-weight line-height syntax the font property may be specified as either a single keyword, which will select a system font, or as a shorthand for various font-related properties. if font is specified as a system keyword, it must be one of: caption, icon, menu, message-box, small-caption, status-bar. if font is specified as a shorthand for several font-related properties, t...
...lect a system font, or as a shorthand for various font-related properties. if font is specified as a system keyword, it must be one of: caption, icon, menu, message-box, small-caption, status-bar. if font is specified as a shorthand for several font-related properties, then: it must include values for: <font-size> <font-family> it may optionally include values for: <font-
style> <font-variant> <font-weight> <font-stretch> <line-height> font-
style, font-variant and font-weight must precede font-size font-variant may only specify the values defined in css 2.1, that is normal and small-caps font-stretch may only be a single keyword value. line-height must immediately follow font-size, preceded by "/", like this: "16px/3" font-family must be the last v...
... <'font-variant'> see the font-variant css property. <'font-weight'> see the font-weight css property. <'font-stretch'> see the font-stretch css property. <'font-size'> see the font-size css property. <'line-height'> see the line-height css property. <'font-family'> see the font-family css property. ...
...And 17 more matches
CSSStyleSheet - Web APIs
the css
stylesheet interface represents a single css
stylesheet, and lets you inspect and modify the list of rules contained in the
stylesheet. it inherits properties and methods from its parent,
stylesheet. a
stylesheet consists of a collection of cssrule objects representing each of the rules in the
stylesheet. the rules are contained in a cssrulelist, which can be obtained from the
stylesheet's cssrules property. for example, one rule might be a css
stylerule object containing a
style such as: h1, h2 { font-size: 16pt; } another rule might be an at-rule such as @import or @media, and so forth. see the notes section for the various ways a css
stylesheet object can be obtained. properties inherits properties from its parent,
stylesheet. cssrules read only returns a live cssrulel...
... a
style such as: h1, h2 { font-size: 16pt; } another rule might be an at-rule such as @import or @media, and so forth. see the notes section for the various ways a css
stylesheet object can be obtained. properties inherits properties from its parent,
stylesheet. cssrules read only returns a live cssrulelist which maintains an up-to-date list of the cssrule objects that comprise the
stylesheet. this is normally used to access individual rules like this:
stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or remove items in cssrules, use the css
stylesheet's insertrule() and deleterule() methods. ...
...et. cssrules read only returns a live cssrulelist which maintains an up-to-date list of the cssrule objects that comprise the
stylesheet. this is normally used to access individual rules like this:
stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or remove items in cssrules, use the css
stylesheet's insertrule() and deleterule() methods. ownerrule read only if this
stylesheet is imported into the document using an @import rule, the ownerrule property returns the corresponding cssimportrule; otherwise, this property's value is null. methods inherits methods from its parent,
stylesheet. ...
...And 16 more matches
Introducing the CSS Cascade - CSS: Cascading Style Sheets
this article explains what the cascade is, the order in which css declarations cascade, and how this affects you, the web developer. which css entities participate in the cascade only css declarations, that is property/value pairs, participate in the cascade. this means that at-rules containing entities other than declarations, such as a @font-face rule containing descriptors, don't participate in the cascade. ...
...e, only the at-rule as a whole is selected via the cascade algorithm. finally, note that @import and @charset obey specific algorithms and aren't affected by the cascade algorithm. origin of css declarations the css cascade algorithm's job is to select css declarations in order to determine the correct values for css properties. ...
... whole is selected via the cascade algorithm. finally, note that @import and @charset obey specific algorithms and aren't affected by the cascade algorithm. origin of css declarations the css cascade algorithm's job is to select css declarations in order to determine the correct values for css properties. ...
...And 16 more matches
Adding Style Sheets - Archive of obsolete content
« previousnext » we have hardly modified the look of the elements we have created so far. xul uses css (cascading
style sheets) to customize elements.
style sheets a
style sheet is a file which contains
style information for elements. it was originally designed for html elements but can be applied to xul elements also, or to any xml for that matter. the
style sheet contains information such as the fonts, colors, borders, and size of elements. mozilla applies a default
style sheet to each xul window. in many cases, it will suffice to leave the defaults as is. other times, however, you will want to provide a custom
style sheet. in general, you will associate a single
style sheet with each xul file. you can place a
style sheet anywhere you wish. if your xul file is stored remotely...
...this method has the disadvantage because it means your application will not be themeable. the second method involves placing your files as part of a theme. ...
...want to provide a custom
style sheet. in general, you will associate a single
style sheet with each xul file. you can place a
style sheet anywhere you wish. if your xul file is stored remotely and accessed via an http url, you can store the
style sheet remotely as well. if you are creating a xul package to be installed as part of the chrome system, you have two choices. first, you could store the
style sheet in the same directory as the xul file. this method has the disadvantage because it means your application will not be themeable. the second method involves placing your files as part of a theme. ...
...And 15 more matches
Mozilla Style System
the
style system is the module of mozilla's code responsible for the loading and parsing of css
style sheets, and the computation of computed values for all css properties. the handling of those computed values is the responsibility of other parts of the code. architecture the
style system is split in half rather neatly. in one half (the backend) are the sources of specified
style data, and in the other half (the frontend) is the code that turns the specified values into computed values. ...
...rts of the code. architecture the
style system is split in half rather neatly. in one half (the backend) are the sources of specified
style data, and in the other half (the frontend) is the code that turns the specified values into computed values. the barrier between these two halves consists of three abstract interfaces, plus some smaller structures associated with some methods on each: nsi
stylesheet nsi
stylesheet represents what one would think of as a
style sheet: the in-memory representation of a css file or other source of
style data. some
style sheets are managed by the document; some apply to all documents. the
style system actually has relatively little to do with
style sheets; it instead deals with
style rule processors. ...
... associated with some methods on each: nsi
stylesheet nsi
stylesheet represents what one would think of as a
style sheet: the in-memory representation of a css file or other source of
style data. some
style sheets are managed by the document; some apply to all documents. the
style system actually has relatively little to do with
style sheets; it instead deals with
style rule processors. nsi
styleruleprocessor a
style rule processor represents an origin within the css cascade. thus there is a single
style rule processor for all user-agent css
style sheets, a single
style rule processor for all user css
style sheets, and a single
style rule processor for all author css
style sheets. ...
...And 13 more matches
CSS reference - CSS: Cascading Style Sheets
use this css reference to browse an alphabetical index of all of the standard css properties, pseudo-classes, pseudo-elements, data types, and at-rules. you can also browse key css concepts and a list of selectors organized by type. also included is a brief dom-css / cssom reference. basic rule syntax
style rule syntax
style-rule ::= selectors-list { properties-list } ... ...
...e-rule ::= selectors-list { properties-list } ... where : selectors-list ::= selector[:pseudo-class] [::pseudo-element] [, selectors-list] properties-list ::= [property : value] [; properties-list] see the index of selectors, pseudo-classes, and pseudo-elements below. the syntax for each specified value depends on the data type defined for each specified property.
style rule examples strong { color: red; } div.menu-bar li:hover > ul { display: block; } for a beginner-level introduction to the syntax of selectors, see our guide on css selectors. be aware that any syntax error in a rule definition invalidates the entire rule. invalid rules are ignored by the browser. note that css rule definitions are entirely (ascii) text-based, whereas dom-css / cssom (t...
... whereas dom-css / cssom (the rule management system) is object-based. at-rule syntax as the structure of at-rules varies widely, please see at-rule to find the syntax of the specific one you want. keyword index note: the property names in this index do not include the javascript names where they differ from the css standard names. ...
...And 13 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
ng_area.clientwidth; if (x > size) x = size; if (y > size) y = size; if (x < 0) x = 0; if (y < 0) y = 0; var value = 100 - (y * 100 / size) | 0; var saturation = x * 100 / size | 0; if (this.picker_mode === 'hsv') this.color.sethsv(this.color.hue, saturation, value); if (this.picker_mode === 'hsl') this.color.sethsl(this.color.hue, saturation, value); this.color_picker.
style.left = x + 'px'; this.color_picker.
style.top = y + 'px'; this.updatealphagradient(); this.updatepreviewcolor(); this.notify('value', value); this.notify('lightness', value); this.notify('saturation', saturation); this.notify('red', this.color.r); this.notify('green', this.color.g); this.notify('blue', this.color.b); this.notify('hexa', this.color.gethexa()); notify(this.
...********/ colorpicker.prototype.updatepickerposition = function updatepickerposition() { var size = this.picking_area.clientwidth; var value = 0; if (this.picker_mode === 'hsv') value = this.color.value; if (this.picker_mode === 'hsl') value = this.color.lightness; var x = (this.color.saturation * size / 100) | 0; var y = size - (value * size / 100) | 0; this.color_picker.
style.left = x + 'px'; this.color_picker.
style.top = y + 'px'; }; colorpicker.prototype.updatesliderposition = function updatesliderposition(elem, pos) { elem.
style.left = pos + 'px'; }; colorpicker.prototype.updatehuepicker = function updatehuepicker() { var size = this.hue_area.clientwidth; var pos = (this.color.hue * size / 360 ) | 0; this.hue_picker.
style.left = pos + 'px'; }; co...
...= pos + 'px'; }; colorpicker.prototype.updatehuepicker = function updatehuepicker() { var size = this.hue_area.clientwidth; var pos = (this.color.hue * size / 360 ) | 0; this.hue_picker.
style.left = pos + 'px'; }; colorpicker.prototype.updatealphapicker = function updatealphapicker() { var size = this.alpha_mask.clientwidth; var pos = (this.color.a * size) | 0; this.alpha_picker.
style.left = pos + 'px'; }; /*************************************************************************/ // update background colors /*************************************************************************/ colorpicker.prototype.updatepickerbackground = function updatepickerbackground() { var nc = new color(this.color); nc.sethsv(nc.hue, 100, 100); this.picking_area.
style.backgroundc...
...And 13 more matches
border-inline-end - CSS: Cascading Style Sheets
the border-inline-end css property is a shorthand property for setting the individual logical inline-end border property values in a single place in the
style sheet. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: border-inline-end-color border-inline-end-
style border-inline-end-width syntax border-inline-end: 1px; border-inline-end: 2px dashed; border-inline-end: medium dashed blue; the physical border to which border-inline-end maps depends on the element's writing mode, directionality, and text orientation. it correspo...
...ing-mode, direction, and text-orientation. related properties are border-block-start, border-block-end, and border-inline-start, which define the other borders of the element. ...
...s are border-block-start, border-block-end, and border-inline-start, which define the other borders of the element. ...
...And 13 more matches
Color picker tool - CSS: Cascading Style Sheets
ng_area.clientwidth; if (x > size) x = size; if (y > size) y = size; if (x < 0) x = 0; if (y < 0) y = 0; var value = 100 - (y * 100 / size) | 0; var saturation = x * 100 / size | 0; if (this.picker_mode === 'hsv') this.color.sethsv(this.color.hue, saturation, value); if (this.picker_mode === 'hsl') this.color.sethsl(this.color.hue, saturation, value); this.color_picker.
style.left = x - picker_offset + 'px'; this.color_picker.
style.top = y - picker_offset + 'px'; this.updatealphagradient(); this.updatepreviewcolor(); this.notify('value', value); this.notify('lightness', value); this.notify('saturation', saturation); this.notify('red', this.color.r); this.notify('green', this.color.g); this.notify('blue', this.color.b); this.notify('hexa', this.c...
...icker.prototype.updatepickerposition = function updatepickerposition() { var size = this.picking_area.clientwidth; var value = 0; var offset = 5; if (this.picker_mode === 'hsv') value = this.color.value; if (this.picker_mode === 'hsl') value = this.color.lightness; var x = (this.color.saturation * size / 100) | 0; var y = size - (value * size / 100) | 0; this.color_picker.
style.left = x - offset + 'px'; this.color_picker.
style.top = y - offset + 'px'; }; colorpicker.prototype.updatesliderposition = function updatesliderposition(elem, pos) { elem.
style.left = math.max(pos - 3, -2) + 'px'; }; colorpicker.prototype.updatehuepicker = function updatehuepicker() { var size = this.hue_area.clientwidth; var offset = 1; var pos = (this.color.hue * size / 360 ) | ...
...'px'; this.color_picker.
style.top = y - offset + 'px'; }; colorpicker.prototype.updatesliderposition = function updatesliderposition(elem, pos) { elem.
style.left = math.max(pos - 3, -2) + 'px'; }; colorpicker.prototype.updatehuepicker = function updatehuepicker() { var size = this.hue_area.clientwidth; var offset = 1; var pos = (this.color.hue * size / 360 ) | 0; this.hue_picker.
style.left = pos - offset + 'px'; }; colorpicker.prototype.updatealphapicker = function updatealphapicker() { var size = this.alpha_area.clientwidth; var offset = 1; var pos = (this.color.a * size) | 0; this.alpha_picker.
style.left = pos - offset + 'px'; }; /*************************************************************************/ // update background colors /*********************...
...And 12 more matches
StylePropertyMapReadOnly - Web APIs
the
stylepropertymapreadonly interface of the the css typed object model api provides a read-only representation of a css declaration block that is an alternative to css
styledeclaration. retrieve an instance of this interface using element.computed
stylemap(). properties
stylepropertymapreadonly.size returns an unsinged long integer containing the size of the
stylepropertymapreadonly object. methods
stylepropertymapreadonly.entries() returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
stylepropertymapreadonly.foreach() executes a provided function once for each element of
stylepropertymapreadonly. ...
.... methods
stylepropertymapreadonly.entries() returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
stylepropertymapreadonly.foreach() executes a provided function once for each element of
stylepropertymapreadonly.
stylepropertymapreadonly.get() returns the value of the specified property.
stylepropertymapreadonly.getall() returns an array of css
stylevalue objects containing the values for the provided property.
stylepropertymapreadonly.has() indicates whether the specified property is in the
stylepropertymapreadonly object. ...
...cutes a provided function once for each element of
stylepropertymapreadonly.
stylepropertymapreadonly.get() returns the value of the specified property.
stylepropertymapreadonly.getall() returns an array of css
stylevalue objects containing the values for the provided property.
stylepropertymapreadonly.has() indicates whether the specified property is in the
stylepropertymapreadonly object.
stylepropertymapreadonly.keys() returns a new array iterator containing the keys for each item in
stylepropertymapreadonly.
stylepropertymapreadonly.values() returns a new array iterator containing the values for each index in the
stylepropertymapreadonly object. ...
...And 11 more matches
border - CSS: Cascading Style Sheets
the border shorthand css property sets an element's border. it sets the values of border-width, border-
style, and border-color. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the values of border-width, border-
style, and border-color. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: border-color border-
style border-width syntax /*
style */ border: solid; /* width |
style */ border: 2px dotted; /*
style | color */ border: outset #f33; /* width |
style | color */ border: medium dashed green; /* global values */ border: inherit; border: initial; border: unset; the border property may be specified using one, two, or three of the values listed below. the order of the values does not matter. no...
... <color> sets the color of the border. defaults to currentcolor if absent. see border-color. ...
...And 11 more matches
Variable fonts guide - CSS: Cascading Style Sheets
they let you access all the variations contained in a given font file via css and a single @font-face reference. this article will give you all you need to know to get you started using variable fonts. warning: in order to use variable fonts on your operating system, you need to make sure that it is up to date. ...
...onts in web pages or the firefox developer tools. variable fonts: what they are, and how they differ to better understand what's different about variable fonts, it is worth reviewing what non-variable ones are like and how they compare. standard (or static) fonts in the past, a typeface would be produced as a number of individual fonts, and each font would represent one specific width/weight/
style combination. so you would have separate files for 'roboto regular', 'roboto bold', and 'roboto bold italic' — meaning that you could end up with 20 or 30 different font files to represent a complete typeface (it could be several times that for a large typeface that has different widths as well). in such a scenario, in order to use a typeface for typical use on a site for body copy you would ne...
...ing downloaded (usually around 20k or more per file). variable fonts with a variable font, all of those permutations can be contained in a single file. that file would be larger than a single font, but in most cases smaller or about the same size as the 4 you might load for body copy. the advantage in choosing the variable font is that you have access to the entire range of weights, widths, and
styles available, rather than being constrained to only the few that you previously would have loaded separately. this allows for common typographic techniques such as setting different size headings in different weights for better readability at each size, or using a slightly narrower width for data-dense displays. for comparison, it is typical in a typographic system for a magazine to use 10–15 or...
...And 10 more matches
Window.getComputedStyle() - Web APIs
the window.getcomputed
style() method returns an object containing the values of all css properties of an element, after applying active
stylesheets and resolving any basic computation those values may contain. individual css property values are accessed through apis provided by the object, or by indexing with css property names. syntax var
style = window.getcomputed
style(element [, pseudoelt]); element the element for which to get the computed
style. pseudoeltoptional a string specifying the pseudo-element to match. omitted (or null) for real elements. the returned
style is a live css
styledeclaration object, which updates automatically when the element's
styles are changed. throws typeerror if the passed object is not an element or the pseudoelt is not a valid pseudo-element sel...
...omatically when the element's
styles are changed. throws typeerror if the passed object is not an element or the pseudoelt is not a valid pseudo-element selector or is ::part() or ::slotted(). note: valid pseudo-element selector refers to syntactic validity, e.g. ::unsupported is considered valid, even though the pseudo-element itself is not supported. examples in this example we
style a <p> element, then retrieve those
styles using getcomputed
style(), and print them into the text content of the <p>. ...
...supported. examples in this example we
style a <p> element, then retrieve those
styles using getcomputed
style(), and print them into the text content of the <p>. html <p>hello</p> css p { width: 400px; margin: 0 auto; padding: 20px; font: 2rem/2 sans-serif; text-align: center; background: purple; color: white; } javascript let para = document.queryselector('p'); let comp
styles = window.getcomputed
style(para); para.textcontent = 'my computed font-size is ' + comp
styles.getpropertyvalue('font-size') + ',\nand my computed line-height is ' + comp
styles.getpropertyvalue('line-height') + '.'; result description the returned object is the same css
styledeclaration type as the object returned from the element's
style property. however, the two objects have...
...And 9 more matches
-moz-image-rect - CSS: Cascading Style Sheets
tage>, of the sub-image within the specified image. left the left edge, specified as an <integer> or <percentage>, of the sub-image within the specified image. description this property allows you to, for example, use different parts of one larger image as backgrounds in different parts of your content. this works very similarly to the -moz-image-region property, which is used with the list-
style-image property to use parts of an image as the bullets in lists. however, this can be used for any css background. the syntax for the rectangle is similar to the rect() function generating a <<shape>()> css type. all four values are relative to the upper left corner of the image. examples this example loads an image and uses it in four segments to draw the firefox logo in four <div> blocks. cl...
...nerating a <<shape>()> css type. all four values are relative to the upper left corner of the image. examples this example loads an image and uses it in four segments to draw the firefox logo in four <div> blocks. clicking on their container causes the four segments to rotate around by swapping the background-image property values among the four <div> blocks. css the css defines one container
style, then the
styles for the four boxes that comprise the complete image. the container looks like this: #container { width:267px; height:272px; top:100px; left:100px; position:absolute; font-size:16px; text-shadow:white 0px 0px 6px; text-align:center; } then the four boxes defining the segments of the image are defined. let's look at them one at a time. #box1 { background-image...
...these four segments are all contained within a larger <div> block whose primary purpose is to re...
...And 9 more matches
Border-image generator - CSS: Cascading Style Sheets
ooltip2[data-info='bottom'] { top: -10px; right: -50px; } #subject .tooltip2[data-info='left'] { bottom: -30px; right: -20px; } /* preview */ #preview { width: 30%; height: 50%; background-color: #fff; text-align: center; overflow: hidden; position: absolute; z-index: 10; left: 60%; top: 15%; border-radius: 2px; border-image-width: 20px; border-image-repeat: round; border-
style: solid; box-shadow: 0 0 3px 0 #bababa; } #preview .resize-handle { width: 10px; height: 10px; background: url("https://mdn.mozillademos.org/files/6027/resize.png") center center no-repeat; position: absolute; bottom: 0; right: 0; } #preview .resize-handle:hover { cursor: nw-resize; } /* * general controls menu */ #general-controls { padding: 10px 30px; background-color: #fff; op...
...rty .value { width: 65%; padding: 0 2.5%; word-break: break-all; float: left; } javascript content 'use strict'; /** * ui-slidersmanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.
style.width = 50 + obj.precision * 10 + 'px'; input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function slidercomponent(obj, sign)...
...onent(obj, sign) { var slider = document.createelement('div'); var startx = null; var start_value = 0; slider.addeventlistener("click", function(e) { document.removeeventlistener("mousemove", slidermotion); setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.
style.cursor = "e-resize"; document.addeventlistener("mouseup", slideend); document.addeventlistener("mousemove", slidermotion); }); var slideend = function slideend(e) { document.removeeventlistener("mousemove", slidermotion); document.body.
style.cursor = "auto"; slider.
style.cursor = "pointer"; }; var slidermotion = function slidermotion(e) { slider.
style.cursor = "e-resi...
...And 9 more matches
border-block-start - CSS: Cascading Style Sheets
the border-block-start css property is a shorthand property for setting the individual logical block-start border property values in a single place in the
style sheet. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...a single place in the
style sheet. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: border-block-start-color border-block-start-
style border-block-start-width syntax border-block-start: 1px; border-block-start: 2px dotted; border-block-start: medium dashed blue; border-block-start can be used to set the values for one or more of border-block-start-width, border-block-start-
style, and border-block-start-color. the physical border to which it maps depends on the element's writing mode, directionality, and text orientation.
...r-left property depending on the values defined for writing-mode, direction, and text-orientation. related properties are border-block-end, border-inline-start, and border-inline-end, which define the other borders of the element. values the border-block-start is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. ...
...And 9 more matches
border-inline-start - CSS: Cascading Style Sheets
the border-inline-start css property is a shorthand property for setting the individual logical inline-start border property values in a single place in the
style sheet. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...a single place in the
style sheet. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: border-inline-start-color border-inline-start-
style border-inline-start-width syntax border-inline-start: 1px; border-inline-start: 2px dotted; border-inline-start: medium dashed green; the physical border to which border-inline-start maps depends on the element's writing mode, directionality, and text orientation. it corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writi...
...r-left property depending on the values defined for writing-mode, direction, and text-orientation. related properties are border-block-start, border-block-end, and border-inline-end, which define the other borders of the element. values the border-inline-start is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. ...
...And 9 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes found 54 pages: # page tags and summary 1 xslt: extensible
stylesheet language transformations landing, web, xslt extensible
stylesheet language transformations (xslt) is an xml-based language used, in conjunction with specialized processing software, for the transformation of xml documents. 2 common xslt errors xslt your server needs to send both the source and the
stylesheet with a xml mime type, text/xml or application/xml. to find out the current type, load the file in mozilla and look at the page info. or use a download tool, those usually tell the mime type. 3 index index, reference, xslt found 54 pages: 4 ...
...presentable form and then add it into an existing document. since the xml data loaded only contains the raw information without any presentation data, it can load quickly even on dialup. 10 javascript/xslt bindings dom, javascript, xml, xslt javascript can run xslt transformations through the xsltprocessor object. once instantiated, an xsltprocessor has an xsltprocessor.import
stylesheet() method that takes as an argument the xslt
stylesheet to be used in the transformation. the
stylesheet has to be passed in as an xml document, which means that the .xsl file has to be loaded by the page before calling xsltprocessor.import
stylesheet(). this can be done via xmlhttprequest or xmldocument.load(). 11 resources xslt no summary! 12 setting parameter...
... itself, unhindered by a need to provide any indication about how this data should eventually be presented. this intelligent structuring is particularly important as more and more data transfers are automated and take place between highly heterogeneous machines linked by a network. 14 an overview needshelp, needsmarkupwork, transforming_xml_with_xslt, xml, xslt the extensible
stylesheet language/transform is a very powerful language, and a complete discussion of it is well beyond the scope of this article, but a brief discussion of some basic concepts will be helpful in understanding the description of netscape's capabilities that follows. 15 for further reading needscontent, needshelp, transforming_xml_with_xslt, xml, xslt http://www.amazon.com/xslt-pr...
...And 9 more matches
CSSCounterStyleRule - Web APIs
the csscounter
stylerule interface represents an @counter-
style at-rule. ...
... the csscounter
stylerule interface represents an @counter-
style at-rule. ...
... the csscounter
stylerule interface represents an @counter-
style at-rule. ...
...And 8 more matches
StyleSheet.media - Web APIs
the media property of the
stylesheet interface specifies the intended destination media for
style information. it is a read-only, array-like medialist object and can be removed with deletemedium() and added with appendmedium(). ...
... the media property of the
stylesheet interface specifies the intended destination media for
style information. it is a read-only, array-like medialist object and can be removed with deletemedium() and added with appendmedium(). ...
... the media property of the
stylesheet interface specifies the intended destination media for
style information. it is a read-only, array-like medialist object and can be removed with deletemedium() and added with appendmedium(). ...
...And 8 more matches
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
-left. if you were using a horizontal-tb writing mode with a right-to-left text direction then margin-inline-start would be the same as margin-right, and in a vertical writing mode it would be the same as using margin-top. ...
...ng a horizontal-tb writing mode with a right-to-left text direction then margin-inline-start would be the same as margin-right, and in a vertical writing mode it would be the same as using margin-top. ...
...ing margin-top. ...
...And 8 more matches
Using media queries - CSS: Cascading Style Sheets
media queries are useful when you want to modify your site or app depending on a device's general type (such as print vs. screen) or specific characteristics and parameters (such as screen resolution or browser viewport width). media queries are used for the following: to conditionally apply
styles with the css @media and @import at-rules. to target specific media for the <
style>, <link>, <source>, and other html elements with the media= attribute. to test and monitor media states using the window.matchmedia() and mediaquerylist.addlistener() javascript methods. note: the examples on this page use css's @media for illustrative purposes, but the basic syntax remains the same for all types of media queries. syntax a media query is composed of an optional media type and any number of ...
...and any number of media feature expressions. multiple queries can be combined in various ways by using logical operators. media queries are case-insensitive. a media query computes to true when the media type (if specified) matches the device on which a document is being displayed and all media feature expressions compute as true. queries involving unknown media types are always false. note: a
style sheet with a media query attached to its <link> tag will still download even if the query returns false. nevertheless, its contents will not apply unless and until the result of the query changes to true. media types media types describe the general category of a device. except when using the not or only logical operators, the media type is optional and the all type will be implied. all su...
...g true if the query would otherwise return false. if present in a comma-separated list of queries, it will only negate the specific query to which it is applied. if you use the not operator, you must also specify a media type. note: in level 3, the not keyword can't be used to negate an individual media feature expression, only an entire media query. only the only operator is used to apply a
style only if an entire query matches, and is useful for preventing older browsers from applying selected
styles. when not using only, older browsers would interpret the query screen and (max-width: 500px) simply as screen, ignoring the remainder of the query, and applying its
styles on all screens. if you use the only operator, you must also specify a media type. , (comma) commas are used to combine...
...And 8 more matches
Specificity - CSS: Cascading Style Sheets
lectors (e.g., [type="radio"]) and pseudo-classes (e.g., :hover). id selectors (e.g., #example). universal selector (*), combinators (+, >, ~, ' ', ||) and negation pseudo-class (:not()) have no effect on specificity. (the selectors declared inside :not() do, however.) for more information, visit: "specificity" in "cascade and inheritance", you can also visit: https://specifishity.com inline
styles added to an element (e.g.,
style="font-weight: bold;") always overwrite any
styles in external
stylesheets, and thus can be thought of as having the highest specificity. the !important exception when an important rule is used on a
style declaration, this declaration overrides any other declarations. although technically !important has nothing to do with specificity, it interacts directly with ...
...when two conflicting declarations with the !important rule are applied to the same element, the declaration with a greater specificity will be applied. ...
...be green because that rule is most specific. (also, the rule for blue overwrites the rule for red, notwithstanding the order of the rules) as a nonsense special case for (2), duplicate simple selectors to increase specificity when you have nothing more to specify. ...
...And 8 more matches
An Overview - XSLT: Extensible Stylesheet Language Transformations
« transforming xml with xslt the extensible
stylesheet language/transform is a very powerful language, and a complete discussion of it is well beyond the scope of this article, but a brief discussion of some basic concepts will be helpful in understanding the description of netscape's capabilities that follows. an xslt
stylesheet is an xml document. unlike css, which has its own specialized syntax, an xslt
stylesheet is an xml document, which must conform to all xml rules, including well-formedness. so the model for transformation is that one xml document is used to transform another xml document. an xslt
stylesheet is marked as such by the inclusion of a standard xslt heading. ...
...this element will include at least one namespace declaration and the mandatory version attribute. other namespaces and three optional attributes may also be included. ...
...this element will include at least one namespace declaration and the mandatory version attribute. other namespaces and three optional attributes may also be included. the mandatory namespace for xslt is "http://www.w3.org/1999/xsl/transform". ...
...And 8 more matches
nsIStyleSheetService
allows extensions or embeddors to add to the built-in list of user or agent
style sheets. layout/base/nsi
stylesheetservice.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports implemented by: @mozilla.org/content/
style-sheet-service;1. ...
... allows extensions or embeddors to add to the built-in list of user or agent
style sheets. layout/base/nsi
stylesheetservice.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports implemented by: @mozilla.org/content/
style-sheet-service;1. ...
...to the built-in list of user or agent
style sheets. layout/base/nsi
stylesheetservice.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports implemented by: @mozilla.org/content/
style-sheet-service;1. ...
...And 7 more matches
Style Editor - Firefox Developer Tools
the
style editor enables you to: view and edit all the
stylesheets associated with a page create new
stylesheets from scratch and apply them to the page import existing
stylesheets and apply them to the page to open the
style editor choose the "
style editor" option from the "web developer" menu (which is a submenu in the "tools" menu on the mac). the toolbox will appear at the bottom of the browser window, with the
style editor activated: the
style editor is divided into three main sections: the
style sheet pane on the left the editor on the right the media sidebar. the
style sheet pane the
style sheet pane, on the left, lists all the
style sheets being used by the current document. you can quickly toggle the use of a given sheet on and off by clicking the eyeball icon to t...
...vided into three main sections: the
style sheet pane on the left the editor on the right the media sidebar. the
style sheet pane the
style sheet pane, on the left, lists all the
style sheets being used by the current document. you can quickly toggle the use of a given sheet on and off by clicking the eyeball icon to the left of the sheet's name. you can save any changes you've made to the
style sheet to your local computer by clicking the save button in the bottom-right corner of each sheet's entry in the list. from firefox 40 onwards, the
style sheet pane also includes a context menu that lets you open the selected
style sheet in a new tab. the editor pane on the right is the editor pane. this is where the source for the selected
style sheet is available for you to read and edit. an...
...ew tab. the editor pane on the right is the editor pane. this is where the source for the selected
style sheet is available for you to read and edit. any changes you make are immediately applied to the page. this makes it easy to experiment with, revise, and test changes. once you're satisfied with your changes, you can save a copy locally by clicking the save button on the sheet's entry in the
style sheet pane. the editor provides line numbers and syntax highlighting to help make it easier to read your css. it also supports a number of keyboard shortcuts. the
style editor automatically de-minimizes
style sheets that it detects, without affecting the original. this makes it much easier to work on pages that have been optimized. the
style editor supports autocomplete. just start typing, and...
...And 7 more matches
Border-radius generator - CSS: Cascading Style Sheets
return input; } var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; var start_value = 0; slider.addeventlistener("click", function(e) { setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.
style.cursor = "e-resize"; document.addeventlistener("mousemove", slidermotion); }); document.addeventlistener("mouseup", function(e) { document.removeeventlistener("mousemove", slidermotion); document.body.
style.cursor = "auto"; slider.
style.cursor = "pointer"; }); var slidermotion = function slidermotion(e) { slider.
style.cursor = "e-resize"; var delta = (e.clientx - start...
...&& y == 'top') handle.classname = 'handle handle-top-left' if (x === 'right' && y == 'top') handle.classname = 'handle handle-top-right'; if (x === 'right' && y == 'bottom') handle.classname = 'handle handle-bottom-right'; if (x === 'left' && y == 'bottom') handle.classname = 'handle handle-bottom-left'; handle.addeventlistener("mousedown", function(e) { active = true; this.radius.
style.display = 'block'; previewmousetracking.subscribe(this.updatecontainer.bind(this)); }.bind(this)); document.addeventlistener("mouseup", function(e) { this.radius.
style.display = 'none'; if (active === true) previewmousetracking.unsubscribe(this.updatecontainer.bind(this)); }.bind(this)); inputslidermanager.subscribe(this.topic + '-w', this.setwidth.bind(this)); inputslide...
...updatecontainer.bind(this)); }.bind(this)); inputslidermanager.subscribe(this.topic + '-w', this.setwidth.bind(this)); inputslidermanager.subscribe(this.topic + '-h', this.setheight.bind(this)); inputslidermanager.subscribe(this.topic, this.setradius.bind(this)); buttonmanager.subscribe(this.topic, function(value) { this.rounded = value; if (value === true) { unitw.container.
style.display = 'none'; unith.container.
style.display = 'none'; unitr.container.
style.display = 'block'; sliderw.
style.display = 'none'; sliderh.
style.display = 'none'; sliderr.
style.display = 'block'; this.setunitr(this.unitr); this.updateradius(); } if (value === false) { unitw.container.
style.display = 'block'; unith.container.
style.display = 'block'; u...
...And 7 more matches
border-block-end - CSS: Cascading Style Sheets
the border-block-end css property is a shorthand property for setting the individual logical block-end border property values in a single place in the
style sheet. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... in a single place in the
style sheet. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: border-block-end-color border-block-end-
style border-block-end-width syntax border-block-end: 1px; border-block-end: 2px dotted; border-block-end: medium dashed blue; border-block-end can be used to set the values for one or more of border-block-end-width, border-block-end-
style, and border-block-end-color. the physical border to which it maps depends on the element's writing mode, directionality, and text orientation. it corresponds ...
...r-left property depending on the values defined for writing-mode, direction, and text-orientation. related properties are border-block-start, border-inline-start, and border-inline-end, which define the other borders of the element. values the border-block-end is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. ...
...And 7 more matches
<mstyle> - MathML
the mathml <m
style> element is used change the
style of its children. it accepts all attributes of all mathml presentation elements with some exceptions and additional attributes listed below. attributes dir overall directionality of formulas. possible values are either ltr (left to right) or rtl (right to left). decimalpoint this attribute is specifying the character for the alignment point within <mstack> and <mtable> columns, if the decimalpoint value is used to specify the alignment. display
style a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. the main effect is that larger versions of operators are displayed, when display
style is set to true. see also largeop and movable...
...the values before, after and duplicate are allowed. scriptlevel controls mostly the font-size. the higher the scriptlevel, the smaller the font size. ...
...the values before, after and duplicate are allowed. scriptlevel controls mostly the font-size. the higher the scriptlevel, the smaller the font size. this attribute accepts a non-negative integer, as well as a "+" or a "-" sign, which increments or decrements the current value. ...
...And 7 more matches
Basic Example - XSLT: Extensible Stylesheet Language Transformations
4 : xml file <?xml version="1.0"?> <myns:article xmlns:myns="http://devedge.netscape.com/2002/de"> <myns:title>my article</myns:title> <myns:authors> <myns:author company="foopy corp.">mr. foo</myns:author> <myns:author>mr. bar</myns:author> </myns:authors> <myns:body> the <b>rain</b> in <u>spain</u> stays mainly in the plains. ...
...ns:article xmlns:myns="http://devedge.netscape.com/2002/de"> <myns:title>my article</myns:title> <myns:authors> <myns:author company="foopy corp.">mr. foo</myns:author> <myns:author>mr. bar</myns:author> </myns:authors> <myns:body> the <b>rain</b> in <u>spain</u> stays mainly in the plains. ...
...5 : xslt
stylesheet <?xml version="1.0"?> <xsl:
stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:output method="html" /> <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/myns:article/myns:title"/> </title> <
style type="text/css"> .mybox {margin:10px 155px 0 50px; border: 1px dotted #639ace; padding:0 5px 0 5px;} </
style> </head> <body> <p class="mybox"> <span class="title"> <xsl:value-of select="/myns:article/myns:title"/> </span> <br /> authors: <br /> <xsl:apply-templates select="/myns:article/myns:authors/m...
...And 7 more matches
Correctly Using Titles With External Stylesheets - Archive of obsolete content
external
stylesheets are often associated with html documents using the <link rel="
stylesheeet"> element, but it is important to use the element's title attribute properly. this is because the title attribute on a <link rel="
stylesheeet"> element makes it either preferred or an alternative
style sheet. this can lead to a
stylesheet being ignored, which is typically not what an author intends to do. why titles matter the title attribute affects how your external
stylesheet is applied to a document. in fact, the use of the title attribute is so significant that html 4.01 categorizes
stylesheets according to the presence or absence of a title. ...
... a
stylesheet being ignored, which is typically not what an author intends to do. why titles matter the title attribute affects how your external
stylesheet is applied to a document. in fact, the use of the title attribute is so significant that html 4.01 categorizes
stylesheets according to the presence or absence of a title. by including a title attribute, you can control whether a particular
stylesheet always affects a document, or if it is only used under certain circumstances. there are three kinds of
stylesheets that are possible: persistent, preferred, and alternate
stylesheets. authors will be most familiar with persistent
stylesheets, of which any number may be applied to a document at once. ...
...le. by including a title attribute, you can control whether a particular
stylesheet always affects a document, or if it is only used under certain circumstances. there are three kinds of
stylesheets that are possible: persistent, preferred, and alternate
stylesheets. authors will be most familiar with persistent
stylesheets, of which any number may be applied to a document at once. a persistent
stylesheet is one which has no title attribute and a value of
stylesheet supplied for the rel attribute. a document may refer to one or more persistent
stylesheets, all of which are used in the presentation of the document. a preferred
stylesheet, on the other hand, is one that has a value of
stylesheet supplied for the rel attribute, and any value at all for the title attribute. here are two examples...
...And 6 more matches
CSSStyleDeclaration.setProperty() - Web APIs
value optional is a domstring containing the new property value. if not specified, treated as the empty string. note: value must not contain "!important" -- that should be set using the priority parameter. priority optional is a domstring allowing the "important" css priority to be set. if not specified, treated as the empty string. ...
...ot specified, treated as the empty string. the following values are accepted: string value "important" keyword undefined string empty value "" return value undefined exceptions domexception (nomodificationallowederror): if the property or declaration block is read only. ...
...e empty string. the following values are accepted: string value "important" keyword undefined string empty value "" return value undefined exceptions domexception (nomodificationallowederror): if the property or declaration block is read only. ...
...And 6 more matches
CanvasRenderingContext2D.strokeStyle - Web APIs
gradient a canvasgradient object (a linear or radial gradient). pattern a canvaspattern object (a repeating image). examples changing the stroke color of a shape this example applies a blue stroke color to a rectangle. ...
... gradient a canvasgradient object (a linear or radial gradient). pattern a canvaspattern object (a repeating image). examples changing the stroke color of a shape this example applies a blue stroke color to a rectangle. ...
... gradient a canvasgradient object (a linear or radial gradient). pattern a canvaspattern object (a repeating image). examples changing the stroke color of a shape this example applies a blue stroke color to a rectangle. ...
...And 6 more matches
HTMLStyleElement.media - Web APIs
the html
styleelement.media property specifies the intended destination medium for
style information. syntax medium =
style.media
style.media = medium parameters medium is a string describing a single medium or a comma-separated list. ...
... the html
styleelement.media property specifies the intended destination medium for
style information. syntax medium =
style.media
style.media = medium parameters medium is a string describing a single medium or a comma-separated list. ...
... the html
styleelement.media property specifies the intended destination medium for
style information. syntax medium =
style.media
style.media = medium parameters medium is a string describing a single medium or a comma-separated list. ...
...And 6 more matches
HTMLStyleElement - Web APIs
the html
styleelement interface represents a <
style> element. it inherits properties and methods from its parent, htmlelement, and from link
style. this interface doesn't allow to manipulate the css it contains (in most case). to manipulate css, see using dynamic styling information for an overview of the objects used to manipulate specified css properties using the dom. ...
...tml
styleelement interface represents a <
style> element. it inherits properties and methods from its parent, htmlelement, and from link
style. this interface doesn't allow to manipulate the css it contains (in most case). to manipulate css, see using dynamic styling information for an overview of the objects used to manipulate specified css properties using the dom. ...
...nk
style. this interface doesn't allow to manipulate the css it contains (in most case). to manipulate css, see using dynamic styling information for an overview of the objects used to manipulate specified css properties using the dom. ...
...And 6 more matches
OpenType font features guide - CSS: Cascading Style Sheets
these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings. this article provides you with all you need to know about using opentype font features in css. ...
...these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings. this article provides you with all you need to know about using opentype font features in css. ...
...h all you need to know about using opentype font features in css. some fonts will have one or more of these features enabled by default (kerning and default ligatures are common examples), while others are left to the designer or developer to choose to enable in specific scenarios. in addition to broad feature sets like ligatures or lining figures (numerals that line up evenly as opposed to 'old
style', which look more like lower-case letters), there are also very specific ones such as stylistic sets (which might include several specific variants of glyphs meant to be used together), alternates (which might be one or more variants of the letter 'a'), or even language-specific alterations for east asian languages. in the latter case, these alterations are actually necessary to properly express ...
...And 6 more matches
border-bottom - CSS: Cascading Style Sheets
the border-bottom shorthand css property sets an element's bottom border. it sets the values of border-bottom-width, border-bottom-
style and border-bottom-color. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. as with all shorthand properties, border-bottom always sets the values of all of the properties that it can set, even if they are not specified. it sets those that are not specified to their default values. this means that ... border-bottom-
style: dotted; border-bottom: thick green; ... is actually the same as ... border-bottom-
style: dotted; border-bottom: none thick green; ... and the value of border-bo...
...nd properties, border-bottom always sets the values of all of the properties that it can set, even if they are not specified. it sets those that are not specified to their default values. this means that ... border-bottom-
style: dotted; border-bottom: thick green; ... is actually the same as ... border-bottom-
style: dotted; border-bottom: none thick green; ... and the value of border-bottom-
style given before border-bottom is ignored. since the default value of border-bottom-
style is none, not specifying the border-
style part results in no border. ...
... <color> see border-bottom-color. ...
...And 6 more matches
column-rule - CSS: Cascading Style Sheets
note: as with all shorthand properties, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties). ...
... in a multi-column layout. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is a shorthand property that sets the individual column-rule-* properties in a single, convenient declaration: column-rule-width, column-rule-
style, and column-rule-color. note: as with all shorthand properties, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties). syntax column-rule: dotted; column-rule: solid 8px; column-rule: solid blue; column-rule: thick inset blue; /* global values */ column-rule: inherit; column-rule: initi...
...id 8px; column-rule: solid blue; column-rule: thick inset blue; /* global values */ column-rule: inherit; column-rule: initial; column-rule: unset; the column-rule property is specified as one, two, or three of the values listed below, in any order. values <'column-rule-width'> is a <length> or one of the three keywords, thin, medium, or thick. see border-width for details. ...
...And 6 more matches
counter() - CSS: Cascading Style Sheets
perimental, and support for the type-or-unit parameter is sparse. check the browser compatibility table carefully before using this in production. syntax values <custom-ident> a name identifying the counter, which is the same case-sensitive name used for the counter-reset and counter-increment. the name cannot start with two dashes and can't be none, unset, initial, or inherit. ...
...pport for the type-or-unit parameter is sparse. check the browser compatibility table carefully before using this in production. syntax values <custom-ident> a name identifying the counter, which is the same case-sensitive name used for the counter-reset and counter-increment. the name cannot start with two dashes and can't be none, unset, initial, or inherit. ...
...heck the browser compatibility table carefully before using this in production. syntax values <custom-ident> a name identifying the counter, which is the same case-sensitive name used for the counter-reset and counter-increment. the name cannot start with two dashes and can't be none, unset, initial, or inherit. ...
...And 6 more matches
Element.computedStyleMap() - Web APIs
the computed
stylemap() method of the element interface returns a
stylepropertymapreadonly interface which provides a read-only representation of a css declaration block that is an alternative to css
styledeclaration. syntax var
stylepropertymapreadonly = element.computed
stylemap() parameters none. return value a
stylepropertymapreadonly interface. examples we start with some simple html: a paragraph with a link, and a definition list to which we will add all the css property / value pairs. <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a little bit of css a { --colour: red; color: var(--colour); } we add javascript to grab our link and return back a definition list of all the css property values using computed
stylemap(). // get the ele...
...airs. <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a little bit of css a { --colour: red; color: var(--colour); } we add javascript to grab our link and return back a definition list of all the css property values using computed
stylemap(). ...
...</dl> we add a little bit of css a { --colour: red; color: var(--colour); } we add javascript to grab our link and return back a definition list of all the css property values using computed
stylemap(). ...
...And 5 more matches
FontFace.style - Web APIs
working draft initial definition. ...
... working draft initial definition. ...
... working draft initial definition. ...
...And 5 more matches
Window.getDefaultComputedStyle() - Web APIs
the getdefaultcomputed
style() method gives the default computed values of all the css properties of an element, ignoring author styling. that is, only user-agent and user
styles are taken into account. syntax var
style = window.getdefaultcomputed
style(element [, pseudoelt]); parameters element the element for which to get the computed
style. pseudoelt optional a string specifying the pseudo-element to match. must be null (or not specified) for regular elements. return value the returned
style is a css
styledeclaration object. the object is of the same type as the object returned by window.getcomputed
style(), but only takes into account user-agent and user rules. ...
...ptional a string specifying the pseudo-element to match. must be null (or not specified) for regular elements. return value the returned
style is a css
styledeclaration object. the object is of the same type as the object returned by window.getcomputed
style(), but only takes into account user-agent and user rules. ...
...pseudo-element to match. must be null (or not specified) for regular elements. return value the returned
style is a css
styledeclaration object. the object is of the same type as the object returned by window.getcomputed
style(), but only takes into account user-agent and user rules. ...
...And 5 more matches
:host-context() - CSS: Cascading Style Sheets
e shadow host of the shadow dom containing the css it is used inside (so you can select a custom element from inside its shadow dom) — but only if the selector given as the function's parameter matches the shadow host's ancestor(s) in the place it sits inside the dom hierarchy. in other words, this allows a custom element, or anything within that custom element's shadow dom, to apply different
styles based on its position within the outer dom or classes/attributes applied to ancestor elements. one typical use of this is with a descendant selector expression — for example h1 — to select only instances of the custom element that are inside an <h1>. another typical use would be to allow inner elements to react to classes or attributes on any anscestor elements - for example, applying a di...
...' | '$' | '*' ]? '='<attr-modifier> = i | s examples selectively styling shadow hosts the following snippets are taken from our host-selectors example (see it live also). ...
... following snippets are taken from our host-selectors example (see it live also). ...
...And 5 more matches
Mozilla CSS extensions - CSS: Cascading Style Sheets
solete since gecko 2 -moz-background-originobsolete since gecko 2 -moz-background-inline-policyobsolete since gecko 32 [superseded by the standard version box-decoration-break] -moz-background-sizeobsolete since gecko 2 -moz-border-end [superseded by the standard version border-inline-end] -moz-border-end-color [superseded by the standard version border-inline-end-color] -moz-border-end-
style [superseded by the standard version border-inline-end-
style] -moz-border-end-width [superseded by the standard version border-inline-end-width] -moz-border-image -moz-border-start [superseded by the standard version border-inline-start] -moz-border-start-color [superseded by the standard version border-inline-start-color] -moz-border-start-
style [superseded by the standard versio...
...standard version border-inline-end-
style] -moz-border-end-width [superseded by the standard version border-inline-end-width] -moz-border-image -moz-border-start [superseded by the standard version border-inline-start] -moz-border-start-color [superseded by the standard version border-inline-start-color] -moz-border-start-
style [superseded by the standard version border-inline-start-
style] -moz-border-start-width [superseded by the standard version border-inline-start-width] -moz-box-sizing [prefixed version still accepted] c clip-path [applying to more than svg] -moz-column-count [prefixed version still accepted] -moz-column-fill [prefixed version still accepted] -moz-column-gap [prefixed version still accepted] -moz-column-width [prefixed version still...
...] c clip-path [applying to more than svg] -moz-column-count [prefixed version still accepted] -moz-column-fill [prefixed version still accepted] -moz-column-gap [prefixed version still accepted] -moz-column-width [prefixed version still accepted] -moz-column-rule [prefixed version still accepted] -moz-column-rule-width [prefixed version still accepted] -moz-column-rule-
style [prefixed version still accepted] -moz-column-rule-color [prefixed version still accepted] -moz-context-properties f–m filter [applying to more than svg] -moz-font-feature-settings [prefixed version still accepted] -moz-font-language-override [prefixed version still accepted] -moz-hyphens [prefixed version still accepted] -moz-margin-end [superseded by the standard ...
...And 5 more matches
border-inline - CSS: Cascading Style Sheets
the border-inline css property is a shorthand property for setting the individual logical inline border property values in a single place in the
style sheet. border-inline: 1px; border-inline: 2px dotted; border-inline: medium dashed blue; the physical borders to which border-inline maps depends on the element's writing mode, directionality, and text orientation. it corresponds to the border-top and border-bottom or border-right, and border-left properties, depending on the values defined for writing-mode, direction, and text-orientation. ...
...entation. it corresponds to the border-top and border-bottom or border-right, and border-left properties, depending on the values defined for writing-mode, direction, and text-orientation. the borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end. ...
... the borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end. initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-
style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-
style is none or hiddenborder-top-
style: as specifiedborder-top-color: computed coloranimation typediscrete constituent properties this property is a shorthand for the following css properties: border-inline-color border-inline-
style border-inline-width syntax values the border-inline is specified with one or more of the following, in any order: <'border-width'> the width of the border. ...
...And 5 more matches
border-left - CSS: Cascading Style Sheets
epository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. as with all shorthand properties, border-left always sets the values of all of the properties that it can set, even if they are not specified. it sets those that are not specified to their default values. this means that ... border-left-
style: dotted; border-left: thick green; ... is actually the same as ... border-left-
style: dotted; border-left: none thick green; ... and the value of border-left-
style given before border-left is ignored. since the default value of border-left-
style is none, not specifying the border-
style part results in no border. constituent properties this property is a shorthand for the following css prop...
... <color> see border-left-color. ...
... constituent properties this property is a shorthand for the following css properties: border-left-color border-left-
style border-left-width syntax border-left: 1px; border-left: 2px dotted; border-left: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-left-width. <br-
style> see border-left-
style. <color> see border-left-color. formal definition initial valueas each of the properties of the shorthand:border-left-width: mediumborder-left-
style: noneborder-left-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-left-width: the absolute length or 0 if border-left-...
...And 5 more matches
border-right - CSS: Cascading Style Sheets
ository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. as with all shorthand properties, border-right always sets the values of all of the properties that it can set, even if they are not specified. it sets those that are not specified to their default values. this means that ... border-right-
style: dotted; border-right: thick green; ... is actually the same as ... border-right-
style: dotted; border-right: none thick green; ... and the value of border-right-
style given before border-right is ignored. since the default value of border-right-
style is none, not specifying the border-
style part results in no border. constituent properties this property is a shorthand for the following cs...
... <color> see border-right-color. ...
...tuent properties this property is a shorthand for the following css properties: border-right-color border-right-
style border-right-width syntax border-right: 1px; border-right: 2px dotted; border-right: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-right-width. <br-
style> see border-right-
style. <color> see border-right-color. formal definition initial valueas each of the properties of the shorthand:border-right-width: mediumborder-right-
style: noneborder-right-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-right-width: the absolute length or 0 if border...
...And 5 more matches
border-top - CSS: Cascading Style Sheets
repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. as with all shorthand properties, border-top always sets the values of all of the properties that it can set, even if they are not specified. it sets those that are not specified to their default values. this means that ... border-top-
style: dotted; border-top: thick green; ... is actually the same as ... border-top-
style: dotted; border-top: none thick green; ... and the value of border-top-
style given before border-top is ignored. since the default value of border-top-
style is none, not specifying the border-
style part results in no border. constituent properties this property is a shorthand for the following css properties...
... <color> see border-top-color. ...
...order. constituent properties this property is a shorthand for the following css properties: border-top-color border-top-
style border-top-width syntax border-top: 1px; border-top: 2px dotted; border-top: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-top-width. <br-
style> see border-top-
style. <color> see border-top-color. formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-
style: noneborder-top-color: currentcolorapplies toall elements. ...
...And 5 more matches
outline - CSS: Cascading Style Sheets
ty set all the outline properties in a single declaration. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: outline-color outline-
style outline-width syntax /*
style */ outline: solid; /* color |
style */ outline: #f66 dashed; /*
style | width */ outline: inset thick; /* color |
style | width */ outline: green solid 3px; /* global values */ outline: inherit; outline: initial; outline: unset; the outline property may be specified using one, two, or three of the values listed below. the order of the values does not matter...
...
style */ outline: #f66 dashed; /*
style | width */ outline: inset thick; /* color |
style | width */ outline: green solid 3px; /* global values */ outline: inherit; outline: initial; outline: unset; the outline property may be specified using one, two, or three of the values listed below. the order of the values does not matter. note: the outline will be invisible for many elements if its
style is not defined. this is because the
style defaults to none. a notable exception is input elements, which are given default styling by browsers. values <'outline-color'> sets the color of the outline. defaults to currentcolor if absent. see outline-color. <'outline-
style'> sets the
style of the outline. defaults to none if absent. see outline-
style. <'outline-width'> sets the thickness o...
...ers in the following ways: outlines never take up space, as they are drawn outside of an element's content. according to the spec, outlines don't have to be rectangular, although they usually are. as with all shorthand properties, any omitted sub-values will be set to their initial value. accessibility concerns assigning outline a value of 0 or none will remove the browser's default focus
style. if an element can be interacted with it must have a visible focus indicator. provide obvious focus styling if the default focus
style is removed. how to design useful and usable focus indicators wcag 2.1: understanding success criterion 2.4.7: focus visible formal definition initial valueas each of the properties of the shorthand:outline-color: invert, for browsers supporting it, cur...
...And 5 more matches
revert - CSS: Cascading Style Sheets
the revert css keyword reverts the cascaded value of the property from its current value to the value the property would have had if no changes had been made by the current
style origin to the current element. thus, it resets the property to its inherited value if it inherits from its parent or to the default value established by the user agent's
stylesheet (or by user
styles, if any exist). it can be applied to any css property, including the css shorthand all. this removes from the cascade all of the
styles that have been overridden until the
style being rolled back to is reached. ...
... resets the property to its inherited value if it inherits from its parent or to the default value established by the user agent's
stylesheet (or by user
styles, if any exist). it can be applied to any css property, including the css shorthand all. this removes from the cascade all of the
styles that have been overridden until the
style being rolled back to is reached. if used by a site's own
styles (the author origin), revert rolls back the property's cascaded value to the user's custom
style, if one exists; otherwise, it rolls the
style back to the user agent's default
style. if used in a user's custom
stylesheet, or if the
style was applied by the user (the user origin), revert rolls back the cascaded value to the user agent's default
style. if used within the user agent's default styl...
... revert will not affect rules applied to children of an element you reset (but will remove effects of a parent rule on a child). so if you have a color: green for all sections and all: revert on a specific section the color of the section will be black. ...
...And 4 more matches
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
this document describes the javascript interface in mozilla 1.2 and up to the xslt processing engine (transformiix). creating an xsltprocessor to start, you need to create an xsltprocessor object: var processor = new xsltprocessor(); specifying the
stylesheet before you can use it, you must import a
stylesheet with the xsltprocessor.import
stylesheet() method. it has a single parameter, which is the dom node of the xslt
stylesheet to import. note: the import is live, meaning that if you alter the
stylesheet dom after importing it, this will be reflected in the processing. rather than modifying the dom it is recommended to use
stylesheet parameters which are usually easier and can give better performance. var testtransform = document.implementation.createdocument("", "test", nul...
...ier and can give better performance. var testtransform = document.implementation.createdocument("", "test", null); // just an example to get a transform into a script as a dom // xmldocument.load is asynchronous, so all processing happens in the // onload handler testtransform.addeventlistener("load", onload, false); testtransform.load("test-transform.xml"); function onload() { processor.import
stylesheet(testtransform); } xsltprocessor.import
stylesheet() requires one argument, a dom node. if that node is a document node, you can pass in a full xsl transform or a literal result element transform, otherwise it must be an xsl:
stylesheet or xsl:transform element. transforming the document you can use the xsltprocessor.transformtodocument() or xsltprocessor.transformtofragment() methods to tr...
...ort
stylesheet() requires one argument, a dom node. if that node is a document node, you can pass in a full xsl transform or a literal result element transform, otherwise it must be an xsl:
stylesheet or xsl:transform element. transforming the document you can use the xsltprocessor.transformtodocument() or xsltprocessor.transformtofragment() methods to transform a document using the imported xslt
stylesheet. ...
...And 4 more matches
CSSStyleDeclaration - Web APIs
the css
styledeclaration interface represents an object that is a css declaration block, and exposes
style information and various
style-related methods and properties. a css
styledeclaration object can be exposed using three different apis: via htmlelement.
style, which deals with the inline
styles of a single element (e.g., <div
style="...">). via the css
stylesheet api. for example, document.
stylesheets[0].cssrules[0].
style returns a css
styledeclaration object on the first css rule in the document's first
stylesheet. via window.getcomputed
style(), which exposes the css
styledeclaration object as a read-only interface. attributes css
styledeclaration.csstext textual representation of the declaration block. setting this attribute changes the
style. ...
...t api. for example, document.
stylesheets[0].cssrules[0].
style returns a css
styledeclaration object on the first css rule in the document's first
stylesheet. via window.getcomputed
style(), which exposes the css
styledeclaration object as a read-only interface. attributes css
styledeclaration.csstext textual representation of the declaration block. setting this attribute changes the
style. css
styledeclaration.lengthread only the number of properties. see the item() method below. css
styledeclaration.parentruleread only the containing cssrule. css properties css
styledeclaration.cssfloat special alias for the float css property. css
styledeclaration named properties dashed and camel-cased attributes for all supported css properties. ...
...bute changes the
style. css
styledeclaration.lengthread only the number of properties. see the item() method below. css
styledeclaration.parentruleread only the containing cssrule. css properties css
styledeclaration.cssfloat special alias for the float css property. css
styledeclaration named properties dashed and camel-cased attributes for all supported css properties. methods css
styledeclaration.getpropertypriority() returns the optional priority, "important". css
styledeclaration.getpropertyvalue() returns the property value given a property name. css
styledeclaration.item() returns a css property name by its index, or the empty string if the index is out-of-bounds. an alternative to accessing nodelist[i] (which instead returns undefined when i is out-of-bounds). this is ...
...And 3 more matches
DocumentOrShadowRoot.styleSheets - Web APIs
specifications specification status comment shadow domthe definition of 'documentorshadowroot' in that specification. ...
... specifications specification status comment shadow domthe definition of 'documentorshadowroot' in that specification. ...
... specifications specification status comment shadow domthe definition of 'documentorshadowroot' in that specification. ...
...And 3 more matches
:host() - CSS: Cascading Style Sheets
' | '$' | '*' ]? '='<attr-modifier> = i | s examples selectively styling shadow hosts the following snippets are taken from our host-selectors example (see it live also). ...
... following snippets are taken from our host-selectors example (see it live also). ...
...ost-selectors example (see it live also). ...
...And 3 more matches
:host - CSS: Cascading Style Sheets
t */ :host { font-weight: bold; } syntax :host examples styling the shadow host the following snippets are taken from our host-selectors example (see it live also). ...
... following snippets are taken from our host-selectors example (see it live also). ...
...ost-selectors example (see it live also). ...
...And 3 more matches
negative - CSS: Cascading Style Sheets
syntax /* <symbol> values */ negative: "-"; /* prepends '-' if value is negative */ negative: "(" ")"; /* surrounds value by '(' and ')' if it is negative */ values first <symbol> this symbol will be prepended to the representation when the counter is negative. second <symbol> if present, this symbol will be appended to the representation when the counter is negative. ...
...representation when the counter is negative. description if the counter value is negative, the symbol provided as value for the descriptor is prepended to the counter representation; and a second symbol if specified, will be appended to the representation. ...
...ified, will be appended to the representation. the negative descriptor has effect only if the system value is symbolic, alphabetic, numeric, additive, or extends, if the extended counter
style itself uses a negative sign. if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored. ...
...And 3 more matches
range - CSS: Cascading Style Sheets
syntax /* keyword value */ range: auto; /* range values */ range: 2 5; range: infinite 10; range: 6 infinite; range: infinite infinite; /* multiple range values */ range: 2 5, 8 10; range: infinite 6, 10 infinite; values auto the range depends on the counter system: for cyclic, numeric, and fixed systems, the range is negative infinity to positive infinity. for alphabetic and symbolic systems, the range is 1 to positive infinity. ...
... the range depends on the counter system: for cyclic, numeric, and fixed systems, the range is negative infinity to positive infinity. for alphabetic and symbolic systems, the range is 1 to positive infinity. for additive systems, the range is 0 to positive infinity. for extends systems, the range is whatever auto would produce for the extended system; if extending a complex predefined
style (§7 complex predefined counter
styles), the range is the
style’s defined range. [ [ | infinite ]{2} ]# defines a comma-separated list of ranges. for each individual range, the first value is the lower bound and the second value is the upper bound. a range is inclusive, that means it always contains both, the lower and upper bound numbers. if infinite is used as the first value in a range...
...-separated list of ranges. for each individual range, the first value is the lower bound and the second value is the upper bound. a range is inclusive, that means it always contains both, the lower and upper bound numbers. if infinite is used as the first value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. the range of the counter
style is the union of all the ranges defined in the list. if the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and will be ignored. description the value of the range descriptor can be either auto or a comma separated list of lower and upper bounds specified as integers. if value is auto, then for cyclic, numeric, and fixed system, the range will be from...
...And 3 more matches
Using CSS animations - CSS: Cascading Style Sheets
there are three key advantages to css animations over traditional script-driven animation techniques: they’re easy to use for simple animations; you can create them without even having to know javascript. the animations run well, even under moderate system load. simple animations can often perform poorly in javascript (unless they’re well made). ...
...ade). the rendering engine can use frame-skipping and other techniques to keep the performance as smooth as possible. letting the browser control the animation sequence lets the browser optimize performance and efficiency by, for example, reducing the update frequency of animations running in tabs that aren't currently visible. configuring the animation to create a css animation sequence, you
style the element you want to animate with the animation property or its sub-properties. this lets you configure the timing, duration, and other details of how the animation sequence should progress. this does not configure the actual appearance of the animation, which is done using the @keyframes at-rule as described in defining the animation sequence using keyframes below. the sub-properties of the ...
...defining the animation sequence using keyframes once you’ve configured the animation’s timing, you need to define the appearance of the animation. this is done by establishing two or more keyframes using the @keyframes at-rule. each keyframe describes how the animated element should render at a given time during the animation sequence. since the timing of the animation is defined in the css
style that configures the animation, keyframes use a <percentage> to indicate the time during the animation sequence at which they take place. 0% indicates the first moment of the animation sequence, while 100% indicates the final state of the animation. because these two times are so important, they have special aliases: from and to. both are optional. if from/0% or to/100% is not specified, the brows...
...And 3 more matches
CSS Containment - CSS: Cascading Style Sheets
se this information to make decisions about how to render the content. for example, it might not render articles that are outside the viewable area. if we give each <article> the contain property with a value of content, when new elements are inserted the browser understands it does not need to relayout or repaint any area outside of the containing element's subtree, although if the <article> is
styled such that its size depends on its contents (e.g. with height: auto), then the browser may need to account for its size changing). we have told it by way of the contain property that each article is independent. the content value is shorthand for contain: layout paint. it tells the browser that the internal layout of the element is totally separate from the rest of the page, and that everything...
...way of performance optimizations when used on its own. however, it means that the size of the element's children cannot affect the size of the element itself — its size is computed as if it had no children. if you turn on contain: size you need to also specify the size of the element you have applied this to. it will end up being zero-sized in most cases, if you don't manually give it a size. ...
...ed on its own. however, it means that the size of the element's children cannot affect the size of the element itself — its size is computed as if it had no children. if you turn on contain: size you need to also specify the size of the element you have applied this to. it will end up being zero-sized in most cases, if you don't manually give it a size.
style containment article { contain:
style; } despite the name,
style containment does not provide scoped
styles such as you would get with the shadow dom. the main use case is to prevent situations where a css counter could be changed in an element, which could then affect the rest of the tree. using contain:
style would ensure that the counter-increment and counter-set properties created new counters scoped to that subtree only. no...
...And 3 more matches
Shorthand properties - CSS: Cascading Style Sheets
the css specification defines shorthand properties to group the definition of common properties acting on the same theme. for instance, the css background property is a shorthand property that's able to define the values of background-color, background-image, background-repeat, and background-position. ...
... try not to force a specific order for the values of the properties they replace. this works well when these properties use values of different types, as the order has no importance, but this does not work as easily when several properties can have identical values. handling of these cases are grouped in several categories: shorthands handling properties related to edges of a box, like border-
style, margin or padding, always use a consistent 1-to-4-value syntax representing those edges: the 1-value syntax: border-width: 1em — the unique value represents all edges the 2-value syntax: border-width: 1em 2em — the first value represents the vertical, that is top and bottom, edges, the second the horizontal ones, that is the left and right ones. ...
...ft top; ... can be shortened to just one declaration: background: #000 url(images/bg.gif) no-repeat left top; (the shorthand form is actually the equivalent of the longhand properties above plus background-attachment: scroll and, in css3, some additional properties.) see background for more detailed information, including css3 properties. font properties the following declarations ... font-
style: italic; font-weight: bold; font-size: .8em; line-height: 1.2; font-family: arial, sans-serif; ... can be shortened to the following: font: italic bold .8em/1.2 arial, sans-serif; this shorthand declaration is actually equivalent to the longhand declarations above plus font-variant: normal and font-size-adjust: none (css2.0 / css3), font-stretch: normal (css3). border properties with borders...
...And 3 more matches
Syntax - CSS: Cascading Style Sheets
the css syntax reflects this goal and its basic building blocks are: the property which is an identifier, that is a human-readable name, that defines which feature is considered. the value which describe how the feature must be handled by the engine. each property has a set of valid values, defined by a formal grammar, as well as a semantic meaning, implemented by the browser engine. css declarations setting css properties to specific values is the core function of the css language. ...
...f valid values, defined by a formal grammar, as well as a semantic meaning, implemented by the browser engine. css declarations setting css properties to specific values is the core function of the css language. a property and value pair is called a declaration, and any css engine calculates which declarations apply to every single element of a page in order to appropriately lay it out, and to
style it. both properties and values are case-insensitive by default in css. the pair is separated by a colon, ':' (u+003a colon), and white spaces before, between, and after properties and values, but not necessarily inside, are ignored. there are more than 100 different properties in css and a nearly infinite number of different values. not all pairs of properties and values are allowed and each ...
...osing braces must be matched. such blocks are naturally called declaration blocks and declarations inside them are separated by a semi-colon, ';' (u+003b semicolon). a declaration block may be empty, that is containing null declaration. white spaces around declarations are ignored. ...
...And 3 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
h an -apple- prefix. a few are prefixed with -epub-. webkit-only properties note: avoid using on websites. these properties will only work in webkit applications. ...
...roperties will only work in webkit applications. ...
...it-appearance* -webkit-aspect-ratio b -webkit-backdrop-filter -webkit-background-composite -webkit-border-after** -webkit-border-after-color** -webkit-border-after-
style** -webkit-border-after-width** -webkit-border-before** -webkit-border-before-color** -webkit-border-before-
style** -webkit-border-before-width** -webkit-border-end** -webkit-border-end-color** -webkit-border-end-
style** -webkit-border-end-width** -webkit-border-fit -webkit-border-horizontal-spacing -webkit-border-start** -webkit-border-start-color** -webkit-border-start-
style** -webkit-border-start-width** -webkit-border-vertical-spacing -webkit-box-align** -webkit-box-direction** -webkit-box-flex-group** -webkit-box-flex** -webkit-box-lines** -webkit-box-ordinal-group** -webkit-box-orient** -w...
...And 3 more matches
animation - CSS: Cascading Style Sheets
it is a shorthand for animation-name, animation-duration, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, animation-fill-mode, and animation-play-state. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...argin-bottom: 0; } svg { width: 1.5em; height: 1.5em; } button { width: 27px; height: 27px; background-size: 16px; background-position: center; background-repeat: no-repeat; border-radius: 3px; cursor: pointer; } button.play { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3c
style%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2f
style%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6...
...3%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#play'); } button.pause { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3c
style%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2f
style%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6...
...And 3 more matches
counters() - CSS: Cascading Style Sheets
the counters() css function enables nested counters, returning a concatenated string representing the current values of the named counters, if there are any. the counters() function has two forms: 'counters(name, string)' or 'counters(name, string,
style)'. it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported. the generated text is the value of all counters with the given name, from outermost to innermost, separated by the specified string. the counters are rendered in the
style indicated, defaulting to decimal if no
style is specified. /* simple usage -
style defaults to decimal */ counters(countername, '-'); /* changing the counter display */ counters(countername, '.', upper-roman) a counter has no visible effect by itself. the...
...erimental, and support for the type-or-unit parameter is sparse. check the browser compatibility table carefully before using this in production. syntax values <custom-ident> a name identifying the counters, which is the same case-sensitive name used for the counter-reset and counter-increment. the name cannot start with two dashes and can't be none, unset, initial, or inherit. <counter-
style> a counter
style name or symbols() function, where a counter
style name is a numeric, alphabetic, or symbolic simple predefined counter
style, a complex longhand east asian or ethiopic predefined counter
style, or other predefined counter
style. if omitted, the counter-
style defaults to decimal <string> any number of text characters. non-latin characters must be encoded using their unicode esc...
...counter
style, a complex longhand east asian or ethiopic predefined counter
style, or other predefined counter
style. if omitted, the counter-
style defaults to decimal <string> any number of text characters. non-latin characters must be encoded using their unicode escape sequences: for example, \000a9 represents the copyright symbol. ...
...And 3 more matches
::first-line (:first-line) - CSS: Cascading Style Sheets
the ::first-line css pseudo-element applies
styles to the first line of a block-level element. note that the length of the first line depends on many factors, including the width of the element, the width of the document, and the font size of the text. /* selects the first line of a <p> */ p::first-line { color: red; } css3 introduced the ::first-line notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also accept :first-line, introduced in css2. ...
...cts the first line of a <p> */ p::first-line { color: red; } css3 introduced the ::first-line notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also accept :first-line, introduced in css2. ...
...see what i mean?</p> <span>the first line of this text will not receive special styling because it is not a block-level element.</span> css ::first-line { color: blue;...
...n, background-repeat, background-size, background-attachment, and background-blend-mode the color property word-spacing, letter-spacing, text-decoration, text-transform, and line-height text-shadow, text-decoration, text-decoration-color, text-decoration-line, text-decoration-
style, and vertical-align. syntax /* css3 syntax */ ::first-line /* css2 syntax */ :first-line examples html <p>
styles will only be applied to the first line of this paragraph. after that, all text will be
styled like normal. see what i mean?</p> <span>the first line of this text will not receive special styling because it is not a block-level element.</span> css ::first-line { color: blue; text-transform: uppercase; /* warning: do not use these */ /* many properties are invalid in ::first-line pseu...
::selection - CSS: Cascading Style Sheets
the ::selection css pseudo-element applies
styles to the part of a document that has been highlighted by the user (such as clicking and dragging the mouse across text). ::selection { background-color: cyan; } allowable properties only certain css properties can be used with ::selection: color background-color cursor caret-color outline and its longhands text-decoration and its associated properties text-emphasis-color text-shadow in particular, background-image is ignored. syntax /* legacy firefox syntax (version 61 and below) */ ::-moz-selection ::selection examples html this text has special
styles when you highlight it. <p>also try selecting text in this paragraph.</p> css ::-moz-selection { color: gold; background-color: red; } p::-moz-selection { color:...
... if overridden, it is important to ensure that the contrast ratio between the text and background colors of the selection is high enough that pe...
...ed; } /* make selected text in a paragraph white on a blue background */ p::selection { color: white; background-color: blue; } result accessibility concerns don't override selected text
styles for purely aesthetic reasons — users can customize them to suit their needs. for people experiencing cognitive concerns or who are less technologically literate, unexpected changes to selection
styles may hurt their understanding of the functionality. if overridden, it is important to ensure that the contrast ratio between the text and background colors of the selection is high enough that people experiencing low vision conditions can read it. color contrast ratio is found by comparing the luminosity of the selected text and the selected text background colors. to meet current web content a...
...it returned in pseudo-elements level 4. ...
:checked - CSS: Cascading Style Sheets
>) element that is checked or toggled to an on state. /* matches any checked/selected radio, checkbox, or option */ :checked { margin-left: 25px; border: 1px solid blue; } the user can engage this state by checking/selecting an element, or disengage it by unchecking/deselecting the element. note: because browsers often treat <option>s as replaced elements, the extent to which they can be
styled with the :checked pseudo-class varies from browser to browser. syntax :checked examples basic example html <div> <input type="radio" name="my-input" id="yes"> <label for="yes">yes</label> <input type="radio" name="my-input" id="no"> <label for="no">no</label> </div> <div> <input type="checkbox" name="my-checkbox" id="opt-in"> <label for="opt-in">check me!</label> </div> <se...
...text]</td><td>[more text]</td></tr> <tr class="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> </tbody> </table> <label for="expand-toggle" id="expand-btn">toggle hidden rows</label> css /* hide the toggle checkbox */ #expand-toggle { display: none; } /* hide expandable content by default */ .expandable { visibility: collapse; background: #ddd; } /*
style the button */ #expand-btn { display: inline-block; margin-top: 12px; padding: 5px 11px; background-color: #ff7; border: 1px solid; border-radius: 3px; } /* show hidden content when the checkbox is checked */ #expand-toggle:checked ~ * .expandable { visibility: visible; } /*
style the button when the checkbox is checked */ #expand-toggle:checked ~ #expand-btn { background-color: ...
...no effect.edge full support 12notes full support 12notes notes on macos, styling <option&rt; elements has no effect.firefox full support 1notes full support 1notes notes from firefox 56, <option&rt; elements cannot be
styled.notes on macos, styling <option&rt; elements has no effect.ie full support 9opera full support 9notes full support 9notes notes on macos, styling <option&rt; elements has no effect.safari full support 3.1notes ...
...notes styling <option&rt; elements has no effect.webview android full support 2chrome android full support 18firefox android full support 4notes full support 4notes notes from firefox 56, <option&rt; elements cannot be
styled.opera android full support 10.1safari ios full support 3.1notes full support 3.1notes notes styling <option&rt; elements has no effect.samsung internet android full support 1.0legend ...
:visited - CSS: Cascading Style Sheets
the :visited css pseudo-class represents links that the user has already visited. for privacy reasons, the
styles that can be modified using this selector are very limited. /* selects any <a> that has been visited */ a:visited { color: green; }
styles defined by the :visited pseudo-class will be overridden by any subsequent link-related pseudo-class (:link, :hover, or :active) that has at least equal specificity. to
style links appropriately, put the :visited rule after the :link rule but before the :hover and :active rules, as defined by the lvha-order: :link — :visited — :hover — :active. ...
...eudo-class will be overridden by any subsequent link-related pseudo-class (:link, :hover, or :active) that has at least equal specificity. to
style links appropriately, put the :visited rule after the :link rule but before the :hover and :active rules, as defined by the lvha-order: :link — :visited — :hover — :active. ...
...y limit which
styles you can apply using this pseudo-class, and how they can be used: allowable css properties are color, background-color, border-color, border-bottom-color, border-left-color, border-right-color, border-top-color, column-rule-color, outline-color, text-decoration-color, and text-emphasis-color. allowable svg attributes are fill and stroke. the alpha component of the allowed
styles will be ignored. the alpha component of the element's non-:visited state will be used instead, except when that component is 0, in which case the
style set in :visited will be ignored entirely. although these
styles can be change the appearance of colors to the end user, the window.getcomputed
style method will lie and always return the value of the non-:visited color. note: for more informat...
...y has a default value for color and column-rule-color only. thus, if you want to modify the other properties, you'll need to give them a base value outside the :visited selector. html <a href="#test-visited-link">have you visited this link yet?</a><br> <a href="">you've already visited this link.</a> css a { /* specify non-transparent defaults to certain properties, allowing them to be
styled with the :visited state */ background-color: white; border: 1px solid white; } a:visited { background-color: yellow; border-color: hotpink; color: hotpink; } result specifications specification status comment html living standardthe definition of ':visited' in that specification. living standard selectors level 4the definition of ':visi...
@charset - CSS: Cascading Style Sheets
the @charset css at-rule specifies the character encoding used in the
style sheet. it must be the first element in the
style sheet and not be preceded by any character; as it is not a nested statement, it cannot be used inside conditional group at-rules. if several @charset at-rules are defined, only the first one is used, and it cannot be used inside a
style attribute on an html element or inside the <
style> element where the character set of the html page is relevant. @charset "utf-8"; this at-rule is useful when using non-ascii characters in some css properties, like content. ...
.... if several @charset at-rules are defined, only the first one is used, and it cannot be used inside a
style attribute on an html element or inside the <
style> element where the character set of the html page is relevant. @charset "utf-8"; this at-rule is useful when using non-ascii characters in some css properties, like content. as there are several ways to define the character encoding of a
style sheet, the browser will try the following methods in the following order (and stop as soon as one yields a result) : the value of the unicode byte-order character placed at the beginning of the file. the value given by the charset attribute of the content-type: http header or the equivalent in the protocol used to serve the
style sheet. the @charset css at-rule. use the character encoding d...
...encoding defined in the iana-registry, and must be double-quoted, following exactly one space character (u+0020), and immediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. ...
...y one space character (u+0020), and immediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. formal syntax @charset "<charset>"; examples valid and invalid charset declarations @charset "utf-8"; /* set the encoding of the
style sheet to unicode utf-8 */ @charset 'iso-8859-15'; /* invalid, wrong quoting
style used */ @charset "utf-8"; /* invalid, more than one space */ @charset "utf-8"; /* invalid, there is a character (a space) before the at-rule */ @charset utf-8; /* invalid, without ' or ", the charset is not a css <string> */ specifications specification status comment css level 2 (revision 1)the definition of '@charset' in that specification. ...
additive-symbols - CSS: Cascading Style Sheets
r weight. the additive system is used to construct sign-value numbering systems such as roman numerals. syntax additive-symbols: 3 "0"; additive-symbols: 3 "0", 2 "\2e\20"; additive-symbols: 3 "0", 2 url(symbol.png); when the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols descriptor instead of additive-symbols. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
suffix - CSS: Cascading Style Sheets
the suffix descriptor of the@counter-
style rule specifies content that will be appended to the marker representation. syntax /* <symbol> values */ suffix: ""; suffix: ") "; suffix: url(bullet.png); values <symbol> specifies a <symbol> that is appended to the marker representation. it may be a <string>, <image>, or <custom-ident>. formal definition related at-rule@counter-
styleinitial value". " (full stop followed by a space)computed valueas specified formal syntax <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>? [ <image-src>? , <color>? ]! )<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<p...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
@font-feature-values - CSS: Cascading Style Sheets
with the ornaments() functional notation of font-variant-alternates. an ornaments feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @stylistic specifies a feature name that will work with the stylistic() functional notation of font-variant-alternates. a stylistic feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @
styleset specifies a feature name that will work with the
styleset() functional notation of font-variant-alternates. a stylset feature value definition allows an unlimited number of values: ident1: 2 4 12 1 maps to the opentype values ss02, ss04, ss12, and ss01. note that values higher than 99 are valid, but don't map to any opentype values and are ignored. @character-variant specifies a feature nam...
... to cv03=1, and ident2: 2 4 maps to cv02=4, but ident2: 2 4 5 is invalid. ...
...eature-value-block-list> = <feature-value-block>+where <feature-value-block> = <feature-type> '{' <feature-value-declaration-list> '}'where <feature-type> = @stylistic | @historical-forms | @
styleset | @character-variant | @swash | @ornaments | @annotation<feature-value-declaration-list> = <feature-value-declaration>where <feature-value-declaration> = <custom-ident>: <integer>+; examples using @
styleset in a @font-feature-values rule /* at-rule for "nice-
style" in font one */ @font-feature-values font one { @
styleset { nice-
style: 12; } } /* at-rule for "nice-
style" in font two */ @font-feature-values font two { @
styleset { nice-
style: 4; } } … /* apply the at-rules with a single declaration */ .nice-look { font-variant-alternates:
styleset(nice-
style); } specificati...
...led from version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
@supports - CSS: Cascading Style Sheets
and (display:run-in) {} @supports (display: table-cell) and ((display: list-item) and (display:run-in)) {} the or operator the or operator creates a new expression from the disjunction of two shorter expressions. it returns true if one or both of the shorter expressions is also true. ...
...isplay: table-cell) and ((display: list-item) and (display:run-in)) {} the or operator the or operator creates a new expression from the disjunction of two shorter expressions. it returns true if one or both of the shorter expressions is also true. ...
...o shorter expressions. it returns true if one or both of the shorter expressions is also true. the following example returns true if at least one of the two shorter expressions is true: @supports (transform-
style: preserve) or (-moz-transform-
style: preserve) {} multiple disjunctions can be juxtaposed without the need of more parentheses. ...
...ue if one or both of the shorter expressions is also true. the following example returns true if at least one of the two shorter expressions is true: @supports (transform-
style: preserve) or (-moz-transform-
style: preserve) {} multiple disjunctions can be juxtaposed without the need of more parentheses. the following are both equivalent: @supports (transform-
style: preserve) or (-moz-transform-
style: preserve) or (-o-transform-
style: preserve) or (-webkit-transform-
style: preserve) {} @supports (transform-
style: preserve-3d) or ((-moz-transform-
style: preserve-3d) or ((-o-transform-
style: preserve-3d) or (-webkit-transform-
style: preserve-3d))) {} note: when using both and and or operators, the parentheses must be used to define the order in which they apply. otherwis...
CSS Animations tips and tricks - CSS: Cascading Style Sheets
here's one way to do it that we feel is stable and reliable enough to suggest to you. html content first, let's define the html for a <div> we wish to animate and a button that will play (or replay) the animation. <div class="box"> </div> <div class="runbutton">click me to run the animation</div> css content now we'll define the animation itself using css. some css that's not important (the
style of the "run" button itself) isn't shown here, for brevity. .runbutton { cursor: pointer; width: 300px; border: 1px solid black; font-size: 16px; text-align: center; margin-top: 12px; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } @keyframes colorchange { 0% { background: yellow } 100% {...
.... function play() { document.queryselector(".box").classname = "box"; window.requestanimationframe(function(time) { window.requestanimationframe(function(time) { document.queryselector(".box").classname = "box changing"; }); }); } this looks weird, doesn't it? that's because the only way to play an animation again is to remove the animation effect, let the document recompute
styles so that it knows you've done that, then add the animation effect back to the element. to make that happen, we have to be creative. here's what happens when the play() function gets called: the box's list of css classes is reset to simply "box". this has the effect of removing any other classes currently applied to the box, including the "changing" class that handles animation. in other words...
...e to be creative. here's what happens when the play() function gets called: the box's list of css classes is reset to simply "box". this has the effect of removing any other classes currently applied to the box, including the "changing" class that handles animation. in other words, we're removing the animation effect from the box. however, changes to the class list don't take effect until the
style recomputation is complete and a refresh has occurred to reflect the change. to be sure that the
styles are recalculated, we use window.requestanimationframe(), specifying a callback. our callback gets executed just before the next repaint of the document. the problem for us is that because it's before the repaint, the
style recomputation hasn't actually happened yet! so... our callback cleverly...
...this callback adds the "changing" class back onto the box, so that the repaint will start the animation once again. ...
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
n, sidebar, and a block into which i am intending to place advertising. ...
...rting with the same markup as used for the grid template areas example. ...
...ext-align: center; margin: 0; padding: 20px; } we are going to create a grid with a flexible number of flexible columns. i want them never to become smaller than 200 pixels, and then to share any available remaining space equally – so we always get equal width column tracks. we achieve this with the minmax() function in our repeat notation for track sizing. .listing { list-
style: none; margin: 2em; display: grid; grid-gap: 20px; grid-template-columns: repeat(auto-fill,minmax(200px, 1fr)); } as soon as i add this css, the items start to lay out as a grid. if i make the window smaller or wider the number of column tracks changes – without me needing to add breakpoints using media queries and redefine the grid. i can then tidy up the internals of the boxes usin...
... background-color: #f08c00; color: #fff; text-align: center; margin: 0; padding: 20px; } .listing li { border: 1px solid #ffe066; border-radius: 5px; display: flex; flex-direction: column; } .listing .cta { margin-top: auto; border-top: 1px solid #ffe066; padding: 10px; text-align: center; } .listing .body { padding: 10px; } .listing { list-
style: none; margin: 2em; display: grid; grid-gap: 20px; grid-auto-flow: dense; grid-template-columns: repeat(auto-fill,minmax(200px, 1fr)); } .listing .wide { grid-column-end: span 2; } this technique of using auto-placement with some rules applied to certain items is very useful, and can help you to deal with content that is being output by a cms for example, where you have repeated i...
CSS Logical Properties and Values - CSS: Cascading Style Sheets
riting modes, and the vertical dimension in vertical writing modes. for standard english text, it is the horizontal dimension. ...
...t is the horizontal dimension. ...
...operties for sizing block-size inline-size max-block-size max-inline-size min-block-size min-inline-size properties for margins, borders and padding border-block border-block-color border-block-end border-block-end-color border-block-end-
style border-block-end-width border-block-start border-block-start-color border-block-start-
style border-block-start-width border-block-
style border-block-width border-color (logical keyword) border-inline border-inline-color border-inline-end border-inline-end-color border-inline-end-
style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-
style border-inline-start-width border-inline-
style border-inline-width border-start-start-radius border-start-end-radius border-end-start-r...
...ogical keyword) border-inline border-inline-color border-inline-end border-inline-end-color border-inline-end-
style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-
style border-inline-start-width border-inline-
style border-inline-width border-start-start-radius border-start-end-radius border-end-start-radius border-end-end-radius border-
style (logical keyword) border-width (logical keyword) margin (logical keyword) margin-block margin-block-end margin-block-start margin-inline margin-inline-end margin-inline-start padding (logical keyword) padding-block padding-block-end padding-block-start padding-inline padding-inline-end padding-inline-start properties for floating and positioning clear (inline-end and...
Using CSS transforms - CSS: Cascading Style Sheets
form specifies the transforms to apply to the element. it is a space-separated list of transforms, which are applied one after the other, as requested by the composition operation. composite transforms are effectively applied in order from right to left. examples here is an unaltered image of the mdn logo: rotating here is the mdn logo rotated 90 degrees from its bottom-left corner. ...
... here is an unaltered image of the mdn logo: rotating here is the mdn logo rotated 90 degrees from its bottom-left corner. <img
style="transform: rotate(90deg); transform-origin: bottom left;" src="https://udn.realityripple.com/samples/6d/6633f3efc0.png"> skewing and translating here is the mdn logo, skewed by 10 degrees and translated by 150 pixels on the x-axis. <img
style="transform: skewx(10deg) translatex(150px); transform-origin: bottom left;" src="https://udn.realityripple.com/samples/6d/6633f3efc0.png"> 3d specific css properties performing css transformations in 3d space is a bit more complex. you have to start by configuring the 3d space by giving it a perspective, then you have to configure how your 2d elements will behave in that spa...
...rspective: 250px; } .pers350 { perspective: 350px; } .pers500 { perspective: 500px; } .pers650 { perspective: 650px; } /* define the container div, the cube div, and a generic face */ .container { width: 200px; height: 200px; margin: 75px 0 0 75px; border: none; } .cube { width: 100%; height: 100%; backface-visibility: visible; perspective-origin: 150% 150%; transform-
style: preserve-3d; } .face { display: block; position: absolute; width: 100px; height: 100px; border: none; line-height: 100px; font-family: sans-serif; font-size: 60px; color: white; text-align: center; } /* define each face based on direction */ .front { background: rgba(0, 0, 0, 0.3); transform: translatez(50px); } .back { background: rgba(0, 255, 0, 1); color: black;...
...o200200neg { perspective-origin: -200% -200%; } .po200200pos { perspective-origin: 200% 200%; } .po200200 { perspective-origin: 200% -200%; } /* define the container div, the cube div, and a generic face */ .container { width: 100px; height: 100px; margin: 24px; border: none; } .cube { width: 100%; height: 100%; backface-visibility: visible; perspective: 300px; transform-
style: preserve-3d; } .face { display: block; position: absolute; width: 100px; height: 100px; border: none; line-height: 100px; font-family: sans-serif; font-size: 60px; color: white; text-align: center; } /* define each face based on direction */ .front { background: rgba(0, 0, 0, 0.3); transform: translatez(50px); } .back { background: rgba(0, 255, 0, 1); color: black; ...
Cubic Bezier Generator - CSS: Cascading Style Sheets
var canvas = document.getelementbyid('bezier'); // make sure we don't execute when canvas isn't supported if (canvas.getcontext) { // use getcontext to use the canvas for drawing var ctx = canvas.getcontext('2d'); // clear canvas ctx.clearrect(0, 0, canvas.width, canvas.height); // draw the rulers ctx.beginpath(); ctx.stroke
style = "black"; // draw the y axis ctx.moveto(cx(0), cy(0)); ctx.lineto(cx(1), cy(0)); ctx.textalign = "right"; for (var i = 0.1; i <= 1; i = i + 0.1) { ctx.moveto(-basic_scale_size + cx(0), ly(i)); if ((i == 0.5) || (i > 0.9)) { ctx.moveto(-2 * basic_scale_size + cx(0), ly(i)); ctx.filltext(math.round(i ...
... } // draw the x axis label ctx.textalign = "left"; ctx.filltext("input (time duration ratio)", cx(0), 4 * basic_scale_size + cy(0)); // limitation the constant 4 should be dependant of the font size ctx.stroke(); ctx.closepath(); // draw the bézier curve ctx.beginpath(); ctx.moveto(cx(0), cy(0)); ctx.stroke
style = 'blue'; ctx.beziercurveto(cx(x1), cy(y1), cx(x2), cy(y2), cx(1), cy(1)); ctx.stroke(); ctx.closepath(); // draw the p2 point (with a line to p0) ctx.beginpath(); ctx.stroke
style = 'red'; ctx.moveto(cx(x1), cy(y1)); ctx.lineto(cx(0), cy(0)); ctx.stroke(); ctx.closepath(); ctx.beginpath(); ctx.movet...
...ctx.closepath(); // draw the p2 point (with a line to p0) ctx.beginpath(); ctx.stroke
style = 'red'; ctx.moveto(cx(x1), cy(y1)); ctx.lineto(cx(0), cy(0)); ctx.stroke(); ctx.closepath(); ctx.beginpath(); ctx.moveto(cx(x1), cy(y1)); ctx.arc(cx(x1), cy(y1), radius, 0, 2 * math.pi); ctx.stroke(); ctx.fill
style = 'white'; ctx.fill(); ctx.closepath(); // draw the p3 point (with a line to p1) ctx.beginpath(); ctx.stroke
style = 'red'; ctx.moveto(cx(x2), cy(y2)); ctx.lineto(cx(1), cy(1)); ctx.stroke(); ctx.closepath(); ctx.beginpath(); ctx.moveto(cx(x2), cy(y2)); ctx.arc(cx(x2), cy(y2), radius, 0, 2 * math.pi...
... ctx.lineto(cx(1), cy(1)); ctx.stroke(); ctx.closepath(); ctx.beginpath(); ctx.moveto(cx(x2), cy(y2)); ctx.arc(cx(x2), cy(y2), radius, 0, 2 * math.pi); ctx.stroke(); ctx.fill(); ctx.closepath(); // draw the p1(1,1) point (with dashed hints) ctx.beginpath(); ctx.moveto(cx(1), cy(1)); ctx.stroke
style = 'lightgrey'; ctx.lineto(cx(0), cy(1)); ctx.moveto(cx(1), cy(1)); ctx.lineto(cx(1), cy(0)); ctx.stroke(); ctx.closepath(); ctx.beginpath(); ctx.stroke
style = "black"; ctx.fill
style = "black"; ctx.arc(cx(1), cy(1), radius, 0, 2 * math.pi); ctx.fill(); ctx.stroke(); ctx.closepath(); // draw t...
Visual formatting model - CSS: Cascading Style Sheets
anonymous box is created when there is not an html element to use for the box. this situation happens when, for example, you declare display: flex on a parent element, and directly inside there is a run of text not contained in another element. in order to fix the box tree, an anonymous box is created around that run of text. it will then behave as a flex item, however, it cannot be targeted and
styled like a regular box because there is no element to target. the same thing happens when you have text runs interspersed with block elements. in the next example i have a string inside a <div>; in the middle of my string is a <p> element containing part of the text. the string is split into three boxes in the box tree. the part of the string before the paragraph element is wrapped in an anony...
...mple i have a string inside a <div>; in the middle of my string is a <p> element containing part of the text. the string is split into three boxes in the box tree. the part of the string before the paragraph element is wrapped in an anonymous box, then we have the <p>, which generates a box, and then another anonymous box. something to consider about these anonymous boxes is that they inherit
styles from their direct parent, but you cannot change how they look by targeting the anonymous box. in my examples, i am using a direct child selector to target the children of the container. this does not change the anonymous boxes, as they are not a child of the parent block. inline anonymous boxes are created when a string is split by an inline element, for example, a sentence that includes a sect...
...nymous boxes are created when a string is split by an inline element, for example, a sentence that includes a section wrapped with <em></em>. this splits the sentence into three inline boxes — an anonymous inline box before the emphasized section, the section wrapped in the <em> element, then a final anonymous inline box. ...
..., for example, a sentence that includes a section wrapped with <em></em>. this splits the sentence into three inline boxes — an anonymous inline box before the emphasized section, the section wrapped in the <em> element, then a final anonymous inline box. as with the anonymous block boxes, these anonymous inline boxes cannot be
styled independently in the way the <em> can; they just inherit the
styles of their container. other formatting contexts also create anonymous boxes. grid layout behaves in the same way as the flexbox example above, turning strings of text into a grid item with an anonymous box. multiple-column layout creates anonymous column boxes around the columns; these also cannot be
styled or otherwise targetted. table layout will add anonymous boxes to create a proper table str...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
ra) browsers to achieve the same thing. note that firefox and edge also support -webkit-appearance, for compatibility reasons. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the -moz-appearance property was used in xul
stylesheets to design custom widgets with platform-appropriate styling. it was also used in the xbl implementations of the widgets that ship with the mozilla platform. starting with gecko/firefox 80, these uses were changed to -moz-default-appearance, which should never be used outside of internal
stylesheets. compatibility note: if you wish to use this property on websites, you should test it very c...
...earance:auto; } <div>lorem</div> none the user agent selects the appropriate special styling based on the element. acts as none on elements with no special styling. menulist-button div { color: black; -moz-appearance: menulist-button; -webkit-appearance: menulist-button; } <div>lorem</div> firefox chrome safari edge the element is
styled as a button that would indicate a menulist can be opened. textfield div { color: black; -moz-appearance: textfield; -webkit-appearance: textfield; } <div>lorem</div> firefox chrome safari edge the following values are treated as equivalent to auto: button div { color: black; -moz-appearance: button; -webkit-appearance:...
...(not implemented for the windows platform) meterbar div { color: black; -moz-appearance: meterbar; -webkit-appearance: meterbar; } <div>lorem</div> firefox use meter instead. number-input div { color: black; -moz-appearance: number-input; -webkit-appearance: number-input; } <div>lorem</di...
...use progress-bar instead progressbar-vertical div { color: transparent; -moz-appearance: progressbar-vertical; -webkit-appearance: preogressbar-vertical; } <div>lorem</div> firefox range div { color: black; -moz-appearance: range; -webkit-appearance: range; } range <div>lorem</div> fi...
border-width - CSS: Cascading Style Sheets
t within a single document. formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumapplies toall elements. ...
...roperties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumapplies toall elements. ...
...bottom-width: mediumborder-left-width: mediumapplies toall elements. ...
...lies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-
style is none or hiddenborder-left-width: the absolute length or 0 if border-left-
style is none or hiddenborder-right-width: the absolute length or 0 if border-right-
style is none or hiddenborder-top-width: the absolute length or 0 if border-top-
style is none or hiddenanimation typeas each of the properties of the shorthand:border-bottom-width: a lengthborder-left-width: a lengthborder-right-width: a lengthborder-top-width: a length formal syntax <line-width>{1,4}where <line-width> = <length> | thin | medium | thick examples a mix of values and lengths html <p id="sval"> one value: 6px wide border on all 4 sides</p> <p id="bival"> ...
<display-listitem> - CSS: Cascading Style Sheets
list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. ...
... list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. ...
... list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. ...
...-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. examples html <div class="fake-list">i will display as a list item</div> css .fake-list { display: list-item; list-
style-position: inside; } result specifications specification status css display module level 3the definition of 'display-listitem' in that specification. candidate recommendation ...
font-synthesis - CSS: Cascading Style Sheets
alic, may be synthesized by the browser. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax this property can take any one of the following forms: the keyword value none. either of the keyword values weight and
style. both the keyword values weight and
style. values none indicates that neither bold nor italic typeface may be synthesized. weight indicates that a bold typeface may be synthesized if needed.
style indicates that an italic typeface may be synthesized if needed. description most standard western fonts include italic and bold variants, but many novelty fonts do not. fonts used for chin...
...scription most standard western fonts include italic and bold variants, but many novelty fonts do not. fonts used for chinese, japanese, korean and other logographic scripts tend not to include these variants, and synthesizing them may impede the legibility of the text. in these cases, it may be desirable to switch off the browser's default font-synthesis. ...
...tend not to include these variants, and synthesizing them may impede the legibility of the text. in these cases, it may be desirable to switch off the browser's default font-synthesis. formal definition initial valueweight
styleapplies toall elements. ...
...weight
styleapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ weight |
style ] examples disabling font synthesis html <em class="syn">synthesize me! 站直。</em> <br/> <em class="no-syn">don't synthesize me! 站直。</em> css em { font-weight: bold; } .syn { font-synthesis:
style weight; } .no-syn { font-synthesis: none; } result specifications specification status comment css fonts module level 3the definition of 'font-synthesis' in that specification. candidate recommendation initial definition ...
font-variant - CSS: Cascading Style Sheets
-lig-values>, <discretionary-lig-values>, <historical-lig-values>, <contextual-alt-values> specifies the keywords related to the font-variant-ligatures longhand property. the possible values are: common-ligatures, no-common-ligatures, discretionary-ligatures, no-discretionary-ligatures, historical-ligatures, no-historical-ligatures, contextual, and no-contextual. stylistic(), historical-forms,
styleset(), character-variant(), swash(), ornaments(), annotation() specifies the keywords and functions related to the font-variant-alternates longhand property. small-caps, all-small-caps, petite-caps, all-petite-caps, unicase, titling-caps specifies the keywords and functions related to the font-variant-caps longhand property. <numeric-figure-values>, <numeric-spacing-values>, <numeric-fraction-...
...perty. small-caps, all-small-caps, petite-caps, all-petite-caps, unicase, titling-caps specifies the keywords and functions related to the font-variant-caps longhand property. <numeric-figure-values>, <numeric-spacing-values>, <numeric-fraction-values>, ordinal, slashed-zero specifies the keywords related to the font-variant-numeric longhand property. the possible values are: lining-nums, old
style-nums, proportional-nums, tabular-nums, diagonal-fractions, stacked-fractions, ordinal, and slashed-zero. <east-asian-variant-values>, <east-asian-width-values>, ruby specifies the keywords related to the font-variant-east-asian longhand property. the possible values are: jis78, jis83, jis90, jis04, simplified, traditional, full-width, proportional-width, ruby. formal definition initial value...
...idth, proportional-width, ruby. formal definition initial valuenormalapplies toall elements. ...
...st-asian-width-values> | ruby ]where <common-lig-values> = [ common-ligatures | no-common-ligatures ]<discretionary-lig-values> = [ discretionary-ligatures | no-discretionary-ligatures ]<historical-lig-values> = [ historical-ligatures | no-historical-ligatures ]<contextual-alt-values> = [ contextual | no-contextual ]<feature-value-name> = <custom-ident><numeric-figure-values> = [ lining-nums | old
style-nums ]<numeric-spacing-values> = [ proportional-nums | tabular-nums ]<numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ]<east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]<east-asian-width-values> = [ full-width | proportional-width ] examples setting the small-caps font variant html <p class="normal">firefox rocks!</p> <p class="small...
Inheritance - CSS: Cascading Style Sheets
by default ("inherited: yes") or not ("inherited: no"). inherited properties when no value for an inherited property has been specified on an element, the element gets the computed value of that property on its parent element. only the root element of the document gets the initial value given in the property's summary. a typical example of an inherited property is the color property. given the
style rules: p { color: green; } ... and the markup: <p>this paragraph has <em>emphasized text</em> in it.</p> ... the words "emphasized text" will appear green, since the em element has inherited the value of the color property from the p element. it does not get the initial value of the property (which is the color that is used for the root element when the page specifies no color). non-inherite...
...e initial value of the property (which is the color that is used for the root element when the page specifies no color). non-inherited properties when no value for a non-inherited property has been specified on an element, the element gets the initial value of that property (as specified in the property's summary). a typical example of a non-inherited property is the border property. given the
style rules: p { border: medium solid; } ... and the markup: <p>this paragraph has <em>emphasized text</em> in it.</p> ... the words "emphasized text" will not have a border (since the initial value of border-
style is none). notes the inherit keyword allows authors to explicitly specify inheritance. it works on both inherited and non-inherited properties. you can control inheritance for all p...
...then it doubles the font size and applies a font-weight of "bold". ...
...s authors to explicitly specify inheritance. it works on both inherited and non-inherited properties. you can control inheritance for all properties at once using the all shorthand property, which applies its value to all properties. for example: font { all: revert; font-size: 200%; font-weight: bold; } this reverts the
style of the font property to the user agent's default unless a user
stylesheet exists, in which case that is used instead. then it doubles the font size and applies a font-weight of "bold". see also css values for controlling inheritance: inherit, initial, unset, and revert introducing the css cascade cascade and inheritance css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, ...
mask - CSS: Cascading Style Sheets
y) by masking or clipping the image at specific points. as well as the properties listed below, the mask shorthand also resets mask-border to its initial value. it is therefore recommended to use the mask shorthand rather than other shorthands or the individual properties to override any mask settings earlier in the cascade. this will ensure that mask-border has also been reset to allow the new
styles to take effect. constituent properties this property is a shorthand for the following css properties: mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size syntax /* keyword values */ mask: none; /* image values */ mask: url(mask.png); /* pixel image used as mask */ mask: url(masks.svg#star); /* elemen...
...ht / 16px repeat-y; /* element within svg graphic is used as a mask on the right-hand side with a width of 16px */ values <mask-reference> sets the mask image source. see mask-image. <masking-mode> sets the masking mode of the mask image. see mask-mode. <position> sets the position of the mask image. see mask-position. <bg-size> sets the size of the mask image. see mask-size. <repeat-
style> sets the repetition of the mask image. see mask-repeat. <geometry-box> if only one <geometry-box> value is given, it sets both mask-origin and mask-clip. if two <geometry-box> values are present, then the first sets mask-origin and the second sets mask-clip. <geometry-box> | no-clip sets the area that is affected by the mask image. see mask-clip. <compositing-operator> sets the compositin...
...age: discretemask-mode: discretemask-repeat: discretemask-position: repeatable list of simple list of length, percentage, or calcmask-clip: discretemask-origin: discretemask-size: repeatable list of simple list of length, percentage, or calcmask-composite: discretecreates stacking contextyes formal syntax <mask-layer>#where <mask-layer> = <mask-reference> | <position> [ / <bg-size> ]? | <repeat-
style> | <geometry-box> | [ <geometry-box> | no-clip ] | <compositing-operator> | <masking-mode>where <mask-reference> = none | <image> | <mask-source><position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ]...
...| <masking-mode>where <mask-reference> = none | <image> | <mask-source><position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? ...
<percentage> - CSS: Cascading Style Sheets
n, although negative values are not valid for all properties. as with all css dimensions, there is no space between the symbol and the number. interpolation when animated, values of the <percentage> data type are interpolated as real, floating-point numbers. the speed of the interpolation is determined by the timing function associated with the animation. ...
...id for all properties. as with all css dimensions, there is no space between the symbol and the number. interpolation when animated, values of the <percentage> data type are interpolated as real, floating-point numbers. the speed of the interpolation is determined by the timing function associated with the animation. ...
...ion when animated, values of the <percentage> data type are interpolated as real, floating-point numbers. the speed of the interpolation is determined by the timing function associated with the animation. ...
... timing function associated with the animation. examples width and margin-left <div
style="background-color:navy;"> <div
style="width:50%; margin-left:20%; background-color:chartreuse;"> width: 50%, left margin: 20% </div> <div
style="width:30%; margin-left:60%; background-color:pink;"> width: 30%, left margin: 60% </div> </div> the above html will output: font-size <div
style="font-size:18px;"> <p>full-size text (18px)</p> <p><span
style="font-size:50%;">50% (9px)</span></p> <p><span
style="font-size:200%;">200% (36px)</span></p> </div> the above html will output: specifications specification status comment css values and units module level 4the definition of '<percentage>' in that specification. editor's draft no signific...
url() - CSS: Cascading Style Sheets
the url() css function is used to include a file. the parameter is an absolute url, a relative url, or a data uri. the url() function can be passed as a parameter of another css functions, like the attr() function. depending on the property for which it is a value, the resource sought can be an image, font, or a
stylesheet. the url() functional notation is the value for the <url> data type. ...
...or which it is a value, the resource sought can be an image, font, or a
stylesheet. the url() functional notation is the value for the <url> data type. ...
...ion */ background-image: cross-fade(20% url(first.png), url(second.png)); mask-image: image(url(mask.png), skyblue, linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* as part of a non-shorthand multiple value */ content: url(star.svg) url(star.svg) url(star.svg) url(star.svg) url(star.svg); /* at-rules */ @document url("https://www.example.com/") { ... ...
...linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* as part of a non-shorthand multiple value */ content: url(star.svg) url(star.svg) url(star.svg) url(star.svg) url(star.svg); /* at-rules */ @document url("https://www.example.com/") { ... } @import url("https://www.example.com/
style.css"); @namespace url(http://www.w3.org/1999/xhtml); relative urls, if used, are relative to the url of the
stylesheet (not to the url of the web page). the url() function can be included as a value for background, background-image, list-
style, list-
style-image, content, cursor, border, border-image, border-image-source, mask, mask-image, src as part of a @font-face block, and @counter-
style/symbol in css level 1, the url() functional notation described only true urls. in css level 2, the definition of url...
will-change - CSS: Cascading Style Sheets
he stronger optimizations that are likely to be tied to will-change end up using a lot of a machine’s resources, and when overused like this can cause the page to slow down or consume a lot of resources. use sparingly. the normal behavior for optimizations that the browser make is to remove the optimizations as soon as it can and revert back to normal. but adding will-change directly in a
stylesheet implies that the targeted elements are always a few moments away from changing and the browser will keep the optimizations for much longer time than it would have otherwise. so it is a good practice to switch will-change on and off using script code before and after the change occurs. don't apply will-change to elements to perform premature optimization. if your page is performing well...
...shorthand expands to. it cannot be one of the following values: unset, initial, inherit, will-change, auto, scroll-position, or contents. the spec doesn't define the behavior of particular value, but it is common for transform to be a compositing layer hint. chrome currently takes two actions, given particular css property idents: establish a new compositing layer or a new stacking context. via
stylesheet it may be appropriate to include will-change in your
style sheet for an application that does page flips on key presses like an album or a slide deck presentation where the pages are large and complex. this will let browser prepare the transition ahead of time and allow for snappy transitions between the pages as soon as the key is pressed. but use caution with the will-change property dire...
...it may cause the browser to keep the optimization in memory for much longer than it is needed. ...
...y through scripting, which is probably what you should be doing in most cases. var el = document.getelementbyid('element'); // set will-change when the element is hovered el.addeventlistener('mouseenter', hintbrowser); el.addeventlistener('animationend', removehint); function hintbrowser() { // the optimizable properties that are going to change // in the animation's keyframes block this.
style.willchange = 'transform, opacity'; } function removehint() { this.
style.willchange = 'auto'; } specifications specification status comment css will change module level 1the definition of 'will-change' in that specification. candidate recommendation initial definition ...
CSS: Cascading Style Sheets
css describes how elements should be rendered on screen, on paper, in speech, or on other media. css among the core languages of the open web and is standardized across web browsers according to the w3c specification. previously development of various parts of css specification was done synchronously, which allowed versioning of the latest recommendation. you might have heard about css1, css2.1, css3. however, css4 has never become an official version. ...
...b developers describes every property and concept of css. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started tutorials our css learning area features multiple modules that teach css from the ground up — no previous knowledge required. css first steps css (cascading
style sheets) is used to
style and layout web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. css ...
... is styling text — one of the most common things you'll do with css. here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features. we round off the module by looking at applying custom fonts to your page, and styling lists and links. css layout at this point we've already looked at css fundamentals, how to
style text, and how to
style and manipulate the boxes that your content sits inside. now it's time to look at how to place your boxes in the right place concerning the viewport, and one another. we have covered the necessary prerequisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legacy te...
... can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer. tools for css development you can use the w3c css validation service to check if your css is valid. this is an invaluable debugging tool. firefox developer tools lets you view and edit a page's live css via the inspector and
style editor tools. the web developer extension for firefox lets you track and edit live css on watched sites. the web community has created various other miscellaneous css tools for you to use. meta bugs firefox: bug 1323667 ...
font-style - SVG: Scalable Vector Graphics
the font-
style attribute specifies whether the text is to be rendered using a normal, italic, or oblique face. note: as a presentation attribute, font-
style can be used as a css property. see the css font-
style property for more information. ...
...attribute, font-
style can be used as a css property. see the css font-
style property for more information. as a presentation attribute, it can be applied to any element but only has an effect on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-
style="normal">normal font
style</text> <text x="150" y="20" font-
style="italic">italic font
style</text> </svg> usage notes value normal | italic | oblique default value normal animatable yes for a description of the values, please refer to the css font-
style property. specifications specification status comment css fonts ...
...text x="150" y="20" font-
style="italic">italic font
style</text> </svg> usage notes value normal | italic | oblique default value normal animatable yes for a description of the values, please refer to the css font-
style property. specifications specification status comment css fonts module level 4the definition of 'font-
style' in that specification. working draft no change css fonts module level 3the definition of 'font-
style' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'font-
style' in that specification. recommendation initial definition browser compatibility the compatibility table on this p...
...nition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
<style> - SVG: Scalable Vector Graphics
the svg <
style> element allows
style sheets to be embedded directly within svg content. svg's
style element has the same attributes as the corresponding element in html (see html's <
style> element). html,body,svg { height:100%; margin: 0; padding: 0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <
style> circle { fill: gold; stroke: maroon; stroke-width: 2px; } </
style> <circle cx="5" cy="5" r="4" /> </svg> attributes type this attribute defines type of the
style sheet language to use as a media type string. value type: <string>; default value: text/css; animatable: no media this attribute defines to which media the
style applies. value type: <string>; default value: all; animatable: no title this attribute the title of the s...
...svg> attributes type this attribute defines type of the
style sheet language to use as a media type string. value type: <string>; default value: text/css; animatable: no media this attribute defines to which media the
style applies. value type: <string>; default value: all; animatable: no title this attribute the title of the
style sheet which can be used to switch between alternate
style sheets. ...
.../css; animatable: no media this attribute defines to which media the
style applies. value type: <string>; default value: all; animatable: no title this attribute the title of the
style sheet which can be used to switch between alternate
style sheets. value type: <string>; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class,
style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<
style>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edi...
... recommendation initial definition ...
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes there are two types of elements discussed here: top-level elements and instructions. a top-level element must appear as the child of either <xsl:
stylesheet> or <xsl:transform>. an instruction, on the other hand, is associated with a template. a
stylesheet may include several templates. a third type of element, not discussed here, is the literal result element (lre). an lre also appears in a template. it consists of any non-instruction element that should be copied as-is to the result document, for example, an <hr> element in an html conversion
stylesheet. on a related note, any attribute in an lre and some attributes of a limited number of xslt elements can also include what is known as an attribut...
...ic.jpg"/> the element annotations that follow include a description, a syntax listing, a list of required and optional attributes, a description of type and position, its source in the w3c recommendation and an explanation of the degree of present gecko support. use the {{listsubpages}} macro once the bcd for <xsl:fallback>, <xsl:import>, <xsl:namespace-alias>, <xsl:number>, <xsl:output>, <xsl:
stylesheet>, <xsl:text> and <xsl:value-of> is fully migrated. <xsl:apply-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:output><xsl:param><xsl:preserve-s...
...ly-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:output><xsl:param><xsl:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:
stylesheet><xsl:template><xsl:text><xsl:transform><xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:copy> <xsl:copy-of> <xsl:decimal-format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:inclu...
... <xsl:decimal-format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:
stylesheet> (partially supported) <xsl:template> <xsl:text> (partially supported) <xsl:transform> <xsl:value-of> (partially supported) <xsl:variable> <xsl:when> <xsl:with-param> ...
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
ray length: 432 pages publisher: o'reilly media; 2 edition (september 22, 2003) isbn: 0596004206 as the title indicates, this is an overview of xml generally. chapter 6 is devoted specifically to xslt. ...
...206 as the title indicates, this is an overview of xml generally. chapter 6 is devoted specifically to xslt. http://www.amazon.com/gp/product/0596004206 digital websites world wide web consortium the w3c homepage: http://www.w3.org/ the main xsl page: http://www.w3.org/
style/xsl/ the version 1.0 recommendation for xslt: http://www.w3.org/tr/xslt archive of public
style (css and xslt) discussions: http://lists.w3.org/archives/public/www-
style/ the version 1.0 recommendation for xpath: http://www.w3.org/tr/xpath the world wide web consortium is the body that publishes recommendations for a number of web-based technologies, many of which become the de-facto standard. articles hands-on xsl author: don r. day location: http://www-106.ib...
... author: jay greenspan location: http://hotwired.lycos.com/webmonkey/...l?tw=authoring what is xslt? author: g. ...
...man/index.html tutorials/examples zvon xsl programmers: http://www.zvon.org/o_html/group_xsl.html jeni's xslt pages index: http://www.jenitennison.com/xslt/ xmlpitstop.com
stylesheet center: http://www.xmlpitstop.com/default.asp?datatype=ssc xsl tutorial index: http://www.nwalsh.com/docs/tutorials/xsl/ other cover pages extensible
stylesheet language (xsl): http://www.oasis-open.org/cover/xsl.html xsl-list subscribe: http://www.mulberrytech.com/xsl/xsl-list/ archives: http://www.biglist.com/lists/xsl-list/archives/ the xsl-list is a very active general mailing list, hosted by mulberry technologies mozilla.dev.tech.xslt google groups: http://groups.google.com/group/mozilla.dev.tech.xslt ...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
documents will need to be presented to human readers. because a browser provides a familiar and highly flexible interface, it is an ideal mechanism for delivering such presentation versions of xml content. built from the ground up utilizing a wide variety of xml technologies, firefox incorporates within itself all of the mechanisms needed to process both original xml documents and the specialized
stylesheets used to
style and lay them out for html display, reducing server load with client-side processing. at present, gecko (the layout engine behind firefox) supports two forms of xml
stylesheets. for basic control of appearance — fonts, colors, position, and so forth — gecko uses css. css1 and css2 are well supported and support for the emerging css3 standard is under development. for furth...
...rocessing. at present, gecko (the layout engine behind firefox) supports two forms of xml
stylesheets. for basic control of appearance — fonts, colors, position, and so forth — gecko uses css. css1 and css2 are well supported and support for the emerging css3 standard is under development. for further information about css, see eric meyer's css pages. our focus here is on the second type of
stylesheet that gecko supports: the xslt
stylesheet. xslt stands for extensible
stylesheet language/transform and the name is apt. ...
..., colors, position, and so forth — gecko uses css. css1 and css2 are well supported and support for the emerging css3 standard is under development. for further information about css, see eric meyer's css pages. our focus here is on the second type of
stylesheet that gecko supports: the xslt
stylesheet. xslt stands for extensible
stylesheet language/transform and the name is apt. xslt allows a
stylesheet author to transform a primary xml document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format (and in the case of firefox, the focus is on converting it on the fly into html which can then be displayed by the browser). xslt/xpath reference elements xsl:apply-imports (su...
...orted) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:
stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-s...
Content states and the style system - Archive of obsolete content
content states are what gecko uses to implement the various state-dependent in css (examples would be :hover, :active, :focus, :target, :checked). we will focus on describing how changes in content state are handled. generally, whenever a node's content state changes,
style has to be reresolved (recomputed) for that node and all of its descendants. this is an expensive operation, however, so the
style system tries to minimize the number of
style reresolves it does. ...
...as to be reresolved (recomputed) for that node and all of its descendants. this is an expensive operation, however, so the
style system tries to minimize the number of
style reresolves it does. to this end, when a <code>contentstateschanged</code> notification is dispatched for a content node the first thing that's done is to is to check whether the content state change something could affect any
styles. this is done by walking the list of all css2.1 simple selectors in all
style sheets applied to the page that have a state-dependent pseudo-class as part of the selector. this list is created during the parsing of the
stylesheets involved. ...
...fect any
styles. this is done by walking the list of all css2.1 simple selectors in all
style sheets applied to the page that have a state-dependent pseudo-class as part of the selector. this list is created during the parsing of the
stylesheets involved. for each selector in this list we check whether it might have stopped matching the node or started matching it. if that has happened, then the
style could depend on the state that changed and we have to reresolve
style. the way we determine whether the selector might have stopped or started matching the node is by just checking whether it matches with the caveat that all the state-dependent pseudo-classes corresponding to the states that changed must be treated as matching (whether they actually do and whether they're negated or not). this i...
Learn to style HTML using CSS - Learn web development
for example, you can use css to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites you should learn the basics of html before attempting any css. we recommend that you work through our introduction to html module first. ...
...the web before proceeding with this topic. however, doing so isn't absolutely necessary as much of what is covered in the css basics article is also covered in our css first steps module, albeit in a lot more detail. modules this topic contains the following modules, in a suggested order for working through them. you should definitely start with the first one. css first steps css (cascading
style sheets) is used to
style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. css...
...n is styling text — one of the most common things you'll do with css. here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows and other text features. we round off the module by looking at applying custom fonts to your page, and styling lists and links. css layout at this point we've already looked at css fundamentals, how to
style text, and how to
style and manipulate the boxes that your content sits inside. now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. we have covered the necessary prerequisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legac...
CSSStyleDeclaration.item() - Web APIs
the css
styledeclaration.item() method interface returns a css property name from a css
styledeclaration by index. this method doesn't throw exceptions as long as you provide arguments; the empty string is returned if the index is out of range and a typeerror is thrown if no argument is provided. syntax var propertyname =
style.item(index); parameters index is the index of the node to be fetched. the index is zero-based. return value propertyname is a domstring that is the name of the css property at the specified index. ...
... typeerror is thrown if no argument is provided. syntax var propertyname =
style.item(index); parameters index is the index of the node to be fetched. the index is zero-based. return value propertyname is a domstring that is the name of the css property at the specified index. javascript has a special simpler syntax for obtaining an item from a nodelist by index: var propertyname =
style[index]; example var
style = document.getelementbyid('div1').
style; var propertyname =
style.item(1); // or simply
style[1] - returns the second
style listed specifications specification status comment css object model (cssom)the definition of 'css
styledeclaration.item()' in that specification. working draft document object model (dom) level 2 styl...
...ent.getelementbyid('div1').
style; var propertyname =
style.item(1); // or simply
style[1] - returns the second
style listed specifications specification status comment css object model (cssom)the definition of 'css
styledeclaration.item()' in that specification. working draft document object model (dom) level 2
style specificationthe definition of 'css
styledeclaration' in that specification. obsolete ...
CSSStyleDeclaration.removeProperty() - Web APIs
the css
styledeclaration.removeproperty() method interface removes a property from a css
style declaration object. syntax var oldvalue =
style.removeproperty(property); parameters property is a domstring representing the property name to be removed. note that multi-word property names are hyphenated and not camel-cased. return value oldvalue is a domstring equal to the value of the css property before it was removed. exceptions domexception no_modification_allowed_err: if the property or declaration block is read only. ...
...rd property names are hyphenated and not camel-cased. return value oldvalue is a domstring equal to the value of the css property before it was removed. exceptions domexception no_modification_allowed_err: if the property or declaration block is read only. ...
...phenated and not camel-cased. return value oldvalue is a domstring equal to the value of the css property before it was removed. exceptions domexception no_modification_allowed_err: if the property or declaration block is read only. example the following javascript code removes the background-color css property from a selector rule: var declaration = document.
stylesheets[0].rules[0].
style; var oldvalue = declaration.removeproperty('background-color'); specifications specification status comment css object model (cssom)the definition of 'css
styledeclaration.removeproperty()' in that specification. working draft document object model (dom) level 2
style specificationthe definition of 'css
styledeclaration' in that specification. obso...
CSSStyleSheet.addRule() - Web APIs
the obsolete css
stylesheet interface's addrule() legacy method adds a new rule to the
stylesheet. you should avoid using this method, and should instead use the more standard insertrule() method. syntax var result = css
stylesheet.addrule(selector,
styleblock, index); parameters selector a domstring specifying the selector portion of the css rule. the default is the string undefined.
styleblock a domstring indicating the
style block to apply to elements matching the selector. the default is the string undefined. index optional an optional index into the
stylesheet's cssrulelist at which to insert the new rule. if index is not specified, the next index after the last item currently in the list is used (that is, the value of css
stylesheet.cssrules.length). return value always retu...
...n the list is used (that is, the value of css
stylesheet.cssrules.length). return value always returns -1. note that due to somewhat estoteric rules about where you can legally insert rules, it's possible that an exception may be thrown. see insertrule() for more information. usage notes this method is implemented by browsers by constructing a string using the template literal `${selector}{${
styleblock}}`, then passing it into the standard insertrule() method. ...
...mewhat estoteric rules about where you can legally insert rules, it's possible that an exception may be thrown. see insertrule() for more information. usage notes this method is implemented by browsers by constructing a string using the template literal `${selector}{${
styleblock}}`, then passing it into the standard insertrule() method. therefore, given existing code such as the following: css
stylesheet.addrule(selector,
styles, 0); you can rewrite this to use the more standard insertrule() like this: css
stylesheet.insertrule(`${selector} {${
styles}}`, 0); specifications specification status comment css object model (cssom)the definition of 'css
stylesheet.addrule()' in that specification. working draft ...
CSSStyleSheet.cssRules - Web APIs
the read-only css
stylesheet property cssrules returns a live cssrulelist which provides a real-time, up-to-date list of every css rule which comprises the
stylesheet. each item in the list is a cssrule defining a single rule. syntax var rules = css
stylesheet.cssrules; value a live-updating cssrulelist containing each of the css rules making up the
stylesheet. each entry in the rule list is a cssrule object describing one rule making up the
stylesheet. ...
..., up-to-date list of every css rule which comprises the
stylesheet. each item in the list is a cssrule defining a single rule. syntax var rules = css
stylesheet.cssrules; value a live-updating cssrulelist containing each of the css rules making up the
stylesheet. each entry in the rule list is a cssrule object describing one rule making up the
stylesheet. examples individual rules within the
stylesheet can then be accessed by index: let rulelist = document.
stylesheets[0].cssrules; for (let i=0; i < rulelist.length; i++) { processrule(rulelist[i]); } rules can also be accessed using for...of: let rulelist = document.
stylesheets[0].cssrules; for (let rule of rulelist) { processrule(rule); } however, because cssrule is not a proper array, you can't use foreach(). specifications ...
...0; i < rulelist.length; i++) { processrule(rulelist[i]); } rules can also be accessed using for...of: let rulelist = document.
stylesheets[0].cssrules; for (let rule of rulelist) { processrule(rule); } however, because cssrule is not a proper array, you can't use foreach(). specifications specification status comment css object model (cssom)the definition of 'css
stylesheet.cssrules' in that specification. working draft ...
CSSStyleSheet.ownerRule - Web APIs
the read-only css
stylesheet property ownerrule returns the cssimportrule corresponding to the @import at-rule which imported the
stylesheet into the document. if the
stylesheet wasn't imported into the document using @import, the returned value is null. syntax var ownerrule = css
stylesheet.ownerrule; value a cssimportrule corresponding to the @import rule which imported the
stylesheet into the document. if the
stylesheet wasn't imported into the document using @import, the returned value is null. examples this snippet of code looks for rules which were not imported into the document using an @import at-rule. ...
... null. syntax var ownerrule = css
stylesheet.ownerrule; value a cssimportrule corresponding to the @import rule which imported the
stylesheet into the document. if the
stylesheet wasn't imported into the document using @import, the returned value is null. examples this snippet of code looks for rules which were not imported into the document using an @import at-rule. ...
...ent. if the
stylesheet wasn't imported into the document using @import, the returned value is null. examples this snippet of code looks for rules which were not imported into the document using an @import at-rule. let rulelist = document.
stylesheets[0].cssrules; for (let rule of rulelist) { if (!rule.ownerrule) { /* rule is not imported */ } } this snipped obtains a reference to the
stylesheet associated with the @import and processes it in some manner: let rulelist = document.
stylesheets[0].cssrules; for (let rule of rulelist) { if (rule.ownerrule) { check
stylesheet(rule.ownerrule.
stylesheet); } } specifications specification status comment css object model (cssom)the definition of 'css
stylesheet.ownerrule' in that specification. working dra...
CanvasRenderingContext2D.fillStyle - Web APIs
the canvasrenderingcontext2d.fill
style property of the canvas 2d api specifies the color, gradient, or pattern to use inside shapes. the default
style is #000 (black). for more examples of fill and stroke
styles, see applying
styles and color in the canvas tutorial. syntax ctx.fill
style = color; ctx.fill
style = gradient; ctx.fill
style = pattern; options color a domstring parsed as css <color> value. gradient a canvasgradient object (a linear or radial gradient). pattern a canvaspattern object (a repeating image). examples changing the fill color of a shape this example applies a blue fill color to a rectangle. ...
... parsed as css <color> value. gradient a canvasgradient object (a linear or radial gradient). pattern a canvaspattern object (a repeating image). examples changing the fill color of a shape this example applies a blue fill color to a rectangle. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fill
style = 'blue'; ctx.fillrect(10, 10, 100, 100); result creating multiple fill colors using loops in this example, we use two for loops to draw a grid of rectangles, each having a different fill color. to achieve this, we use the two variables i and j to generate a unique rgb color for each square, and only modify the red and green values. (the blue channel has a fixed value.) by modifying the cha...
...ique rgb color for each square, and only modify the red and green values. (the blue channel has a fixed value.) by modifying the channels, you can generate all kinds of palettes. <canvas id="canvas" width="150" height="150"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); for (let i = 0; i < 6; i++) { for (let j = 0; j < 6; j++) { ctx.fill
style = `rgb( ${math.floor(255 - 42.5 * i)}, ${math.floor(255 - 42.5 * j)}, 0)`; ctx.fillrect(j * 25, i * 25, 25, 25); } } the result looks like this: screenshotlive sample specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.fill
style' in that specification. living standard ...
HTMLStyleElement.scoped - Web APIs
the html
styleelement.scoped property is a boolean value indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true). by default it contains the value of the scoped content attribute. ...
... the html
styleelement.scoped property is a boolean value indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true). by default it contains the value of the scoped content attribute. ...
... the html
styleelement.scoped property is a boolean value indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true). by default it contains the value of the scoped content attribute. ...
HTMLStyleElement.type - Web APIs
the html
styleelement.type read-only property returns the type of the current
style. ...
... the html
styleelement.type read-only property returns the type of the current
style. ...
... the html
styleelement.type read-only property returns the type of the current
style. ...
StylePropertyMapReadOnly.entries() - Web APIs
example // tbd specifications specification status comment css typed om level 1the definition of 'entries()' in that specification. working draft initial definition. ...
... example // tbd specifications specification status comment css typed om level 1the definition of 'entries()' in that specification. working draft initial definition. ...
... example // tbd specifications specification status comment css typed om level 1the definition of 'entries()' in that specification. working draft initial definition. ...
StylePropertyMapReadOnly.forEach() - Web APIs
thisarg optional value to use as this (i.e the reference object) when executing callback. return value undefined. ...
... thisarg optional value to use as this (i.e the reference object) when executing callback. return value undefined. ...
... thisarg optional value to use as this (i.e the reference object) when executing callback. return value undefined. example // tbd specifications specification status comment css typed om level 1the definition of 'foreach()' in that specification. ...
StyleSheet - Web APIs
an object implementing the
stylesheet interface represents a single
style sheet. css
style sheets will further implement the more specialized css
stylesheet interface. properties
stylesheet.disabled is a boolean representing whether the current
stylesheet has been applied or not.
stylesheet.href read only returns a domstring representing the location of the
stylesheet.
stylesheet.media read only returns a medialist representing the intended destination medium for
style information.
stylesheet.ownernode read only returns a node associating this
style sheet with the current document.
stylesheet.parent
stylesheet read only returns a
stylesheet including this one, if any; returns null if there aren't any. ...
...string representing the location of the
stylesheet.
stylesheet.media read only returns a medialist representing the intended destination medium for
style information.
stylesheet.ownernode read only returns a node associating this
style sheet with the current document.
stylesheet.parent
stylesheet read only returns a
stylesheet including this one, if any; returns null if there aren't any.
stylesheet.title read only returns a domstring representing the advisory title of the current
style sheet.
stylesheet.typeread only returns a domstring representing the
style sheet language for this
style sheet. specifications specification status comment css object model (cssom)the definition of '
stylesheet' in that specification. working draft no change from docu...
...a domstring representing the advisory title of the current
style sheet.
stylesheet.typeread only returns a domstring representing the
style sheet language for this
style sheet. specifications specification status comment css object model (cssom)the definition of '
stylesheet' in that specification. working draft no change from document object model (dom) level 2
style specification. document object model (dom) level 2
style specificationthe definition of '
stylesheet' in that specification. obsolete initial definition. ...
-moz-image-region - CSS: Cascading Style Sheets
this allows elements to use different pieces of the same image to improve performance. /* keyword value */ -moz-image-region: auto; /* <shape> value */ -moz-image-region: rect(0, 8px, 4px, 4px); /* global values */ -moz-image-region: inherit; -moz-image-region: initial; -moz-image-region: unset; the syntax is similar to the clip property. all four values are relative to the upper left corner of the image. note: for a system that works on any background, see -moz-image-rect(). ...
...) function defines a rectangle to use as shape. its parameters define the top, right, bottom, and left offsets of the edges of the image, in this order. formal definition initial valueautoapplies toxul <image> elements and :-moz-tree-image, :-moz-tree-twisty, and :-moz-tree-checkbox pseudo-elements. ...
...n only works with <image> elements where the icon is specified using list-
style-image. it will not work with xul <image src="url" />.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image #example-button { /* display only the 4x4 area from the top left of this image */ list-
style-image: url("chrome://example/skin/example.png"); -moz-image-region: rect(0px, 4px, 4px, 0px); } #example-button:hover { /* use the 4x4 area to the right of the first for the hovered button */ -moz-image-region: rect(0px, 8px, 4px, 4px); } specifications not part of any standard. ...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
/* selects the first letter of a <p> */ p::first-letter { font-size: 130%; } the first letter of an element is not always trivial to identify: punctuation that precedes or immediately follows the first letter is included in the match. punctuation includes any unicode character defined in the open (ps), close (pe), initial quote (pi), final quote (pf), and other punctuation (po) classes. some languages have digraphs that are always capitalized together, like the ij in dutch. ...
... case, ::first-letter will match the first letter of this generated content. css3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also accept :first-letter, introduced in css2. ...
...nd-color, background-image, background-clip, background-origin, background-position, background-repeat, background-size, background-attachment, and background-blend-mode all margin properties: margin, margin-top, margin-right, margin-bottom, margin-left all padding properties: padding, padding-top, padding-right, padding-bottom, padding-left all border properties: the shorthands border, border-
style, border-color, border-width, border-radius, border-image, and the longhands properties the color property the text-decoration, text-shadow, text-transform, letter-spacing, word-spacing (when appropriate), line-height, text-decoration-color, text-decoration-line, text-decoration-
style, box-shadow, float, vertical-align (only if float is none) css properties syntax /* css3 syntax */ ::first-le...
::part() - CSS: Cascading Style Sheets
the ::part css pseudo-element represents any element within a shadow tree that has a matching part attribute. ...
... the ::part css pseudo-element represents any element within a shadow tree that has a matching part attribute. ...
... the ::part css pseudo-element represents any element within a shadow tree that has a matching part attribute. ...
::slotted() - CSS: Cascading Style Sheets
sing</slot></li> </ul> </div> </template> a custom element — <person-details> — is defined like so: customelements.define('person-details', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('person-template'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}); let
style = document.createelement('
style');
style.textcontent = 'div { padding: 10px; border: 1px solid gray; width: 200px; margin: 10px; }' + 'h2 { margin: 0 0 10px; }' + 'ul { margin: 0; }' + 'p { margin: 10px 0; }' + '::slotted(*) { color: gray; font-family: sans-serif; } '; shadowro...
...this allows them to stand out better next to the slots that haven't been successfully filled. ...
...n: 10px; }' + 'h2 { margin: 0 0 10px; }' + 'ul { margin: 0; }' + 'p { margin: 10px 0; }' + '::slotted(*) { color: gray; font-family: sans-serif; } '; shadowroot.appendchild(
style); shadowroot.appendchild(templatecontent.clonenode(true)); } }) you'll see that when filling the
style element with content, we select all slotted elements (::slotted(*)) and give them a different font and color. this allows them to stand out better next to the slots that haven't been successfully filled. the element looks like this when inserted into the page: <person-details> <p slot="person-name">dr. shazaam</p> <span slot="person-age">immortal</span> <span slot="person-occupation">supe...
:defined - CSS: Cascading Style Sheets
the :defined css pseudo-class represents any element that has been defined. this includes any standard element built in to the browser, and custom elements that have been successfully defined (i.e. with the customelementregistry.define() method). /* selects any defined element */ :defined { font-
style: italic; } /* selects any instance of a specific custom element */ simple-custom:defined { display: block; } syntax :defined examples hiding elements until they are defined the following snippets are taken from our defined-pseudo-class demo (see it live also). in this demo we define a very simple trivial custom element: customelements.define('simple-custom', class extends htmlelement { constructor() { super(); let divelem = document.createelement('div'); div...
...he document, along with a standard <p>: <simple-custom text="custom element example text"></simple-custom> <p>standard paragraph example text</p> in the css we first include the following rules: // give the two elements distinctive backgrounds p { background: yellow; } simple-custom { background: cyan; } // both the custom and the built-in element are given italic text :defined { font-
style: italic; } then provide the following two rules to hide any instances of our custom element that are not defined, and display instances that are defined as block level elements: simple-custom:not(:defined) { display: none; } simple-custom:defined { display: block; } this is useful if you have a complex custom element that takes a while to load into the page — you might want to hide inst...
... living standard browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and ...
:placeholder-shown - CSS: Cascading Style Sheets
the :placeholder-shown css pseudo-class represents any <input> or <textarea> element that is currently displaying placeholder text. /* selects any element with an active placeholder */ :placeholder-shown { border: 2px solid silver; } syntax :placeholder-shown examples basic example this example applies special font and border
styles when the placeholder is shown. html <input placeholder="type something here!"> css input { border: 1px solid black; padding: 3px; } input:placeholder-shown { border-color: teal; color: purple; font-
style: italic; } result overflowing text when form fields are too small, placeholder text can get cropped in an undesirable way. you can use the text-overflow property to alter the way overflowing text is displayed. html <input id="input1" p...
...n use the text-overflow property to alter the way overflowing text is displayed. html <input id="input1" placeholder="name, rank, and serial number"> <br><br> <input id="input2" placeholder="name, rank, and serial number"> css #input2:placeholder-shown { text-overflow: ellipsis; } result customized input field the following example highlights the branch and id code fields with a custom
style. html <form id="test"> <p> <label for="name">enter student name:</label> <input id="name" placeholder="student name"/> </p> <p> <label for="branch">enter student branch:</label> <input id="branch" placeholder="student branch"/> </p> <p> <label for="sid">enter student id:</label> <input type="number" pattern="[0-9]{8}" title="8 digit id" id="sid" class="studenti...
... working draft initial definition. ...
@document - CSS: Cascading Style Sheets
@document url("https://www.example.com/") { h1 { color: green; } } syntax an @document rule can specify one or more matching functions. if any of the functions apply to a given url, the rule will take effect on that url. the functions available are: url(), which matches an exact url. url-prefix(), which matches if the document url starts with the value provided. domain(), which matches if the document url is on the domain provided (or a subdomain of it). ...
...ets in firefox 59 in nightly and beta — an experiment designed to mitigate potential css injection attacks (see bug 1035091). ...
... ...
@font-face - CSS: Cascading Style Sheets
ermines how a font face is displayed based on whether and when it is downloaded and ready to use. font-family specifies a name that will be used as the font face value for font properties. font-stretch a font-stretch value. since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-stretch: 50% 200%; font-
style a font-
style value. since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-
style: oblique 20deg 50deg; font-weight a font-weight value. since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-weight: 100 400; fon...
...ttf); font-weight: bold; } } formal syntax @font-face { [ font-family: <family-name>; ] | [ src: <src>; ] | [ unicode-range: <unicode-range>; ] | [ font-variant: <font-variant>; ] | [ font-feature-settings: <font-feature-settings>; ] | [ font-variation-settings: <font-variation-settings>; ] | [ font-stretch: <font-stretch>; ] | [ font-weight: <font-weight>; ] | [ font-
style: <font-
style>; ] }where <family-name> = <string> | <custom-ident>+ examples specifying a downloadable font this example simply specifies a downloadable font to use, applying it to the entire body of the document: view the live example <html> <head> <title>web font sample</title> <
style type="text/css" media="screen, print"> @font-face { font-family: "bitstream vera serif bold";...
...wnloadable font to use, applying it to the entire body of the document: view the live example <html> <head> <title>web font sample</title> <
style type="text/css" media="screen, print"> @font-face { font-family: "bitstream vera serif bold"; src: url("https://mdn.mozillademos.org/files/2468/verasebd.ttf"); } body { font-family: "bitstream vera serif bold", serif } </
style> </head> <body> this is bitstream vera serif bold. </body> </html> in this example, the user's local copy of "helvetica neue bold" is used; if the user does not have that font installed (two different names are tried), then the downloadable font named "mgopenmodernabold.ttf" is used instead: @font-face { font-family: myhelvetica; src: local("helvetica neue bold"), local("helvetica...
@keyframes - CSS: Cascading Style Sheets
this gives more control over the intermediate steps of the animation sequence than transitions. syntax @keyframes slidein { from { transform: translatex(0%); } to { transform: translatex(100%); } } values <custom-ident> a name identifying the keyframe list. this must match the identifier production in css syntax. from a starting offset of 0%. to an ending offset of 100%. <percentage> a percentage of the time through the animation sequence at which the specified keyframe should occur. ...
...rcentage of the time through the animation sequence at which the specified keyframe should occur. description javascript can access the @keyframes at-rule with the css object model interface csskeyframesrule. to use keyframes, create a @keyframes rule with a name that is then used by the animation-name property to match an animation to its keyframe declaration. each @keyframes rule contains a
style list of keyframe selectors, which specify percentages along the animation when the keyframe occurs, and a block containing the
styles for that keyframe. you can list the keyframe percentages in any order; they will be handled in the order they should occur. valid keyframe lists if a keyframe rule doesn't specify the start or end states of the animation (that is, 0%/from and 100%/to), browsers ...
...this can be used to animate an element from its initial state and back. properties that can't be animated in keyframe rules are ignored, but supported properties will still be animated. ...
aspect-ratio - CSS: Cascading Style Sheets
{ background: #f9a; /* red */ } } _example used iframe and dataurl to enable this iframe could resize html <label id="wf" for="w">width:165</label> <input id="w" name="w" type="range" min="100" max="250" step="5" value="165"> <label id="hf" for="w">height:165</label> <input id="h" name="h" type="range" min="100" max="250" step="5" value="165"> <iframe id="outer" src="data:text/html,<
style> @media (min-aspect-ratio: 8/5) { div { background: %239af; } } @media (max-aspect-ratio: 3/2) { div { background: %239ff; } } @media (aspect-ratio: 1/1) { div { background: %23f9a; } }</
style><div id='inner'> watch this element as you resize your viewport's width and height.</div>"> </iframe> css iframe{ display:block; } javascript outer.
style.width=outer.
style.height="165px" w.onchange...
... candidate recommendation no change. media queriesthe definiti...
... candidate recommendation no change. ...
prefers-reduced-data - CSS: Cascading Style Sheets
e so the following example will not work. ...
... example will not work. ...
...fers reduced data, in this case the "system font stack" will serve as the fallback font: html <head> <link rel="preload" href="fonts/montserrat-regular.woff2" as="font" media="(prefers-reduced-data: no-preference)" crossorigin> <link rel="
stylesheet" href="
style.css"> </head> css @media (prefers-reduced-data: no-preference) { @font-face { font-family: montserrat; font-
style: normal; font-weight: 400; font-display: swap; /* latin */ src: local('montserrat regular'), local('montserrat-regular'), url('fonts/montserrat-regular.woff2') format('woff2'); unicode-range: u+0000-00ff, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+2000-206f, u+2074, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215, u+feff, u+fffd; } } bo...
shape - CSS: Cascading Style Sheets
ditional designs are appropriate. round the shape is rounded or a similar shape to the circle such as an oval, an ellipse for which distinctively rounded designs are appropriate. ...
...he shape is rounded or a similar shape to the circle such as an oval, an ellipse for which distinctively rounded designs are appropriate. examples basic example html <h1>hello world!</h1> css h1 { text-align: left; } @media (shape: rect) { h1 { text-align: left; } } @media (shape: round) { h1 { text-align: center; } } custom
stylesheet this html will apply a special
stylesheet for devices that have round screens. ...
...n ellipse for which distinctively rounded designs are appropriate. examples basic example html <h1>hello world!</h1> css h1 { text-align: left; } @media (shape: rect) { h1 { text-align: left; } } @media (shape: round) { h1 { text-align: center; } } custom
stylesheet this html will apply a special
stylesheet for devices that have round screens. <head> <link rel="
stylesheet" href="default.css" /> <link media="screen and (shape: rect)" rel="
stylesheet" href="rectangle.css" /> <link media="screen and (shape: round)" rel="
stylesheet" href="round.css" /> </head> specifications specification status css round display level 1the definition of 'shape' in that specification. working draft ...
Attribute selectors - CSS: Cascading Style Sheets
n the presence or value of a given attribute. /* <a> elements with a title attribute */ a[title] { color: purple; } /* <a> elements with an href matching "https://example.org" */ a[href="https://example.org"] { color: green; } /* <a> elements with an href containing "example" */ a[href*="example"] { font-size: 2em; } /* <a> elements with an href ending ".org" */ a[href$=".org"] { font-
style: italic; } /* <a> elements whose class attribute contains the word "logo" */ a[class~="logo"] { padding: 2px; } syntax [attr] represents elements with an attribute name of attr. [attr=value] represents elements with an attribute name of attr whose value is exactly value. [attr~=value] represents elements with an attribute name of attr whose value is a whitespace-separated list of wor...
...</li> <li><a href="#insensitive">insensitive internal link</a></li> <li><a href="http://example.org">example org link</a></li> <li><a href="https://example.org">example https org link</a></li> </ul> result languages css /* all divs with a `lang` attribute are bold. */ div[lang] { font-weight: bold; } /* all divs without a `lang` attribute are italicized. */ div:not([lang]) { font-
style: italic; } /* all divs in us english are blue. */ div[lang~="en-us"] { color: blue; } /* all divs in portuguese are green. */ div[lang="pt"] { color: green; } /* all divs in chinese are red, whether simplified (zh-cn) or traditional (zh-tw). */ div[lang|="zh"] { color: red; } /* all divs with a traditional chinese `data-lang` are purple. */ /* note: you could also use hyphenated a...
...the html specification requires the type attribute to be matched case-insensitively due to it primarily being used in the <input> element, trying to use attribute selectors to with the type attribute of an ordered list doesn't work without the case-sensitive modifier. css /* list types require the case sensitive flag due to a quirk in how html treats the type attribute. */ ol[type="a"] { list-
style-type: lower-alpha; background: red; } ol[type="a" s] { list-
style-type: lower-alpha; background: lime; } ol[type="a" s] { list-
style-type: upper-alpha; background: lime; } html <ol type="a"> <li>example list</li> </ol> result specifications specification status comment selectors level 4the definition of 'attribute selectors' in that specification. ...
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
styles in the css backgrounds and borders module allow filling backgrounds with color or an image (clipped or resized), or modifying them in other ways. these
styles can also decorate borders with lines or images, and make them square or rounded. ...
...lement boxes can be decorated with a shadow.) reference css properties background background-attachment background-clip background-color background-image background-origin background-position background-position-x background-position-y background-repeat background-size border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-
style border-left-width border-radius border-right border-right-color border-right-
style border-right-width border-
style border-top border-top-color border-top-left-radius bo...
...apse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-
style border-left-width border-radius border-right border-right-color border-right-
style border-right-width border-
style border-top border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width border-width box-shadow tools using multiple backgrounds explains how to set one or more backgrounds on an element. scaling background images describes how to change the size and repeating behavior of background images. applying color to html elements using css an overview of how css color can be used in html, including for borders. border-image generator this int...
Styling Columns - CSS: Cascading Style Sheets
the anonymous boxes that make up your columns can’t be targeted in any way, meaning it isn’t possible to change a box's background color or have one column larger than the others. perhaps in future versions of the specification it might be. for now, however, we are able to change the spacing and add lines between columns. ...
... can change the gap by using any length unit as the value of column-gap. in the example below, the column-gap is set to 40px. the allowed value for column-gap is a <length-percentage>, this means percentages are allowed. percentage values for column-gap are calculated as a percentage of the width of the multicol container. column rules the specification defines column-rule-width, column-rule-
style and column-rule-color, providing a shorthand column-rule. these properties work in exactly the same way as the border properties: any valid border-
style can be used as a column-rule-
style. these properties are applied to the element which is the multicol container and therefore all columns will have the same rule. rules are only drawn between columns and not on the outer edges. rules should also...
...l not push the columns apart to make space for the rule. instead, the rule overlays the gap. in this next example we have a very wide rule of 40px and a 10px gap. the rule displays under the content of the columns. in order to make space on both sides of the rule, the gap would need to be increased to be larger than 40px. summary this details all the current ways in which column boxes can be
styled. in the next guide we will take a look at making elements inside a container span across all columns. ...
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; margin: 0 auto; } .wrapper li { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper ul { overflow: hidden; margin: 0 -10px; padding: 0; list-
style: none; } .wrapper li { float: left; width: calc(33.333333% - 20px); margin: 0 10px 20px 10px; } <div class="wrapper"> <ul> <li class="card"><h2>one</h2> <p>we can use css grid to overwrite older methods.</p> </li> <li class="card"><h2>two</h2> <p>we can use css grid to overwrite older methods.</p> </li> <li class="c...
...: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; margin: 0 auto; } .wrapper li { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper ul { overflow: hidden; margin: 0 -10px; padding: 0; list-
style: none; } .wrapper li { float: left; width: calc(33.333333% - 20px); margin: 0 10px 20px 10px; } @supports (display: grid) { .wrapper ul { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; margin: 0; } .wrapper li { width: auto; min-height: auto; margin: 0; } } <div class="wrapper"> <ul> ...
...m becomes a grid item: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; margin: 0 auto; } .wrapper li { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper ul { margin: 0 -10px; padding: 0; list-
style: none; } .wrapper li { display: inline-block; vertical-align: top; width: calc(33.333333% - 20px); margin: 0 10px 20px 10px; } @supports (display: grid) { .wrapper ul { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; margin: 0; } .wrapper li { width: auto; margin: 0; } } <div class="wrapper"> ...
Using CSS counters - CSS: Cascading Style Sheets
nce initialized, a counter's value can be increased or decreased with counter-increment. the counter's name must not be "none", "inherit", or "initial"; otherwise the declaration is ignored. displaying a counter the value of a counter can be displayed using either the counter() or counters() function in a content property. the counter() function has two forms: 'counter(name)' or 'counter(name,
style)'. the generated text is the value of the innermost counter of the given name in scope at the given pseudo-element.the counter is rendered in the specified
style (decimal by default). the counters() function also has two forms: 'counters(name, string)' or 'counters(name, string,
style)'. the generated text is the value of all counters with the given name in scope at the given pseudo-element, fro...
... basic example this example adds "section [the value of the counter]:" to the beginning of each heading. css body { counter-reset: section; /* set a counter named 'section', and its initial value is 0. ...
...s automatically created in child elements. using the counters() function, separating text can be inserted between different levels of nested counters. ...
Stacking context example 3 - CSS: Cascading Style Sheets
that arise when mixing several positioned elements in a multi-level html hierarchy and when z-indexes are assigned using class selectors. let's take as an example a three-level hierarchical menu made from several positioned divs. second-level and third-level divs appear when hovering or clicking on their parents. usually this kind of menu is script-generated either client-side or server-side, so
style rules are assigned with a class selector instead of the id selector. if the three menu levels partially overlap, then managing stacking could become a problem. the first-level menu is only relatively positioned, so no stacking context is created. the second-level menu is absolutely positioned inside the parent element. in order to put it above all first-level menus, a z-index is used. the pr...
...flattening the html hierarchy. note: in the source code you will see that second-level and third level menus are made of several divs contained in an absolutely positioned container. this is useful to group and position all of them at once. ...
... opacity: 0.9; width: 200px; height: 60px; position: relative; border: 2px outset #990000; background-color: #ffdddd; padding-left: 5px; } #container2 { z-index: 1; position: absolute; top: 20px; left: 110px; } div.lev3 { z-index: 10; width: 100px; position: relative; border: 2px outset #000099; background-color: #ddddff; padding-left: 5px; } </
style></head> <body> <br /> <div class="lev1"> <span class="bold">level #1</span> <div id="container1"> <div class="lev2"> <br /><span class="bold">level #2</span> <br />z-index: 1; <div id="container2"> <div class="lev3"><span class="bold">level #3</span></div> <div class="lev3"><span class="bold">level #3</span></div> <div class...
CSS Properties Reference - CSS: Cascading Style Sheets
ound background background-attachment backgroundattachment background-color backgroundcolor background-image backgroundimage background-position backgroundposition background-repeat backgroundrepeat border border border-bottom borderbottom border-bottom-color borderbottomcolor border-bottom-
style borderbottom
style border-bottom-width borderbottomwidth border-color bordercolor border-left borderleft border-left-color borderleftcolor border-left-
style borderleft
style border-left-width borderleftwidth border-right borderright border-right-color borderrightcolor border-right-
style bo...
...rbottom
style border-bottom-width borderbottomwidth border-color bordercolor border-left borderleft border-left-color borderleftcolor border-left-
style borderleft
style border-left-width borderleftwidth border-right borderright border-right-color borderrightcolor border-right-
style borderright
style border-right-width borderrightwidth border-
style border
style border-top bordertop border-top-color bordertopcolor border-top-
style bordertop
style border-top-width bordertopwidth border-width borderwidth clear clear clip clip color color cursor cursor display...
... cursor cursor display display filter filter float cssfloat font font font-family fontfamily font-size fontsize font-variant fontvariant font-weight fontweight height height left left letter-spacing letterspacing line-height lineheight list-
style list
style list-
style-image list
styleimage list-
style-position list
styleposition list-
style-type list
styletype margin margin margin-bottom marginbottom margin-left marginleft margin-right marginright margin-top margintop overflow overflow padding padding padding-botto...
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
when a url points at a specific piece of a document, it can be difficult for the user to notice. find out how you can use some simple css to draw attention to the target of a url and improve the user's experience. picking a target the pseudo-class :target is used to
style the target element of a url containing a fragment identifier. for example, the url http://developer.mozilla.org/en/docs/using_the_:target_selector#example contains the fragment identifier #example. in html, identifiers are found as the values of either id or name attributes, since the two share the same namespace. thus, the example url would point to the heading "example" in this document. suppose you wish to
style any h2 element that is the target of a url, but do not want any other kind of element to get a target
style. ...
...rs are found as the values of either id or name attributes, since the two share the same namespace. thus, the example url would point to the heading "example" in this document. suppose you wish to
style any h2 element that is the target of a url, but do not want any other kind of element to get a target
style. this is simple enough: h2:target { font-weight: bold; } it's also possible to create
styles that are specific to a particular fragment of the document. this is done using the same identifying value that is found in the uri. ...
...selecting the "first" link, for example, will cause <h1 id="one"> to become the target element. ...
CSS Transforms - CSS: Cascading Style Sheets
specifications specification status comment css transforms level 1 working draft initial definition. ...
... specifications specification status comment css transforms level 1 working draft initial definition. ...
... specifications specification status comment css transforms level 1 working draft initial definition. css transforms level 2 editor's draft adds individual transforms. ...
Questions about CSS - CSS: Cascading Style Sheets
cascading
style sheets (css) is a rule-based language allowing developers to define
styles to apply to html elements (or other markup structures). css gives more control over the appearance of a web page to the page creator than to the browser designer or the viewer. with css, the sources of
style definition for a given document element are in this order of precedence: the
style attribute on an individual element tag the
style element that defines a specific
style sheet containing
style declarations or a link element that links to a separate document containing the
style element. in a web page, the
style element is placed between the title statement and the body statement. ...
...e definition for a given document element are in this order of precedence: the
style attribute on an individual element tag the
style element that defines a specific
style sheet containing
style declarations or a link element that links to a separate document containing the
style element. in a web page, the
style element is placed between the title statement and the body statement. ...
...ibute on an individual element tag the
style element that defines a specific
style sheet containing
style declarations or a link element that links to a separate document containing the
style element. in a web page, the
style element is placed between the title statement and the body statement. an imported
style sheet, using the css @import notation to automatically import and merge an external
style sheet with the current
style sheet
style attributes specified by the viewer to the browser the default
style sheet assumed by the browser in general, the web page creator's
style sheet takes precedence, but it's recommended that browsers provide ways for the viewer to override the
style attributes in some respects. since it's likely that different browsers will choose to implement css1 somewh...
Media queries - CSS: Cascading Style Sheets
app depending on the presence or value of various device characteristics and parameters. they are a key component of responsive design. for example, a media query can shrink the font size on small devices, increase the padding between paragraphs when a page is viewed in portrait mode, or bump up the size of buttons on touchscreens. in css, use the @media at-rule to conditionally apply part of a
style sheet based on the result of a media query. use @import to conditionally apply an entire
style sheet. media queries in html in html, media queries can be applied to various elements: in the <link> element's media attribute, they define the media to which a linked resource (typically css) should be applied. in the <source> element's media attribute, they define the media to which that source...
... media queries in javascript in javascript, you can use the window.matchmedia() method to test the window against a media query. you can also use mediaquerylist.addlistener() to be notified whenever the state of a query changes. ...
...ies can be applied to various elements: in the <link> element's media attribute, they define the media to which a linked resource (typically css) should be applied. in the <source> element's media attribute, they define the media to which that source should be applied. (this is only valid inside <picture> elements.) in the <
style> element's media attribute, they define the media to which the
style should be applied. media queries in javascript in javascript, you can use the window.matchmedia() method to test the window against a media query. you can also use mediaquerylist.addlistener() to be notified whenever the state of a query changes. with this functionality, your site or app can respond to changes in the device configuration, orientation, or state. you can learn more about progra...
Viewport concepts - CSS: Cascading Style Sheets
*/ window.innerwidth /* 800 */ window.outerwidth /* 800 in firefox, 1200 in chrome */ document.documentelement.clientheight /* 533 */ window.innerheight /* 533 */ window.outerheight /* 596 in firefox, 900 in chrome */ the viewport was originally 1200 x 800 pixels. upon zooming in, the viewport became 800 x 533 pixels. this is the layout viewport. sticky headers or footers, with the following
styles, will stick to the top and bottom of the layout viewport respectively. body > header { position: fixed; top: 0; } body > footer { position: fixed; bottom: 0; } we got the 800 x 533 measurement when we zoomed in using the keyboard. the header and footer stayed flush against the top and bottom of the window. but what if we had pinched-zoomed on a tablet? what if a dynamic keyboard pops ...
...in our example above, or 600px, with 1vw being 6px. when zoomed in, the iframe shrinks to 400px and 1vw becomes 4px. a width-based media query within the iframe document is relative to the iframe's viewport. @media screen and (min-width: 500px) { p { color: red; } } if the above css is included in the iframe, the paragraphs will become red when the user has zoomed in, but this
style does not apply in the non-zoomed-in state. svg in an svg document, the viewport is the visible area of the svg image. you can set any height and width on an svg, but the whole image might not be visible. the area that is visible is called the viewport. the size of the viewport can be defined using the width and height attributes of the <svg> element. <svg height="300" width="400"></svg> in th...
...his viewport discussion. if you include an svg file in your html, the viewport of the svg is the initial containing block, or the width and height of the svg container. using the @media query in your svg's css is relative to that container, not the browser. @media screen and (min-width: 400px) and (max-width: 500px) { /* css goes here */ } generally, when you write the above media query, the
styles are applied if the viewport, generally the browser window, is between 400px and 500px, inclusive. the width media query in the svg is based on the element in which the svg is contained — the <img> if the source is an svg file, the svg itself if the svg is included directly into the html, or the parent if the parent element has a width assigned and — not the viewport’s width. with the above...
background-repeat - CSS: Cascading Style Sheets
eat: repeat; background-repeat: space; background-repeat: round; background-repeat: no-repeat; /* two-value syntax: horizontal | vertical */ background-repeat: repeat space; background-repeat: repeat repeat; background-repeat: round space; background-repeat: no-repeat round; /* global values */ background-repeat: inherit; background-repeat: initial; background-repeat: unset; values <repeat-
style> the one-value syntax is a shorthand for the full two-value syntax: single value two-value equivalent repeat-x repeat no-repeat repeat-y no-repeat repeat repeat repeat repeat space space space round round round no-repeat no-repeat no-repeat in the two-value syntax, the fir...
...ot necessarily be entirely covered). the position of the non-repeated background image is defined by the background-position css property. formal definition initial valuerepeatapplies toall elements. ...
...irely covered). the position of the non-repeated background image is defined by the background-position css property. formal definition initial valuerepeatapplies toall elements. ...
box-align - CSS: Cascading Style Sheets
tation is horizontal. stretch the box stretches the contents so that there is no extra space in the box. notes the edge of the box designated the start for alignment purposes depends on the box's orientation: horizontal top vertical left the edge opposite to the start is designated the end. ...
...ment is set using the element's align attribute, then the
style is ignored. ...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the dat...
box-decoration-break - CSS: Cascading Style Sheets
the background is also drawn independently for each fragment, which means that a background image with background-repeat: no-repeat may nevertheless repeat multiple times. formal definition initial valuesliceapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax slice | clone examples inline box fragments an inline element that contains line breaks
styled with: .example { background: linear-gradient(to bottom right, yellow, green); box-shadow: 8px 8px 10px 0px deeppink, -5px -5px 5px 0px blue, 5px 5px 15px 0px yellow; padding: 0em 1em; border-radius: 16px; border-
style: solid; margin-left: 10px; font: 24px sans-serif; line-height: 2; } ... <span class="example">the<br>quick<br>orange fox</span> ... results in: ad...
...results in: you can try the two inline examples above in your browser. ...
...n inline element using a large border-radius value. the second "im" has a line-break between the "i" and the "m". for comparison, the first "im" is without line breaks. note that if you stack the rendering of the two fragments horizontally next to each other it will result in the non-fragmented rendering. try the above example in your browser. block box fragments a block element with similar
styles as above and no fragmentation results in: fragmenting the above block into three columns results in: note that stacking these pieces vertically will result in the non-fragmented rendering. now, the same example but
styled with box-decoration-break: clone results in: note here that each fragment has an identical replicated border, box-shadow, and background. you can try the block examp...
box-flex - CSS: Cascading Style Sheets
ining box allocates the available extra space in proportion to the flex value of each of the content elements. content elements that have zero flex do not grow. if only one content element has nonzero flex, then it grows to fill the available space. content elements that have the same flex grow by the same absolute amounts. if the flex value is set using the element's flex attribute, then the
style is ignored. to make xul elements in a containing box the same size, set the containing box's equalsize attribute to the value always. this attribute does not have a corresponding css property. a trick to make all content elements in a containing box the same size, is to give them all a fixed size (e.g. height: 0), and the same box-flex value greater than zero (e.g. -moz-box-flex: 1). formal de...
...e.g. -moz-box-flex: 1). ...
... ...
<color> - CSS: Cascading Style Sheets
e used wherever a <color> value can be used. currentcolor keyword the currentcolor keyword represents the value of an element's color property. this lets you use the color value on properties that do not receive it by default. if currentcolor is used as the value of the color property, it instead takes its value from the inherited value of the color property. currentcolor example html <div
style="color:blue; border: 1px dashed currentcolor;"> the color of this text is blue. <div
style="background:currentcolor; height:9px;"></div> this block is surrounded by a blue border. </div> result rgb colors the rgb color model defines a given color according to its red, green, and blue components. an optional alpha component represents the color's transparency. syntax rgb colors can be...
...v { width: 100%; height: 200px; } javascript const inputelem = document.queryselector('input'); const divelem = document.queryselector('div'); function validtextcolor(stringtotest) { if (stringtotest === "") { return false; } if (stringtotest === "inherit") { return false; } if (stringtotest === "transparent") { return false; } const image = document.createelement("img"); image.
style.color = "rgb(0, 0, 0)"; image.
style.color = stringtotest; if (image.
style.color !== "rgb(0, 0, 0)") { return true; } image.
style.color = "rgb(255, 255, 255)"; image.
style.color = stringtotest; return image.
style.color !== "rgb(255, 255, 255)"; } inputelem.addeventlistener('change', () => { if(validtextcolor(inputelem.value)) { divelem.
style.backgroundcolor = inputelem.value; ...
... /* these syntax variations all specify the same color: a fully opaque hot pink. ...
element() - CSS: Cascading Style Sheets
id the id of an element to use as the background, specified using the html attribute #id on the element. examples these examples can be viewed live in builds of firefox that support -moz-element(). a somewhat realistic example this example uses a hidden <div> as a background. the background element uses a gradient, but also includes text that is rendered as part of the background. ...
... support -moz-element(). a somewhat realistic example this example uses a hidden <div> as a background. the background element uses a gradient, but also includes text that is rendered as part of the background. <div
style="width:400px; height:400px; background:-moz-element(#mybackground1) no-repeat;"> <p>this box uses the element with the #mybackground1 id as its background!</p> </div> <div
style="overflow:hidden; height:0;"> <div id="mybackground1"
style="width:1024px; height:1024px; background-image: linear-gradient(to right, red, orange, yellow, white);"> <p
style="transform-origin:0 0; transform: rotate(45deg); color:white;">this text is part of the background. cool, huh?</p> </div> </div> the <div> element with the id "mybackground1" is used as the background for the content i...
...1" is used as the background for the content including the paragraph "this box uses the element with the #mybackground1 id as its background!". a somewhat more bizarre example this example uses a hidden <button> element in a repeating pattern as its background. this demonstrates that you can use arbitrary elements as background, but doesn't necessarily demonstrate good design practices. <div
style="width:400px; height:100px; background:-moz-element(#mybackground2);"> </div> <div
style="overflow:hidden; height:0;"> <button id="mybackground2" type="button">evil button!</button> </div> specifications specification status comment css images module level 4the definition of 'using elements as images: the element() notation' in that specification. working dr...
font-family - CSS: Cascading Style Sheets
of fonts, from highest priority to lowest. font selection does not simply stop at the first font in the list that is on the user's system. rather, font selection is done one character at a time, so that if an available font does not have a glyph for a needed character, the latter fonts are tried. (however, this doesn't work in internet explorer 6 or earlier.) when a font is only available in some
styles, variants, or sizes, those properties may also influence which font family is chosen. syntax /* a font family name and a generic family name */ font-family: gill sans extrabold, sans-serif; font-family: "goudy bookletter 1911", sans-serif; /* a generic family name only */ font-family: serif; font-family: sans-serif; font-family: monospace; font-family: cursive; font-family: fantasy; font-fami...
... font families, the first with a <family-name> and the second with a <generic-name>: font-family: gill sans extrabold, sans-serif; values <family-name> the name of a font family. for example, "times" and "helvetica" are font families. font family names containing whitespace should be quoted. <generic-name> generic font families are a fallback mechanism, a means of preserving some of the
style sheet author's intent when none of the specified fonts are available. generic family names are keywords and must not be quoted. a generic font family should be the last item in the list of font family names. the following keywords are defined: serif glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings. e.g. lucida bright, lucida fax, palatino, "palatino ...
.... math this is for the particular stylistic concerns of representing mathematics: superscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings. this is some example math text: ax² + bx + c = 0. emoji fonts that are specifically designed to render emoji. this is some example emoji text: ✝♾. fangsong a particular
style of chinese characters that are between serif-
style song and cursive-
style kai forms. this
style is often used for government documents. this is some example fangsong text with the chinese characters for "fangsong" in traditional and simple forms, respectively: 仿宋體 仿宋体. valid family names font family names must either be given quoted as strings, or unquoted as a sequence of one ...
ime-mode - CSS: Cascading Style Sheets
me mode. this property should only be used for private web applications or to undo the property if it was previously set by legacy code. syntax the ime-mode property is specified using one of the keyword values listed below. values auto no change is made to the current input method editor state. this is the default. normal the ime state should be normal; this value can be used in a user
style sheet to override the page's setting. this value is not supported by internet explorer. active the input method editor is initially active; text entry is performed through it unless the user specifically dismisses it. not supported on linux. inactive the input method editor is initially inactive, but the user may activate it if they wish. not supported on linux. disabled the input method ed...
...led and may not be activated by the user. description unlike internet explorer, firefox's implementation of ime-mode allows this property on <input type="password">. however, this makes for a bad user experience, and password fields should not enable the ime. users may correct the inappropriate behavior of sites that don't follow this recommendation by placing the following css into their user
stylesheet: input[type=password] { ime-mode: auto !important; } the mac version of gecko 1.9 (firefox 3) can't recover the previous state of the ime when a field for which it is disabled loses focus, so mac users may get grumpy when you use the disabled value. formal definition initial valueautoapplies totext fieldsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto |...
...ritednocomputed valueas specifiedanimation typediscrete formal syntax auto | normal | active | inactive | disabled examples disabling input method support this example disables input method support for a form field. in the past, this was commonly used on fields that entered data into databases which didn't support extended character sets. <input type="text" name="name" value="initial value"
style="ime-mode: disabled"> note: you shouldn't rely on disabling ime to prevent extended characters from passing through your form. even with ime disabled, users can still paste extended characters into your form's fields. specifications specification status comment css basic user interface module level 3the definition of 'ime-mode' in that specification. recommenda...
Specified value - CSS: Cascading Style Sheets
if none of the above pertain, the element's initial value will be used. ...
... if none of the above pertain, the element's initial value will be used. ...
... if none of the above pertain, the element's initial value will be used. ...
<transform-function> - CSS: Cascading Style Sheets
)</option> <option>perspective(200px)</option> <option>matrix(1, 2, -1, 1, 80, 80)</option> <option>matrix3d(1,0,0,0,0,1,3,0,0,0,1,0,50,100,0,1.1)</option> </select> </div> </main> css main { width: 400px; height: 200px; padding: 50px; background-image: linear-gradient(135deg, white, cyan, white); } #example-element { width: 100px; height: 100px; transform-
style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0...
... editor's draft added 3d transform functions. c...
... editor's draft added 3d transform functions. css transforms level 1the definition of '<transform-function>' in that specification. working draft ini...
<url> - CSS: Cascading Style Sheets
uri or url? there is a difference between a uri and a url. a uri simply identifies a resource. a url is a type of uri, and describes the location of a resource. a uri can be either a url or a name (urn) of a resource. in css level 1, the url() functional notation described only true urls. in css level 2, the definition of url() was extended to describe any uri, whether a url or a urn. ...
...necessary, since urns are almost never used in actual css. to alleviate the confusion, css level 3 returned to the narrower, initial definition. now, url() denotes only true <url>s. syntax the <url> data type is specified using the url() functional notation. it may be written without quotes, or surrounded by single or double quotes. relative urls are allowed, and are relative to the url of the
stylesheet (not to the url of the web page). if you choose to write the url without quotes, use a backslash (\) before any parentheses, whitespace characters, single quotes (') and double quotes (") that are part of the url. <a_css_property>: url("http://mysite.example.com/mycursor.png") <a_css_property>: url('http://mysite.example.com/mycursor.png') <a_css_property>: url(http://mysite.example.com/my...
...fore any parentheses, whitespace characters, single quotes (') and double quotes (") that are part of the url. <a_css_property>: url("http://mysite.example.com/mycursor.png") <a_css_property>: url('http://mysite.example.com/mycursor.png') <a_css_property>: url(http://mysite.example.com/mycursor.png) examples .topbanner { background: url("topbanner.png") #00d no-repeat fixed; } ul { list-
style: square url(http://www.example.com/redball.png); } specifications specification status comment css values and units module level 4the definition of '<url>' in that specification. editor's draft css values and units module level 3the definition of '<url>' in that specification. candidate recommendation no significant change from css level 2 (rev...
style - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. usage note: this attribute must not be used to convey semantic information. even if all styling is removed, a page should remain semantically correct. typically it shouldn't be used to hide irrelevant information; this should be done using the hidden attribute. ...
...d send us a pull request. usage note: this attribute must not be used to convey semantic information. even if all styling is removed, a page should remain semantically correct. typically it shouldn't be used to hide irrelevant information; this should be done using the hidden attribute. specifications specification status comment html living standardthe definition of '
style' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of '
style' in that specification. recommendation snapshot of html living standard, no change from html5 html5the definition of '
style' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, it is now a true globa...
...test snapshot, html 5.1 html 5.1the definition of '
style' in that specification. recommendation snapshot of html living standard, no change from html5 html5the definition of '
style' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, it is now a true global attribute. html 4.01 specificationthe definition of '
style' in that specification. recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <
style>, and <title>. css
style attributes recommendation defines the content of the
style attribute. ...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
// importnode is used to clone the nodes we want to process via xslt - true makes it do a deep clone var mynode = document.getelementbyid("example"); var clonednode...
...nding"); else xsltprocessor.setparameter(null, "myorder", "descending"); // initiate the transformation var fragment = xsltprocessor.transformtofragment(xmlref, document); // clear the contents document.getelementbyid("example").innerhtml = ""; mydom = fragment; // add the new content from the transformation document.getelementbyid("example").appendchild(fragment) } // xsl
stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:
stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" indent="yes" /> <xsl:param name="myorder" /> <xsl:template match="/"> <xsl:apply-templates select="/div//div"> <xsl:sort select="." data-type="number...
..." xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" indent="yes" /> <xsl:param name="myorder" /> <xsl:template match="/"> <xsl:apply-templates select="/div//div"> <xsl:sort select="." data-type="number" order="{$myorder}" /> </xsl:apply-templates> </xsl:template> <xsl:template match="div"> <xsl:copy-of select="." /> </xsl:template> </xsl:
stylesheet> ...
XSLT: Extensible Stylesheet Language Transformations
although the process is referred to as "transformation," the original document is not changed; rather, a new xml document is created based on the content of an existing document. then, the new document may be serialized (output) by the processor in standard xml syntax or in another format, such as html or plain text. ...
...e content of an existing document. then, the new document may be serialized (output) by the processor in standard xml syntax or in another format, such as html or plain text. xslt is most often used to convert data between different xml schemas or to convert xml data into web pages or pdf documents. documentation xslt element reference reference. transforming xml with xslt xslt allows a
stylesheet author to transform a primary xml document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format. using the mozilla javascript interface to xsl transformations this document describes the javascript interface to the xslt processing engine in mozilla 1.2 and up. specifying pa...
... significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format. using the mozilla javascript interface to xsl transformations this document describes the javascript interface to the xslt processing engine in mozilla 1.2 and up. specifying parameters using processing instructions firefox allows
stylesheet parameters to be specified when using the <?xml-
stylesheet?> processing instruction. this is done using the <?xslt-param?> pi described in this document. xslt & xpath tutorial the topxml xslt tutorial introduces you to the basics of xslt concepts, syntax, and programming. xslt tutorial this w3schools tutorial teaches the reader how to use xslt to transform xml documents into other format...
XUL Coding Style Guidelines - Archive of obsolete content
xul, pronounced as "zool", stands for "xml-based user interface language", is a cross platform way of describing user interface. it could contain xul specific element types for ui controls, html4 markups for content data, and even javascript for user event handling. to make xul files easy to read and maintain, localization friendly, and portable across user agents, we need to have a set of coding
style guidelines to ensure our objectives are achievable. the author has collected a set of guidelines from various sources listed in the references section. while some of the guidelines are recommended practices, the others are mandatory. xml, xul, html, and xhtml guidelines the following are considered good coding
style for xml/xul documents. disobeying them might not cause any parsing error for now...
...alized for a specific language or culture. in the new world, mozilla 5.0, this is not true any more. most of the windows and dialogs in mozilla will be described using xul. to make xul stream/file localizable, several guidelines are to be adopted to make the translation work easier and less error-prone. the issues are discussed in details here: what is localizable? widget resources content data
style info layout geometry how to make them localizable? localization notes localization notes are the xul writers' notes to the localizers/translators. they are placed above the actual entity string in the format: <!-- localization note (entity.name): content --> where the <var>entity.name</var> is the entity name (id) for the string (entity value) to be localized, and the content provides helpfu...
Style origin - MDN Web Docs Glossary: Definitions of Web-related terms
in css, there are three categories of sources for
style changes. these categories are called
style origins. they are the user agent origin, user origin, and the author origin. user-agent origin the user agent origin is the
style origin comprised of the default
styles used by the user's web browser. if no other
styles are applied to content, the user agent origin's
styles are used while rendering elements. user origin the user origin is the
style origin containing any css that the user of the web browser has added. these may be from adding
styles using a developer tool or from a browser extension that automatically applies custom
styles to content, such as stylus or stylish. ...
...ed to content, the user agent origin's
styles are used while rendering elements. user origin the user origin is the
style origin containing any css that the user of the web browser has added. these may be from adding
styles using a developer tool or from a browser extension that automatically applies custom
styles to content, such as stylus or stylish. author origin the author origin is the
style origin which contains all of the
styles which are part of the document, whether embedded within the html or loaded from an external
stylesheet file. the
style origins are used to determine where to stop rolling back (or backtracking through) the cascade of
styles that have been applied to an element when removing
styles, such as when using the unset or revert keywords. learn more technical in...
Stylesheet - MDN Web Docs Glossary: Definitions of Web-related terms
a
stylesheet is a set of css rules used to control the layout and design of a webpage or document. internal
stylesheets are placed inside a <
style> element inside the <head> of a web document, and external
stylesheets are placed inside a separate .css file, which is applied to a document by referencing the file inside a <link> element in the document's head. external
stylesheets are generally preferred because they allow you to control the styling of multiple pages from a single place, rather than having to repeat the css across each page. ...
...xternal
stylesheets are placed inside a separate .css file, which is applied to a document by referencing the file inside a <link> element in the document's head. external
stylesheets are generally preferred because they allow you to control the styling of multiple pages from a single place, rather than having to repeat the css across each page. ...
Animation.commitStyles() - Web APIs
the commit
styles() method of the web animations api's animation interface commits the end styling state of an animation to the element being animated, even after that animation has been removed. it will cause the end styling state to be written to the element being animated, in the form of properties inside a
style attribute. syntax animation.commit
styles(); parameters none. return value none. ...
...n the form of properties inside a
style attribute. syntax animation.commit
styles(); parameters none. return value none. examples const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { transform: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commit
styles(); }); specifications specification status comment web animationsthe definition of 'commit
styles()' in that specification. working draft ...
CSSStyleDeclaration.getPropertyCSSValue() - Web APIs
the css
styledeclaration.getpropertycssvalue() method interface returns a cssvalue containing the css value for a property. note that it returns null if the property name is a shorthand property. you should use css
styledeclaration.getpropertyvalue() instead. syntax var value =
style.getpropertycssvalue(property); parameters property is a domstring representing the property name to be retrieved. return value value is a cssvalue containing the css value for a property. if none exists, returns null. ...
...opertyvalue() instead. syntax var value =
style.getpropertycssvalue(property); parameters property is a domstring representing the property name to be retrieved. return value value is a cssvalue containing the css value for a property. if none exists, returns null. example the following javascript code gets an object containing the computed rgb values of the color css property: var
style = window.getcomputed
style(elem, null); var rgbobj =
style.getpropertycssvalue('color').getrgbcolorvalue(); specifications specification status comment document object model (dom) level 2
style specificationthe definition of 'css
styledeclaration' in that specification. obsolete declared as obsolete in july 2003. ...
CSSStyleDeclaration.getPropertyValue() - Web APIs
the css
styledeclaration.getpropertyvalue() method interface returns a domstring containing the value of a specified css property. syntax var value =
style.getpropertyvalue(property); parameters property is a domstring representing the property name to be checked. return value value is a domstring containing the value of the property. if not set, returns the empty string. example the following javascript code queries the value of the margin property in a css selector rule: var declaration = document.
stylesheets[0].cssrules[0].
style; var value = declaration.getpropertyvalue('margin'); // "1px 2px" specifications specification status comment css object model (cssom)the definition of 'css
styledeclaration.getpropertyvalue()' in that specification. wo...
... in a css selector rule: var declaration = document.
stylesheets[0].cssrules[0].
style; var value = declaration.getpropertyvalue('margin'); // "1px 2px" specifications specification status comment css object model (cssom)the definition of 'css
styledeclaration.getpropertyvalue()' in that specification. working draft document object model (dom) level 2
style specificationthe definition of 'css
styledeclaration' in that specification. obsolete ...
CSSStyleDeclaration.length - Web APIs
the read-only property returns an integer that represents the number of
style declarations in this css declaration block. syntax var num =
styles.length; value an integer that provides the number of
styles explictly set on the parent of the instance. example the following gets the number of explicitly set
styles on the following html element: <div id="div1"
style="margin: 0 10px; background-color: #ca1; font-family: monospace"></div> javascript code: var mydiv = document.getelementbyid('div1'); var div
style = mydiv.
style; var len = div
style.length; // 6 specifications specification status comment css object model (cssom)the definition of 'css
styledeclaration.length' in that specification. working draft document object model (dom) level 2 s...
... javascript code: var mydiv = document.getelementbyid('div1'); var div
style = mydiv.
style; var len = div
style.length; // 6 specifications specification status comment css object model (cssom)the definition of 'css
styledeclaration.length' in that specification. working draft document object model (dom) level 2
style specificationthe definition of 'css
styledeclaration' in that specification. obsolete ...
Examples - Archive of obsolete content
rticle to learn more about these examples. if you wish to test these examples by yourself, please read the important notes. important notes if you plan to test these examples by yourself, you must use the right filename extension (it is written at the beginning of the code). ideally, upload the file to a web server and you're done. please note that the examples 4, 5 and 6 require a file named
style.css to exist in the same directory as the example. you can get the contents of
style.css at the bottom of this page. examples for "problems with inline
style and script" problem 1 <!-- this file should have a .xhtml extension and will generate an error when parsed. --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html ...
...article problem 2 <!-- this file should have a .xhtml extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 2 - comments in xhtml</title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <
style type="text/css"> <!-- body {background-color: blue; color: yellow; } --> </
style> <script type="text/javascript"> <!-- var i = 0; var sum = 0; for (i = 0; i < 10; ++i) { sum += i; } alert('sum = ' + sum); // --> </script> </head> <body> <h1>problem 2 - comments in xhtml</h1> <p> this document is valid xhtml 1.0 strict served as <code>applicat...
...ipt type="text/javascript"> <!-- var i = 0; var sum = 0; for (i = 0; i < 10; ++i) { sum += i; } alert('sum = ' + sum); // --> </script> </head> <body> <h1>problem 2 - comments in xhtml</h1> <p> this document is valid xhtml 1.0 strict served as <code>application/xhtml+xml</code>. </p> <p> this document contains inline css rules contained in a <code>
style</code> element and surrounded by a comment and javascript contained in a <code>script</code> element and surrounded by a comment. </p> <dl> <dt>mozilla 1.1+/opera 7</dt> <dd>do not apply css or execute the javascript.</dd> <dt>netscape 7.0x/mozilla 1.0.x</dt> <dd>do not apply css but does execute the javascript.</dd> <dt>internet explorer 5.5+</dt> <dd>can not display the doc...
...And 20 more matches
Examples of web and XML development using the DOM - Web APIs
telementbyid("image1"); arrimages[1] = document.getelementbyid("image2"); arrimages[2] = document.getelementbyid("image3"); var objoutput = document.getelementbyid("output"); var strhtml = "<ul>"; for (var i = 0; i < arrimages.length; i++) { strhtml += "<li>image" + (i+1) + ": height=" + arrimages[i].height + ", width=" + arrimages[i].width + ",
style.height=" + arrimages[i].
style.height + ",
style.width=" + arrimages[i].
style.width + "<\/li>"; } strhtml += "<\/ul>"; objoutput.innerhtml = strhtml; } </script> </head> <body onload="init();"> <p>image 1: no height, width, or
style <img id="image1" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif"> </p> <p>image 2: height="50", width="500", but no s...
...rhtml = strhtml; } </script> </head> <body onload="init();"> <p>image 1: no height, width, or
style <img id="image1" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif"> </p> <p>image 2: height="50", width="500", but no
style <img id="image2" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif" height="50" width="500"> </p> <p>image 3: no height, width, but
style="height: 50px; width: 500px;" <img id="image3" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif"
style="height: 50px; width: 500px;"> </p> <div id="output"> </div> </body> </html> example 2: image attributes <!doctype html> <html lang="en"> <head> <title>modifying an image border</title> <script> function setborderwidth(width) { document.getelementbyid("img1").s...
....gif"
style="height: 50px; width: 500px;"> </p> <div id="output"> </div> </body> </html> example 2: image attributes <!doctype html> <html lang="en"> <head> <title>modifying an image border</title> <script> function setborderwidth(width) { document.getelementbyid("img1").
style.borderwidth = width + "px"; } </script> </head> <body> <p> <img id="img1" src="image1.gif"
style="border: 5px solid green;" width="100" height="100" alt="border test"> </p> <form name="formname"> <input type="button" value="make border 20px-wide" onclick="setborderwidth(20);" /> <input type="button" value="make border 5px-wide" onclick="setborderwidth(5);" /> </form> </body> </html> example 3: manipulating
styles in this simple example, some basic
style properties of an html...
...And 20 more matches
Styling links - Learn web development
previous overview: styling text next when styling links, it is important to understand how to make use of pseudo-classes to
style link states effectively, and how to
style links for use in common varied interface features such as navigation menus and tabs. we'll look at all these topics in this article. prerequisites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css), css text and font fundamentals. objective: to learn how to
style link states, and how to use links effectively in common ui features like navigation menus. let's look at some links we looked at how links are implemented in your html according to best practices in creating hyperlinks. in this article we'll build on this knowledge, sho...
...n ui features like navigation menus. let's look at some links we looked at how links are implemented in your html according to best practices in creating hyperlinks. in this article we'll build on this knowledge, showing you best practices for styling links. ...
... hyperlinks. in this article we'll build on this knowledge, showing you best practices for styling links. link states the first thing to understand is the concept of link states — different states that links can exist in, which can be
styled using different pseudo-classes: link (unvisited): the default state that a link resides in, when it isn't in any other state. this can be specifically
styled using the :link pseudo class. visited: a link when it has already been visited (exists in the browser's history),
styled using the :visited pseudo class. hover: a link when it is being hovered over by a user's mouse pointer,
styled using the :hover pseudo class. focus: a link when it has been focused (for example moved to by a keyboard user using the tab key or similar, or programmatically fo...
...And 19 more matches
Organizing your CSS - Learn web development
previous overview: building blocks as you start to work on larger
stylesheets and big projects you will discover that maintaining a huge css file can be challenging. in this article we will take a brief look at some best practices for writing your css to make it easily maintainable, and some of the solutions you will find in use by others to help improve maintainability. ...
...asily maintainable, and some of the solutions you will find in use by others to help improve maintainability. ...
...html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn some tips and best practices for organizing
stylesheets, and find out about some of the naming conventions and tools in common usage to help with css organization and team working. tips to keep your css tidy here are some general suggestions for ways to keep your
stylesheets organised and tidy. does your project have a coding
style guide? if you are working with a team on an existing project, the first thing to check is whether the project has an existing
style guide for css. the team
style guide should always win over your own personal preferences. there often isn't a right or wrong way to do things, but consistency is important. keep it consistent if you ...
...And 18 more matches
Styling lists - Learn web development
and font fundamentals. objective: to become familiar with the best practices and properties related to styling lists. a simple list example to begin with, let's look at a simple list example. throughout this article, we'll look at unordered, ordered, and description lists — all have styling features that are similar, and some that are particular to their type of list. ...
... the list items (<li> elements) have no set defaults for spacing. the <dl> element has a top and bottom margin of 16px (1em), but no padding set. the <dd> elements have margin-left of 40px (2.5em.) the <p> elements we've included for reference have a top and bottom margin of 16px (1em), the same as the different list types. ...
...nts we've included for reference have a top and bottom margin of 16px (1em), the same as the different list types. ...
...And 18 more matches
Index - Archive of obsolete content
to hide the resizer grippy on maximized windows). 338 sizetopopup xul attributes, xul reference no summary! 339 smoothscroll xul attributes, xul reference no summary! 340 sort xul attributes, xul reference no summary! 341 sortactive xul attributes, xul reference no summary! 342 sortdirection ...
... xul attributes, xul reference no summary! 348 statedatasource xul attributes, xul reference no summary! 349 statusbar xul attributes, xul reference no summary! 350 statustext deprecated, xul attributes, xul reference no summary! 351 stringbundle.src xul attributes, xul reference no summary! 352
style xul attributes, xul reference no summary! 353 subject xul attributes, xul reference no summary! 354 substate xul attributes, xul reference no summary! 355 suppressonselect xul attributes, xul reference no summary! 356 tab.selected xul, xul attributes, xul reference no summary! 357 tabindex ...
...editems xul properties, xul reference no summary! 826 selectedpanel xul properties, xul reference no summary! 827 selectedtab xul properties, xul reference no summary! 828 selectionend xul properties, xul reference no summary! 829 selectionstart xul properties, xul reference no summary! 830 sel
style xul properties, xul reference no summary! 831 sessioncount xul properties, xul reference no summary! 832 sessionhistory xul properties, xul reference no summary! 833 showcommentcolumn xul properties, xul reference no summary! 834 showimagecolumn xul, xul properties, xul reference, popup no summary! ...
...And 17 more matches
Common Firefox theme issues and solutions - Archive of obsolete content
n/: keyhole-circle.png toolbar.png toolbarbutton-dropmarker.png tabbrowser/alltabs-box-bkgnd-icon.png tabview/tabview.png places/toolbar.png linux linux select box fields are showing both drop arrow and spinner arrows on linux: the styling of drop down select box fields may show both a drop arrow and up/down spinner arrows. the problem is commonly caused by a -moz-appearance:menulist
style rule in chrome://global/skin/menulist.css. once the offending rule is found, it should be deleted and manual styling used. app button not
styled on linux, but is
styled on windows on linux the firefox app button that is displayed when tabs are on top and menu bar is disabled is not
styled properly compared to windows and is not changing colors when in private browsing mode. the cause of this is...
...tyling used. app button not
styled on linux, but is
styled on windows on linux the firefox app button that is displayed when tabs are on top and menu bar is disabled is not
styled properly compared to windows and is not changing colors when in private browsing mode. the cause of this issue is that linux firefox uses a different id for the firefox button from windows. the fix is to make sure any
style rule that references #appmenu-button also has a comparable reference to #appmenu-toolbar-button in chrome://browser/skin/browser.css. if your firefox button relies on some button styling from toolbarbuttons.css you'll need to add comparable
style rules for #appmenu-toolbar-button in browser.css. toolbars and menus firefox application button application button doesn't change styling for private...
...ge styling for private browsing mode when in private browsing mode there needs to be a visual difference to the firefox app button that is displayed when tabs are on top and the menu bar is disabled. text only toolbar buttons not aligned properly when text only toolbar buttons are selected in customize toolbars, text labels in toolbar buttons may not align properly. the common cause of this is
style rules that reference [iconsize="small"] without excluding [mode="text"]. the solution usually is to append :not ([mode="text"]) to those
style rules. for instance use toolbar[iconsize="small"]:not ([mode="text"]). a little experimenting may be required to fully address this issue with your theme. address bar identity box is missing padlock icons for secure sites in firefox 14 and later the ide...
...And 17 more matches
Drawing graphics - Learn web development
now, you'll see nothing, which is fine, but you'll also see scrollbars — this is a problem for us, which happens because the <body> element has a margin that, added to our full-window-size canvas, results in a document that's wider than the window. to get rid of the scrollbars, we need to remove the margin and also set overflow to hidden. add the following into the <head> of your document: <
style> body { margin: 0; overflow: hidden; } </
style> the scrollbars should now be gone. note: you should generally set the size of the image using html attributes or dom properties, as explained above. you could use css, but the trouble then is that the sizing is done after the canvas has rendered, and just like any other image (the rendered canvas is just an image), the image coul...
... it — our canvas is now primed and ready for drawing on! the ctx variable now contains a canvasrenderingcontext2d object, and all drawing operations on the canvas will involve manipulating this object. let's do one last thing before we move on. we'll color the canvas background black to give you a first taste of the canvas api. ...
... object, and all drawing operations on the canvas will involve manipulating this object. let's do one last thing before we move on. we'll color the canvas background black to give you a first taste of the canvas api. ...
...And 17 more matches
Using custom elements - Web Components
correct prototype chain is established. inside the constructor, we define all the functionality the element will have when an instance of it is instantiated. in this case we attach a shadow root to the custom element, use some dom manipulation to create the element's internal shadow dom structure — which is then attached to the shadow root — and finally attach some css to the shadow root to
style it. // create a shadow root this.attachshadow({mode: 'open'}); // sets and returns 'this.shadowroot' // create (nested) span elements const wrapper = document.createelement('span'); wrapper.setattribute('class','wrapper'); const icon = wrapper.appendchild(document.createelement('span')); icon.setattribute('class','icon'); icon.setattribute('tabindex', 0); // insert icon from defined attribute o...
...g = icon.appendchild(document.createelement('img')); img.src = this.hasattribute('img') ? ...
...eateelement('img')); img.src = this.hasattribute('img') ? ...
...And 17 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
erited many quirks. in this article, i will describe mozilla's quirks mode, which provides strong backwards html compatibility with internet explorer and other legacy browsers. i'll also cover nonstandard technologies, such as xmlhttprequest and rich text editing, that mozilla does support because no w3c equivalent existed at the time. ...
...a does support because no w3c equivalent existed at the time. ...
...ebugging features as breakpoint management, call stack inspection, and variable/object inspection. all features are accessible through the user interface or through the debugger's interactive console. with the console, you can execute arbitrary javascript in the same scope as the javascript currently being debugged. css differences mozilla-based products have the strongest support for cascading
style sheets (css), including most of css1, css2.1 and parts of css3, compared to internet explorer as well as all other browsers. for most issues mentioned below, mozilla will add an error or warning entry into the javascript console. check the javascript console if you encounter css-related issues. mimetypes (when css files are not applied) the most common css-related issue is that css definitions...
...And 16 more matches
Styling Vue components with CSS - Learn web development
(like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn about styling vue components. styling vue components with css before we move on to add more advanced features to our app, we should add some basic css to make it look better. vue has three common approaches to styling apps: external css files. global
styles in single file components (.vue files). component-scoped
styles in single file components. to help familiarize you with each one, we'll use a combination of all three to give our app a nicer look and feel. styling with external css files you can include external css files and apply them globally to your app. let's look at how this is done. to start with, create a file called reset.css in t...
...rial will not be using such tools, it's good to know that when including such code in the assets folder it will be processed automatically. ...
...sx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; } @media screen and (min-width: 620px) { body { font-size: 1.9rem; line-height: 1.31579; } } /*end resets*/ next, in your src/main.js file, import the reset.css file like so: import './assets/reset.css'; this will cause the file to get picked up during the build step and automatically added to our site. ...
...And 16 more matches
Basic animations - Web APIs
ter it's running on. basic animation steps these are the steps you need to take to draw a frame: clear the canvas unless the shapes you'll be drawing fill the complete canvas (for instance a backdrop image), you need to clear any shapes that have been drawn previously. the easiest way to do this is using the clearrect() method. save the canvas state if you're changing any setting (such as
styles, transformations, etc.) which affect the canvas state and you want to make sure the original state is used each time a frame is drawn, you need to save that original state. draw animated shapes the step where you do the actual frame rendering. restore the canvas state if you've saved the state, restore it before drawing a new frame. controlling an animation shapes are drawn to the canvas ...
...canvas_sun.png'; moon.src = 'https://mdn.mozillademos.org/files/1443/canvas_moon.png'; earth.src = 'https://mdn.mozillademos.org/files/1429/canvas_earth.png'; window.requestanimationframe(draw); } function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.globalcompositeoperation = 'destination-over'; ctx.clearrect(0, 0, 300, 300); // clear canvas ctx.fill
style = 'rgba(0, 0, 0, 0.4)'; ctx.stroke
style = 'rgba(0, 153, 255, 0.4)'; ctx.save(); ctx.translate(150, 150); // earth var time = new date(); ctx.rotate(((2 * math.pi) / 60) * time.getseconds() + ((2 * math.pi) / 60000) * time.getmilliseconds()); ctx.translate(105, 0); ctx.fillrect(0, -12, 40, 24); // shadow ctx.drawimage(earth, -12, -12); // moon ctx.save(); ctx.rotate(((2 *...
... id="canvas" width="300" height="300"></canvas> screenshotlive sample an animated clock this example draws an animated clock, showing your current time. ...
...And 16 more matches
Styling web forms - Learn web development
this has historically been difficult — form controls vary greatly in how easy they are to customize with css — but it is getting easier as old browsers are retired and modern browsers give us more features to use. prerequisites: basic computer literacy, and a basic understanding of html and css. ...
... basic styling techniques that will be useful to you. why is styling form widgets challenging? form controls were added to html in the html 2 specification in 1995; css wasn't released until late 1996, and wasn't supported very well by browsers for a few years after that. browsers relied on the underlying operating system to manage and render form controls. and even with css available to
style html, browser vendors have historically been reluctant to make form controls stylable because users were so accustomed to the visual appearance of their respective platforms. but this has changed. website owners want form
styles that fit in with their overall site design more than ever, and the web platform has changed to make this more possible. for some form widgets, it is still difficult to r...
...orm controls stylable because users were so accustomed to the visual appearance of their respective platforms. but this has changed. website owners want form
styles that fit in with their overall site design more than ever, and the web platform has changed to make this more possible. for some form widgets, it is still difficult to rebuild controls to make them stylable, but we can now use css to
style many form features, though we do need to take extra care to ensure we don't break usability. not all widgets are created equal when css is involved at present, some difficulties remain when using css with forms. these problems can be divided into three categories: the good some elements can be
styled with few if any problems across platforms. these include the following elements: <form> <...
...And 15 more matches
Index - Learn web development
onal website, so if you're new to web development, we encourage you to start small. you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there. 37 css basics beginner, css, codingscripting, learn, styling, web, l10n:priority like html, css is not a programming language. it's not a markup language either. css is a
style sheet language. css is what you use to selectively
style html elements. for example, this css selects paragraph text, setting the color to red: 38 dealing with files beginner, codingscripting, files, guide, html, l10n:priority, theory, website when you are working on a website locally on your computer, you should keep all the related files in a single folder that mirrors the ...
... 100 test your skills: loops beginner, javascript, learn, loops this aim of this skill test is to assess whether you've understood our looping code article. 101 solve common problems in your javascript code beginner, javascript, learn the following links point to solutions to common problems you may encounter when writing javascript. 102 learn to
style html using css beginner, css, codingscripting, debugging, landing,
style, topic, length, specificity cascading
stylesheets — or css — is the first technology you should start learning after html. while html is used to define the structure and semantics of your content, css is used to
style it and lay it out. for example, you can use css to alter the font, color, size, and spacing of...
...ox. do explore the different property pages if you want to find out more about any of the features we have discussed. each page on mdn has more examples of usage for you to play with and enhance your knowledge. 107 css selectors attribute, beginner, css, class, learn, pseudo, selectors, id in css, selectors are used to target the html elements on our web pages that we want to
style. there are a wide variety of css selectors available, allowing for fine-grained precision when selecting elements to
style. in this article and its sub-articles we'll run through the different types in great detail, seeing how they work. 108 attribute selectors attribute, beginner, css, learn, selectors as you know from your study of html, elements can have attributes that gi...
...And 15 more matches
Advanced form styling - Learn web development
previous overview: forms next in this article, we will see what can be done with css to
style the types of form control that are more difficult to
style — the "bad" and "ugly" categories. as we saw in the previous article, text fields and buttons are perfectly easy to
style; now we will dig into styling the bits that are more problematic. prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand what parts of forms are hard to
style, and why; to learn what can be done to customize them. ...
...now we will dig into styling the bits that are more problematic. prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand what parts of forms are hard to
style, and why; to learn what can be done to customize them. to recap what we said in the previous article, we have: the bad: some elements are more difficult to
style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> the ugly: some elements can't be
styled thoroughly using css. these include: elements involved in creating dropdown widgets, including <select>, <option>, <optgroup> and <datalist>. <input type="color"> date-related controls such as <input type="datetime-local"> <input type="ra...
...med to be using the -webkit- prefixed version, so it was better for compatibility. if you look at the reference page you'll see a lot of different possible values listed for -webkit-appearance, however by far the most helpful value, and probably the only one you'll use, is none. this stops any control you apply it to from using system-level styling, as much as possible, and lets you build up the
styles yourself using css. for example, let's take the following controls: <form> <p> <label for="search">search: </label> <input id="search" name="search" type="search"> </p> <p> <label for="text">text: </label> <input id="text" name="text" type="text"> </p> <p> <label for="date">date: </label> <input id="date" name="date" type="datetime-local"> </p> <p> <la...
...And 14 more matches
Using dynamic styling information - Web APIs
the css object model (cssom), part of the dom, exposes specific interfaces allowing manipulation of a wide amount of information regarding css. initially defined in the dom level 2
style recommendation, these interfaces forms now a specification, css object model (cssom) which aims at superseding it. in many cases, and where possible, it really is best practice to dynamically manipulate classes via the classname property since the ultimate appearance of all of the styling hooks can be controlled in a single
stylesheet. one's javascript code also becomes cleaner since instead of being dedicated to styling details, it can focus on the overall semantics of each section it is creating or manipulating, leaving the precise
style details to the
stylesheet. however, there are cases where actually obt...
...styling hooks can be controlled in a single
stylesheet. one's javascript code also becomes cleaner since instead of being dedicated to styling details, it can focus on the overall semantics of each section it is creating or manipulating, leaving the precise
style details to the
stylesheet. however, there are cases where actually obtaining or manipulating the rules can be useful (whether for whole
stylesheets or individual elements), and that is described in further detail below. note also that, as with individual element's dom
styles, when speaking of manipulating the
stylesheets, this is not actually manipulating the physical document(s), but merely the internal representation of the document. the basic
style object exposes the
stylesheet and the css
stylesheet interfaces. those interfaces con...
...in further detail below. note also that, as with individual element's dom
styles, when speaking of manipulating the
stylesheets, this is not actually manipulating the physical document(s), but merely the internal representation of the document. the basic
style object exposes the
stylesheet and the css
stylesheet interfaces. those interfaces contain members like insertrule, selectortext, and parent
stylesheet for accessing and manipulating the individual
style rules that make up a css
stylesheet. to get to the
style objects from the document, you can use the document.
stylesheets property and access the individual objects by index (e.g., document.
stylesheets[0] is the first
stylesheet defined for the document, etc.). ...
...And 14 more matches
tabs - Archive of obsolete content
bs"); tabs.on('activate', function(tab) { var worker = tab.attach({ contentscript: 'self.port.emit("html", document.body.innerhtml);' }); worker.port.on("html", function(message) { console.log(message) }) }); note that tab.attach is tab-centric: if the user navigates to a new page in the same tab, then the worker and content scripts will be reattached to the new page. ...
...ker = tab.attach({ contentscript: 'self.port.emit("html", document.body.innerhtml);' }); worker.port.on("html", function(message) { console.log(message) }) }); note that tab.attach is tab-centric: if the user navigates to a new page in the same tab, then the worker and content scripts will be reattached to the new page. attaching
stylesheets new in firefox 34. ...
...unction(message) { console.log(message) }) }); note that tab.attach is tab-centric: if the user navigates to a new page in the same tab, then the worker and content scripts will be reattached to the new page. attaching
stylesheets new in firefox 34. you can't attach
style sheets to a tab using tab.attach(), but from firefox 34 onwards you can attach and detach them using the low-level
stylesheet/
style and content/mod apis. here's an add-on that uses a toggle button to attach a
stylesheet to the active tab, and detach it again. ...
...And 13 more matches
JavaScript Daemons Management - Archive of obsolete content
ript type="text/javascript" src="daemon-methods.js"></script> <script type="text/javascript"> function perform (nindex, nlength, bbackw) { // http://tyleregeto.com/text-animation-in-javascript for (var oletter, nletter = 0; nletter < aletters.length; nletter++) { oletter = aletters[nletter]; var ndist = nmaxdist - nmaxdist * nindex / nlength; oletter.pos += 0.08; oletter.elem.
style.top = math.sin(oletter.pos) * ndist + "px"; oletter.elem.
style.left = math.cos(oletter.pos) * ndist * 5 + "px"; } } function prepare () { // build letters list // http://tyleregeto.com/text-animation-in-javascript this.textcontent = ""; aletters.length = 0; for (var ospan, oletter, nletter = 0, nlen = stext.length; nletter < nlen; nletter++) { ospan = document.createelement("...
...//tyleregeto.com/text-animation-in-javascript this.textcontent = ""; aletters.length = 0; for (var ospan, oletter, nletter = 0, nlen = stext.length; nletter < nlen; nletter++) { ospan = document.createelement("span"); ospan.textcontent = stext[nletter]; oletter = { "elem": ospan, "parent": this }; aletters.push(oletter); oletter.pos = math.random() * 50; oletter.elem.
style.position = "relative"; this.appendchild(ospan); } } var nmaxdist = 25, aletters = [], stext = "do you feel lucky, punk?", orecompose = new daemon(document.createelement("p"), perform, 33, 30, prepare); onload = function () { orecompose.owner.id = "perform-me"; document.body.appendchild(orecompose.owner); orecompose.play(); }; </script> <
style type="text/css"> body { font-fam...
...ew daemon(document.createelement("p"), perform, 33, 30, prepare); onload = function () { orecompose.owner.id = "perform-me"; document.body.appendchild(orecompose.owner); orecompose.play(); }; </script> <
style type="text/css"> body { font-family: monospace, sans-serif; background: #dddddd; overflow: hidden; } #perform-me { margin: 50px; font-size: 20px; line-height: 20px; } </
style> </head> <body> <h1>new daemon(<em>@thisobject</em>, <em>@callback</em>[, <em>@rate</em>, <em>@length</em>, <em>@init</em>, <em>@onstart</em>])</h1> <p><button onclick="orecompose.skipto(11);">skipto(11)</button> <button onclick="orecompose.makesteps(29);">makesteps(29)</button> <button onclick="orecompose.fixposition(-13);">fixposition(-13)</button> <button onclick="orecompose.play();">play</...
...And 13 more matches
Layout System Overview - Archive of obsolete content
content elements and frames. layout creates frames for content based on either the specific html rules for an element or based on the css display type of the element. ...
...s for content based on either the specific html rules for an element or based on the css display type of the element. in the case of the html-specific elements, the frame types that correspond to the element are hard-coded, but in the more general case where the display type is needed, the layout system must determine that display type by using the
style system. ...
...les for an element or based on the css display type of the element. in the case of the html-specific elements, the frame types that correspond to the element are hard-coded, but in the more general case where the display type is needed, the layout system must determine that display type by using the
style system. a content element is passed to the
style system and a request is made to resolve the
style for that element. ...
...And 13 more matches
jspage - Archive of obsolete content
:function(){return this.ownerdocument.window;},getdocument:function(){return this.ownerdocument; },getelementbyid:function(o,n){var m=this.ownerdocument.getelementbyid(o);if(!m){return null;}for(var l=m.parentnode;l!=this;l=l.parentnode){if(!l){return null; }}return document.id(m,n);},getselected:function(){return new elements($a(this.options).filter(function(l){return l.selected;}));},getcomputed
style:function(m){if(this.current
style){return this.current
style[m.camelcase()]; }var l=this.getdocument().defaultview.getcomputed
style(this,null);return(l)?l.getpropertyvalue([m.hyphenate()]):null;},toquerystring:function(){var l=[]; this.getelements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;}var n=(m.tagname.tolo...
...s.removeeventlistener(m,l,false);}else{this.detachevent("on"+m,l);}return this; },retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},store:function(m,l){var n=c(this.uid);n[m]=l; return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.addlistener("unload",d);})();element.properties=new hash;element.properties.
style={set:function(a){this.
style.csstext=a; },get:function(){return this.
style.csstext;},erase:function(){this.
style.csstext="";}};element.properties.tag={get:function(){return this.tagname.tolowercase(); }};element.properties.html=(function(){var c=document.createelement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,...
...1}; (function(){var a=function(b){var c=b.relatedtarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.haschild(c)); };element.events=new hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(browser.engine.gecko)?"dommousescroll":"mousewheel"}}); })();element.properties.
styles={set:function(a){this.set
styles(a);}};element.properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.
style.visibility!="hidden"){this.
style.visibility="hidden"; }}else{if(this.
style.visibility!="visible"){this.
style.visibility="visible";}}}if(!this.current
style||!this.current
style.haslayout){this.
style.zoom=1;}if(browser.engine.trident){this.
style.filter=(a==1)?"":"alpha(opacity="+a*100+"...
...And 13 more matches
Browser Feature Detection - Archive of obsolete content
rue true document.open() true true true document.close() true true true document.write() true true true document.writeln() true true true document.getelementbyid() true true true document.getelementsbyname() true true true dom css 1 support for properties/methods in document.body.
style name firefox 1.5 ie 6 & 7 opera 8.54 - 9.01 background true true true backgroundattachment true true true backgroundcolor true true true backgroundimage true true true backgroundrepeat true true true border true true true borderspacing true false true ...
...me firefox 1.5 ie 6 & 7 opera 8.54 - 9.01 background true true true backgroundattachment true true true backgroundcolor true true true backgroundimage true true true backgroundrepeat true true true border true true true borderspacing true false true border
style true true true bordertop true true true borderright true true true borderbottom true true true borderleft true true true bordertopwidth true true true borderrightwidth true true true borderbottomwidth true true true borderleftwidth true true true...
... true borderleftwidth true true true borderwidth true true true clear true true true color true true true display true true true cssfloat true false true font true true true fontfamily true true true fontsize true true true font
style true true true fontvariant true true true fontweight true true true height true true true letterspacing true true true lineheight true true true list
style true true true list
styleimage true true true list
styleposition true true true list...
...And 13 more matches
Cascade and inheritance - Learn web development
nd the concepts before moving on. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the cascade and specificity, and how inheritance works in css. conflicting rules css stands for cascading
style sheets, and that first word cascading is incredibly important to understand — the way that the cascade behaves is key to understanding css. at some point, you will be working on a project and you will find that the css you thought should be applied to an element is not working. usually the problem is that you have created two rules which could potentially apply to the same element. the cascade...
...on't. this can also cause some behavior that you might not expect. let's start by taking a quick look at the key things we are dealing with, then we'll look at each in turn and see how they interact with each other and your css. this can seem like a set of tricky concepts to understand. as you get more practice writing css, however, the way it works will become more obvious to you. the cascade
stylesheets cascade — at a very simple level this means that the order of css rules matter; when two rules apply that have equal specificity the one that comes last in the css is the one that will be used. in the below example, we have two rules that could apply to the h1. the h1 ends up being colored blue — these rules have an identical selector and therefore carry the same specificity, so the la...
...selector appears further down in the source order. we'll explain specificity scoring and other such things later on. inheritance inheritance also needs to be understood in this context — some css property values set on parent elements are inherited by their child elements, and some aren't. for example, if you set a color and font-family on an element, every element inside it will also be
styled with that color and font, unless you've applied different color and font values directly to them. some properties do not inherit — for example if you set a width of 50% on an element, all of its descendants do not get a width of 50% of their parent's width. if this was the case, css would be very frustrating to use! note: on mdn css property reference pages you can find a technical infor...
...And 13 more matches
Fundamental text and font styling - Learn web development
overview: styling text next in this article we'll start you on your journey towards mastering text styling with css. here we'll go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and
style, font shorthand, text alignment and other effects, and line and letter spacing. prerequisites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css). objective: to learn the fundamental properties and techniques needed to
style text on web pages. what is involved in styling text in css? as you'll have already experienced in your work with html and css, text inside an element is laid out inside the element's content box. it starts at the top left of the content ...
... elements, being laid out on lines adjacent to one another, and not creating line breaks until the end of the line is reached, or unless you force a line break manually using the <br> element. note: if the above paragraph leaves you feeling confused, then no matter — go back and review our box model article, to brush up on the box model theory, before carrying on. ...
...of the line is reached, or unless you force a line break manually using the <br> element. note: if the above paragraph leaves you feeling confused, then no matter — go back and review our box model article, to brush up on the box model theory, before carrying on. the css properties used to
style text generally fall into two categories, which we'll look at separately in this article: font
styles: properties that affect the font that is applied to the text, affecting what font is applied, how big it is, whether it is bold, italic, etc. text layout
styles: properties that affect the spacing and other layout features of the text, allowing manipulation of, for example, the space between lines and letters, and how the text is aligned within the content box. note: bear in mind that the te...
...And 13 more matches
Challenge solutions - Developer guides
solution css supports common color names like orange, yellow, blue, green, or black. ...
...of specifying colors. how css works dom inspector challenge in domi, click on a strong node. use domi's right-hand pane to find out where the node's color is set to red, and where its appearance is made bolder than normal text. solution in the menu above the right-hand pane, choose css rules. you see two items listed, one that references an internal resource and one that references your
stylesheet file. the internal resource defines the font-weight property as bolder; your
stylesheet defines the color property as red. cascading and inheritance inherited
styles challenge change your
stylesheet so that only the red letters are underlined. solution move the declaration for underlining from the rule for <p> to the one for <strong>. the resulting file looks like this: p {color: b...
... selectors second paragraph blue challenge without changing your html file, add a single rule to your css file that keeps all the initial letters the same color as they are now, but makes all the other text in the second paragraph blue. ...
...And 13 more matches
CSS FAQ - Learn web development
transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> when at all possible, you should just use the html5 doctype. why doesn't my css, which is valid, render at all? here are some possible causes: you've got the path to css file wrong. to be applied, a css
stylesheet must be served with a text/css mime type. if the web server doesn't serve it with this type, it won't be applied. what is the difference between id and class? html elements can have an id and/or class attribute. the id attribute assigns a name to the element it is applied to, and for valid markup, there can be only one element with that name. the class attribute assigns a class name to th...
...pe, it won't be applied. what is the difference between id and class? html elements can have an id and/or class attribute. the id attribute assigns a name to the element it is applied to, and for valid markup, there can be only one element with that name. the class attribute assigns a class name to the element, and that name can be used on many elements within the page. ...
...ss? html elements can have an id and/or class attribute. the id attribute assigns a name to the element it is applied to, and for valid markup, there can be only one element with that name. the class attribute assigns a class name to the element, and that name can be used on many elements within the page. css allows you to apply
styles to particular id and/or class names. use a class-specific
style when you want to apply the styling rules to many blocks and elements within the page, or when you currently only have element to
style with that
style, but you might want to add more later. use an id-specific
style when you need to restrict the applied styling rules to one specific block or element. this
style will only be used by the element with that particular id. it is generally recommende...
...And 12 more matches
UI pseudo-classes - Learn web development
en it is selected. in this article, we will explore in detail the different ui pseudo-classes available to us in modern browsers for styling forms in different states. prerequisites: basic computer literacy, and a basic understanding of html and css, including general knowledge of pseudo-classes and pseudo-elements. objective: to understand what parts of forms are hard to
style, and why; to learn what can be done to customize them. what pseudo-classes do we have available? the original pseudo-classes available to us (as of css 2.1) that are relevant to forms are: :hover: selects an element only when it is being hovered over by a mouse pointer. :focus: selects an element only when it is focused (i.e. by being tabbed to via the keyboard). :active: selects an ...
... word "required" being associated with the controls in question. in the next section, we'll look at a better example of indicating required fields using :required, which also digs into using generated content. note: you'll probably not find yourself using the :optional pseudo-class very often. form controls are optional by default, so you could just do your optional styling by default, and add
styles on top for required controls. note: if one radio button in a same-named group of radio buttons has the required attribute, all the radio buttons will be invalid until one is selected, but only the one with the attribute assigned will actually match :required. using generated content with pseudo-classes in previous articles, we've seen the usage of generated content, but we thought now woul...
... seen the usage of generated content, but we thought now would be a good time to talk about it in a bit more detail. the idea is that we can use the ::before and ::after pseudo-elements along with the content property to make a chunk of content appear before or after the affected element. the chunk of content is not added to the dom, so is invisible to screenreaders; it is part of the document's
styles. because it is a pseudo element, it can be targetted with
styles in the same way that any actual dom node can. this is really useful when you want to add a visual indicator to an element, such as a label or icon, but don't want it to be picked up by assistive technologies. for example, in our custom radio buttons example, we use generated content to handle the placement and animation of the inn...
...And 12 more matches
Handling common HTML and CSS problems - Learn web development
them. the trouble with html and css some of the trouble with html and css lies with the fact that both languages are fairly simple, and often developers don't take them seriously, in terms of making sure the code is well-crafted, efficient, and semantically describes the purpose of the features on the page. in the worst cases, javascript is used to generate the entire web page content and
style, which makes your pages inaccessible, and less performant (generating dom elements is expensive). in other cases, nascent features are not supported consistently across browsers, which can make some features and
styles not work for some users. responsive design problems are also common — a site that looks good in a desktop browser might provide a terrible experience on a mobile device, because ...
...and what related techniques are useful. see finding help below. html fallback behaviour some problems can be solved by just taking advantage of the natural way in which html/css work. unrecognised html elements are treated by the browser as anonymous inline elements (effectively inline elements with no semantic value, similar to <span> elements). ...
... note: see ie conditional comments for the best way to do this. more complex elements like html <video>, <audio>, and <canvas> (and other features besides) have natural mechanisms for fallbacks to be added, which work on the same principle as described above. ...
...And 12 more matches
Mozilla’s UAAG evaluation report
a ui for this would be good. 2.4 allow time-independent interaction. (p1) nr need to look into this 2.5 make captions, transcripts available. (p1) na this relates to multimedia players 2.6 respect synchronization cues. (p1) na this re...
...a ui for this would be good. ...
...a ui for this would be good. 2.10 toggle placeholders. (p3) ni 2.11 alert unsupported language. (p3) nr ? guideline 3. allow configuration not to render some content that may reduce accessibility. checkpoint title status n...
...And 12 more matches
inIDOMUtils
ls(in nsidomelement aelement); nsidomnodelist getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long long getcontentstate(in nsidomelement aelement); void getcsspropertynames([optional] in unsigned long aflags, [optional] out unsigned long acount, [retval, array, size_is(acount)] out wstring aprops); nsisupportsarray getcss
stylerules(in nsidomelement aelement, [optional] in domstring apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(in nsidomcss
stylerule arule); unsigned long getrulecolumn(in nsidomcss
stylerule arule); unsigned long getselectorcount(in nsidomcss
stylerule arule); astring getselectortext(in...
...sidomelement aelement, [optional] in domstring apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(in nsidomcss
stylerule arule); unsigned long getrulecolumn(in nsidomcss
stylerule arule); unsigned long getselectorcount(in nsidomcss
stylerule arule); astring getselectortext(in nsidomcss
stylerule arule, in unsigned long aselectorindex); unsigned long long getspecificity(in nsidomcss
stylerule arule, in unsigned long aselectorindex); nsidomfontfacelist getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool is...
...long long getspecificity(in nsidomcss
stylerule arule, in unsigned long aselectorindex); nsidomfontfacelist getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname); void parse
stylesheet(in nsidomcss
stylesheet asheet, in domstring ainput); void removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcss
stylerule arule, in unsigned long aselectorindex, [optional] in domstring apseudo); void set...
...And 12 more matches
Generating HTML - Web APIs
e <body> element of the article now contains html elements (a <b> and <u> tag, see figure 2). the xml document contains both html elements and xml elements, but only one namespace is needed, namely for the xml elements. ...
...foo</myns:author> <myns:author>mr. ...
..." href="example2.xsl"?> <myns:article xmlns:myns="http://devedge.netscape.com/2002/de"> <myns:title>my article</myns:title> <myns:authors> <myns:author company="foopy corp.">mr. foo</myns:author> <myns:author>mr. bar</myns:author> </myns:authors> <myns:body> the <b>rain</b> in <u>spain</u> stays mainly in the plains. ...
...And 12 more matches
Using the W3C DOM - Archive of obsolete content
html page is document.getelementbyid(). all modern browsers support it. the method returns a reference to the uniquely identified element, which can then be used to script the element. for example, the following short sample dynamically sets the left margin of a <div> element with an id of "inset" to half an inch: // in the html: <div id="inset">sample text</div> document.getelementbyid("inset").
style.marginleft = ".5in"; note: internet explorer 5 through 7 have a flawed implementation of getelementbyid(), which returns the first element with a matching name or id (id versus name when using getelementbyid, msdn: getelementbyid method). ie-specific ways to access elements w3c web standards replacements id_attribute_value document.getelementbyid() document.all...
... in addition to these access methods, the w3c dom specifications provide methods for creating new elements and inserting them in a document, for creating attributes, new content, for traversing the content tree and for handling events dispatched as the user interacts with the document it...
...// and now, the first paragraph in the document // gets a 2px solid green border. in addition to these access methods, the w3c dom specifications provide methods for creating new elements and inserting them in a document, for creating attributes, new content, for traversing the content tree and for handling events dispatched as the user interacts with the document itself. manipulating document
style and content changing an element's
style using the dom the following table describes standards-based methods for accessing and updating
style rules defined for various html elements in a web page. see the w3c dom 2 recommendation, css2 extended interface. dom level 2 provides for the assignment of new values to the css properties of an element using the elemref.
style object reference. you can g...
...And 11 more matches
Practical positioning examples - Learn web development
on> element with a class of info-box, which contains a <ul> and a <div>. the unordered list contains three list items with links inside, which will become the actual tabs to click on for displaying our content panels. the div contains three <article> elements, which will make up the content panels that correspond to each tab. each panel contains some sample content. the idea here is that we will
style the tabs to look like a standard horizontal navigation menu, and
style the panels to sit on top of one another using absolute positioning. we'll also give you a bit of javascript to include on your page to display the corresponding panel when a tab is pressed, and
style the tab itself. you won't need to understand the javascript itself at this stage, but you should think about learning some basic...
...sed, and
style the tab itself. you won't need to understand the javascript itself at this stage, but you should think about learning some basic javascript as soon as possible — the more complex your ui features become, the more likely it is that you'll need some javascript to implement your desired functionality. general setup to begin with, add the following between your opening and closing <
style> tags: html { font-family: sans-serif; } * { box-sizing: border-box; } body { margin: 0; } this is just some general setup to set a sans-serif font on our page, use the border-box box-sizing model, and get rid of the default <body> margin. next, add the following just below your previous css: .info-box { width: 450px; height: 400px; margin: 0 auto; } this sets a specific width ...
...s a specific width and height on the content, and centers it on the screen using the old margin: 0 auto trick. previously in the course we advised against setting a fixed height on content containers if at all possible; it is ok in this circumstance because we have fixed content in our tabs. it also looks a bit jarring to have different tabs at different heights. styling our tabs now we want to
style tabs to look like tabs — basically, these are a horizontal navigation menu, but instead of loading different web pages when they are clicked on like we've seen previously in the course, they cause different panels to be displayed on the same page. first, add the following rule at the bottom of your css to remove the default padding-left and margin-top from the unordered list: .info-box ul { ...
...And 11 more matches
Getting started with CSS - Learn web development
very first thing we need to do is to tell the html document that we have some css rules we want it to use. there are three different ways to apply css to an html document that you'll commonly come across, however, for now, we will look at the most usual and useful way of doing so — linking css from the head of your document. create a file in the same folder as your html document and save it as
styles.css. the .css extension shows that this is a css file. to link
styles.css to index.html add the following line somewhere inside the <head> of the html document: <link rel="
stylesheet" href="
styles.css"> this <link> element tells the browser that we have a
stylesheet, using the rel attribute, and the location of that
stylesheet as the value of the href attribute. you can test that the css work...
...using your code editor add the following to your css file: h1 { color: red; } save your html and css files and reload the page in a web browser. the level one heading at the top of the document should now be red. if that happens, congratulations — you have successfully applied some css to an html document. ...
...add the following to your css file: h1 { color: red; } save your html and css files and reload the page in a web browser. the level one heading at the top of the document should now be red. if that happens, congratulations — you have successfully applied some css to an html document. if that doesn't happen, carefully check that you've typed everything correctly. you can continue to work in
styles.css locally, or you can use our interactive editor below to continue with this tutorial. the interactive editor acts as if the css in the first panel is linked to the html document, just as we have with our document above. styling html elements by making our heading red we have already demonstrated that we can target and
style an html element. we do this by targeting an element selector — th...
...And 11 more matches
CSS basics - Learn web development
previous overview: getting started with the web next css (cascading
style sheets) is the code that
styles web content. css basics walks through what you need to get started. we'll answer questions like: how do i make text red? how do i make content display at a certain location in the (webpage) layout? how do i decorate my webpage with background images and colors? what is css? ...
...sheets) is the code that
styles web content. css basics walks through what you need to get started. we'll answer questions like: how do i make text red? how do i make content display at a certain location in the (webpage) layout? how do i decorate my webpage with background images and colors? what is css? like html, css is not a programming language. it's not a markup language either. css is a
style sheet language. css is what you use to selectively
style html elements. for example, this css selects paragraph text, setting the color to red: p { color: red; } let's try it out! using a text editor, paste the three lines of css (above) into a new file. save the file as
style.css in a directory named
styles. to make the code work, we still need to apply this css (above) to your html documen...
...you should see something like this: if your paragraph text is red, congratulations! your css is working. anatomy of a css ruleset let's dissect the css code for red paragraph text to understand how it works : the whole structure is called a ruleset. ...
...And 11 more matches
Gecko info for Windows accessibility vendors
readonly dom support, and the keyboard api/user interface. definitions here are some basic definitions that you'll need for this document to make sense: gecko: the rendering engine for firefox, thunderbird, nvu, mozilla seamonkey and other applications. gecko is the internal engine that mozilla uses to render any kind of web content. it supports html, xhtml, cascading
style sheets (css) and the document object model (dom). microsoft active accessibility (msaa) an api devised by microsoft so that accessibility aids can track what's going on inside the user interface of any software package that supports it. if you seriously need to understand msaa, you'll need to read the docs on msdn and play with the sample apps and code that come with msaa sd...
...read the docs on msdn and play with the sample apps and code that come with msaa sdk 1.3. (i recommend sdk 1.3 because the msaa sdk 2.0 doesn't come with the source code to the testing tools. the other differences are not important). dom: document object model this is the w3c's specification for how web content is exposed to javascript and other languages. it covers content,
style and events. inside the gecko process, code has full access to dom apis. however, exposing the entire dom to external software packages is quite involved, partially because changes to the dom in firefox must occur on the main thread. we have chosen a subset of readonly methods in the dom needed for assistive technology vendors. events such as focus changes must be tracked through msaa events, rath...
...thods in the dom needed for assistive technology vendors. events such as focus changes must be tracked through msaa events, rather than dom events. xul: extensible user-interface language the xml-based language used by firefox and mozilla to develop the ui. similar to html in that it can be combined with css and javascript to make powerful applications. contains more desktop-
style widgets than html and follows a box layout model, rather than being text-flow based. ajax: asynchronous javascript and xml ajax is a method of building interactive web applications that process user requests, user actions immediately in real time, unlike an http request, during which users must wait for a whole page to reload or for a new page to load. data is therefore stor...
...And 11 more matches
MathML Torture Test
</mrow> </math> </td></tr> <tr> <td>6</td> <td><img src="https://udn.realityripple.com/samples/76/5ce9da68c6.png" width="220" height="138" alt="texbook, 17.5-17.6" /></td> <td> <math display="block"> <mrow> <msub> <mi>a</mi> <mn>0</mn> </msub> <mo>+</mo> <mfrac> <mn>1</mn> <m
style display
style="true" scriptlevel="0"> <msub> <mi>a</mi> <mn>1</mn> </msub> <mo>+</mo> <mfrac> <mn>1</mn> <m
style display
style="true" scriptlevel="0"> <msub> <mi>a</mi> <mn>2</mn> </msub> ...
... <mn>1</mn> </msub> <mo>+</mo> <mfrac> <mn>1</mn> <m
style display
style="true" scriptlevel="0"> <msub> <mi>a</mi> <mn>2</mn> </msub> <mo>+</mo> <mfrac> <mn>1</mn> <m
style display
style="true" scriptlevel="0"> <msub> <mi>a</mi> <mn>3</mn> </msub> <mo>+</mo> <mfrac> <mn>1</mn> <m
style display
style="true" scriptlevel="0"> <msub> <mi>a...
... <mn>3</mn> </msub> <mo>+</mo> <mfrac> <mn>1</mn> <m
style display
style="true" scriptlevel="0"> <msub> <mi>a</mi> <mn>4</mn> </msub> </m
style> </mfrac> </m
style> </mfrac> </m
style> </mfrac> </m
style> </mfrac> </mrow> </math> </td></tr> <tr> <td>7</td> <td><img src="https://udn.realityripple.com/samples/e0/ebbefa9d75.png" width="200" height="85" alt="texbook, 17.5-17.6" /></td> <td> <math> ...
...And 11 more matches
Migrating from Firebug - Firefox Developer Tools
ion firebug's html panel allows to copy the inner and outer html of an element as well as the css and xpath to it via the context menu of an element. the page inspector provides the same functionality except copying xpaths. this is covered by bug 987877. edit css both tools allow to view and edit the css rules related to the element selected within the node view in a similar way. ...
...from the context menu. the devtools display an element {} rule for this purpose, which requires a single click into it to start editing the properties. ...
...from the context menu. the devtools display an element {} rule for this purpose, which requires a single click into it to start editing the properties. ...
...And 11 more matches
panel - Archive of obsolete content
", text); textarea.value = ''; } }, false); // listen for the "show" event being sent from the // main add-on code. it means that the panel's about // to be shown. // // set the focus to the text area so the user can // just start typing. ...
...anel's about // to be shown. // // set the focus to the text area so the user can // just start typing. self.port.on("show", function onshow() { textarea.focus(); }); finally, the "text-entry.html" file defines the <textarea> element: <html> <head> <
style type="text/css" media="all"> textarea { margin: 10px; } body { background-color: gray; } </
style> </head> <body> <textarea rows="13" cols="33" id="edit-box"></textarea> </body> </html> finally, save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png to learn much more about content scripts, see the working with content scripts guide. scripting trusted panel content note: this example uses the action b...
...); textarea.value = ''; } }, false); // listen for the "show" event being sent from the // main add-on code. it means that the panel's about // to be shown. // // set the focus to the text area so the user can // just start typing. ...
...And 10 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
ul and javascript source files. most extensions consist of a single content package2 the locale package this package is used to contain language data that can be translated. to make an extension’s gui support multiple languages, you can include multiple locale packages, one for each language. the skin package this is used to include source files used as visual elements in the gui, including
style sheets and images. most extensions include only one skin package, but you can include multiple skin packages to allow the gui to change with different themes. chrome url use a file called a “chrome manifest” to register chrome packages with firefox and start using them. to register a package, you use a special uri scheme called a “chrome url” to represent the path to the file. chrome ur...
...you can create the overlay.xul file that will insert it (listing 3). in line 4, we identify the merge point as the menupop element; in lines 5–7, we have the code that adds the new menu item. the insertbefore attribute determines where the element gets added. test install and operational check this brings us to the point where we finally install our hello world extension. using the normal xpi-
style installer would just be added trouble in this case, so we won’t use it. for source files under development, we do test installs. placing pointer files first, navigate to the profile folder of the currently active profile4, and open the extensions folder within it. create a new file there with the name you used as the hello world extension id in the install manifest, helloworld@xuldev.org. set...
...plays the clock (listing 5) and its controller (listing 6). we’ve already covered the dialog element in chapter 3. in this case, we only want to display an ok button, so we set the buttons attribute to accept. within the window are a label element and textbox element, wrapped in a hbox element so that they are arranged horizontally. ...
...And 10 more matches
Creating a Skin - Archive of obsolete content
e it easier. for this reason, we'll modify only the file findfile.css rather than the global.css file. this section assumes that you are starting with the classic skin. you may wish to make a copy of the files used by the find files dialog before editing. you need to create a file 'findfile.css' in a custom skin. or, you can temporarily place it in the content directory and refer to it using a
stylesheet directive. you can modify the existing findfile.css directly to see what it looks like, or you can create a custom skin and link to that. creating a custom skin package to create a skin, do the following: (if you are using firefox 1.5 or later, see manifest files instead of below) create a directory somewhere where you want to place the skin files. copy a manifest file (contents.rdf) f...
... a line to the file 'chrome/installed-chrome.txt of the following form: skin,install,url,file:///stuff/blueswayedshoes/ where the last part points to the directory you created. make sure to add a slash at the end. copy the original findfile.css into the new directory. we'll use this as a basis for the new skin. we can then refer to it using the url 'chrome://findfile/skin/findfile.css'. adding
style rules first, let's decide what kind of changes we want to make. we'll make some simple color changes, modify the button
styles, and modify the spacing a bit. let's start with the menus, toolbars and the overall tab panel. the following
style rules added to findfile.css will cause the changes shown in the accompanying image. window > box { background-color: #0088cc; } menubar,menupopup,toolb...
... border around these four elements has been changed to give a heavier 3d appearance. you can see this if you look closely. the background color of the caption has also been changed to match the background. the first rule above (for 'window > box') specifies that the child box of the window has a different color. this probably isn't the best way to do this. we should really change this to use a
style class. let's do this. that way, we can modify the xul without needing to keep the box as the first child of the window. css: .findfilesbox { background-color: #0088cc; } xul: <vbox class="findfilesbox" orient="vertical" flex="100%"> <toolbox> rounding on the tabs next, let's modify the tabs. we will make the selected tab bold and change the rounding on the tabs. tab:first-child { -moz-b...
...And 10 more matches
Styling a Tree - Archive of obsolete content
this is because the tree body is stored in a different way to other elements. the outer treechildren is the only real element in the tree body. the inner elements are just placeholders. ...
...this is because the tree body is stored in a different way to other elements. the outer treechildren is the only real element in the tree body. the inner elements are just placeholders. ...
...this is because the tree body is stored in a different way to other elements. the outer treechildren is the only real element in the tree body. the inner elements are just placeholders. ...
...And 10 more matches
Using the standard theme - Archive of obsolete content
by default, no
style is associated with xul extension windows or dialogs. you can either provide a complete custom styling, but most of the time you also want to be able to reuse the standard theme (also called the "global skin") of the base application for non-custom elements, transparently with regard to which theme the user has currently chosen. at the beginning, there is no
style when creating a new xul <tt>window</tt> (or a new <tt>dialog</tt>, for that matter) in your extension, and you do not associate a
style sheet with it, your widgets will be un
styled. meaning, some internal default will be applied, which does by no means correspond to the standard theme (the theme currently chosen by the user in the theme selector), or even the default theme delivered with your the base app...
... be applied, which does by no means correspond to the standard theme (the theme currently chosen by the user in the theme selector), or even the default theme delivered with your the base application. ...
...eme currently chosen by the user in the theme selector), or even the default theme delivered with your the base application. ...
...And 10 more matches
Styling tables - Learn web development
isn't the most glamorous job in the world, but sometimes we all have to do it. this article provides a guide to making html tables look good, with some specific table styling techniques highlighted. prerequisites: html basics (study introduction to html), knowledge of html tables, and an idea of how css works (study css first steps.) objective: to learn how to effectively
style html tables. a typical html table let's start by looking at a typical html table. well, i say typical — most html table examples are about shoes, or the weather, or employees; we decided to make things more interesting by making it about famous punk bands from the uk. the markup looks like so: <table> <caption>a summary of the uk's most famous punk bands</caption> <thead> <tr> ...
...>6</td> <td>london calling</td> </tr> ... some rows removed for brevity <tr> <th scope="row">the stranglers</th> <td>1974</td> <td>17</td> <td>no more heroes</td> </tr> </tbody> <tfoot> <tr> <th scope="row" colspan="2">total albums</th> <td colspan="2">77</td> </tr> </tfoot> </table> the table is nicely marked up, easily
styleable, and accessible, thanks to features such as scope, <caption>, <thead>, <tbody>, etc. unfortunately, it doesn't look good when rendered on the screen (see it live at punk-bands-un
styled.html): with only the default browser styling it looks cramped, hard to read, and boring. we need to use some css to fix this up. styling our table let's work through styling our table example together. ...
...owser styling it looks cramped, hard to read, and boring. we need to use some css to fix this up. styling our table let's work through styling our table example together. to start with, make a local copy of the sample markup, download both images (noise and leopardskin), and put the three resulting files in a working directory somewhere on your local computer. ...
...And 10 more matches
HTML text fundamentals - Learn web development
instead. this is done with software called a screen reader. this software provides ways to get fast access to given text content. among the various techniques used, they provide an outline of the document by reading out the headings, allowing their users to find the information they need quickly. if headings are not available, they will be forced to listen to the whole document read out loud. to
style content with css, or make it do interesting things with javascript, you need to have elements wrapping the relevant content, so css/javascript can effectively target it. we therefore need to give our content structural markup. active learning: giving our content structure let's jump straight in with a live example. in the example below, add elements to the raw text in the input field so that ...
...ent structure let's jump straight in with a live example. in the example below, add elements to the raw text in the input field so that it appears as a heading and two paragraphs in the output field. if you make a mistake, you can always reset it using the reset button. if you get stuck, press the show solution button to see the answer. playable code <h2>live output</h2> <div class="output"
style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input"
style="min-height: 100px; width: 95%">my short story i am a statistician and my name is trish. my legs are made of cardboard and i am married to a fish.</textarea> <div class="playable-buttons"> <input i...
...re using the correct elements, giving our content the correct meaning, function, or appearance. ...
...And 10 more matches
Looping code - Learn web development
ot the same one over and over again! let's look at an example to perfectly illustrate why loops are such a good thing. ...
...dden code <!doctype html> <html> <head> <meta charset="utf-8"> <title>random canvas circles</title> <
style> html { width: 100%; height: inherit; background: #ddd; } canvas { display: block; } body { margin: 0; } button { position: absolute; top: 5px; left: 5px; } </
style> </head> <body> <button>update</button> <canvas></canvas> <script> const btn = document.queryselector('button'); const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); let width = document.documentelement.clientwidth; let height = document.documentelement.clientheight; canvas.width = width; canvas.height = height; f...
...t('2d'); let width = document.documentelement.clientwidth; let height = document.documentelement.clientheight; canvas.width = width; canvas.height = height; function random(number) { return math.floor(math.random()*number); } function draw() { ctx.clearrect(0,0,width,height); for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fill
style = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } btn.addeventlistener('click',draw); </script> </body> </html> you don't have to understand all the code for now, but let's look at the part of the code that actually draws the 100 circles: for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fi...
...And 10 more matches
Adding a new CSS property
this document assumes that you have a specifcation for the property available. issues about how to write such a specification (including things such as whether it is appropriate to use prefixes or when properties should be inherited by default) are not covered here. if you need more details on any of the points mentioned here, a good place to find them is by looking at other changes in the version control history of the files mentioned. ...
...ts mentioned here, a good place to find them is by looking at other changes in the version control history of the files mentioned. getting started first, you'll want to add an appropriate test entry to property_database.js. see the documentation at the top of the file and the other entries for examples. ...
...he version control history of the files mentioned. getting started first, you'll want to add an appropriate test entry to property_database.js. see the documentation at the top of the file and the other entries for examples. this will cause tests of your new property to be added to many of the mochitests in layout/
style/test, which can be run with the command "./mach mochitest -f plain layout/
style/". then, unless you're implementing a shorthand property, you need to decide which
style struct the computed value of the property should go in. (again, see the gecko overview for more information.) it should generally be grouped with related properties. remember that each
style struct contains only properties that inherit by default or only properties that do not. (which set the property is...
...And 10 more matches
The Firefox codebase: CSS Guidelines
comment). the overriding css section contains more information about this. avoid magic numbers; prefer automatic sizing or alignment methods. some examples to avoid: absolutely positioned elements hardcoded values such as: vertical-align: -2px; . the reason you should avoid such "hardcoded" values is that, they don't necessarily work for all font-size configurations. avoid setting
styles in javascript. it's generally better to set a class and then specify the
styles in css. classlist is generally better than classname. there's less chance of overwriting an existing class. only use generic selectors such as :last-child, when it is what you mean semantically. if not, using a semantic class name is more descriptive and usually better. boilerplate make sure each file starts wit...
...ed, it can be the case that a common component has been already written could be reused with or without changes. most of the time, the common component already follows the a11y/theme standards defined in this guide. so, when possible, always prefer editing common components to writing your own. also, it is good practice to introduce a common class when the new element you are styling reuses some
styles from another element, this allows the maintenance cost and the amount of code duplication to be reduced. formatting spacing & indentation 2 spaces indentation is preferred add a space after each comma, except within color functions: linear-gradient(to bottom, black 1px, rgba(255,255,255,0.2) 1px) always add a space before !important. omit units on 0 values do this: margin: 0; ...
...plicit. do this: border-color: red; not this: border: red; put multiple selectors on different lines do this: h1, h2, h3 { font-family: sans-serif; text-align: center; } not this: h1, h2, h3 { font-family: sans-serif; text-align: center; } naming standards for class names lower-case-with-dashes is the most common. but camelcase is also used sometimes. try to follow the
style of existing or related code. other tips assume ="true" in attribute selectors. example: use option[checked], not option[checked="true"]. avoid id selectors unless it is really the wanted goal, since ids have higher specificity and therefore are harder to override. using descendant selectors is good practice for performance when possible: for example: .autocomplete-item[se...
...And 10 more matches
page-mod - Archive of obsolete content
s your code easier to maintain, secure, debug and review. a page-mod only attaches scripts to documents loaded in tabs. it will not attach scripts to add-on panels, page-workers, sidebars, or firefox hidden windows. to stop a page-mod from making any more modifications, call its destroy() method. the pagemod constructor takes a number of other options to control its behavior: content
style lists
stylesheets to attach, supplied as strings. content
stylefile lists
stylesheets to attach, supplied in separate files. contentscriptoptions defines read-only values accessible to content scripts. attachto controls whether to attach scripts to tabs that were already open when the page-mod was created, and whether to attach scripts to iframes as well as t...
...t scripts to tabs we've seen that the page-mod api attaches content scripts to documents based on their url. sometimes, though, we don't care about the url: we just want to execute a script on demand in the context of a particular tab. for example, we might want to run a script in the context of the currently active tab when the user clicks a button: to block certain content, to change the font
style, or to display the document's dom structure. using the attach method of the tab object, you can attach a set of content scripts to a particular tab. the scripts are executed immediately. the following add-on creates a button which, when clicked, highlights all the div elements in the document loaded into the active tab: require("sdk/ui/button/action").actionbutton({ id: "highlight-divs", l...
...you could use this icon: . private windows if your add-on has not opted into private browsing, then your page-mods will not attach content scripts to documents loaded into private windows, even if their urls match the...
...And 9 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
this chapter, please include them. because a xul document is also an xml document, it can contain xhtml, svg, mathml, and other elements; if you use external entity references, the xml document's contents are modularized; combined with other xml-related technologies, such as dom, xlink, or xslt, you can use it for a number of different applications. <?xml version="1.0" encoding="utf-8"?> <?xml-
stylesheet href="chrome://global/skin/"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- contents go here. --> </window> listing 2: general structure of a xul document even with the internationalization of firefox and extensions, this kind of xml function is being used. reading in
style sheets xul uses css to specify the appearance of its elements. again, sin...
...al/skin/"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- contents go here. --> </window> listing 2: general structure of a xul document even with the internationalization of firefox and extensions, this kind of xml function is being used. reading in
style sheets xul uses css to specify the appearance of its elements. again, since xul is a type of xml,
stylesheets are read in using the xml-
stylesheet processing instruction. on line 2 of listing 2, we’re reading in the theme’s standard
style sheet. by referring to a special
style sheet within chrome://global/skin/, we can make label and button sizes, window background color, etc, match the currently selected theme in firefox. we can also read in a
stylesheet that we had set up ourselves. the xul...
...nt's orient attribute. for example, flex="1" indicates that the element should extend to fill that axis; if there are two elements with flex="1" in a row, they are adjusted to be of equal size. you can assign flex="2" (or higher values) as a size multiplier for elements. in listing 4, the second label will be displayed twice as big as the first (figure 3). <hbox> <label value="label1" flex="1"
style="border: 1px solid;"/> <label value="label2" flex="2"
style="border: 1px solid;"/> </hbox> listing 4: growing with flex figure 3: output of listing 4 ordinal within a xul box, elements will ordinarily be laid out following their order of appearance in the source code (laid out left to right or top to bottom). use the ordinal attribute to alter their order. the ordinal attribute takes pos...
...And 9 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
ad no significant effort invested into either for more than two years. i think that fact played a critical role in our team's willingness to try out something completely new. our engineering team actually needed the least convincing to convert over to a standards-based design, because they could also immediately envision the benefits to their workload and maintenance of the site. ...
...itical role in our team's willingness to try out something completely new. our engineering team actually needed the least convincing to convert over to a standards-based design, because they could also immediately envision the benefits to their workload and maintenance of the site. how is the site
styled now that you've ripped out all the html-based presentation? technically, there are 13 total
stylesheets used at any one time. ...
... how is the site
styled now that you've ripped out all the html-based presentation? technically, there are 13 total
stylesheets used at any one time. the breakdown: 1 master screen media file which imports 4 files: a base file (bulk of formatting) a file for finance/table formatting color file (override colors and background images for specific color scheme) temp file (used for
styles associated with temporary features and ad-related pages) 1 print media file 1 aural media file 3 master alternate
style sheets which import 1 file each the 3 imported files set alternate font sizes (small, large, larger) how much did the size of a typical wired news page shrink? the html went from 32 kb down to 19 kb, but images increased from 8 to 13 kb. we've noted that s...
...And 9 more matches
Binding Attachment and Detachment - Archive of obsolete content
f the binding document's url and the binding's document-unique identifier. in the following example, a binding is referenced that will be attached to all html checkbox elements. input[type="checkbox"] { -moz-binding: url("http://www.mozilla.org/xbl/htmlbindings.xml#checkbox"); } bindings attached through css will only remain on the bound element as long as the element continues to match the
style rule. if at any time a resolution of
style on the element determines that a different binding should be attached, the old binding (and all bindings that it explicitly extends in its inheritance chain) will be detached. no bindings will be attached to elements that match the
style rule, but are inside an element that has
style display:none set. see bug 307098. whenever an element is removed from...
...hed, the old binding (and all bindings that it explicitly extends in its inheritance chain) will be detached. no bindings will be attached to elements that match the
style rule, but are inside an element that has
style display:none set. see bug 307098. whenever an element is removed from a document, any bindings attached via css loaded by the document will be detached. attachment using element.
style property none of the xbl inheritance properties of element.
style.mozbinding described here are implemented (if ever). bindings can be attached to elements through the scripting by assigning the element.
style.mozbinding property. respectively bindings can be detached by setting element.
style.mozbinding to empty string. note: some older papers mentioned dom methods document.addbinding and docu...
...scripts that invoke this method should not assume that the binding is installed immediately after this method returns. see binding documents for more information. ...
...And 9 more matches
Table Reflow Internals - Archive of obsolete content
ing (the frame tree contains only viewport, scroll(s), canvas, html, body). the initial chunk of an xml doc is loaded. the initial chunk of an html doc (or a subsequent chunk of an xml doc) is loaded. the container posts a dirty reflow command with itself as the target. content is inserted, appended, or deleted through the dom. the container posts a dirty reflow command with itself as the target.
style changes through the dom - javascript, browser change font (ctrl+/-), a preference changes, etc. review of reflow reflow starts with pres shell which reflows the reflow root (usually the viewport frame), which reflows it children, etc. ususally it starts when the pres shell processes its queue of reflow commands. the reflower positions reflowee (if it can) before actually reflowing in case...
...wer positions reflowee (if it can) before actually reflowing in case views are involved (e.g. absolutely positioned elements) reflows reflowee and passes a reflow state (in) and a reflow metrics (in/out) review of reflow the reflow state: is a node in a tree structurally equivalent to the frame tree of reflow participants contains: reflow type, avail size, various computed values, resolved
style structs possible request for preferred size and more. review of reflow the reflow metrics contains: max element size (if requested) - the minimum size it can be preferred size (if requested) - the size it would like to be given no size constraints. desired size - the size it would like to be given the avail size. this is equivalent to preferred size if the avail size is not constrained. ...
...sm. kinds of reflows initial - reflowee's first reflow must be of this type (reflower's responsibility). resize - reflowee gets a change in available space only. similar to initial, except it can reoccur. incremental - has a reflow path (tree) where each node has a command with a target frame, reflow command types are: dirty - something changed inside a target (e.g. ...
...And 9 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
ide detection strategy can be found in the ultimate browser sniffer. this script and variants of it can be found today on many web sites where it is a common source of detection problems. netscape navigator 4 and internet explorer 4 introduced the ability to manipulate html content in a browser (dynamic html or dhtml) rather than on the web server and began the introduction of support for css to
style content. this generation of browser, in addition to sharing several features which were not available in earlier versions, each implemented their own (incompatible) competing abilities to manipulate content in a web page. since each vendor's browser implemented different objects to perform dhtml, web authors began to use object detection to distinguish vendor/version through the existence of par...
...gly advise everyone to avoid this trap. problems caused by inappropriate browser detection excluding unknown browsers if you only provide tests for specific browsers in your detection logic, your site will not be usable if a visitor uses a different browser. consider the following example: // wrong approach - do not use! if (document.all) { // internet explorer 4+ document.write('<link rel="
stylesheet" type="text/css" src="
style-ie.css">'); } else if (document.layers) { // navigator 4 document.write('<link rel="
stylesheet" type="text/css" src="
style-nn.css">'); } note how the above example only provided
stylesheets for internet explorer and navigator 4 and even then only if the visitor has javascript support turned on in their browser. users of netscape 6, netscape 7, compuserve 7, mozi...
...lorer features not available in // other browsers. </script> </body> </html> using netscape navigator 4's css limitations it is possible to use netscape navigator 4's limitations for css support to automatically exclude certain css rules from ever being seen by navigator 4. ...
...And 9 more matches
Manipulating documents - Learn web development
uage, a media stream from the user's webcam, etc. the document (represented by the dom in browsers) is the actual page loaded into the window, and is represented in javascript by the document object. you can use this object to return and manipulate information on the html and css that comprises the document, for example get a reference to an element in the dom, change its text content, apply new
styles to it, create new elements and add them to the current element as children, or even delete it altogether. in this article we'll focus mostly on manipulating the document, but we'll show a few other useful bits besides. the document object model the document currently loaded in each one of your browser tabs is represented by a document object model. this is a "tree structure" representation c...
...nkpara); when you want to remove a node based only on a reference to itself, which is fairly common, you can use childnode.remove(): linkpara.remove(); this method is not supported in older browsers. they have no method to tell a node to remove itself, so you'd have to do the following. linkpara.parentnode.removechild(linkpara); have a go at adding the above lines to your code. manipulating
styles it is possible to manipulate css
styles via javascript in a variety of ways. to start with, you can get a list of all the
stylesheets attached to a document using document.
stylesheets, which returns an array-like object with css
stylesheet objects. you can then add/remove
styles as wished. however, we're not going to expand on those features because they are a somewhat archaic and difficult way...
...le to manipulate css
styles via javascript in a variety of ways. to start with, you can get a list of all the
stylesheets attached to a document using document.
stylesheets, which returns an array-like object with css
stylesheet objects. you can then add/remove
styles as wished. however, we're not going to expand on those features because they are a somewhat archaic and difficult way to manipulate
style. there are much easier ways. the first way is to add inline
styles directly onto elements you want to dynamically
style. this is done with the htmlelement.
style property, which contains inline styling information for each element in the document. you can set properties of this object to directly update element
styles. ...
...And 9 more matches
Examine and edit CSS - Firefox Developer Tools
a new rule; change the display based on the color scheme preference (as of firefox 72, you must set devtools.inspector.color-scheme-simulation.enabled to true in the configuration editor to enable this feature); change the display based on print media rules. a warning icon appears next to unsupported css properties or rules that have invalid values. this can help you understand why certain
styles are not being applied. in the following example, a spelling error, "background-colour" instead of "background-color" has made the rule invalid: rule display it displays each rule as in a
stylesheet, with a list of selectors followed by a list of property:value; declarations. highlight matched elements: next to the selector is a target icon: click this to highlight all nodes in the page ...
... can use this to toggle the declaration on or off. filename and line number: on the right-hand side is a link to the rule. see link to css file. if the element has a display: grid declaration, then it gets a grid icon next to it, like this: . click that icon to display the grid overlaid on the page, including grid lines and tracks. see examine grid layouts for more on this. ...
...r: on the right-hand side is a link to the rule. see link to css file. if the element has a display: grid declaration, then it gets a grid icon next to it, like this: . click that icon to display the grid overlaid on the page, including grid lines and tracks. see examine grid layouts for more on this. to view user-agent
styles (i.e., browser-default css rules), enable "inspector > show browser
styles" under the developer tool settings panel. (note that this setting is independent of the "browser
styles" checkbox in the computed view.) user-agent
styles are displayed against a different background, and the link to the filename and line number contains the prefix (user agent): element {} rule the element {} rule at the top of the rules list isn't actually a css rule. it represents the css...
...And 9 more matches
CSS Object Model (CSSOM) - Web APIs
the css object model is a set of apis allowing the manipulation of css from javascript. it is much like the dom, but for the css rather than the html. it allows users to read and modify css
style dynamically. ...
... the css object model is a set of apis allowing the manipulation of css from javascript. it is much like the dom, but for the css rather than the html. it allows users to read and modify css
style dynamically. ...
... than the html. it allows users to read and modify css
style dynamically. ...
...And 9 more matches
Document - Web APIs
the document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the dom tree. the dom tree includes elements such as <body> and <table>, among many others. it provides functionality globally to the document, like how to obtain the page's url and create new elements in the document. ...
... the dom tree. the dom tree includes elements such as <body> and <table>, among many others. it provides functionality globally to the document, like how to obtain the page's url and create new elements in the document. ...
...urrent document. document.headread only returns the <head> element of the current document. document.hiddenread only returns a boolean value indicating if the page is considered hidden or not. document.imagesread only returns a list of the images in the current document. document.implementationread only returns the dom implementation associated with the current document. document.last
stylesheetsetread only returns the name of the
style sheet set that was last enabled. has the value null until the
style sheet is changed by setting the value of selected
stylesheetset. document.linksread only returns a list of all the hyperlinks in the document. document.mozsyntheticdocument returns a boolean that is true only if this document is synthetic, such as a standalone image, video, a...
...And 9 more matches
HTML documentation index - HTML: Hypertext Markup Language
y, storage, data html provides a crossorigin attribute for images that, in combination with an appropriate cors header, allows images defined by the <img> element that are loaded from foreign origins to be used in a <canvas> as if they had been loaded from the current origin. 3 applying color to html elements using css beginner, css, css colors, guide, html, html colors, html
styles, styling html, color with css, there are lots of ways to add color to your html elements to create just the look you want. this article is a primer introducing each of the ways css color can be used in html. 4 block-level elements beginner, development, guide, html, html5, web html (hypertext markup language) elements historically were categorized as either "block-leve...
...tten in, or the language that the editable elements should be written in by the user. the attribute contains a single “language tag” in the format defined in tags for identifying languages (bcp47). 27 part global attributes, html, reference, part the part global attribute contains a space-separated list of the part names of the element. part names allows css to select and
style specific elements in a shadow tree via the ::part pseudo-element. 28 slot global attributes, html, reference the slot global attribute assigns a slot in a shadow dom shadow tree to an element: an element with a slot attribute is assigned to the slot created by the <slot> element whose name attribute's value matches that slot attribute's value. 29 spellcheck glo...
...a shadow dom shadow tree to an element: an element with a slot attribute is assigned to the slot created by the <slot> element whose name attribute's value matches that slot attribute's value. 29 spellcheck global attributes, html, reference the spellcheck global attribute is an enumerated attribute defines whether the element may be checked for spelling errors. 30
style global attributes, html, reference the
style global attribute contains css styling declarations to be applied to the element. note that it is recommended for
styles to be defined in a separate file or files. this attribute and the <
style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. 31 tabindex global attributes, html, r...
...And 9 more matches
Populating the page: how browsers work - Web Performance
response once we have an established connection to a web server, the browser sends an initial http get request on behalf of the user, which for websites is most often an html file. once the server receives the request, it will reply with relevant response headers and the contents of the html. <!doctype html> <html> <head> <meta charset="utf-8"/> <title>my simple page</title> <link rel="
stylesheet" src="
styles.css"/> <script src="myscript.js"></script> </head> <body> <h1 class="heading">my page</h1> <p>a paragraph with a <a href="https://example.com/about">link</a></p> <div> <img src="myimage.jpg" alt="image description"/> </div> <script src="anotherscript.js"></script> </body> </html> this response for this initial request contains the first byte of data received. ti...
...pt, and web fonts. thanks to the preload scanner, we don't have to wait until the parser finds a reference to an external resource to request it. it will retrieve resources in the background so that by the time the main html parser reaches requested assets, they may possibly already be in flight, or have been downloaded. the optimizations the preload scanner provides reduce blockages. <link rel="
stylesheet" src="
styles.css"/> <script src="myscript.js" async></script> <img src="myimage.jpg" alt="image description"/> <script src="anotherscript.js" async></script> in this example, while the main thread is parsing the html and css, the preload scanner will find the scripts and image, and start downloading them as well. to ensure the script doesn't block the process, add the async attribute, or t...
...nloading, but it does block javascript, because javascript is often used to query css properties’ impact on elements. building the cssom the second step in the critical rendering path is processing css and building the cssom tree. the css object model is similar to the dom. the dom and cssom are both trees. they are independent data structures. ...
...And 9 more matches
Using templates and slots - Web Components
ent; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } } ); the key point to note here is that we append a clone of the template content to the shadow root, created using the node.clonenode() method. ...
...one of the template content to the shadow root, created using the node.clonenode() method. and because we are appending its contents to a shadow dom, we can include some styling information inside the template in a <
style> element, which is then encapsulated inside the custom element. this wouldn't work if we just appended it to the standard dom. ...
... because we are appending its contents to a shadow dom, we can include some styling information inside the template in a <
style> element, which is then encapsulated inside the custom element. this wouldn't work if we just appended it to the standard dom. so for example: <template id="my-paragraph"> <
style> p { color: white; background-color: #666; padding: 5px; } </
style> <p>my paragraph</p> </template> now we can use it by just adding it to our html document: <my-paragraph></my-paragraph> note: templates are well-supported in browsers; the shadow dom api is supported by default in firefox (version 63 onwards), chrome, opera, safari, and edge (starting with version 79). adding flexibility with slots so far so good, but the element isn't very flexible. w...
...And 9 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
a csp (content security policy) is used to detect and mitigate certain types of website related attacks like xss and data injections. 54 csrf glossary, security csrf (cross-site request forgery) is an attack that impersonates a trusted user and sends a website unwanted commands. 55 css css, codingscripting, glossary, web, l10n:priority css (cascading
style sheets) is a declarative language that controls how webpages look in the browser. 56 css object model (cssom) css, cssom, dom, glossary, web performance the css object model (cssom) is a map of all css selectors and relevant properties for each selector in the form of a tree, with a root node, sibling, descendant, child, and other relationship. the cssom is very similar to th...
...audio-visual presentation) audio, glossary, media, multimedia, video the term media (more accurately, multimedia) refers to audio, video, or combined audio-visual material such as music, recorded speech, movies, tv shows, or any other form of content that is presented over a period of time. 265 media (css) css, glossary, intro, media in the context of css (cascading
style sheets), the term media refers to the destination to which the document is to be drawn by the rendering engine. 266 metadata codingscripting, glossary, html, metadata metadata is — in its very simplest definition — data that describes data. for example, an html document is data, but html can also contain metadata in its <head> element that describes the document — for ...
...f the data that is being exchanged. the set of rules that defines a format is called a protocol. 340 prototype apps, composing, glossary a prototype is a model that displays the appearance and behavior of an application or product early in the development lifecycle. 341 prototype-based programming codingscripting, glossary prototype-based programming is a
style of object-oriented programming in which classes are not explicitly defined, but rather derived by adding properties and methods to an instance of another class or, less frequently, adding them to an empty object. in simple words: this type of
style allows the creation of an object without first defining its class. 342 proxy server glossary, proxy, server a proxy server is ...
...And 8 more matches
Getting started with HTML - Learn web development
tart of the line. to close the element, put the closing tag </em> at the end of the line. doing this should give the line italic text formatting! see your changes update live in the output area. if you make a mistake, you can clear your work using the reset button. if you get really stuck, press the show solution button to see the answer. playable code <h2>live output</h2> <div class="output"
style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="playable-code"
style="min-height: 100px;width: 95%"> this is my text. </textarea> <div class="controls"> <input id="reset" type="button" value="reset" /> <input id="solution" type="button" value="show soluti...
...ealityripple.com/samples/d5/2be21e0477.png"> this would output the following: note: empty elements are sometimes called void elements. attributes elements can also have attributes. attributes look like this: attributes contain extra information about the element that won't appear in the content. in this example, the class attribute is an identifying name used to target the element with
style information. an attribute should have: a space between it and the element name. (for an element with more than one attribute, the attributes should be separated by spaces too.) the attribute name, followed by an equal sign. an attribute value, wrapped with opening and closing quote marks. active learning: adding attributes to an element another example of an element is <a>. this stands f...
...ue of the title attribute, and when clicked, navigates to the web address in the href attribute. remember that you need to include a space between the element name, and between each attribute. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see the answer. ...
...And 8 more matches
Getting started with Svelte - Learn web development
vascript, generating optimal javascript code without any runtime overhead. to achieve this, svelte extends vanilla web technologies in the following ways: it extends html by allowing javascript expressions in markup and providing directives to use conditions and loops, in a fashion similar to handlebars. it extends css by adding a scoping mechanism, allowing each component to define their own
styles without the risk of clashing with other component's
styles. it extends javascript by reinterpreting specific directives of the language to achieve true reactivity and ease component state management. the compiler only intervenes in very specific situations and only in the context of svelte components. extensions to the javascript language are minimal and carefully picked in order to not break...
...to the body of our html page. public: this directory contains all the files that will be published in production. favicon.png: this is the favicon for your app. currently, it's the svelte logo. index.html: this is the main page of your app. initially it's just an empty html5 page that loads the css files and js bundles generated by svelte. global.css: this file contains unscoped
styles. it's a regular css file that will be applied to the whole application. build: this folder contains the generated css and javascript source code. bundle.css: the css file that svelte generated from the
styles defined for each component. bundle.js: the javascript file compiled from all your javascript source code. having a look at our first svelte component comp...
... bundle.css: the css file that svelte generated from the
styles defined for each component. bundle.js: the javascript file compiled from all your javascript source code. having a look at our first svelte component components are the building blocks of svelte applications. they are written into .svelte files using a superset of html. all three sections — <script>, <
styles>, and markup — are optional, and can appear in any order you like. <script> // logic goes here </script> <
style> /*
styles go here */ </
style> <!-- markup (zero or more html elements) goes here --> note: for more information on the component format, have a look at the svelte documentation. with this in mind, let's have a look at the src/app.svelte file that came with the starter tem...
...And 8 more matches
Building the WebLock UI
browser component, where it will provide a small icon the user can click to access the web lock interface. weblock indicator in browser user interface package list the user interface described in this section is comprised of four files: weblockoverlay.xul is the file that defines the little status icon in the browser. weblock.xul defines the web lock manager dialog. weblock.css provides
style rules for both of the xul files. weblock.js provides javascript functions for both of the xul files. each of these files is described briefly in the sections below. in the following chapter we'll describe how you can take these files and create a package, an installable archive that includes the weblock component and the new ui. because this step (particularly the overlay section) is so depen...
...l xul document in which the user interface for the dialog and the events that initiate interaction with the web locking are defined. at the top of all xul documents, an xml declaration is followed by the root element for the document, which is usually <window/> but for dialog boxes can also be the element <dialog/>. ...
..." for the xul file, then, looks like this: <?xml version="1.0"?> <?xml-
stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="weblock_ui" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="web lock manager" persist="screenx screeny" screenx="24" screeny="24"> </dialog> note that this part of the xul file also contains a
stylesheet declaration, which imports css rules and applies them to particular parts of the interface. in gecko, css is used to do virtually all of the presentation of the xul interface - its color, position,
style, and to some extent its behavior as well. the web lock manager dialog does not deviate from the look of a standard dialog, so it can use a single declaration to import the "global" skin from...
...And 8 more matches
Using the CSS Painting API - Web APIs
the css paint api is designed to enable developers to programmatically define images which can then be used anywhere a css image can be invoked, such as css background-image, border-image, mask-image, etc. to programmatically create an image used by a css
stylesheet we need to work through a few steps: define a paint worklet using the registerpaint() function register the worklet include the paint() css function to elaborate over these steps, we're going to start by creating a half-highlight background, like on this header: css paint worklet in an external script file, we employ the registerpaint() function to name our css paint worklet. it takes two parameters. the first is the name we give the worklet — this is the name we will use in our css as the parameter of the pain...
...eaderhighlight', class { /* define if alphatransparency is allowed alpha is set to true by default. if set to false, all colours used on the canvas will be fully opaque */ static get contextoptions() { return { alpha: true }; } /* ctx is the 2d drawing context a subset of the html5 canvas api. */ paint(ctx) { ctx.fill
style = 'hsla(55, 90%, 60%, 1.0)'; ctx.fillrect(0, 15, 200, 20); /* order: x, y, w, h */ } }); in this class example we have defined a single context option with the contextoptions() function: we returned a simple object stating alpha transparency is allowed. we have then used the paint() function to paint to our canvas. a paint() function can take three arguments. here we have provide...
...ontext (we'll look at more in due course), often refered to by the variable name ctx. the 2d rendering context is a subset of the html5 canvas api; the version available to houdini (called the paintrenderingcontext2d) is a further subset containing most of the features available in the full canvas api with the exception of the canvasimagedata, canvasuserinterface, canvastext, and canvastextdrawing
styles apis. we define the fill
style as being hsla(55, 90%, 60%, 1.0), which is a shade of yellow, and then call fillrect() to create a rectangle of that color. the fillrect() parameters are, in order, x-axis origin, y-axis origin, width, and height. fillrect(0, 15, 200, 20) results in the creation of a rectangle that is 200 units wide by 20 units tall, positioned 0 units from the left and 15 units fr...
...And 8 more matches
Advanced animations - Web APIs
the ball, we will create a ball object which contains properties and a draw() method to paint it on the canvas. var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var ball = { x: 100, y: 100, radius: 25, color: 'blue', draw: function() { ctx.beginpath(); ctx.arc(this.x, this.y, this.radius, 0, math.pi * 2, true); ctx.closepath(); ctx.fill
style = this.color; ctx.fill(); } }; ball.draw(); nothing special here, the ball is actually a simple circle and gets drawn with the help of the arc() method. adding velocity now that we have a ball, we are ready to add a basic animation like we have learned in the last chapter of this tutorial. again, window.requestanimationframe() helps us to control the animation. the ball gets moving by a...
...n. for each frame, we also clear the canvas to remove old circles from prior frames. ...
...irection of the velocity vectors. to do so, we add the following checks to the draw method: if (ball.y + ball.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } first demo let's see how it looks in action so far. move your mouse into the canvas to start the animation. ...
...And 8 more matches
Compositing example - Web APIs
vas canvas1.width = width; canvas1.height = height; canvas2.width = width; canvas2.height = height; lightmix() colorsphere(); runcomposite(); return; }; and this code, runcomposite(), handles the bulk of the work, relying on a number of utility functions to do the hard parts. ...
...ight; canvas2.width = width; canvas2.height = height; lightmix() colorsphere(); runcomposite(); return; }; and this code, runcomposite(), handles the bulk of the work, relying on a number of utility functions to do the hard parts. ...
....height = height; lightmix() colorsphere(); runcomposite(); return; }; and this code, runcomposite(), handles the bulk of the work, relying on a number of utility functions to do the hard parts. ...
...And 8 more matches
HTML elements reference - HTML: Hypertext Markup Language
n the introduction to html article. main root element description <html> the html <html> element represents the root (top-level element) of an html document, so it is also referred to as the root element. all other elements must be descendants of this element. document metadata metadata contains information about the page. this includes information about
styles, scripts and data to help software (search engines, browsers, etc.) use and render the page. metadata for
styles and scripts may be defined in the page or link to another file that has the information. element description <base> the html <base> element specifies the base url to use for all relative urls in a document. <head> the html <head> element ...
...adata for
styles and scripts may be defined in the page or link to another file that has the information. element description <base> the html <base> element specifies the base url to use for all relative urls in a document. <head> the html <head> element contains machine-readable information (metadata) about the document, like its title, scripts, and
style sheets. <link> the html external resource link element (<link>) specifies relationships between the current document and an external resource. this element is most commonly used to link to
stylesheets, but is also used to establish site icons (both "favicon"
style icons and icons for the home screen and apps on mobile devices) among other things. <meta> the html <meta>...
... <title> the html title element (<title>) defines the document's title that is shown in a browser's title bar or a page's tab. ...
...And 8 more matches
HTTP Index - HTTP
the accept request http header advertises which content types, expressed as mime types, the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the context where the request is done: when fetching a css
stylesheet a different value is set for the request than when fetching an image, video or a script. 48 accept-ch client hints, http, http header the accept-ch header is set by the server to specify which client hints headers client should include in subsequent requests. 49 accept-ch-lifetime client hints, http, header the accept-ch-lifetime header is set by the...
... the content security policy. these violation reports consist of json documents sent via an http post request to the specified uri. 96 csp: require-sri-for csp, directive, http, reference, security, subresource integrity, require-sri-for the http content-security-policy require-sri-for directive instructs the client to require the use of subresource integrity for scripts or
styles on the page. 97 csp: sandbox csp, content-security-policy, directive, http, sandbox, security the http content-security-policy (csp) sandbox directive enables a sandbox for the requested resource similar to the <iframe> sandbox attribute. it applies restrictions to a page's actions including preventing popups, preventing the execution of plugins and scripts, and enforcing a ...
...ame-origin policy. 98 csp: script-src csp, content, content-security-policy, directive, http, reference, script, security, script-src, source the http content-security-policy (csp) script-src directive specifies valid sources for javascript. this includes not only urls loaded directly into <script> elements, but also things like inline script event handlers (onclick) and xslt
stylesheets which can trigger script execution. 99 csp: script-src-attr csp, content, content-security-policy, directive, http, reference, script, security, script-src, source the http content-security-policy (csp) script-src-attr directive specifies valid sources for javascript inline event handlers. this includes only inline script event handlers like onclick, but not urls loaded...
...And 8 more matches
Elements - Archive of obsolete content
n. each binding child element defines a unique binding that can be attached to elements in other documents. an element can have only one binding attached (explicitly or inherited) at one moment. from several bindings only the last in the sequence will be used (like with any css rule). ...
...nt can have only one binding attached (explicitly or inherited) at one moment. from several bindings only the last in the sequence will be used (like with any css rule). ...
...(see bug 83830 for <table> specifics). css: div { -moz-binding: url(mybinding.xml#default); } dom: el...
...And 7 more matches
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
.tooltip;" onclick="myextension.onclick(event);"/> </toolbarpalette> onclick: function(event) { switch(event.button) { case 0: // left click break; case 1: // middle click break; case 2: // right click break; } } to add more buttons, put more <toolbarbutton> elements inside the <toolbarpalette> element. wrap elements other than <toolbarbutton> in <toolbaritem>. adding the button bootstrap
style adding a button to the browserpalette on runtime in a bootstrap addon is a bit different because the browserpalette is indirectly reached. a simple document.getelementbyid('browsertoolbarpalette') will not work. this is the code to create and add it in. let button = doc.createelement("toolbarbutton"); button.setattribute("id", button_id); button.setattribute("label", "replace bookmark"); button...
... document.getelementbyid('browsertoolbarpalette') will not work. this is the code to create and add it in. let button = doc.createelement("toolbarbutton"); button.setattribute("id", button_id); button.setattribute("label", "replace bookmark"); button.setattribute("class", "toolbarbutton-1 chromeclass-toolbar-additional"); button.setattribute("tooltiptext", "replace an existing bookmark"); button.
style.list
styleimage = "url(" + icon + ")"; button.addeventlistener("command", main.action, false); toolbox.palette.appendchild(button); this code is thanks to dgutov and is seen in full context at his repository here at github: dgutov / bmreplace / bootstrap.js. watch for a snippet that you can copy and paste into scratchpad, and then run on gists@github here: _ff-addon-snippet-addtoolbarbuttontopal...
...to provide two icons for each of your toolbar buttons. ...
...And 7 more matches
HTML table basics - Learn web development
css applied. be under no illusion; for tables to be effective on the web, you need to provide some styling information with css, as well as good solid structure with html. in this module we are focusing on the html part; to find out about the css part you should visit our styling tables article after you've finished here. we won't focus on css in this module, but we have provided a minimal css
stylesheet for you to use that will make your tables more readable than the default you get without any styling. you can find the
stylesheet here, and you can also find an html template that applies the
stylesheet — these together will give you a good starting point for experimenting with html tables. when should you not use html tables? html tables should be used for tabular data — this is what ...
...s. these exist because it can be a bit annoying and inefficient having to specify styling on columns — you generally have to specify your styling information on every <td> or <th> in the column, or use a complex selector such as :nth-child(). note: styling columns like this is limited to a few properties: border, background, width, and visibility. ...
...<td> or <th> in the column, or use a complex selector such as :nth-child(). note: styling columns like this is limited to a few properties: border, background, width, and visibility. to set other properties you'll have to either
style every <td> or <th> in the column, or use a complex selector such as :nth-child(). ...
...And 7 more matches
Beginning our React todo list - Learn web development
he mouse or keyboard. delete any task, using the mouse or keyboard. edit any task, using the mouse or keyboard. view a specific subset of tasks: all tasks, only the active task, or only the completed tasks. we'll tackle these stories one-by-one. pre-project housekeeping create-react-app has made a few files we won't be using at all for our project. we're not going to write per-component
stylesheets, so first delete the app.css import from the top of app.js. we are also not going to be using the logo.svg file, so remove that import too. then, copy and paste the following commands into your terminal to delete some unneeded files. make sure you’re starting in the app's root directory! # move into the src directory of your project cd src # delete a few files rm -- app.test.js app.cs...
... cd .. notes: two of the files we’re deleting are for testing the application. we will not cover testing here. if you stopped your server to do the terminal tasks mentioned above, you’ll have to start it again using npm start. project starter code as a starting point for this project, we're going to provide two things: an app() function to replace the one you have now, and some css to
style your app. the jsx copy the following snippet to your clipboard, then paste it into app.js so that it replaces the existing app() function: function app(props) { return ( <div classname="todoapp stack-large"> <h1>todomatic</h1> <form> <h2 classname="label-wrapper"> <label htmlfor="new-todo-input" classname="label__lg"> what needs to be done? ...
...den">repeat</span> </button> </div> </li> </ul> </div> ); } now open public/index.html and change the <title> element’s text to todomatic. this way, it will match the <h1> at the top of our app. <title>todomatic</title> when your browser refreshes, you should see something like this: it's ugly, and doesn’t function yet, but that's okay — we'll
style it in a moment. first, consider the jsx we have, and how it corresponds to our user stories: we have a <form> element, with an <input type="text"> for writing out a new task, and a button to submit the form. we have an array of buttons that will be used to filter our tasks. we have a heading that tells us how many tasks remain. we have our 3 tasks, arranged in an un-ordered list. each task ...
...And 7 more matches
CustomizableUI.jsm
he items in a customizable area. note that these are also abstract cross-window objects; customizableui will manage the actual dom manipulation involved with adding/moving/removing widgets in all windows for you. there are three main types of widgets: 'legacy' xul widgets, which are the way customizableui represents widgets whose dom representation is present (or overlaid) into a window; api-
style widgets, which are the new widgets customizableui can create and manage for you. these come in 3 types themselves: button which are simple toolbar buttons which do something when clicked view which are toolbar buttons with a 'view' of further options. the view can be shown as its own panel when such a widget is in the toolbar, or as a sliding 'subview' of the menu panel when such a...
...ments you want to obtain. return value an array containing the widget ids that are in the area. getwidgetsinarea() get an array of widget wrappers for all the widgets in an area. this is the same as calling getwidgetidsinarea and .map()-ing the result through customizableui.getwidget. careful: this means that if there are ids in there which don't have corresponding dom nodes (like in the old-
style currentset attribute), there might be nulls in this array, or items for which wrapper.forwindow(win) will return null. nb: will throw if called too early (before placements have been fetched) or if the area is not currently known to customizableui. parameters aarea the id of the area whose widgets you want to obtain. return value an array containing the widget wrappers and/or null values...
... var mywidgetlistener = { onwidgetadded: function(awidgetid, aarea, aposition) { console.log('a widget moved to an area, arguments:...
...And 7 more matches
nsIXSLTProcessor
ko 1.7 implemented by: @mozilla.org/document-transformer;1?type=xslt. ...
...@mozilla.org/document-transformer;1?type=xslt. ...
...n domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() removes all set parameters from this nsixsltprocessor. this will make the processor use the default-value for all parameters as specified in the
stylesheet. void clearparameters(); parameters none. getparameter() gets a parameter if previously set by setparameter(). returns null otherwise. nsivariant getparameter( in domstring namespaceuri, in domstring localname ); parameters namespaceuri the namespaceuri of the xslt parameter. localname the local name of the xslt parameter. return value an nsivariant containing the value of the parame...
...And 7 more matches
Timing element visibility with the Intersection Observer API - Web APIs
hout the intersection observer api, this winds up being done using intervals and timeouts for each individual ad, or other techniques that tend to slow the page down. using this api lets everything get streamlined by the browser to reduce the impact on performance substantially. let's get started! site structure: the html the site's structure is not too complicated. ...
...he top is the site's header region, contained within a <header> block. below that, we define the site's sidebar as a list of links within an <aside> block. finally comes the main body. we start with an empty <main> element here. this box will be populated using script later. styling the site with css with the structure of the site defined, we turn to the styling for the site. let's look at the
style for each component of the page individually. the basics we provide
styles for the <body> and <main> elements to define the site's background as well as the grid the various parts of the site will be placed in. body { font-family: "open sans", "arial", "helvetica", sans-serif; background-color: aliceblue; } .wrapper { display: grid; grid-template-columns: auto minmax(min-content, 1fr);...
...re sized the same way as the columns: the first one is automatically sized and the one uses the remaining space, but at least enough space to provide room for all elements within it. the wrapper's width is fixed at 700px so that it will fit in the available space when presented inline on mdn below. the header the header is fairly simple, since for this example all it contains is some text. its
style looks like this: header { grid-column: 1 / -1; grid-row: 1; background-color: aliceblue; } grid-row is set to 1, since we want the header to be placed in the top row of the site's grid. more interesting is our use of grid-column here; here we specify that we want the column to start in the first column and ends in the first column past the last grid line—in other words, the header spans...
...And 7 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
a primer introducing each of the ways css color can be used in html. fortunately, adding color to your html is actually really easy to do, and you can add color to nearly anything. we're going to touch on most of what you'll need to know when using color, including a list of what you can color and what css properties are involved, how you describe colors, and how to actually use colors both in
stylesheets and in scripts. we'll also take a look at how to let the user pick a color. then we'll wrap things up with a brief discussion of how to use color wisely: how to select appropriate colors, keeping in mind the needs of people with differing visual capabilities. things that can have color at the element level, everything in html can have color applied to it. instead, let's look at things in...
...enerally used as a focus indicator, to show which element will receive input events. borders any element can have a border drawn around it. a basic element border is a line drawn around the edges of the element's content. see box properties in the box model to learn about the relationship between elements and their borders, and the article styling borders using css to learn more about applying
styles to borders. you can use the border shorthand property, which lets you configure everything about the border in one shot (including non-color features of borders, such as its width,
style (solid, dashed, etc.), and so forth. border-color specifies a single color to use for every side of the element's border. border-left-color, border-right-color, border-top-color, and border-bottom-color l...
...s", helvetica, arial, sans-serif; border-spacing: 0; border-collapse: collapse; } th, td { border: 1px solid black; padding:4px 6px; text-align: left; } th { background-color: hsl(0, 0%, 75%); } <table> <thead> <tr> <th scope="col">color in hsl notation</th> <th scope="col">example</th> </tr> </thead> <tbody> <tr> <td><code>hsl(90deg, 100%, 50%)</code></td> <td
style="background-color: hsl(90deg, 100%, 50%);"> </td> </tr> <tr> <td><code>hsl(90, 100%, 50%)</code></td> <td
style="background-color: hsl(90, 100%, 50%);"> </td> </tr> <tr> <td><code>hsl(0.15turn, 50%, 75%)</code></td> <td
style="background-color: hsl(0.15turn, 50%, 75%);"> </td> </tr> <tr> <td><code>hsl(0.15turn, 90%, 75%)</code></td> <td
style="backgrou...
...And 7 more matches
Intl.NumberFormat() constructor - JavaScript
f the following properties: compactdisplay only used when notation is "compact". takes either "short" (default) or "long". currency the currency to use in currency formatting. possible values are the iso 4217 currency codes, such as "usd" for the us dollar, "eur" for the euro, or "cny" for the chinese rmb — see the current currency & funds code list. there is no default value; if the
style is "currency", the currency property must be provided. currencydisplay how to display the currency in currency formatting. possible values are: "symbol" to use a localized currency symbol such as €, this is the default value, "narrowsymbol" to use a narrow format symbol ("$100" rather than "us$100"), "code" to use the iso currency code, "name" to use a localized currency name...
...u", "hanidec", "khmr", " knda", "laoo", "latn", "limb", "mlym", " mong", "mymr", "orya", "tamldec", " telu", "thai", "tibt". signdisplay when to display the sign for the number; defaults to "auto" "auto" sign display for negative numbers only "never" never display sign "always" always display sign "exceptzero" sign display for positive and negative numbers, but not zero
style the formatting
style to use , the default is "decimal". "decimal" for plain number formatting. "currency" for currency formatting. "percent" for percent formatting "unit" for unit formatting unit the unit to use in unit formatting, possible values are core unit identifiers, defined in uts #35, part 2, section 6. a subset of units from the full list was selected for use ...
...y formatting. "percent" for percent formatting "unit" for unit formatting unit the unit to use in unit formatting, possible values are core unit identifiers, defined in uts #35, part 2, section 6. a subset of units from the full list was selected for use in ecmascript. pairs of simple units can be concatenated with "-per-" to make a compound unit. there is no default value; if the
style is "unit", the unit property must be provided. unitdisplay the unit formatting
style to use in unit formatting, the defaults is "short". "long" (e.g., 16 litres) "short" (e.g., 16 l) "narrow" (e.g., 16l) usegrouping whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. possible values are true and false; the default is true. ...
...And 7 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
s workaround module (n.b. as of may 29, 2017, that module does not work with packed extensions; i'm preserving the link in case the author updates the gist to fix this issue). step 5: no more internal jar files you know how i've been mentioning extractionless add-ons every once in a while thus far? well, you should probably consider switching to be extractionless when you go restartless. ...
... textbox({'id': 'coord-y', 'class': 'coord-box', 'placeholder': '0'}) ... that way you build elements hierarchy with not much interaction with dom, plus you can see tag properties and it children in a nice, structured way, just like in overlay.xul. you can find working example here. it involves using of firebug.sdk xul.js with few modifications. ...
...y', 'class': 'coord-box', 'placeholder': '0'}) ... that way you build elements hierarchy with not much interaction with dom, plus you can see tag properties and it children in a nice, structured way, just like in overlay.xul. you can find working example here. it involves using of firebug.sdk xul.js with few modifications. step 7: manually handle global css
stylesheets any global css
style sheets which you are using will need to be registered upon load and unregistered when your extension is unloaded. any css files used in any of your own xul files will function normally without any extra work needed. components.utils.import("resource://gre/modules/services.jsm"); var
stylesheets = ["chrome://myextension/skin/my
stylesheet.css"]; function startup(data,reason) { ... // load sty...
...And 6 more matches
XUL user interfaces - Archive of obsolete content
ces: xul (xml user-interface language, usually pronounced like "zool"). in xul, many common user interface features are built in. for example, xul provides specialized windows like dialogs and wizards, as well as status bars, menus, tool bars, and even browsers. more specialized features can be built from parts by using xul together with other technologies that you have seen in this tutorial: css
style, javascript code, and xbl bindings. like other xml-based languages, xul uses css
stylesheets. more details for more information about xul user interfaces, see the xul page in this wiki. action: a xul demonstration make a new xul document as a plain text file, doc7.xul. copy and paste the content from here, making sure that you scroll to get all of it: <?xml version="1.0"?> <?
...vascript code, and xbl bindings. like other xml-based languages, xul uses css
stylesheets. more details for more information about xul user interfaces, see the xul page in this wiki. action: a xul demonstration make a new xul document as a plain text file, doc7.xul. ...
...like other xml-based languages, xul uses css
stylesheets. more details for more information about xul user interfaces, see the xul page in this wiki. action: a xul demonstration make a new xul document as a plain text file, doc7.xul. ...
...And 6 more matches
CSS3 - Archive of obsolete content
it brings a lot of long-awaited novelties, like rounded corners, shadows, gradients, transitions or animations, as well as new layouts like multi-columns, flexible box or grid layouts. experimental parts are vendor-prefixed and should either be avoided in production environments, or used with extreme caution as both their syntax and semantics can change in the future. modules and the standardization process css level 2 needed 9 years, from august 2002 to june 2011 to reach the recommendation status. this was due to the fact that a few secondary features held back the whole specification. ...
...cument but also in some attributes of html elements, like the media attribute of the <link> element. the next iteration of this specification is in the work, allowing to tailor a web site regarding the input methods available on the user agent, with new media features like hover or pointer. detection of ecmascript support, using the script media features is also proposed. css
style attributes recommendation since november 7th, 2013 formally defines the syntax of the content of the html
style global attribute. css fonts module level 3 candidate recommendation since september 20th, 2018 amends the css2.1 font matching algorithm to be closer to what is really implemented. adds: support for downloadable fonts via th...
...tage, it plans to add the ability to clip a border (with the css border-clip, border-clip-top, border-clip-right, border-clip-bottom, and border-clip-left properties) or to control the shape of the border in a corner (using the css border-corner-shape property). css conditional rules module level 3 candidate recommendation adds features for conditional processing of parts of
style sheets, conditioned on capabilities of the browser or the document the
style sheet is being applied to. it consists mainly in allowing nested at-rules inside @media and the adding of a new css at-rule, @supports, and a new dom method css.supports(). css multi-column layout module working draft adds support for easy multi-column layouts using the css columns, column-cou...
...And 6 more matches
Introduction to XUL - Archive of obsolete content
e included in the file. namespaces must be treated carefully. correct namespace usage dictates that the namespace be used only for the tag, not in individual attributes. rare exceptions to this rule are bugs. xul file preamble xul is xml, and a good xul file begins with the standard xml version and doctype statements. ...
...e treated carefully. correct namespace usage dictates that the namespace be used only for the tag, not in individual attributes. rare exceptions to this rule are bugs. xul file preamble xul is xml, and a good xul file begins with the standard xml version and doctype statements. since xml has no implicit display semantics, there must always be associated
stylesheets. mozilla includes a standard
stylesheet, "xul.css". ...
... dictates that the namespace be used only for the tag, not in individual attributes. rare exceptions to this rule are bugs. xul file preamble xul is xml, and a good xul file begins with the standard xml version and doctype statements. since xml has no implicit display semantics, there must always be associated
stylesheets. mozilla includes a standard
stylesheet, "xul.css". ...
...And 6 more matches
Modifying the Default Skin - Archive of obsolete content
« previousnext » as of firefox 69, you must set the toolkit.legacyuserprofilecustomizations.
stylesheets preference to true in about:config in order to load userchrome.css or usercontent.css files. this documentation has not been fully updated for firefox quantum. support for the userchrome.css file and any of its elements described below are not guaranteed in future versions of firefox. using it may lead to hard-to-diagnose bugs or crashes. use at your own risk! this section describes how to modify the skin of a window. skin basics a skin is a set of
style sheets, images and behaviors that are applied to a xul file. by applying a different skin, you can change the look of a window without changing its functionality. firefox provides a skin by default, and you may download others. ...
...larger changes can be done by creating an entirely new skin. firefox has a theme manager for changing the default skin. ...
...larger changes can be done by creating an entirely new skin. ...
...And 6 more matches
Using Remote XUL - Archive of obsolete content
navigation as well as to build sophisticated web-based applications. [***aw: we should have a screenshot here of a xul document loaded in a content window***] this tutorial walks you through the process of building xul-based navigation for the mozilla.org web site. after completing the tutorial you should understand how to: create xul documents; serve them from a web server; use cascading
style sheets (css) to change their appearance; use javascript to define their behavior. global web site navigation most web sites today have poor global navigation (features for locating and visiting pages across the entire site). it is difficult to discern the site's basic structure and available resources, which makes it hard to locate a particular page or find the one with the information you wa...
...defined in the xul specification, has no specific function in xul; it can store any data associated with the item. in our case we use it to store the url of the page to load when the user selects the item from the menu. source | rendered step 5: appearance there's an obvious problem with the menus: their labels look plain. this makes them ugly and not like menus at all. ...
...ion, has no specific function in xul; it can store any data associated with the item. in our case we use it to store the url of the page to load when the user selects the item from the menu. source | rendered step 5: appearance there's an obvious problem with the menus: their labels look plain. this makes them ugly and not like menus at all. ...
...And 6 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
le, and modify it to create your own simple stopwatch. you need to display a time as before, but in this example, you need: a "start" button to start the stopwatch running. a "stop" button to pause/stop it. a "reset" button to reset the time back to 0. the time display to show the number of seconds elapsed, rather than the actual time. here's a few hints for you: you can structure and
style the button markup however you like; just make sure you use semantic html, with hooks to allow you to grab the button references using javascript. you probably want to create a variable that starts at 0, then increments by one every second using a constant loop. it is easier to create this example without using a date() object, like we've done in our version, but less accurate — you can't guar...
...over when the value is divided by 360) so the circle animation can continue uninterrupted, at a sensible, low value. note that this isn't strictly necessary, but it is easier to work with values of 0–359 degrees than values like "128000 degrees". if (rotatecount > 359) { rotatecount %= 360; } next, below the previous block add the following line to actually rotate the spinner: spinner.
style.transform = `rotate(${rotatecount}deg)`; at the very bottom inside the draw() function, insert the following line. this is the key to the whole operation — you are setting the variable defined earlier to an active requestanimation() call, which takes the draw() function as its parameter. this starts the animation off, constantly running the draw() function at a rate as near 60 fps as poss...
... try this yourself first; if you get really stuck, check out of our live example and source code. throttling a requestanimationframe() animation one limitation of requestanimationframe() is that you can't choose your frame rate. this isn't a problem most of the time, as generally you want your animation to run as smoothly as possible. but what about when you want to create an old school, 8-bit-
style animation? this was a problem, for example, in the monkey island-inspired walking animation from our drawing graphics article: in this example, you have to animate both the position of the character on the screen, and the sprite being shown. there are only 6 frames in the sprite's animation. if you showed a different sprite frame for every frame displayed on the screen by requestanimationfram...
...And 6 more matches
A first splash into JavaScript - Learn web development
ourse. with that in mind, let's look at the example we'll be building up in this article, and review the general process of dissecting it into tangible tasks. ...
...see if you can guess it in 10 turns or fewer. ...
...sfield'); let guesscount = 1; let resetbutton; function checkguess() { let userguess = number(guessfield.value); if (guesscount === 1) { guesses.textcontent = 'previous guesses: '; } guesses.textcontent += userguess + ' '; if (userguess === randomnumber) { lastresult.textcontent = 'congratulations! ...
...And 6 more matches
Starting our Svelte Todo list app - Learn web development
previous overview: client-side javascript frameworks next now that we have a basic understanding of how things work in svelte, we can start building our example app: a todo list. in this article we will first have a look at the desired functionality of our app, then we'll create a todos.svelte component and put static markup and
styles in place, leaving everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles. we want our users to be able to browse, add and delete tasks, and also to mark them as complete. this will be the basic functionality that we'll be developing in this tutorial series, plus we'll look at some more advanced concepts along the way too. prerequisites: at minimum, it is recommended that y...
...but let's have a look at the markup and see how it relates to our desired features: a label and a text box for entering new tasks. three buttons to filter by task status. a label showing the total number of tasks and the completed tasks. an unordered list, which holds a list item for each task. when the task is being edited, the list item has an input and t...
... class="visually-hidden">tasks</span> </button> here, aria-pressed tells assistive technology (like screen readers) that the button can be in one of two states: pressed or unpressed. think of these as analogs for on and off. setting a value of true means that the button is pressed by default. the class visually-hidden has no effect yet, because we have not included any css. once we have put our
styles in place, though, any element with this class will be hidden from sighted users and still available to screen reader users — this is because these words are not needed by sighted users; they are there to provide more information about what the button does for screenreader users that do not have the extra visual context to help them. further down, you can find the following <ul> element: <ul ...
...And 6 more matches
Introduction to Layout in Mozilla
overview basic data flow key data structures detailed walk-through incrementalism future tech-talks wrap-up, q&a basic data flow source document arrives via network apis incrementally “pumped” through the single-threaded layout engine parse, compute
style, render; repeat css used for rendering all content content theoretically separate from “presentation” key data structures content node elements, attributes, leaves dom frame rectangular formatting primitive geometric information [0..n] per content node 2nd thru nth are “continuations”
style context non-geometric information may be shared by adjacent frames reference counted, owned by frame ...
...by frame view clipping, z-order, transparency [0..1] per frame, owned by frame widget native window [0..1] per view, owned by view key data structures the document owns the content model, and one or more presentations exposed programmatically via dom apis the presentation owns the frame hierarchy frames own the
style contexts, views, widgets presentation has media type, dimensions, etc. may not be directly manipulated detailed walk-through setting up content model construction frame construction
style resolution reflow painting setting up assume basic knowledge of embedding and network apis (doc shell, streams) content dll auto-registers a document loader factory (dlf) ...
... elements more buffering and fixup occurs here insertchildat, appendchildto, removechildat frame construction content sink uses nsidocument interface to notify of Δs in content model contentappended, contentinserted, contentremoved presshell is registered as document observer receives contentappended, etc. ...
...And 6 more matches
Basics
p(x) q(x) = a0 + a1x + a2 x2 + ... + an-1 xn-1 b0 + b1x + b2 x2 + ... + bn-1 xn-1 . you can also do other weird and risky things which are not portable, bongo warns, such as mixing mathml with other markups lizard + bongo = ∫ a b d x + mathml and javascript html content <p> and you can turn to javascript and the dom for dynamic operations. </p> <div
style="text-align:center"> fill the gaps in this matrix with resizable input fields. </div> <math class="inputmath" display="block"> <mrow> <mi>a</mi> <mo>=</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext><input id="input12" value="?" size="1"/></mtext> </mtd> </mtr> <mtr> <mtd> <mtext><input id="input21" value="?" size="1"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]...
...the gaps in this matrix with resizable input fields. ...
...2","1"); setselection("a33","1"); setselection("a41","1"); setselection("a42","1"); setselection("a43","1"); } function incrementinput(inputid, increment) { var inputelement = document.getelementbyid(inputid); var size = parseint(inputelement.size) + increment; if (size <= 0) size = 1 inputelement.size = size; } and there could be more... ...
...And 6 more matches
CSSMathSum - Web APIs
constructor cssmathsum.cssmathsum() creates a new cssmathsum object. properties cssmathsum.values returns a cssnumericarray object which contains one or more cssnumericvalue objects. event handlers no methods none. ...
...thsum.values returns a cssnumericarray object which contains one or more cssnumericvalue objects. event handlers no methods none. examples we create an element with a width determined using a calc() function, then console.log() the operator and values, and dig into the values a bit. ...
...ich contains one or more cssnumericvalue objects. event handlers no methods none. examples we create an element with a width determined using a calc() function, then console.log() the operator and values, and dig into the values a bit. ...
...And 6 more matches
CanvasRenderingContext2D - Web APIs
g point (x, y) and size (width, height) to transparent black, erasing any previously drawn content. canvasrenderingcontext2d.fillrect() draws a filled rectangle at (x, y) position whose size is determined by width and height. canvasrenderingcontext2d.strokerect() paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke
style. ...
... canvasrenderingcontext2d.linewidth width of lines. default 1.0. canvasrenderingcontext2d.linecap type of endings on the end of lines. possible values: butt (default), round, square. canvasrenderingcontext2d.linejoin defines the type of corners where two lines meet. ...
...l, miter (default). canvasrenderingcontext2d.miterlimit miter limit ratio. default 10. canvasrenderingcontext2d.getlinedash() returns the current line dash pattern array containing an even number of non-negative numbers. canvasrenderingcontext2d.setlinedash() sets the current line dash pattern. canvasrenderingcontext2d.linedashoffset specifies where to start a dash array on a line. text
styles the following properties control how text is laid out. canvasrenderingcontext2d.font font setting. default value 10px sans-serif. canvasrenderingcontext2d.textalign text alignment setting. possible values: start (default), end, left, right, center. canvasrenderingcontext2d.textbaseline baseline alignment setting. possible values: top, hanging, middle, alphabetic (default), ideographic, ...
...And 6 more matches
Transformations - Web APIs
he entire state of the canvas. restore() restores the most recently saved canvas state. canvas states are stored on a stack. every time the save() method is called, the current drawing state is pushed onto the stack. a drawing state consists of the transformations that have been applied (i.e. translate, rotate and scale – see below). the current values of the following attributes: stroke
style, fill
style, globalalpha, linewidth, linecap, linejoin, miterlimit, linedashoffset, shadowoffsetx, shadowoffsety, shadowblur, shadowcolor, globalcompositeoperation, font, textalign, textbaseline, direction, imagesmoothingenabled. the current clipping path, which we'll see in the next section. you can call the save() method as many times as you like. each time the restore() method is called, the...
... restored. a save and restore canvas state example this example tries to illustrate how the stack of drawing states functions by drawing a set of consecutive rectangles. ...
...var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.fillrect(0, 0, 150, 150); // draw a rectangle with default settings ctx.save(); // save the default state ctx.fill
style = '#09f'; // make changes to the settings ctx.fillrect(15, 15, 120, 120); // draw a rectangle with new settings ctx.save(); // save the current state ctx.fill
style = '#fff'; // make changes to the settings ctx.globalalpha = 0.5; ctx.fillrect(30, 30, 90, 90); // draw a rectangle with new settings ctx.restore(); // restore previous state ctx.fillrect(45, 45, 60, 60); // draw a rectangle with restored settings ctx.restore(); // restore original state ctx.fillrect(60, 60, 30, 30); // draw a rectangle with res...
...And 6 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
- translation of that film i like note this translation was done by kyle so that some friends can watch it with their parents. 1 00:02:15.000 --> 00:02:20.000 - ta en kopp varmt te. - det är inte varmt. 2 00:02:20.000 --> 00:02:25.000 - har en kopp te. - det smakar som te. note this last line may not translate well. 3 00:02:25.000 --> 00:02:30.000 - ta en kopp styling webvtt cues you can
style webvtt cues by looking for elements which match the ::cue pseudo-element. within site css video::cue { background-image: linear-gradient(to bottom, dimgray, lightgray); color: papayawhip; } video::cue(b) { color: peachpuff; } here, all video elements are
styled to use a gray linear gradient as their backgrounds, with a foreground color of "papayawhip". in addition, text boldfaced using...
...lements are
styled to use a gray linear gradient as their backgrounds, with a foreground color of "papayawhip". in addition, text boldfaced using the <b> element are colored "peachpuff". the html snippet below actually handles displaying the media itself. <video controls autoplay src="video.webm"> <track default src="track.vtt"> </video> within the webvtt file itself you can also define the
style directly in the webvtt file. ...
...t boldfaced using the <b> element are colored "peachpuff". the html snippet below actually handles displaying the media itself. <video controls autoplay src="video.webm"> <track default src="track.vtt"> </video> within the webvtt file itself you can also define the
style directly in the webvtt file. ...
...And 6 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
ple calls the flashtext() function once a second until the stop button is pressed. <!doctype html> <html> <head> <meta charset="utf-8" /> <title>setinterval/clearinterval example</title> <script> var nintervid; function changecolor() { nintervid = setinterval(flashtext, 1000); } function flashtext() { var oelem = document.getelementbyid('my_box'); oelem.
style.color = oelem.
style.color == 'red' ? 'blue' : 'red'; // oelem.
style.color == 'red' ? 'blue' : 'red' is a conditional or ternary operator. } function stoptextcolor() { clearinterval(nintervid); } </script> </head> <body onload="changecolor();"> <div id="my_box"> <p>hello world</p> </div> <button onclick="stoptextcolor();">stop</button> </body> </html> examp...
...s.play = function () { if (btyping) { return; } if (bstart) { var aitems = document.queryselectorall(sselector); if (aitems.length === 0) { return; } for (var nitem = 0; nitem < aitems.length; nitem++) { asheets.push(new sheet(aitems[nitem])); /* uncomment the following line if you have previously hidden your elements via css: */ // aitems[nitem].
style.visibility = "visible"; } bstart = false; } nintervid = setinterval(typewrite, this.rate); btyping = true; }; this.pause = function () { clearinterval(nintervid); btyping = false; }; this.terminate = function () { ocurrent.nodevalue += spart; spart = ""; for (nidx; nidx < asheets.length; scroll(asheets[nidx++], 0, false)); clean(); }; ...
... var otwexample1 = new typewriter(/* elements: */ '#article, h1, #info, #copyleft', /* frame rate (optional): */ 15); /* default frame rate is 100: */ var otwexample2 = new typewriter('#controls'); /* you can also change the frame rate value modifying the "rate" property; for example: */ // otwexample2.rate = 150; onload = function () { otwexample1.play(); otwexample2.play(); }; </script> <
style type="text/css"> span.intlink, a, a:visited { cursor: pointer; color: #000000; text-decoration: underline; } #info { width: 180px; height: 150px; float: right; background-color: #eeeeff; padding: 4px; overflow: auto; font-size: 12px; margin: 4px; border-radius: 5px; /* visibility: hidden; */ } </
style> </head> <body> <p id="copyleft"
style="font-
style: italic; font-si...
...And 6 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
ces that your page will need very soon, which you want to start loading early in the page lifecycle, before browsers' main rendering machinery kicks in. this ensures they are available earlier and are less likely to block the page's render, improving performance. this article provides a basic guide to how <link rel="preload"> works. the basics you most commonly use <link> to load a css file to
style your page with: <link rel="
stylesheet" href="
styles/main.css"> here however, we will use a rel value of preload, which turns <link> into a preloader for any resource we want. you will also need to specify: the path to the resource in the href attribute. the type of resource in the as attribute. a simple example might look like this (see our js and css example source, and also live): <hea...
...ue of preload, which turns <link> into a preloader for any resource we want. you will also need to specify: the path to the resource in the href attribute. the type of resource in the as attribute. a simple example might look like this (see our js and css example source, and also live): <head> <meta charset="utf-8"> <title>js and css preload example</title> <link rel="preload" href="
style.css" as="
style"> <link rel="preload" href="main.js" as="script"> <link rel="
stylesheet" href="
style.css"> </head> <body> <h1>bouncing balls</h1> <canvas></canvas> <script src="main.js" defer></script> </body> here we preload our css and javascript files so they will be available as soon as they are required for the rendering of the page later on. this example is trivial, as the brow...
...for example: resources that are pointed to from inside css, like fonts or images. resources that javascript can request, like json, imported scripts, or web workers. ...
...And 6 more matches
MathML attribute reference - MathML
the xlink attributes on mathml elements: xlink:actuate, xlink:href, xlink:show and xlink:type are deprecated as well. ...
... the xlink attributes on mathml elements: xlink:actuate, xlink:href, xlink:show and xlink:type are deprecated as well. ...
...gnments of several elements (see element pages for details). unimplemented alignmentscope <mtable> a boolean value specifying whether table columns should act as alignment scopes or not. unimplemented altimg altimg-width altimg-height altimg-valign alttext <math> visual and textual fall-back options. bevelled <mfrac> specifies the
style how the fraction should be displayed. deprecated. use u+2044 (fraction slash) instead. unimplemented charalign <mstack> specifies the horizontal alignment of digits. close <mfenced> a string for the closing delimiter. columnalign <mtable>, <mtd>, <mtr>, <mlabeledtr> specifies the horizontal alignment of table cells. columnlines <mtable> ...
...And 6 more matches
Boxes - Archive of obsolete content
wrapping contents in html you can use a div as a container and when the div changes size, the contents will wrap or adjust the layout. this does not happen with xul box (or hbox and vbox) by default. however, you can easily add this capability with a
style change. ...
... wrapping contents in html you can use a div as a container and when the div changes size, the contents will wrap or adjust the layout. this does not happen with xul box (or hbox and vbox) by default. however, you can easily add this capability with a
style change. ...
... wrapping contents in html you can use a div as a container and when the div changes size, the contents will wrap or adjust the layout. this does not happen with xul box (or hbox and vbox) by default. however, you can easily add this capability with a
style change. ...
...And 5 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
ird errors will begin to happen. always set the label and tooltiptext attributes of a toolbarbutton. in the case of a toolbaritem element (discussed later), use the title attribute instead of label. tooltips are very important for users that want to know what a button does before clicking it. ...
...on is done with css: #xulschoolhello-hello-world-button { list-
style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button states, but we'll get into that further ahead. the css file with your toolbar
styles needs to be included in the overlay file, as you would expect, but also in the chrome.manifest file. this is very important because the toolbar customization dialog won't work correctly without this. ...
...systems, and also consider the different button states, but we'll get into that further ahead. the css file with your toolbar
styles needs to be included in the overlay file, as you would expect, but also in the chrome.manifest file. this is very important because the toolbar customization dialog won't work correctly without this. the way to include the file in the manifest is to add this line:
style chrome://global/content/customizetoolbar.xul chrome://xulschoolhello/skin/toolbar.css if you are using xbl bindings (explained way ahead) for your toolbar items, you'll have to include the css files for those as well, each in a new line like the one above. we now have code that adds one or more buttons to the toolbar palette. the user can now use the customize dialog to add the buttons to the ...
...And 5 more matches
Connecting to Remote Content - Archive of obsolete content
can also be used to extract information from web pages once they load, along with the page load interception techniques discussed previously. xpath is very useful for cases when you're receiving large and complex xml files, and you only need some of the data contained in them. using xpath to parse a complete xml document is probably not a good idea performance-wise. using xslt xslt (extensible
stylesheet language transformations) is another tool used to manipulate xml documents and transform them into other forms of text output, such as html, xul, and so on. we can not cover all transformations to various output formats, so we'll just look into converting an xml document to xul. first you need to create an xslt
stylesheet that acts as a template. this template will transform the xml you re...
...ansformations to various output formats, so we'll just look into converting an xml document to xul. first you need to create an xslt
stylesheet that acts as a template. this template will transform the xml you receive (in our case, the example xml document above) and convert it into xul. the xslt tutorial contains details for building these templates. ...
...now, the processor is ready to perform the transformation. let domparser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); let fi...
...And 5 more matches
Creating reusable content with CSS and XBL - Archive of obsolete content
easily reusable. note: xbl cannot be loaded over http, so this technique is only useful for local content accessed using the file:/// scheme, or from add-on code. you apply this technique in a simple demonstration. information: xbl bindings the structure provided by markup languages and css is not ideal for complex applications where parts need to be self-contained and reusable. you can place
stylesheets in separate files, and you can place scripts in separate files. but you must link those files from the document as a whole. another structural limitation concerns content. you can use css to provide content for selected elements, but the content is limited to text and images, and its positioning is limited to before or after the selected element. mozilla provides a mechanism that overcomes ...
...the document as a whole. another structural limitation concerns content. you can use css to provide content for selected elements, but the content is limited to text and images, and its positioning is limited to before or after the selected element. mozilla provides a mechanism that overcomes these limitations: xbl (xml bindings language). you can use xbl to link selected elements to their own:
stylesheets content properties and methods event handlers because you avoid linking everything at the document level, you can make self-contained parts that are easy to maintain and reuse. more details for more information about xbl bindings, see the xbl page in this wiki. action: an xbl demonstration make a new html document, doc6.html. copy and paste the content from here: <!
...ntained parts that are easy to maintain and reuse. more details for more information about xbl bindings, see the xbl page in this wiki. action: an xbl demonstration make a new html document, doc6.html. copy and paste the content from here: <!doctype html public "-//w3c//dtd html 4.0//en"> <html> <head> <title>mozilla css getting started - xbl demonstration</title> <link rel="
stylesheet" type="text/css" href="
style6.css"> </head> <body> <h1>xbl demonstration</h1> <div id="square">click me</div> </body> </html> make a new css file,
style6.css. this
stylesheet contains the document
style. copy and paste the content from here: /*** xbl demonstration ***/ #square { -moz-binding: url("square.xbl#square"); } make a new text file, square.xbl. this file contains the xbl...
...And 5 more matches
Editor Embedding Guide - Archive of obsolete content
to a valid structure filled with relative parameters to acommand (see list below for legal params). 3. verify if a command is enabled -- iscommandenabled: commandmanager->iscommanddisabled(acommand, retval) 4. get the current command state of a given command -- getcommandstate: commandmanager->getcommandstate(acommand,acommandparams) index of commands and parameters cmd_bold toggles bold
style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal bold cmd_italics toggles italics
style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand...
...boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal italics cmd_underline toggles underline on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal underline cmd_tt toggles teletype
style (monospace font) on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal teletype cmd_strikethrough toggles strikethrough
style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "st...
... "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal teletype cmd_strikethrough toggles strikethrough
style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal strikethrough cmd_superscript toggles superscript
style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal superscript cmd_subscript toggles subscript
style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean)...
...And 5 more matches
Example Sticky Notes - Archive of obsolete content
notes.html all parts are made and commented by vk [schools_ring@yahoo.com]. all rights are given to the world. view this example <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html401/strict.dtd"> <html> <head> <title>xbl demo : sticky notes</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <
style type="text/css"> body { background-color: #ffffff; color: #000000; font: 1em verdana, sans-serif; } h1 { font-size: 1.5em; } /* binding: */ .sticker { -moz-binding: url(notes.xml#default); } </
style> </head> <body> <h1><a href="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme, inc. fax - respond today.</p></div> <div class="sticker"><p>don't forget t...
... </
style> </head> <body> <h1><a href="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme, inc. ...
... the others are only needed if you plan to handle ...
...And 5 more matches
Custom toolbar button - Archive of obsolete content
ation: this file contains information used by the application's extension manager. sections for target applications specify the versions where the extension works. the last section in the file specifies that this extension adds content to the application. 4. create a plain text file named chrome.manifest. ...
...ntent/button.xul # thunderbird address book overlay chrome://messenger/content/addressbook/addressbook.xul chrome://custombutton/content/button.xul # sunbird overlay chrome://calendar/content/calendar.xul chrome://custombutton/content/button.xul optionally remove the sections for toolbars that you do not need. save the file. explanation: this file defines the extension's content. it adds a
stylesheet to the toolbar customization window. then it specifies an overlay for each toolbar. 5. create a directory named chrome. perform the following steps in that directory, creating five files there. explanation: the chrome directory contains files that specify what the extension does. 6. create a plain text file named button.xul. copy the following content, making sure that you scroll to ge...
...r. 5. create a directory named chrome. perform the following steps in that directory, creating five files there. explanation: the chrome directory contains files that specify what the extension does. 6. create a plain text file named button.xul. copy the following content, making sure that you scroll to get all of it. ...
...And 5 more matches
Adding more elements - Archive of obsolete content
og. adding elements to our find files example we will add some more elements to the find files dialog now. first, we will add the capability to search for other information such as the file size and date. <hbox> <menulist id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer
style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer
style="width: 10px;"/> <textbox id="find-text" flex="1"
style="min-width: 15em;"/> </hbox> two drop down boxes have been added to the dialog. a spacer has been added in between each element to separate them. these spacers have b...
...ox grows but the other components do not. you will also notice that the label was removed. if you resize the window vertically, the elements do not change size. this is because they are inside horizontal boxes. in might be more appropriate if the find and cancel buttons always stayed along the bottom of the window. this is easy to do by adding a spacer in between the two horizontal boxes. ...
...t be more appropriate if the find and cancel buttons always stayed along the bottom of the window. this is easy to do by adding a spacer in between the two horizontal boxes. ...
...And 5 more matches
Element Positioning - Archive of obsolete content
« previousnext » here we'll look at controlling the position and size of an element. box element positioning so far, we know how to position elements either horizontally or vertically inside a box. we will often need more control over the position and size of elements within the box. for this, we first need to look at how a box works. the position of an element is determined by the layout
style of its container. for example, the position of a button in a horizontal box is to the right of the previous button, if any. the size of an element is determined by two factors, the size that the element wants to be and the size you specify. the size that an element wants to be is determined by what is in the element. for example, a button's width is determined by the amount of text inside the but...
...t allow you to control the size of an element. the quick way is to simply add the width and height attributes on an element, much like you might do on an html img tag. an example is shown below: example 1: source view <button label="ok" width="100" height="40"/> however, it is not recommended that you do this. it is not very portable and may not fit in with some themes. a better way is to use
style properties, which work similarly to
style sheets in html. the following css properties can be used. width this specifies the width of the element. note that the css global skin of the xul application may also specify a min-width for the buttons and other elements, thus if simply setting the width property does not set the button width as you expect, try also to modify the button min-width pro...
... and other elements, thus if simply setting the width property does not set the button width as you expect, try also to modify the button min-width property. height this specifies the height of the element. by setting either of the two properties, the element will be created with that width and height. if you specify only one size property, the other is calculated as needed. the size of these
style properties should be specified as a number followed by a unit. flexible elements the sizes are fairly easy to calculate for non-flexible elements. they simply obey their specified widths and heights, and if the size wasn't specified, the element's default size is just large enough to fit the contents. for flexible elements, the calculation is slightly trickier. flexible elements are those that...
...And 5 more matches
tree - Archive of obsolete content
keyboard access). ...
...hange the order in which they are displayed. firstordinalcolumn type: treecol element a reference to the first treecol element, which or may not be the first column displayed in the tree. inputfield type: textbox element read-only property that holds the textbox that is used for editing. seltype type: string gets and sets the value of the seltype attribute. sel
style type: string if set to the value primary, only the label of the primary column will be highlighted when an item in the tree is selected. otherwise, the entire row will be highlighted. to see the difference, compare the selection
style in the folder list and the message list in mozilla mail. tabindex type: integer gets and sets the value of the tabindex attribu...
...etcelltext() method is called to change the cell contents). otherwise the cell label is reverted to the value it had prior to editing. related elements treecols, treecol, treechildren, treeitem, treerow, treecell and treeseparator.. ...
...And 5 more matches
treecol - Archive of obsolete content
ns to allow column resizing. you should always place an id attribute on a treecol element to ensure that the column positioning is handled properly. more information is available in the xul tutorial. attributes crop, cycler, dragging, editable, fixed, hidden, hideheader, ignoreincolumnpicker, label, primary, sort, sortactive, sortdirection, src, type, width properties accessibletype
style classes treecol-image examples this example shows a checkbox in the first column, requires the
style below. <tree flex="1" editable="true"> <treecols> <treecol label="active" type="checkbox" editable="true"/> <treecol label="name" flex="1" /> </treecols> <treechildren> <treeitem> <treerow> <treecell value="true"/> <treecell label="alice"/> </...
...however, chrome://global/skin/checkbox/cbox-check.gif is available in seamonkey on mac os x.. treechildren::-moz-tree-checkbox { /* unche...
... <treechildren> <treeitem> <treerow> <treecell value="true"/> <treecell label="alice"/> </treerow> </treeitem> <treeitem> <treerow> <treecell value="false"/> <treecell label="bob"/> </treerow> </treeitem> </treechildren> </tree> to make the checkbox visible on some platforms, the following
styles need to be added to the
stylesheet (see treecol.type). on firefox 2.x and 3.x, all operating systems other than mac os x already use these
styles by default. if targeting firefox for mac os x, be sure to use these
styles but include your own checkbox image. however, chrome://global/skin/checkbox/cbox-check.gif is available in seamonkey on mac os x.. treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. this s...
...And 5 more matches
Gecko Compatibility Handbook - Archive of obsolete content
plorer 4 and netscape navigator 4 share support for a large part of the html 3.2 standard and basic javascript. while they support the css 1 standard to some degree, the implementations are not complete and have non-standard features added. neither internet explorer 4 or netscape navigator 4 support the w3 dom. instead, each browser supports its own proprietary api for manipulating the content,
style and position of html elements in a web page. in addition, internet explorer 4 and netscape navigator 4 use completely different methods of embedding third-party software into the browser. gecko is a cross-platform browser engine, compatible with a number of windows versions including windows xp, as well as mac and linux. because of gecko's cross-platform nature, functionality is generally very...
... versions that support the w3 standards and gecko browsers content differs in gecko browsers and internet explorer your css relies on bugs in internet explorer's implementation of css. internet explorer incorrectly treats id's and class names as case insensitive while gecko treats them correctly as case sensitive. inconsistent case between the css defining the
style for html id's and classes results in gecko browsers not applying the
styles to id's or class names that differ in case. internet explorer incorrectly specifies height and width of inline elements such as span. internet explorer implements the box model (padding, margins, borders) incorrectly. do not use internet explorer's invalid implementation of css. use only t...
...net explorer incorrectly specifies height and width of inline elements such as span. internet explorer implements the box model (padding, margins, borders) incorrectly. do not use internet explorer's invalid implementation of css. use only the cross-browser, standards conformant features of css. use consistent case when writing html id and class name attributes and css
styles for those ids and classes. do not specify heights or widths on inline elements such as spans. use only cross-browser box specifications for margins, padding and borders. (more about css) content differs in gecko browsers and internet explorer incorrect layout mode specified by doctype. if pages should be displayed by legacy browsers such as netscape navigator 4...
...And 5 more matches
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
ml. proper xhtml is an application of xml and as such requires that authors follow strict rules when authoring xhtml. in particular: raw < and & characters are not allowed except inside of cdata sections (<![cdata[ ... ]]>). comments (<!—— ... ——>) must not contain double dashes (——). content contained within comments (<!—— ... ——>) can be ignored. problems with inline
style and script inline
style and script tags can cause several different problems in xhtml when it is treated as xml rather than html. javascript contains characters which can not exist in xhtml javascript typically contains characters which can not exist in xhtml outside of cdata sections. <script type="text/javascript"> var i = 0; while (++i < 10) { // ... } </script> note that th...
... contains characters which can not exist in xhtml javascript typically contains characters which can not exist in xhtml outside of cdata sections. <script type="text/javascript"> var i = 0; while (++i < 10) { // ... } </script> note that this example is not well formed xhtml since the use of raw < is only allowed as a part of markup in xhtml or xml. ...
...hich can not exist in xhtml outside of cdata sections. <script type="text/javascript"> var i = 0; while (++i < 10) { // ... } </script> note that this example is not well formed xhtml since the use of raw < is only allowed as a part of markup in xhtml or xml. ...
...And 5 more matches
The Business Benefits of Web Standards - Archive of obsolete content
. this article discusses how adhering to web standards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals. site wide consistent look and feel by separating structure (or content) from presentation, web designers have a lot to gain. specifically, presentation is defined using layout-oriented css language. ...
...the blogging community are particularly dynamic in this respect where on many platforms including wordpress, textpattern and habari, the site theme is a complete and discrete entity in its own right. ...
...sheet) and applying it to a set of html documents permits a complete change of presentation for all these documents in a snap. strict html (as opposed to the often-used transitional html markup), forces the designer not to use presentation tags in the html documents, naturally enforcing the separation of content from presentation. by locating all the
style and design issues in one document - the
style sheet - whole sites can be rethemed in one go. the blogging community are particularly dynamic in this respect where on many platforms including wordpress, textpattern and habari, the site theme is a complete and discrete entity in its own right. improved user experience: less bandwidth and fast loads html code is often much more compact (therefore easier to read and maintain) when used in conj...
...And 5 more matches
The box model - Learn web development
rnate box model. parts of a box making up a block box in css we have the: content box: the area where your content is displayed, which can be sized using properties like width and height. padding box: the padding sits around the content as white space; its size can be controlled using padding and related properties. border box: the border box wraps the content and any padding. its size and
style can be controlled using border and related properties. margin box: the margin is the outermost layer, wrapping the content, padding and border as whitespace between this box and other elements. its size can be controlled using margin and related properties. the below diagram shows these layers: the standard css box model in the standard box model, if you give a box a width and a height att...
... the padding of a box. if you are using the standard box model, the size of the border is added to the width and height of the box. if you are using the alternative box model then the size of the border makes the content box smaller as it takes up some of that available width and height. ...
...order is added to the width and height of the box. if you are using the alternative box model then the size of the border makes the content box smaller as it takes up some of that available width and height. for styling borders, there are a large number of properties — there are four borders, and each border has a
style, width and color that we might want to manipulate. you can set the width,
style, or color of all four borders at once using the border property. ...
...And 5 more matches
What is CSS? - Learn web development
prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to learn what css is. in the introduction to html module we covered what html is, and how it is used to mark up documents. these documents will be readable in a web browser. headings will look larger than regular text, paragraphs break onto a new line and have space between them. ...
... css is. in the introduction to html module we covered what html is, and how it is used to mark up documents. these documents will be readable in a web browser. headings will look larger than regular text, paragraphs break onto a new line and have space between them. links are colored and underlined to distinguish them from the rest of the text. what you are seeing is the browser's default
styles — very basic
styles that the browser applies to html to make sure it will be basically readable even if no explicit styling is specified by the author of the page. however, the web would be a boring place if all websites looked like that. using css you can control exactly how html elements look in the browser, presenting your markup using whatever design you like. for more on browser/defau...
... a document is usually a text file structured using a markup language — html is the most common markup language, but you may also come across other markup languages such as svg or xml. ...
...And 5 more matches
Introduction to events - Learn web development
we also define a function that returns a random number. the third part of the code is the event handler. the btn constant points to a <button> element, and this type of object has a number of events that can fire on it, and therefore, event handl...
... mechanisms and discuss which ones you should use. event handler properties these are the properties that exist to contain event handler code we have seen most frequently during the course. returning to the above example: const btn = document.queryselector('button'); btn.onclick = function() { const rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.
style.backgroundcolor = rndcol; } the onclick property is the event handler property being used in this situation. it is essentially a property like any other available on the button (e.g. btn.textcontent, or btn.
style), but it is a special type — when you set it to be equal to some code, that code is run when the event fires on the button. you could also set the handler property to be equal to a n...
... equal to some code, that code is run when the event fires on the button. you could also set the handler property to be equal to a named function name (like we saw in build your own function). the following works just the same: const btn = document.queryselector('button'); function bgchange() { const rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.
style.backgroundcolor = rndcol; } btn.onclick = bgchange; there are many different event handler properties available. let's experiment. first, make a local copy of random-color-eventhandlerproperty.html, and open it in your browser. it's just a copy of the simple random color example we've played with already. now try changing btn.onclick to the following different values in turn, and observing the...
...And 5 more matches
CSS performance optimization - Learn web development
previous overview: performance next painting an un
styled page, and then repainting it once
styles are parsed would be bad user experience. for this reason, css is render blocking, unless the browser knows the css is not currently needed. the browser can paint the page once it has downloaded the css and built the css object model. browsers follow a specific rendering path: paint only occurs after layout, which occurs after the render tree is created, which in turn requires both the dom and the cssom trees. to optimize the cssom construction, remove unnecessary
styles, minify, compress and cache it, and split css not required at page load into additional files to reduce css render blocking. ...
...ow a specific rendering path: paint only occurs after layout, which occurs after the render tree is created, which in turn requires both the dom and the cssom trees. to optimize the cssom construction, remove unnecessary
styles, minify, compress and cache it, and split css not required at page load into additional files to reduce css render blocking. optimizing for render blocking css can scope
styles to particular conditions with media queries. media queries are important for a responsive web design and help us optimize a critical rendering path. the browser blocks rendering until it parses all of these
styles but will not block rendering on
styles it knows it will not use, such the print
stylesheets. by splitting the css into multiple files based on media queries, you can prevent render blo...
... and help us optimize a critical rendering path. the browser blocks rendering until it parses all of these
styles but will not block rendering on
styles it knows it will not use, such the print
stylesheets. by splitting the css into multiple files based on media queries, you can prevent render blocking during download of unused css. to create a non-blocking css link, move the not-immediately used
styles, such as print
styles, into separate file, add a <link> to the html mark up, and add a media query, in this case stating it's a print
stylesheet. ...
...And 5 more matches
IME handling guide
ot connected adjacently. these clauses are called "converted clause"). if one or more clauses were not converted as expected, the user can choose one of the clauses with arrow keys and look for the expected result form the list in the drop down menu (in the following screenshot, the clause with the thicker underline is called "selected clause"). basically, composition string and each clause
style is rendered by gecko. and the drop down menu is created by ime. each clause is represented with selection in the editor. from chrome script, you can check it with nsiselectioncontroller. in native code, you can access it with either nsiselectioncontroller or mozilla::selectiontype (the latter is recommended because of type safer). and editor sets these ime selections from mozilla::textrangetype ...
...process by this, the imestatemanager forgets all focus information (i.e., that indicates nobody has focus). when imestatemanager in parent process is notified of pseudo focus move from or to menubar while a remote process has focus, it notifies the remote process of "menu keyboard listener installed". then, tabchild calls imestatemanager::oninstalledmenukeyboardlistener() in the remote process.
style of each clause the
style of each ime selection is managed by lookandfeel class per platform. therefore, it can be overridden by prefs. background color, foreground color (text color) and underline color can be specified with following prefs. the values must be string of "#rrggbb" format. ui.imerawinputbackground ui.imerawinputforeground ui.imerawinputunderline ui.imeselectedrawtextbackgro...
...t. ...
...And 5 more matches
Scroll-linked effects
to be laggy, janky, or jittery — in short, something we want to avoid. below are a couple of examples of effects that would not work well with asynchronous scrolling, along with equivalent versions that would work well: example 1: sticky positioning here is an implementation of a sticky-positioning effect, where the "toolbar" div will stick to the top of the screen as you scroll down. <body
style="height: 5000px" onscroll="document.getelementbyid('toolbar').
style.top = math.max(100, window.scrolly) + 'px'"> <div id="toolbar"
style="position: absolute; top: 100px; width: 100px; height: 20px; background-color: green"></div> </body> this implementation of sticky positioning relies on the scroll event listener to reposition the "toolbar" div. as the scroll event listener runs in the javascr...
...to the user-visible scroll, and so the div will not stay visually fixed as intended. instead, it will move with the user's scrolling, and then "snap" back into position when the scroll event handler runs. this constant moving and snapping will result in a jittery visual effect. one way to implement this without the scroll event listener is to use the css property designed for this purpose: <body
style="height: 5000px"> <div id="toolbar"
style="position: sticky; top: 0px; margin-top: 100px; width: 100px; height: 20px; background-color: green"></div> </body> this version works well with asynchronous scrolling because position of the "toolbar" div is updated by the browser as the user scrolls. example 2: scroll snapping below is an implementation of scroll snapping, where the scroll position ...
...h: 100px; height: 20px; background-color: green"></div> </body> this version works well with asynchronous scrolling because position of the "toolbar" div is updated by the browser as the user scrolls. example 2: scroll snapping below is an implementation of scroll snapping, where the scroll position snaps to a particular destination when the user's scrolling stops near that destination. ...
...And 5 more matches
nsIAccessNode
accessible/public/nsiaccessnode.idlscriptable an interface used by in-process accessibility clients to get
style, window, markup and other information about a dom node. when accessibility is active in gecko, every dom node can have one nsiaccessnode. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the nsiaccessnode implementations are instantiated lazily. the nsiaccessnode tree for a given dom window has a one to one relationship to the dom tree. if the dom node for this access node is "accessible", then a queryinterface to nsiaccessible will succeed. ...
... nsiaccessnode implementations are instantiated lazily. the nsiaccessnode tree for a given dom window has a one to one relationship to the dom tree. if the dom node for this access node is "accessible", then a queryinterface to nsiaccessible will succeed. ...
...ndow has a one to one relationship to the dom tree. if the dom node for this access node is "accessible", then a queryinterface to nsiaccessible will succeed. method overview nsiaccessnode getchildnodeat(in long childnum); obsolete since gecko 2.0 nsidomcssprimitivevalue getcomputed
stylecssvalue(in domstring pseudoelt, in domstring propertyname); domstring getcomputed
stylevalue(in domstring pseudoelt, in domstring propertyname); void scrollto(in unsigned long ascrolltype); void scrolltopoint(in unsigned long acoordinatetype, in long ax, in long ay); attributes note: attempting to access the attributes of a node that is unattached from the accessible tree will result in an exception - ns_error_failure. attribute type descr...
...And 5 more matches
nsIDOMWindowUtils
string aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsummary(in long ascript); astring getpccountscriptcontents(in long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly); astring getvisiteddependentcomputed
style(in nsidomelement aelement, in astring apseudoelement, in astring apropertyname); boolean isinmodalstate(); void leavemodalstate(); void loadsheet(in nsiuri sheeturi, in unsigned long type); nsidomnodelist nodesfromrect(in float ax, in float ay, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, in boolean aignorerootscrollfram...
.... exceptions thrown ns_error_not_available there is no current inner window displaydpi float the dpi of the display. read only. doccharsetisforced boolean whether the charset of the window's current document has been forced by the user. cannot be accessed from unprivileged context (not content-accessible) read only. elementsre
styled read only unsigned long long the number of elements which have been re
styled for the current document. keep in mind that during a re
style operation, an element may be re
styled multiple times (for example, when an inline element contains blocks). this number also counts restyling of pseudo-elements and anonymous boxes. throws ns_error_not_available if the count can't be provided. ...
...tevent(). if this is set, the selection is set from aoffset + alength to aoffset. select_character 0 select_cluster 1 select_word 2 select_line 3 select_beginline 4 select_endline 5 select_paragraph 6 select_wordnospace 7 agent_sheet 0 a possible type of a
style sheet loaded/removed with loadsheet()/removesheet(). see css2 specification for details. user_sheet 1 a possible type of a
style sheet loaded/removed with loadsheet()/removesheet(). see css2 specification for details. author_sheet 2 a possible type of a
style sheet loaded/removed with loadsheet()/removesheet(). see css2 specification for details. methods a...
...And 5 more matches
CSSPrimitiveValue - Web APIs
a cssprimitivevalue object only occurs in a context of a css property. ...
...a cssprimitivevalue object only occurs in a context of a css property. ...
...a cssprimitivevalue object only occurs in a context of a css property. ...
...And 5 more matches
CSS Typed Object Model API - Web APIs
generally, css values can be read and written in javascript as strings, which can be slow and cumbersome. ...
...erations defined for them). it is also generally faster, as values can be directly manipulated and then cheaply translated back into underlying values without having to both build and parse strings of css. css typed om both allows for the performant manipulation of values assigned to css properties while enabling maintainable code that is both more understand and easier to write. interfaces css
stylevalue the css
stylevalue interface of the the css typed object model api is the base class of all css values accessible through the typed om api. an instance of this class may be used anywhere a string is expected. css
stylevalue.parse(property, csstext) the parse() method of the css
stylevalue interface allows a cssnumericvalue to be constructed from a css string. it sets a specific css prop...
...del api is the base class of all css values accessible through the typed om api. an instance of this class may be used anywhere a string is expected. css
stylevalue.parse(property, csstext) the parse() method of the css
stylevalue interface allows a cssnumericvalue to be constructed from a css string. it sets a specific css property to the specified values and returns the first value as a css
stylevalue object. ...
...And 5 more matches
How CSS works - Learn web development
previous overview: first steps next we have learned the basics of css, what it is for and how to write simple
stylesheets. in this lesson we will take a look at how a browser takes css and html and turns that into a webpage. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to understand the basics of how css and html are parsed by the browser, and what happens when a browser encounters css it does not understand. how does css actually work? when a browser displays a document, it must combine the document's content with its
style information. it processes the document in a number of stages, which we've listed below. bear in mind that...
...s ... and linked css! javascript is handled a bit later on in the process, and we won't talk about it here to keep things simpler. the browser parses the fetched css, and sorts the different rules by their selector types into different "buckets", e.g. element, class, id, and so on. based on the selectors it finds, it works out which rules should be applied to which nodes in the dom, and attaches
style to them as required (this intermediate step is called a render tree). the render tree is laid out in the structure it should appear in after the rules have been applied to it. the visual display of the page is shown on the screen (this stage is called painting). the following diagram also offers a simple view of the process. about the dom a dom has a tree-like structure. each element, att...
...s and the document's content meet up. when you start working with browser devtools you will be navigating the dom as you select items in order to see which rules apply. a real dom representation rather than a long, boring explanation, let's look at an example to see how a real html snippet is converted into a dom. ...
...And 4 more matches
Example 1 - Learn web development
ple of code that explains how to build a custom form widget. ...
.../div> css /* --------------- */ /* required
styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy
styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 ...
...er { content : "▼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-index : 2; list-
style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; ...
...And 4 more matches
How to build custom form controls - Learn web development
h to implement the equivalent of the <optgroup> element later on? class names, however, provide no semantic value. in this current state, the screen reader user only "sees" an unordered list. we will add aria semantics in a bit. creating the look and feel using css now that we have a structure, we can start designing our control. the whole point of building this custom control is to be able to
style it exactly how we want. to that end, we will split our css work into two parts: the first part will be the css rules absolutely necessary to make our control behave like a <select> element, and the second part will consist of the fancy
styles used to make it look the way we want. required
styles the required
styles are those necessary to handle the three states of our control. .select { /* t...
...s; adding this to .select:focus-within will be a better option when fully supported */ position: relative; /* this will make our control become part of the text flow and sizable at the same time */ display : inline-block; } we need an extra class active to define the look and feel of our control when it is in its active state. because our control is focusable, we double this custom
style with the :focus pseudo-class in order to be sure they will behave the same. .select .active, .select:focus { outline: none; /* this box-shadow property is not exactly required, however it's imperative to ensure active state is visible, especially to keyboard users, that we use it as a default value. */ box-shadow: 0 0 3px 1px #227755; } now, let's handle the list of options: /* the...
...t meta tag */ position: absolute; z-index : 1; /* this will be important to keep the arrow from overlapping the list of options */ top : 0; right : 0; box-sizing : border-box; height : 100%; width : 2em; padding-top : .1em; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; text-align : center; } next, let's
style the list of options: .select .optlist { z-index : 2; /* we explicitly said the list of options will always be on top of the down arrow */ /* this will reset the default
style of the ul element */ list-
style: none; margin : 0; padding: 0; box-sizing : border-box; /* if the values are smaller than the control, the list of options will be as wide as the control itself */ min...
...And 4 more matches
Your first form - Learn web development
g more complex, creative button content. basic form styling now that you have finished writing your form's html code, try saving it and looking at it in a browser. at the moment, you'll see that it looks rather ugly. note: if you don't think you've got the html code right, try comparing it with our finished example — see first-form.html (also see it live). ...
...l see that it looks rather ugly. note: if you don't think you've got the html code right, try comparing it with our finished example — see first-form.html (also see it live). forms are notoriously tricky to
style nicely. it is beyond the scope of this article to teach you form styling in detail, so for the moment we will just get you to add some css to make it look ok. first of all, add a <
style> element to your page, inside your html head. ...
...l code right, try comparing it with our finished example — see first-form.html (also see it live). forms are notoriously tricky to
style nicely. it is beyond the scope of this article to teach you form styling in detail, so for the moment we will just get you to add some css to make it look ok. first of all, add a <
style> element to your page, inside your html head. ...
...And 4 more matches
Making decisions in your code — conditionals - Learn web development
ock of code is not controlled by the conditional statement, so it always runs, regardless of whether the condition returns true or false. this is not necessarily a bad thing, but it might not be what you want — often you want to run one block of code or the other, not both. as a final point, you may sometimes see if...else statements written without the curly braces, in the following shorthand
style: if (condition) code to run if condition is true else run some other code instead this is perfectly valid code, but using it is not recommended — it is much easier to read the code and work out what is going on if you use the curly braces to delimit the blocks of code, and use multiple lines and indentation. a real example to understand this syntax better, let's consider a real example. ima...
... live example shows a simple theme chooser where the styling for the site is applied using a ternary operator. <label for="theme">select theme: </label> <select id="theme"> <option value="white">white</option> <option value="black">black</option> </select> <h1>this is my website</h1> const select = document.queryselector('select'); const html = document.queryselector('html'); document.body.
style.padding = '10px'; function update(bgcolor, textcolor) { html.
style.backgroundcolor = bgcolor; html.
style.color = textcolor; } select.onchange = function() { ( select.value === 'black' ) ? update('black','white') : update('white','black'); } here we've got a <select> element to choose a theme (black or white), plus a simple <h1> to display a website title. we also have a function calle...
...or to group multiple months together into a single condition; many of them share the same number of days. think about which number of days is the most common, and use that as a default value. if you make a mistake, you can always reset the example with the "reset" button. if you get really stuck, press "show solution" to see a solution. ...
...And 4 more matches
Web performance resources - Learn web development
r bot traffic); for example, by using the loading attribute on the <img> element it is also crucial to realize what is really important to your users. it might not be absolute timing, but user perception. quick wins css web performance is all about user experience and perceived performance. ...
...nal link tag with rel="
stylesheet" is synchronous and blocks rendering. optimize the rendering of your page by removing blocking css. to load css asynchronously one can simpy set the media type to print and then change to all once loaded. the following snippet includes an onload attribute, requiring javascript, so it is important to include a noscript tag with a traditional fallback. ...
... your page by removing blocking css. to load css asynchronously one can simpy set the media type to print and then change to all once loaded. the following snippet includes an onload attribute, requiring javascript, so it is important to include a noscript tag with a traditional fallback. ...
...And 4 more matches
Android-specific test suites
android-findbugs ensures that the code avoids common java coding errors. android-lint ensures that the code avoids common android coding errors. all of these suites require a functioning build of firefox for android — either a full build or an artifact build. all of the suites are configured by and invoked using gradle. android-test runs android-specific local unit tests. ...
...stsuccessrunnableisexecutedifpermissionsaregranted, add @ignore as follows: ... @runwith(testrunner.class) public class testpermissions { @ignore @test public void testsuccessrunnableisexecutedifpermissionsaregranted() { ... contact information android-test is currently owned by :sebastian and :nalexander. file tickets in the firefox for android product in bugzilla. ...
...onsaregranted, add @ignore as follows: ... @runwith(testrunner.class) public class testpermissions { @ignore @test public void testsuccessrunnableisexecutedifpermissionsaregranted() { ... contact information android-test is currently owned by :sebastian and :nalexander. file tickets in the firefox for android product in bugzilla. android-check
style verifies that the java coding
style is consistent throughout. see http://check
style.sourceforge.net/index.html and https://docs.gradle.org/2.14/userguide/check
style_plugin.html for more details. running android-check
style to run android-check
style, first build firefox for android with your changes; then run ./mach android check
style this will run the tests and report the results to stdout, as well as produce an html report. d...
...And 4 more matches
SVG Guidelines
recommended to remove that kind of metadata since it doesn't bring much value. you shouldn't include doctypes in your svgs either; they are a source of many issues, and the svg wg recommends not to include them. see svg authoring guidelines. avoid the use of cdata sections cdata sections are used to avoid parsing some text as html. most of time, cdata isn't needed, for example, the content in <
style> tags doesn't need to be wrapped in a cdata section as the content inside the tag is already correctly parsed as css. invisible shapes there are two kinds of invisible shapes: the off-screen ones and the uncolored ones. the offscreen shapes are hard to spot, even with an automated tool, and are usually context aware. those kinds of shapes are visible but off the svg view box. here's an example...
...visible shapes there are two kinds of invisible shapes: the off-screen ones and the uncolored ones. the offscreen shapes are hard to spot, even with an automated tool, and are usually context aware. those kinds of shapes are visible but off the svg view box. here's an example of a file with offscreen shapes. on the other hand, the uncolored ones are easier to spot, since they usually come with
styles making them invisible. they must meet two conditions: they must be devoid of any fill (or a transparent one) or stroke. unused attributes on root <svg> element the root <svg> element can also host many useless attributes. here's an example taking into account the list below: version x="0" and y="0" enable-background (unsupported by gecko and now deprecated by the filter effects specificat...
... shapes or paths) clip-rule attribute when the element is not a descendant of a <clippath> fill-rule attribute when the element is a descendant of a <clippath> unreferenced/unused clip paths, masks or defs (example) styling basics privilege short lowercase hex for colors don't use excessive precision for numeric values (usually comes from illustrator) use descriptive ids avoid inline
styles and use class names or svg attributes examples here are some examples for excessive number precision: 5.000000e-02 → 0.05 (as seen here) -3.728928e-10 → 0 (as seen here) translate(0.000000, -1.000000) → translate(0, -1) (as seen here) as for descriptive ids: for gradients: svg_id1 → gradient1 (as seen here) use of class names avoid using a class if that class is only us...
...And 4 more matches
Mozilla Content Localized in Your Language
this section of the
style guide is for you to author. the content here should be what you and your localization team have decided, together, to follow when localizing mozilla products and web sites. you are free to add, edit, remove, and localize everything in this section according to how the localization team for your language agrees. all we ask is that you name this page according to this example, "mozilla content in spanish (es-mx)" and add your locale code tag at the bottom. ...
...tion team have decided, together, to follow when localizing mozilla products and web sites. you are free to add, edit, remove, and localize everything in this section according to how the localization team for your language agrees. all we ask is that you name this page according to this example, "mozilla content in spanish (es-mx)" and add your locale code tag at the bottom. enjoy developing your
style guide! your language's
style guide abbreviations how are abbreviations expressed in your language? numerals and metrics how are numerals and metrics expressed in your language? formal and informal forms, and separators (, or .) date format what are the date formats for weeks and months are expressed in the following forms: 1)fully spelled out, 2). 2 or 3 letters and 3). single letter. a...
...ference material on other languages can be found here. pluralization what is the appropriate form of expressing pluralization in your language? if yes, list all forms of plural forms and examples if there is more than one. additional discussions can be found here. voice what is the appropriate form of expressing voice in your language? how should emphasis be made in your language? character
styles how are bold, italics, underlines, etc. used to express certain concepts in your language? if these are not applicable
styles, what are some of the corresponding ways to express, emphasis or highlight some of the texts. address format what is the format in your language? ex: most asian countries start from big to small: [country] [postal code][state/province][city][district][street numbe...
...And 4 more matches
Mozilla Web Developer FAQ
therefore, the default margins for paragraphs apply even with markup such as <td><p>foo</p></td>. often the content of a cell in a table of tabular data does not constitute a paragraph. in that case, the easy solution is not to mark the contents of the cell as a paragraph. when the paragraph markup is called for but the default margins are unwanted, zero margins can be suggested using css. my
style sheet doesn’t work! why? here’s the check list: does the html document validate? styling misnested markup may cause strange effects. the <link> and <
style> elements should be inside the <head> element. does the css
style sheet pass the syntax check? the css error handling rules require erroneous parts to be ignored rather than fixed by guessing. lengths other than zero ...
... does the css
style sheet pass the syntax check? the css error handling rules require erroneous parts to be ignored rather than fixed by guessing. lengths other than zero should be followed by a proper unit without a space between the number and the unit (eg. 1.2em). the character to use between the property name and the value is the colon—not the equal sign. html markup, such as <
style>, does not belong in .css files. font-face is not a real css property. the property is font-family and @font-face is an at-rule. if @import is used, it should be the first thing in a css file. css parsing errors are reported to the javascript console. is the server sending the proper content-type header for css
style sheets? the correct type is text/css. in the standards m...
...nt-face is not a real css property. the property is font-family and @font-face is an at-rule. if @import is used, it should be the first thing in a css file. css parsing errors are reported to the javascript console. is the server sending the proper content-type header for css
style sheets? the correct type is text/css. in the standards mode and the almost standards mode only
style sheets with the correct type are applied. you can see the http headers sent by the server by using the livehttpheaders extension or by using the web sniffer. class names and ids are case-sensitive. the element selectors are case-sensitive with xml.
style sheet processing instructions are only allowed in the prolog of xml documents. also, they only work in xml documents—not in documen...
...And 4 more matches
about:memory
...
...e represents all javascript window objects, which includes the browser tabs and ui windows. for example, the "top(http://edition.cnn.com/, id=8)" sub-tree represents the tab open to cnn.com, and "top(chrome://browser/content/browser.xul, id=3)" represents the main browser ui window. within each window's measurements are sub-trees for javascript ("js-compartment(...)" and "js-zone(...)"), layout,
style-sheets, the dom, and other things. it's clear that the cnn.com tab is using more memory than the techcrunch.com tab, which is using more than the arstechnica.com tab. sub-trees with names like "(2 tiny)" are artificial nodes inserted to allow insignificant sub-trees to be collapsed by default. if you select the "verbose" checkbox before measuring, all trees will be shown fully expanded and no a...
...others are identified only by a hexadecimal identifier. you can look in about:support to see which add-on a particular identifier belongs to. for example, 59c81df5-4b7a-477b-912d-4e0fdf64e5f2 is chatzilla. all javascript memo...
...And 4 more matches
nsIParserUtils
l); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned long flags); constants constant value description sanitizerallowcomments (1 << 0) flag for sanitizer: allow comment nodes. sanitizerallow
style (1 << 1) flag for sanitizer: allow <
style> elements and
style attributes (with contents sanitized in case of -moz-binding). note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved! sanitizercidembedsonly (1 << 2) flag for sanitizer: only allow cid: urls for embedded content. at present, sanitizing css backgro...
...tes (with contents sanitized in case of -moz-binding). note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved! sanitizercidembedsonly (1 << 2) flag for sanitizer: only allow cid: urls for embedded content. at present, sanitizing css backgrounds, and so on., is not supported, so setting this together with sanitizerallow
style doesn't make sense. at present, sanitizing css syntax in svg presentational attributes is not supported, so this option flattens out svg. sanitizerdropnoncsspresentation (1 << 3) flag for sanitizer: drops non-css presentational html elements and attributes, such as <font>, <center>, and the bgcolor attribute. sanitizerdropforms (1 << 4) flag for sanitizer: drops...
..., so an explicit user action (following a link) after the content has been loaded can still leak information. by default, non-dangerous non-css presentational html elements and attributes or forms are not removed. to remove these, use sanitizerdropnoncsspresentation and/or sanitizerdropforms. by default, comments and css is removed. to preserve comments, use sanitizerallowcomments. ...
...And 4 more matches
CanvasRenderingContext2D.globalAlpha - Web APIs
syntax ctx.globalalpha = value; options value a number between 0.0 (fully transparent) and 1.0 (fully opaque), inclusive. the default value is 1.0. values outside that range, including infinity and nan, will not be set, and globalalpha will retain its previous value. ...
...that range, including infinity and nan, will not be set, and globalalpha will retain its previous value. examples drawing translucent shapes this example uses the globalalpha property to draw two semi-transparent rectangles. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.globalalpha = 0.5; ctx.fill
style = 'blue'; ctx.fillrect(10, 10, 100, 100); ctx.fill
style = 'red'; ctx.fillrect(50, 50, 100, 100); result overlaying transparent shapes this example illustrates the effect of overlaying multiple transparent shapes on top of each other. we begin by drawing a solid background composed of four differently colored squares. next, we set the globalalpha property to 0.2 (20% opaque); this alpha lev...
..., the opacity of the previous circles underneath is effectively increased. if we were to increase the step count (and thus draw more circles), the background would eventually disappear completely from the center of the image. ...
...And 4 more matches
Element: overflow event - Web APIs
the overflow event is fired when an element has been overflowed by its content or has been rendered for the first time in this state (only works for elements
styled with overflow != visible). it is a proprietary event specific to gecko (firefox). ...
...n this state (only works for elements
styled with overflow != visible). it is a proprietary event specific to gecko (firefox). ...
...t handler property unknown examples <div id="wrapper"> <div id="child"></div> </div> <br/> <label><input type="checkbox" id="toggle" checked/> overflow</label> <
style> #wrapper { width: 20px; height: 20px; background: #000; padding: 5px; overflow: hidden; } #child { width: 40px; height: 40px; border: 2px solid grey; background: #ccc; } </
style> <script> var wrapper = document.getelementbyid("wrapper"), child = document.getelementbyid("child"), toggle = document.getelementbyid("toggle"); wrapper.addeventlistener("overflow", function( event ) { console.log( event ); }, false); wrapper.addeventlistener("underflow", function( event ) { console.log( event ); }, false); toggle.addeventlistener("change"...
...And 4 more matches
HTMLElement.offsetLeft - Web APIs
he left in pixels from the closest relatively positioned parent element. example var colortable = document.getelementbyid("t1"); var toleft = colortable.offsetleft; if (toleft > 5) { // large left offset: do something here } this example shows a 'long' sentence that wraps within a div with a blue border, and a red box that one might think should describe the boundaries of the span. ...
...ositioned parent element. example var colortable = document.getelementbyid("t1"); var toleft = colortable.offsetleft; if (toleft > 5) { // large left offset: do something here } this example shows a 'long' sentence that wraps within a div with a blue border, and a red box that one might think should describe the boundaries of the span. <div
style="width: 300px; border-color:blue; border-
style:solid; border-width:1;"> <span>short span. ...
...e left offset: do something here } this example shows a 'long' sentence that wraps within a div with a blue border, and a red box that one might think should describe the boundaries of the span. <div
style="width: 300px; border-color:blue; border-
style:solid; border-width:1;"> <span>short span. ...
...And 4 more matches
ShadowRoot - Web APIs
properties included from documentorshadowroot the shadowroot interface includes the following properties defined on the documentorshadowroot mixin. note that this is currently only implemented by chrome; other browsers still implement them on the document interface. documentorshadowroot.activeelement read only returns the element within the shadow tree that has focus. documentorshadowroot.
stylesheets read only returns a
stylesheetlist of css
stylesheet objects for
stylesheets explicitly linked into, or embedded in a document. methods the shadowroot interface includes the following methods defined on the documentorshadowroot mixin. note that this is currently only implemented by chrome; other browsers still implement them on the document interface. documentorshadowroot.getselectio...
...t, and caret's character offset within that node. examples the following snippets are taken from our life-cycle-callbacks example (see it live also), which creates an element that displays a square of a size and color specified in the element's attributes. ...
...e element's attributes. inside the <custom-square> element's class definition we include some life cycle callbacks that make a call to an external function, update
style(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. ...
...And 4 more matches
Web APIs
elow is a list of all the apis and interfaces (object types) that you may be able to use while developing your web app or site. web apis are typically used with javascript, although this doesn't always have to be the case. specifications this is a list of all the apis that are available. ...
...blob blobbuilder blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties bluetoothdevice bluetoothremotegattcharacteristic bluetoothremotegattdescriptor bluetoothremotegattserver bluetoothremotegattservice body broadcastchannel budgetservice budgetstate buffersource bytelengthqueuingstrategy bytestring c cdatasection css cssconditionrule csscounter
stylerule cssgroupingrule cssimagevalue csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist css
styledeclaration css
stylerule css
stylesheet css
stylevalue csssupportsrule cssunitvalue cssunparsedvalue ...
...pe doublerange dragevent dynamicscompressornode e ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic eckeygenparams eckeyimportparams ecdhkeyderiveparams ecdsaparams effecttiming element elementcssinline
style elementtraversal errorevent event eventlistener eventsource eventtarget extendableevent extendablemessageevent f featurepolicy federatedcredential fetchevent file fileentrysync fileerror fileexception filelist filereader filereadersync filerequest filesystem filesystemdirectoryentry filesystemdirectoryreader filesystementry filesystementrysync filesystemfileentry filesy...
...And 4 more matches
Adding captions and subtitles to HTML5 video - Developer guides
this article will take the same player and show how to add captions and subtitles to it, using the webvtt format and the <track> element. captioned video example in this article, we will refer to the video player with captions example. this example uses an excerpt from the sintel open movie, created by the blender foundation. note: you can find the source on github, and also view the example live. ...
...voldown">vol-</button> <button id="fs" type="button" data-state="go-fullscreen">fullscreen</button> <button id="subtitles" type="button" data-state="subtitles">cc</button> </div> css changes the video controls have undergone some minor changes in order to make space for the extra button, but these are relatively straightforward. no image is used for the captions button, so it is simply
styled as: .controls button[data-state="subtitles"] { height:85%; text-indent:0; font-size:16px; font-size:1rem; font-weight:bold; color:#666; background:#000; border-radius:2px; } there are also other css changes that are specific to some extra javascript implementation, but these will be mentioned at the appropriate place below. subtitle implementation a lot of wha...
...it also sets up the required event listeners on the button to toggle the relevant subtitle set on or off. this is done by simply setting the required subtlte's mode attribute to showing,...
...And 4 more matches
Video player styling basics - Developer guides
preliminary modifications from the original example this section summarises the modifications that were made to the original video player example to make the styling task easier, before the bulk of the work was started. ...
... preliminary modifications from the original example this section summarises the modifications that were made to the original video player example to make the styling task easier, before the bulk of the work was started. ...
...ation. this "data-state" idea is also used for setting the current state of buttons within the video control set, which allows specific state styling. javascript as mentioned above, a data-state attribute is used in various places for styling purposes and these are set using javascript. specific implementations will be mentioned at appropriate places below. styling the resultant video player
style used here is rather basic — this is intentional, as the purpose is to show how such a video player could be
styled and be made responsive. note: in some cases some basic css is omitted from the code examples here as its use is either obvious or not specifically relevant to styling the video player. basic styling the html video and its controls are all contained within a <figure> element, w...
...And 4 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
se in the future. external resource not allowed not allowed prev indicates that the current document is a part of a series, and that the previous document in the series is the referenced document. link link link search gives a link to a resource that can be used to search through the current document and its related pages. link link link
stylesheet imports a
style sheet. external resource not allowed not allowed tag gives a tag (identified by the given address) that applies to the current document. not allowed link not allowed the rel attribute is relevant to the <link>, <a>, <area>, and <form> elements, but some values only relevant to a subset of those elements. like all html keyword attribute ...
... uses the non-standard apple-touch-icon and apple-touch-startup-image respectively. the shortcut link type is often seen before icon, but this link type is non-conforming, ignored and web authors must not use it anymore. alternate indicates an alternate representation of the current document. valid for link, a, and area, the meaning depends on the values of the other attributes. with the
stylesheet keyword on a <link>, it creates an alternate
stylesheet. <!-- a persistent
style sheet --> <link rel="
stylesheet" href="default.css"> <!-- alternate
style sheets --> <link rel="alternate
stylesheet" href="highcontrast.css" title="high contrast"> with an hreflang attribute that differs from the document language, it indicates a translation. with the type attribute, it indicates that...
...t helps reduce latency and thereby improves performance when the user does access the resources as the browser preemptively performed dns resolution for the origin of the specified resource. see dns-prefetch described in resource hints. external relevant to <form>, <a>, and <area>, it indicates the referenced document is not part of the current site. this can be used with attribute selectors to
style external links in a way that indicates to the user that they will be leaving the current site. help relevant to <form>, <link>, <a>, and <area>, the help keyword indicates that the linked to content provides context-sensitive help, providing information for the parent of the element defining the hyperlink, and its children. when used within <link>, the help is for the whole document. when inclu...
...And 4 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
racter (such as "." or ","). bgcolorobsolete since html5 a domstring specifying a color to apply to the backgrounds of each of the row's cells. this can be either an hexadecimal #rrggbb or #rgb value or a color keyword. omitting the attribute or setting it to null in javascript causes the row's cells to inherit the row's parent element's background color. the <tr> element should be
styled using css. to give a similar effect as the bgcolor attribute, use the css property background-color. charobsolete since html5 a domstring which sets the character to align the cells in each of the row's columns on (each row's centering that uses the same character gets aligned with others using the same character . typical values for this include a period (".") or comma (",") when att...
...cell span across two columns. once again, we haven't touched the css. table { border: 1px solid black; } th, td { border: 1px solid black; } result the output is entirely unchanged, despite the addition of useful contextual information under the hood: basic styling as is the case with all parts of a table, you can change the appearance of a table row and its contents using css. any
styles applied to the <tr> element will affect the cells within the row unless overridden by
styles applied to those cells. let's apply a basic
style to the table to adjust the typeface being used, and add a background color to the header row. result again, let's take a look at the result first. <table> <thead> <tr> <th rowspan="2">name</th> <th rowspan="2">id</th> <th co...
...solid black; font: 16px "open sans", helvetica, arial, sans-serif; } thead > tr { background-color: rgb(228, 240, 245); } th, td { border: 1px solid black; padding:4px 6px; } while we add a font property to the <table> element here to set a more visually-appealing typeface (or an an abominable sans-serif typeface, depending on your personal opinion), the interesting part is the second
style here, where we
style <tr> elements located within the <thead> so they have a light blue background color. this is a way to quickly apply a background color to all of the cells in the heading area at once. this does not affect the
style of the <th> elements in the first column, though, where we treat the member names as a row heading. advanced styling now we'll go all-out, with
styles on rows i...
...And 4 more matches
Using shadow DOM - Web Components
the shadow dom api is a key part of this, providing a way to attach a hidden separated dom to an element. this article covers the basics of using the shadow dom. note: shadow dom is supported by default in firefox (63 and onwards), chrome, opera, and safari. the new chromium-based edge (75 and onwards) supports it too; the old edge didn't. ...
...t the shadow dom is attached to. shadow tree: the dom tree inside the shadow dom. shadow boundary: the place where the shadow dom ends, and the regular dom begins. shadow root: the root node of the shadow tree. you can affect the nodes in the shadow dom in exactly the same way as non-shadow nodes — for example appending children or setting attributes, styling individual nodes using element.
style.foo, or adding
style to the entire shadow dom tree inside a <
style> element. the difference is that none of the code inside a shadow dom can affect anything outside it, allowing for handy encapsulation. note that the shadow dom is not a new thing by any means — browsers have used it for a long time to encapsulate the inner structure of an element. think for example of a <video> element, with t...
...'); // take attribute content and put it inside the info span let text = this.getattribute('data-text'); info.textcontent = text; // insert icon let imgurl; if(this.hasattribute('img')) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } let img = document.createelement('img'); img.src = imgurl; icon.appendchild(img); styling the shadow dom after that we create a <
style> element and populate it with some css to
style it: // create some css to apply to the shadow dom let
style = document.createelement('
style');
style.textcontent = ` .wrapper { position: relative; } .info { font-size: 0.8rem; width: 200px; display: inline-block; border: 1px solid black; padding: 10px; background: white; border-radius: 10px; opacity: 0; transition: 0.6s all; ...
...And 4 more matches
Modifying the Page Hosted by a Tab - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to modify the page hosted by a particular tab, load one or more content scripts into it using attach() method of tab object. the job of these scripts is to interact with web content. here's a simple example: var button = require("sdk/ui/button/action").actionbutton({ id: "
style-tab", label: "
style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscript: 'document.body.
style.border = "5px solid red";' }); } }); to run this example, save an icon file named "icon-16.png" in add-on's "data" directory. you could download this icon: . this add-on creates a button with mozilla favicon as an icon. it has a click handler which fetches the active tab and ...
.... this makes the code easier to maintain, debug, and review. to do this, provide option contentscriptfile not contentscript, whose value is a url pointing to one or more content script files. for example, if we save the script above under the add-on's data directory in a file called my-script.js: var self = require("sdk/self"); var button = require("sdk/ui/button/action").actionbutton({ id: "
style-tab", label: "
style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscriptfile: self.data.url("my-script.js") }); } }); you can load more than one script, and the scripts can interact directly with each other. so you can load jquery, and then your content script can use that. loading several content script files the data a...
...cript, tab.attach() returns a worker object containing the port property you use to send messages to the content script. let's rewrite the example above to pass a message from the add-on to the content script. ...
...And 3 more matches
Extension Theming Guidelines - Archive of obsolete content
guidelines on how to control the look and feel of your extension while leaving it open for styling by custom themes. skin packages just as extension code should exist in chrome content packages, all of the styling for an extension including css and images should exist in a chrome skin package. ...
...ving it open for styling by custom themes. skin packages just as extension code should exist in chrome content packages, all of the styling for an extension including css and images should exist in a chrome skin package. custom themes may then register a replacement for your skin package allowing them to provide their own
styles for all of your content. ...
... styling for an extension including css and images should exist in a chrome skin package. custom themes may then register a replacement for your skin package allowing them to provide their own
styles for all of your content. branding certain items of your extensions
style, in particular logos and icons can be kept in the chrome content package such that they are not replaceable by custom themes
stylesheets guidelines include
stylesheets for every new window that your extension adds and for every window that your extension overlays content into be sure to add a
stylesheet from your chrome skin package. ...
...And 3 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
es contains any created nodes that have optionally been captured (for later convenient javascript access) by giving them a 'key' attribute; for example: " + capturednodes.mytestbutton123); another example this here is another example of using jsontodom but in the html scope, a complex form is created with ease. ...
...a document fragment while removing any scripts or other unsafe content in the process. let { cc, ci } = require("chrome"); /** * safely parse an html fragment, removing any executable * javascript, and return a document fragment. * * @param {document} doc the document in which to create the * returned dom tree. * @param {string} html the html fragment to parse. ...
...ile removing any scripts or other unsafe content in the process. let { cc, ci } = require("chrome"); /** * safely parse an html fragment, removing any executable * javascript, and return a document fragment. * * @param {document} doc the document in which to create the * returned dom tree. * @param {string} html the html fragment to parse. ...
...And 3 more matches
JXON - Archive of obsolete content
}, "input": [{ "@type": "hidden", "@name": "instid", "@value": 1234 }, { "@type": "hidden", "@name": "currency", "@value": "gbp" }, { "@type": "hidden", "@name": "amount", "@value": 0 }, { "@type": "hidden", "@name": "name", "@value": "captured" }], "table": { "tr": [{ "th": { "@
style": "text-align: right;", "keyvalue": "product:" }, "td": { "span": [{ "input": { "@type": "radio", "@name": "nome", "@id": "rel_tshirt", "@value": "tshirt" }, "label": { "@for": "rel_tshirt", "keyvalue": "t-shirt" }, "@c...
...uct" }, { "input": { "@type": "radio", "@name": "nome", "@id": "rel_pullover", "@value": "pullover" }, "label": { "@for": "rel_pullover", "keyvalue": "pullover" }, "@class": "product" }] } }, { "th": { "@
style": "text-align: right;", "keyvalue": "quantity:" }, "td": { "input": { "@type": "text", "@name": "myinput", "@onkeypress": "return numbersonly(this, event);", "@onpaste": "return false;" } } }] }, "p": { "input": { "@type": "submit", "@value": "purchase!" ...
...otocheckfield, okeyevent) { return okeyevent.charcode === 0 || /\d/.test(string.fromcharcode(okeyevent.charcode)); } </script> <input type="hidden" name="instid" value="1234" /> <input type="hidden" name="currency" value="gbp" /> <input type="hidden" name="amount" value="0" /> <input type="hidden" name="name" value="captured" /> <table> <tr> <th
style="text-align: right;">product:</th> <td><span class="product"><input type="radio" name="nome" id="rel_tshirt" value="tshirt"/><label for="rel_tshirt">t-shirt</label></span><span class="product"><input type="radio" name="nome" id="rel_trousers" value="trousers"/><label for="rel_trousers">trousers</label></span><span class="product"><input type="radio" name="nome" id="rel_pullover" value="pu...
...And 3 more matches
Notes on HTML Reflow - Archive of obsolete content
n for each frame object that requires it. reflow may have the side-effect of creating new continuation frames, for example, for a text frame when the text must be wrapped. some reflows are immediate in response to user or script actions; for example, resizing the window or changing the document's default font. these are dispatched directly from the presentation shell (e.g., nsipresshell::
stylechangereflow), and affect the entire frame tree. other reflows are incremental and are dealt with asynchronously; for example, when content streams in from the network. incremental reflows are queued by the presentation shell for batched dispatch. reflow state the reflow state object, nshtmlreflowstate, is used to pass constraining information "down" from parent frames to child f...
...able width) have changed; instead, something "within" the frame has changed, which may have bottom-up impact to the frame hierarchy. resize, when the containing boundary for the frame hierarchy changes. during a resize reflow, the frame can assume that none of the frame's internal state (e.g., a text frame's text) has changed; instead, a top-down change in the layout constraints has occurred. ...
...ext) has changed; instead, a top-down change in the layout constraints has occurred.
stylechange, when the entire frame hierarchy must be traversed to recover from stylistic change; for example, a change in the default font size. dirty, when a container frame has consolidated several individual incremental reflows that have been targeted at its child frames. initial, incremental, resize, and
style change reflows may each be performed as an immediate "global" reflow from the presentation shell: an initial reflow is performed when the presentation shell is initialized to flow the shell's initial frame hierarchy. incremental reflows are dispatched en masse when the presentation shell's incremental reflow queue is asynchronously serviced. a resize reflow is performed when...
...And 3 more matches
New Skin Notes - Archive of obsolete content
ia wordpress skins need footer information. -- dria when a page is redirected, need to say-so and what it was redirected from, (see document for an example of such.) this is only an issue in mw1.5 so far. devmo skin vs cavendish skin --callek i can probably pull-off this patch if needed (quickly), so dria or others do not have to hunt up "how". --callek add "what not to do" css class to
stylesheet, as discussed on talk:core javascript 1.5 reference. what's the class called? --maian 21:08, 1 sep 2005 (pdt) in the new mw1.5 skin (not the one currently available here) there's class "wrong" and class "wrong-inline". those will be available after we do the wiki upgrades in the near future. --dria headers need a little padding. h1 could be smaller. --dria is it just me or visited li...
...omeone who uses devmo on regular basis sees some violet links just because he already worked with this site yesterday.also, the current color for visited links makes them less visible. --gandalf 00:45, 31 aug 2005 (pdt) i don't like the current color too, but i strongly disagree that we don't need to give visited links different color. this is not what user expects (well, i don't expect sites to
style visited and non-visited links the same), and it's false that other documentation sites do this (i just checked apple's and microsoft's sites). your statement that "it looks odd when someone who uses devmo on regular basis sees some violet links just because he already worked with this site yesterday" holds true for every single place on the web, yet visited links use different styling on most sit...
... so i think we'll just leave the internal/external links colours the same. ==dria you've got to be kidding me, the colors are clearly different (rgb(0,51,153) vs rgb(51,102,187)). --nickolay 09:19, 25 aug 2005 (pdt) (moving this to a new item) on the contrary, the list of categories current page belongs to, should be near the footer (see mdc:policies_and_guidelines page) (dria: fix catlinks
style) the arrows that appear if you select "enhanced recent changes" in your preferences have an ugly border around them. --nickolay 04:43, 25 aug 2005 (pdt) the radio buttons on history page are jumping in a weird way because the selected row becomes bold. --nickolay 04:46, 25 aug 2005 (pdt) the sidebar overrides content on diff pages --nickolay turns out this was fixed for 1.5 already. --dri...
...And 3 more matches
Anonymous Content - Archive of obsolete content
d the textfield within an html file upload control, then the file upload control is now also focused. if the user then focuses the button inside the file upload control, the focus event generated for the button is stopped before it reaches the file control, since the file control is already focused. because content in multiple scopes can be focused, the css :focus pseudo-element is hierarchical.
style rules can be written with the assumption that they will match (in the above example) both the file control and the element focused inside the file control. in other words, an arbitrary chain of elements can be in the :focus state at the same time. mouseover and mouseout events mouseover and mouseout events are retargeted if the mouse genuinely enters or exits the bound element (in addition to e...
...lso have an arbitrary set of anonymous parents (created by bindings when child insertion points were used). child, descendant, and sibling selectors will match on any path of anonymous and explicit elements. as far as css is concerned, anonymous content nodes are children (or descendants) of the bound element, they are ancestors of explicit content, and they are siblings of the explicit content.
style rules using the child, descendant, or sibling selectors transparently cross bind scopes and operate on the altered and original content models. the final modified content tree determines how css properties (e.g., fonts and colors) are inherited. an element either ends up underneath its explicit parent (just as in the content model), or it ends up being nested through a series of insertion points...
...oss bind scopes and operate on the altered and original content models. the final modified content tree determines how css properties (e.g., fonts and colors) are inherited. an element either ends up underneath its explicit parent (just as in the content model), or it ends up being nested through a series of insertion points. when nested, it inherits from the innermost anonymous parent. ...
...And 3 more matches
Things I've tried to do with XUL - Archive of obsolete content
he window is unfortunately very difficult. (to add insult, xul layout code *explicitly* trims off '%' from width/height, thus treating it as pixels.) for reference, i'd like the following to give a vbox that resizes along with the window, with the green, red, and blue inside boxes always maintaining a 30%-20%-50% ratio to the height of the parent vbox. ...
..., xul layout code *explicitly* trims off '%' from width/height, thus treating it as pixels.) for reference, i'd like the following to give a vbox that resizes along with the window, with the green, red, and blue inside boxes always maintaining a 30%-20%-50% ratio to the height of the parent vbox. ...
.../height, thus treating it as pixels.) for reference, i'd like the following to give a vbox that resizes along with the window, with the green, red, and blue inside boxes always maintaining a 30%-20%-50% ratio to the height of the parent vbox. ...
...And 3 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
each calls the 'showtitle' method. this method checks to see whether the element is be...
...each calls the 'showtitle' method. this method checks to see whether the element is being hidden or shown from the 'state' parameter that is passed in. in either case, it grabs the first element ...
... used to change the visibility of the label. each calls the 'showtitle' method. this method checks to see whether the element is being hidden or shown from the 'state' parameter that is passed in. in either case, it grabs the first element of the anonymous array. this refers to the first child in the content element, which here is the first label widget. the visibility is changed by modifying the
style on the element. accessing from inside the anonymous content to go the other way, and get the bound element from inside the anonymous content, you can use the getbindingparent method of the document to get the element that the binding is bound to. you can also use the the parentnode property to go up by a single node, but the getbindingparent method is useful for a node that is nested several le...
...And 3 more matches
XUL element attributes - Archive of obsolete content
the elements are aligned on their left edges. center the elements are centered horizontally. right the elements are aligned on their right edges. the pack attribute is related to the alignment but is used to specify the position in the opposite direction. you can also specify the value of align using the
style property -moz-box-align. allowevents type: boolean if true, events are passed to children of the element. otherwise, events are passed to the element only. allownegativeassertions type: boolean valid on any element that has a datasources attribute. when multiple datasources are used, one may override an assertion from another. this attribute, if true, which is the default,...
...ssed to children of the element. otherwise, events are passed to the element only. allownegativeassertions type: boolean valid on any element that has a datasources attribute. when multiple datasources are used, one may override an assertion from another. this attribute, if true, which is the default, allows a datasource to negate an earlier assertion. class type: string the
style class of the element. multiple classes may be specified by separating them with spaces. coalesceduplicatearcs type: boolean valid on any element that has a datasources attribute. when multiple datasources are used, one may override an assertion from another. this attribute, if true, which is the default, allows a datasource to negate an earlier assertion. collapsed type: boolean ...
...r maximum height. the css height property may also be used. hidden type: boolean if set to true, the element is not displayed. this is similar to setting the css display property to 'none'. id type: unique id a unique identifier so that you can identify the element with. you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in
style sheets. insertafter type: id when an element is in an overlay, the insertafter attribute specifies the id of the element in the base window that the element should appear after. this attribute overrides the insertbefore attribute. this value may be a comma-separated list of ids, which are scanned and the first one found in the window is used. insertbefore type: id when an elem...
...And 3 more matches
splitter - Archive of obsolete content
element which should appear before or after an element inside a container. when the splitter is dragged, the sibling elements of the splitter are resized. if a grippy is placed inside the splitter, one sibling element of the splitter is collapsed when the grippy is clicked. more information is available in the xul tutorial. attributes collapse, resizeafter, resizebefore, state, substate
style classes tree-splitter examples <!-- this bar has some styling associated with it. the vbox is used to hold the .png image that a user clicks on to resize the search bar.--> <splitter tooltiptext="resize the search box" oncommand="alert('the splitter was dragged')"> <vbox id="example_vbox" /> </splitter> attributes collapse type: one of the values below determines which sid...
...t or above the splitter resizes. farthest the element that is the farthest away from the splitter to the left or above the splitter resizes. flex the closest flexible element resizes. state type: one of the values below indicates whether the splitter has collapsed content or not. this attribute will be updated automatically as the splitter is moved, and is generally used in a
stylesheet to apply a different appearance for each state. open the content either before or after the splitter, depending on the value of the collapsed attribute, is currently displayed. collapsed the content either before or after the splitter is collapsed and is not visible. dragging the user is current adjusting the position of the splitter, typically by dragging it with the mouse. ...
...fter the splitter is collapsed. ...
...And 3 more matches
Summary of Changes - Archive of obsolete content
document.forms["formname"].formctrlname ie5+ document.forms(0) dom level 1: document.forms[0] ie elemref.innertext dom level 1 (core) interface we could introduce dom 3 core textcontent attribute here which is supported by mozilla 1.5+ and is a perfect equivalent to innertext. ...
... ie5+ document.forms(0) dom level 1: document.forms[0] ie elemref.innertext dom level 1 (core) interface we could introduce dom 3 core textcontent attribute here which is supported by mozilla 1.5+ and is a perfect equivalent to innertext. ...
...evel 1: document.forms[0] ie elemref.innertext dom level 1 (core) interface we could introduce dom 3 core textcontent attribute here which is supported by mozilla 1.5+ and is a perfect equivalent to innertext. ...
...And 3 more matches
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
this led to a number of workarounds which were designed to cater to these bugs, and also to gecko-based browsers emulating the behavior in some cases. ...
...m parent elements. find out why this happens and how to fix it in documents that have to remain in quirks mode. in version 4 browsers such as netscape navigator 4.x and internet explorer 4.x, tables generally "broke" the inheritance of font styling. if the author had set a font size on the body element, for example, the font size of text within a table would match the user's default, not the body
style. this led to a number of workarounds which were designed to cater to these bugs, and also to gecko-based browsers emulating the behavior in some cases. fortunately, the behavior can be overcome in all cases with a single css2 rule. tables and inheritance in css terms, tables are like any other element when it comes to inheritance. if a css property can be inherited, then table elements and thei...
...rs emulating the behavior in some cases. fortunately, the behavior can be overcome in all cases with a single css2 rule. tables and inheritance in css terms, tables are like any other element when it comes to inheritance. if a css property can be inherited, then table elements and their components (tr, td, etc.) should inherit just as any other element would. for example, if an author writes: <
style type="text/css"> body {font-size: 11px;} </
style> ...then the text inside table cells should also be 11 pixels in size. browsers from the version-four era, however, treated tables differently. in these browsers, a table's text would be the same size as the user's default settings, regardless of the css assigned to ancestor elements such as body. this represented a violation of css inheritance r...
...And 3 more matches
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
summary: thanks to long-standing limitations, we're used to thinking of hover
styles as applying only to hyperlinks, which has led to some sloppy authoring practices that are now causing problems for some web sites. this technote explains the source of the problems and how to avoid encountering them. many authors make use of the css2 pseudo-class :hover to
style their links. this innovation, first introduced by microsoft® internet explorer and later adopted into the css specification, is very popular for the styling of text links, particularly those that are supposed to look and act like javascript-driven "rollovers." however, advancing css support in browsers has caused some unexpectedly aggressive hovering behavior on some pages. hover and non-link elements section 5.11.3 of css2 defines ...
...tates are entered and left. scripting may change whether elements react to user events or not, and different devices and uas may have different ways of pointing to, or activating elements. thus, although authors are used to thinking of these states as applying exclusively to hyperlinks, they are not so restricted by css2. any element can, in theory, be in any of the three states, and thus can be
styled based on those states. this has not traditionally been the case. bare pseudo-classes the second piece of the problem comes when we consider the effects of a "bare" pseudo-class in a selector. for example: :hover {color: red;} this is equivalent to the css2 rule: *:hover {color: red;} ..which translates as "any element that is being hovered should have its foreground colored red." thus, hov...
...r.html" class="nav">three</a> | <a href="fou.html" class="nav">four</a> </td> because the enclosing table cell has a class of nav, the vertical-bar characters will turn red when the user moves the mouse pointer anywhere within the table cell. the links will also turn red when they are hovered. gecko behavior in browsers based on netscape gecko builds later than 20020410 (netscape 6.1+), :hover
styles can be applied to any element in a document. thus authors who have used bare pseudo-classes, or bare class-pseudo-class combinations, are at risk of seeing hover
styles applied to more than just their links. the most reliable fix is to add the anchor element to the selectors, like this: a:hover {color: red;} a.nav:hover {color: red;} in an attempt to avoid causing problems for legacy documents...
...And 3 more matches
Create the Canvas and draw on it - Game development
the <canvas> element. the game's html the html document structure is quite simple, as the game will be rendered entirely on the <canvas> element. using your favourite text editor, create a new html document, save it as index.html, in a sensible location, and add the following code to it: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>gamedev canvas workshop</title> <
style> * { padding: 0; margin: 0; } canvas { background: #eee; display: block; margin: 0 auto; } </
style> </head> <body> <canvas id="mycanvas" width="480" height="320"></canvas> <script> // javascript code goes here </script> </body> </html> we have a charset defined, <title> and some basic css in the header. the body contains <canvas> and <script> elements — we will render the ga...
... <canvas> element to the canvas variable. then we're creating the ctx variable to store the 2d rendering context — the actual tool we can use to paint on the canvas. let's see an example piece of code that prints a red square on the canvas. add this below your previous lines of javascript, then load your index.html in a browser to try it out. ctx.beginpath(); ctx.rect(20, 40, 50, 50); ctx.fill
style = "#ff0000"; ctx.fill(); ctx.closepath(); all the instructions are between the beginpath() and closepath() methods. we are defining a rectangle using rect(): the first two values specify the coordinates of the top left corner of the rectangle on the canvas, while the second two specify the width and height of the rectangle. in our case the rectangle is painted 20 pixels from the left side of the...
... defining a rectangle using rect(): the first two values specify the coordinates of the top left corner of the rectangle on the canvas, while the second two specify the width and height of the rectangle. in our case the rectangle is painted 20 pixels from the left side of the screen and 40 pixels from the top side, and is 50 pixels wide and 50 pixels high, which makes it a perfect square. ...
...And 3 more matches
Web fonts - Learn web development
.ttf, .woff, .woff2, etc.; the exact fonts provided will be updated over time as browser support requirements change). as mentioned above, multiple fonts are needed for cross browser support — this is fontsquirrel's way of making sure you've got everything you need. a demo html file for each font — load these in your browser to see what the font will look like in different usage contexts. ...
...ing sure you've got everything you need. a demo html file for each font — load these in your browser to see what the font will look like in different usage contexts. a
stylesheet.css file, which contains the generated @font-face code you'll need. to implement these fonts in your demo, follow these steps: rename the unzipped directory to something easy and simple, like fonts. open up the
stylesheet.css file and copy both the @font-face blocks contained inside into your web-font-start.css file — you need to put them at the very top, before any of your css, as the fonts need to be imported before you can use them on your site. each of the url() functions points to a font file that we want to import into our css — we need to make sure the paths to the files are correct, so add fonts/...
...let's go through it to see what it does: font-family: this line specifies the name you want to refer to the font as. you can put this as anything you like, as long as you use it consistently throughout your css. sr...
...And 3 more matches
What are browser developer tools? - Learn web development
lts of your changes reflected live in the browser viewport. if you don't see the inspector, tap/click the inspector tab. in internet explorer, tap/click dom explorer, or press ctrl + 1. in microsoft edge, or opera, tap/click elements. in safari, the controls are not so clearly presented, but you should see the html if you haven't selected something else to appear in the window. press the
style button to see the css. exploring the dom inspector for a start, right-click (ctrl-click) an html element in the dom inspector and look at the context menu. the available menu options vary among browsers, but the important ones are mostly the same: delete node (sometimes delete element). deletes the current element. edit as html (sometimes add attribute/edit text). lets you change the htm...
...s applied to the current element are shown in order of most-to-least-specific. click the checkboxes next to each declaration to see what would happen if you removed the declaration. click the little arrow next to each shorthand property to show the property's longhand equivalents. click a property name or value to bring up a text box, where you can key in a new value to get a live preview of a
style change. next to each rule is the file name and line number the rule is defined in. clicking that rule causes the dev tools to jump to show it in its own view, where it can generally be edited and saved. you can also click the closing curly brace of any rule to bring up a text box on a new line, where you can write a completely new declaration for your page. you'll notice a number of clickable...
...defined in. clicking that rule causes the dev tools to jump to show it in its own view, where it can generally be edited and saved. you can also click the closing curly brace of any rule to bring up a text box on a new line, where you can write a completely new declaration for your page. you'll notice a number of clickable tabs at the top of the css viewer: computed: this shows the computed
styles for the currently selected element (the final, normalized values that the browser applies). layout: in firefox, this area includes two sections: box model: represents visually the current element's box model, so you can see at a glance what padding, border and margin is applied to it, and how big its content is. grid: if the page you are inspecting uses css grid, this section allows yo...
...And 3 more matches
Client-side form validation - Learn web development
e. pattern: specifies a regular expression that defines a pattern the entered data needs to follow. if the data entered in a form field follows all of the rules specified by the above attributes, it is considered valid. if not, it is considered invalid. when an element is valid, the following things are true: the element matches the :valid css pseudo-class, which lets you apply a specific
style to valid elements. if the user tries to send the data, the browser will submit the form, provided there is nothing else stopping it from doing so (e.g., javascript). when an element is invalid, the following things are true: the element matches the :invalid css pseudo-class, and sometimes other ui pseudo-classes (e.g., :out-of-range) depending on the error, which lets you apply a specific s...
... <option>lemon</option> <option>orange</option> </datalist> </p> <p> <label for="t2">what's your e-mail address?</label> <input type="email" id="t2" name="email"> </p> <p> <label for="t3">leave a short message</label> <textarea id="t3" name="msg" maxlength="140" rows="5"></textarea> </p> <p> <button>submit</button> </p> </form> and now some css to
style the html: form { font: 1em sans-serif; max-width: 320px; } p > label { display: block; } input[type="text"], input[type="email"], input[type="number"], textarea, fieldset { width : 100%; border: 1px solid #333; box-sizing: border-box; } input:invalid { box-shadow: 0 0 5px 1px red; } input:focus:invalid { box-shadow: none; } this renders as follows: see validation-related ...
...alidate attribute to turn off the browser's automatic validation; this lets our script take control over validation. however, this doesn't disable support for the constraint validation api nor the application of css pseudo-classes like :valid, etc. that means that even though the browser doesn't automatically check the validity of the form before sending its data, you can still do it yourself and
style the form accordingly. our input to validate is an <input type="email">, which is required, and has a minlength of 8 characters. let's check these using our own code, and show a custom error message for each one. we are aiming to show the error messages inside a <span> element. the aria-live attribute is set on that <span> to make sure that our custom error message will be presented to everyone,...
...And 3 more matches
Advanced text formatting - Learn web development
d> <dt>monologue</dt> <dd>in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present.</dd> <dt>aside</dt> <dd>in drama, where a character shares a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought, or piece of additional background information.</dd> </dl> the browser default
styles will display description lists with the descriptions indented somewhat from the terms. note that it is permitted to have a single term with multiple descriptions, for example: <dl> <dt>aside</dt> <dd>in drama, where a character shares a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought, or piece of additional background information.</dd> ...
...description lists; add elements to the raw text in the input field so that it appears as a description list in the output field. you could try using your own terms and descriptions if you like. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see the answer. playable code <h2>live output</h2> <div class="output"
style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input"
style="min-height: 100px; width: 95%"> bacon the glue that binds the world together. eggs the glue that binds the cake together. coffee the drink that gets the world running in the morning. a light brown col...
... active learning: who said that? time for another active learning example! in this example we'd like you to: turn the middle paragraph into a blockquote, which includes a cite attribute. turn "the need to eliminate negative self talk" in the third paragraph into an inline quote, and include a cite attribute. wrap the title of each source in <cite> tags and turn...
...And 3 more matches
Adding vector graphics to the Web - Learn web development
eate a variety of illustrations using various graphics tools, and create approximations of photos (for example inkscape's trace bitmap feature.) svg has some additional advantages besides those described so far: text in vector images remains accessible (which also benefits your seo). svgs lend themselves well to styling/scripting, because each component of the image is an element that can be
styled via css or scripted via javascript. so why would anyone want to use raster graphics over svg? well, svg does have some disadvantages: svg can get complicated very quickly, meaning that file sizes can grow; complex svgs can also take significant processing time in the browser. svg can be harder to create than raster images, depending on what kind of image you are trying to create. svg is n...
...alent available in the alt attribute. you can make the image into a hyperlink easily by nesting the <img> inside an <a> element. the svg file can be cached by the browser, resulting in faster loading times for any page that uses the image loaded in the future. cons you cannot manipulate the image with javascript. if you want to control the svg content with css, you must include inline css
styles in your svg code. (external
stylesheets invoked from the svg file take no effect.) you cannot re
style the image with css pseudoclasses (like :focus). troubleshooting and cross-browser support for browsers that don't support svg (ie 8 and below, android 2.3 and below), you could reference a png or jpg from your src attribute and use a srcset attribute (which only recent browsers recognize) to...
... and ends with the <svg></svg> tags (don't include anything outside those.) here's a very simple example of what you might paste into your document: <svg width="300" height="200"> <rect width="100%" height="100%" fill="green" /> </svg> pros putting your svg inline saves an http request, and therefore can reduce a bit your loading time. ...
...And 3 more matches
Introducing asynchronous JavaScript - Learn web development
n the ui somehow that's because you don't know how long the image will take to download, so when you come to run the second line it will throw an error (possibly intermittently, possibly every time) because the response is not yet available. instead, you need your code to wait until the response is returned before it tries to do anything else to it. there are two main types of asynchronous code
style you'll come across in javascript code, old-
style callbacks and newer promise-
style code. in the below sections we'll review each of these in turn. async callbacks async callbacks are functions that are specified as arguments when calling a function which will start executing code in the background. when the background code finishes running, it calls the callback function to let you know the wor...
...ndex){ console.log(index + '. ' + eachname); }); in this example we loop through an array of greek gods and print the index numbers and values to the console. the expected parameter of foreach() is a callback function, which itself takes two parameters, a reference to the array name and index values. however, it doesn't wait for anything — it runs immediately. promises promises are the new
style of async code that you'll see used in modern web apis. a good example is the fetch() api, which is basically like a modern, more efficient version of xmlhttprequest. let's look at a quick example, from our fetching data from the server article: fetch('products.json').then(function(response) { return response.json(); }).then(function(json) { products = json; initialize(); }).catch(function(...
... them fully yet. the event queue async operations like promises are put into an event queue, which runs after the main thread has finished processing so that they do not block subsequent javascript code from running. the queued operations will complete as soon as possible then return their results to the javascript environment. ...
...And 3 more matches
Client-side storage - Learn web development
em is stored in web storage if(localstorage.getitem('name')) { // if it is, display personalized greeting let name = localstorage.getitem('name'); h1.textcontent = 'welcome, ' + name; personalgreeting.textcontent = 'welcome to our website, ' + name + '! ...
...rage.getitem('name')) { // if it is, display personalized greeting let name = localstorage.getitem('name'); h1.textcontent = 'welcome, ' + name; personalgreeting.textcontent = 'welcome to our website, ' + name + '! ...
...if we don't do this, then the personalized greeting will not persist across page reloads. ...
...And 3 more matches
Useful string methods - Learn web development
? you'll then need to write a conditional test of the form operand1 operator operand2. is the thing on the left equal to the thing on the right? or in this case, does the method call on the left return the result on the right? hint: in this case it is probably more useful to test whether the method call isn't equal to a certain result. ...
...right? hint: in this case it is probably more useful to test whether the method call isn't equal to a certain result. ...
...per case. store the result of this replace procedure in another new variable. change the value of the result variable to equal to the final result, not the input. note: a hint — the parameters of the string methods don't have to be string literals; they can also be variables, or even variables with a method being invoked on them. ...
...And 3 more matches
HTMLLinkElement - Web APIs
the htmllinkelement interface represents reference information for external resources and the relationship of those resources to a document and vice-versa (corresponds to <link> element; not to be confused with <a>, which is represented by htmlanchorelement). this object inherits all of the properties and methods of the htmlelement interface. ...
... those resources to a document and vice-versa (corresponds to <link> element; not to be confused with <a>, which is represented by htmlanchorelement). this object inherits all of the properties and methods of the htmlelement interface. ...
...th="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmllinkelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement, and link
style. htmllinkelement.as is a domstring representing the type of content being loaded by the html link. htmllinkelement.crossorigin is a domstring that corresponds to the cors setting for this link element. see cors settings attributes for details. htmllinkelement.disabled is a boolean which represents whether the link is disabled; currently only used with
style sheet links. htmllinkeleme...
...And 3 more matches
Multi-touch interaction - Web APIs
f this application is available on github. the source code is available on github; pull requests and bug reports are welcome. example this example demonstrates using pointer events' various event types (pointerdown, pointermove, pointerup pointercancel, etc.) for different multi-touch interactions. define touch targets the application uses <div> to define three different touch target areas. <
style> div { margin: 0em; padding: 2em; } #target1 { background: white; border: 1px solid black; } #target2 { background: white; border: 1px solid black; } #target3 { background: white; border: 1px solid black; } </
style> global state to support multi-touch interaction, preserving a pointer's event state during various event phases is required. this ap...
...nt. function pointermove_handler(ev) { // note: if the user makes more than one "simultaneous" touch, most browsers // fire at least one pointermove event and some will fire several pointermoves. // // this function sets the target element's border to "dashed" to visually // indicate the target received a move event. if (logevents) log("pointermove", ev); update_background(ev); ev.target.
style.border = "dashed"; } pointer up the pointerup event is fired when a pointer is raised from the contact surface. when this occurs, the event is removed from the associated event cache. in this application, this handler is also used for pointercancel, pointerleave and pointerout events. function pointerup_handler(ev) { if (logevents) log(ev.type, ev); // remove this touch point from the ca...
...ace. when this occurs, the event is removed from the associated event cache. in this application, this handler is also used for pointercancel, pointerleave and pointerout events. ...
...And 3 more matches
Storage - Web APIs
ey's value if it already exists. storage.removeitem() when passed a key name, will remove that key from the storage. storage.clear() when invoked, will empty all keys out of the storage. examples here we access a storage object by calling localstorage. we first test whether the local storage contains data items using !localstorage.getitem('bgcolor'). ...
... key from the storage. storage.clear() when invoked, will empty all keys out of the storage. examples here we access a storage object by calling localstorage. we first test whether the local storage contains data items using !localstorage.getitem('bgcolor'). if it does, we run a function called set
styles() that grabs the data items using storage.getitem() and uses those values to update page
styles. ...
...bject by calling localstorage. we first test whether the local storage contains data items using !localstorage.getitem('bgcolor'). if it does, we run a function called set
styles() that grabs the data items using storage.getitem() and uses those values to update page
styles. if it doesn't, we run another function, populatestorage(), which uses storage.setitem() to set the item values, then runs set
styles(). ...
...And 3 more matches
Multi-touch interaction - Web APIs
nd pull requests and bug reports are welcome. example this example demonstrates using the touchstart, touchmove, touchcancel, and touchend) touch events for the following gestures: single touch, two (simultaneous) touches, more than two simultaneous touches, 1-finger swipe, and 2-finger move/pinch/swipe. define touch targets the application uses <div> elements to represent four touch areas. ...
... // log events flag var logevents = false; // touch point cache var tpcache = new array(); register event handlers event handlers are registered for all four touch event types. ...
...it also calls preventdefault() to keep the browser from applying further event handling (for example, mouse event emulation). function start_handler(ev) { // if the user makes simultaneous touches, t...
...And 3 more matches
Creating a cross-browser video player - Developer guides
this article describes a simple html5 video player that uses the media and fullscreen apis and works across most major desktop and mobile browsers. as well as working fullscreen, the player features custom controls rather than just using the browser defaults. the player controls themselves won't be
styled beyond the basics required to get them working; full styling of the player will be taken care of in a future article. working example our example video player displays a clip from an open source movie called tears of steel, and includes typical video controls. note: you can see the example running live, or check out the source code on github. html markup to start off with, let's take a look at the html that makes up the player. the video first of all the <video> element is...
...so in html, which will be used to control the video. the control set most browser's default video controls have the following functionality: play/pause mute volume control progress bar skip ahead go fullscreen the custom control set will also support this functionality, with the addition of a stop button. once again the html is quite straightforward, using an unordered list with list-
style-type:none set to enclose the controls, each of which is a list item with float:left. for the progress bar, the progress element is taken advantage of, with a fallback provided for browsers that don't support it (e.g. ie8 and ie9). this list is inserted after the <video> element, but inside the <figure> element (this is important for the fullscreen functionality, which is explained later on). <ul...
...ntainer = document.getelementbyid('videocontainer'); var video = document.getelementbyid('video'); var videocontrols = document.getelementbyid('video-controls'); as mentioned earlier, the browser's default controls now need to be disabled, and the custom controls need to be displayed: // hide the default controls video.controls = false; // display the user defined video controls videocontrols.
style.display = 'block'; with that done, a variable pointing to each of the buttons is now required: var playpause = document.getelementbyid('playpause'); var stop = document.getelementbyid('stop'); var mute = document.getelementbyid('mute'); var volinc = document.getelementbyid('volinc'); var voldec = document.getelementbyid('voldec'); var progress = document.getelementbyid('progress'); var progres...
...And 3 more matches
Rich-Text Editing in Mozilla - Developer guides
t an entire line (indenting). when using contenteditable, calling execcommand will affect the currently active editable element. ...
...(indenting). when using contenteditable, calling execcommand will affect the currently active editable element. internet explorer differences one major difference between mozilla and internet explorer that affects designmode is the generated code in the editable document: while internet explorer uses html tags (em, i, etc), mozilla 1.3 will generate by default spans with inline
style rules. ...
...ences one major difference between mozilla and internet explorer that affects designmode is the generated code in the editable document: while internet explorer uses html tags (em, i, etc), mozilla 1.3 will generate by default spans with inline
style rules. the
stylewithcss command can be used to toggle between css and html markup creation. ...
...And 3 more matches
HTML attribute reference - HTML: Hypertext Markup Language
with the public key. charset <meta>, <script> declares the character encoding of the page or script. checked <command>, <input> indicates whether the element should be checked on page load. cite <blockquote>, <del>, <ins>, <q> contains a uri which points to the source of the quote or change. class global attribute often used with css to
style elements with common properties. code <applet> specifies the url of the applet's class file to be loaded and executed. codebase <applet> this attribute gives the absolute or relative url of the directory where applets' .class files referenced by the code attribute are stored. color <basefont>, <font>, <hr> this attribute sets the text color using ...
...lower bound of the upper range. href <a>, <area>, <base>, <link> the url of a linked resource. hreflang <a>, <area>, <link> specifies the language of the linked resource. http-equiv <meta> defines a pragma directive. icon <command> specifies a picture which represents the command. id global attribute often used with css to
style a specific element. the value of this attribute must be unique. importance <iframe>, <img>, <link>, <script> indicates the relative fetch priority for the resource. integrity <link>, <script> specifies a subresource integrity value that allows browsers to verify what they fetch. intrinsicsize <img> this attribute tells the browser to ignor...
...lete, use <link rel="manifest"> instead. max <input>, <meter>, <progress> indicates the maximum value allowed. maxlength <input>, <textarea> defines the maximum number of characters allowed in the element. minlength <input>, <textarea> defines the minimum number of characters allowed in the element. media <a>, <area>, <link>, <source>, <
style> specifies a hint of the media for which the linked resource was designed. method <form> defines which http method to use when submitting the form. can be get (default) or post. min <input>, <meter> indicates the minimum value allowed. multiple <input>, <select> indicates whether multiple values can be entered in an input of the type email or file. ...
...And 3 more matches
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
n echoed back to the user by the system. see echoed input, below, for an example. nesting a <samp> element inside a <kbd> element, on the other hand, represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen. see the example under representing onscreen input options below. you can define a custom
style to override the browser's default font selection for the <kbd> element, although the user's preferences may potentially override your css. examples basic example <p>use the command <kbd>help mycommand</kbd> to view documentation for the command "mycommand".</p> representing keystrokes within an input to describe an input comprised of multiple keystrokes, you can nest multiple <kbd> eleme...
...sic example <p>use the command <kbd>help mycommand</kbd> to view documentation for the command "mycommand".</p> representing keystrokes within an input to describe an input comprised of multiple keystrokes, you can nest multiple <kbd> elements, with an outer <kbd> element representing the overall input and each individual keystroke or component of the input enclosed within its own <kbd>. un
styled first, let's look at what this looks like as just plain html. html <p>you can also create a new document using the keyboard shortcut <kbd><kbd>ctrl</kbd>+<kbd>n</kbd></kbd>.</p> this wraps the entire key sequence in an outer <kbd> element, then each individual key within its own, in order to denote the components of the sequence. note: you don't need to do all this wrapping; you can choose...
...bd>.</p> this wraps the entire key sequence in an outer <kbd> element, then each individual key within its own, in order to denote the components of the sequence. note: you don't need to do all this wrapping; you can choose to simplify it by leaving out the external <kbd> element. in other words, simplifying this to just <kbd>ctrl</kbd>+<kbd>n</kbd> would be perfectly valid. ...
...And 3 more matches
CSP: default-src - HTTP
ttp content-security-policy (csp) default-src directive serves as a fallback for the other csp fetch directives. ...
...-security-policy (csp) default-src directive serves as a fallback for the other csp fetch directives. ...
... (csp) default-src directive serves as a fallback for the other csp fetch directives. ...
...And 3 more matches
Intl.DateTimeFormat() constructor - JavaScript
ng", "mymr", "orya", "tamldec", "telu", "thai", "tibt". ca calendar. possible values include: "buddhist", "chinese", "coptic", "ethiopia", "ethiopic", "gregory", "hebrew", "indian", "islamic", "iso8601", "japanese", "persian", "roc". hc hour cycle. possible values include: "h11", "h12", "h23", "h24". options optional an object with some or all of the following properties: date
style the date formatting
style to use when calling format(). possible values include: "full" "long" "medium" "short" time
style the time formatting
style to use when calling format(). possible values include: "full" "long" "medium" "short" fractionalseconddigits the number of fractional seconds to apply when calling format(). valid values are 0-3. c...
...ations to find the best match. two algorithms are available for this negotiation and selected by the formatmatcher property: a fully specified "basic" algorithm and an implementation-dependent "best fit" algorithm. weekday the representation of the weekday. possible values are: "long" (e.g., thursday) "short" (e.g., thu) "narrow" (e.g., t). two weekdays may have the same narrow
style for some locales (e.g. tuesday's narrow
style is also t). era the representation of the era. possible values are: "long" (e.g., anno domini) "short" (e.g., ad) "narrow" (e.g., a) year the representation of the year. possible values are: "numeric" (e.g., 2012) "2-digit" (e.g., 12) month the representation of the month. possible values are: "...
... domini) "short" (e.g., ad) "narrow" (e.g., a) year the representation of the year. possible values are: "numeric" (e.g., 2012) "2-digit" (e.g., 12) month the representation of the month. possible values are: "numeric" (e.g., 2) "2-digit" (e.g., 02) "long" (e.g., march) "short" (e.g., mar) "narrow" (e.g., m). two months may have the same narrow
style for some locales (e.g. may's narrow
style is also m). day the representation of the day. possible values are: "numeric" (e.g., 1) "2-digit" (e.g., 01) hour the representation of the hour. possible values are "numeric", "2-digit". minute the representation of the minute. possible values are "numeric", "2-digit". second the representation of the second. possible...
...And 3 more matches
Authoring MathML - MathML
<head> <title>mathml in html5</title> </head> <body> <h1>mathml in html5</h1> <p> square root of two: <math> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> content mathml is not supported by browsers. it's recommended to convert your content mathml markup into presentation mathml before publishing it, for example with the help of the ctop.xsl
stylesheet. tools mentioned on this page generates presentation mathml. fallback for browsers without mathml support unfortunately, some browsers are not able to render mathml equations or only have a limited support. hence you will need to use a mathml polyfill to provide some fallback rendering. if you need only basic mathematical constructions such as those used on this mdn wiki then a small mathm...
... tools mentioned on this page generates presentation mathml. fallback for browsers without mathml support unfortunately, some browsers are not able to render mathml equations or only have a limited support. hence you will need to use a mathml polyfill to provide some fallback rendering. if you need only basic mathematical constructions such as those used on this mdn wiki then a small mathml.css
stylesheet might be enough. to use it, just insert one line in your document header: <script src="https://fred-wang.github.io/mathml.css/mspace.js"></script> if you need more complex constructions, you might instead consider using the heavier mathjax library as a mathml polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> note that these two scripts perform featur...
...and webkit). note that ua string sniffing is not the most reliable method and might break from version to version: var ua = navigator.useragent; var isgecko = ua.indexof("gecko") > -1 && ua.indexof("khtml") === -1 && ua.indexof('trident') === -1; var iswebkit = ua.indexof('applewebkit') > -1 && ua.indexof('chrome') === -1; mathematical fonts in order to get a good layout or to allow different
style, it's important to have mathematical fonts available. it's always good to provide a link to mdn's font instructions, so that your visitors can verify whether they have appropriate fonts installed on their system. it's also good to provide a fallback with web fonts. prior to gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28), it was a bit tedious to setup math fonts, see the font instr...
...And 3 more matches
Animation performance and frame rate - Web Performance
as they give the browser more control over when to render frames, and to drop frames if necessary. however, the performance cost of modifying a css property can vary from one property to another. it's commonly accepted that 60 frames per second is the rate at which animations will appear smooth. ...
...this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. ...
...animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. the rendering waterfall the process a browser uses to paint changes to a page when an element is animating css properties can be described as a waterfall consisting of the following steps: recalculate
style: when a property for an element changes, the browser must recalculate computed
styles. layout: next, the browser uses the computed
styles to figure out the position and geometry for the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence: the page may be split into layers, which are painted independently and then combined in a proc...
...And 3 more matches
Progressive loading - Progressive web apps (PWAs)
is all about deferring loading of as many resources as possible (html, css, javascript), and only loading those immediately that are really needed for the very first experience. bundling versus splitting many visitors won't go through every single page of a website, yet the usual approach is to bundle every feature we have into one big file. a bundle.js file can be many megabytes, and a single
style.css bundle can contain everything from basic css structure definitions to all the possible
styles of every version of the site: mobile, tablet, desktop, print only, etc. it is faster to load all that information as one file rather than many small ones, but if the user doesn't need everything at the very beginning, we could load only what's crucial and then manage other resources when needed. re...
... website access and completion of loading, the user sees a blank page, which is a bad experience. to fix that we can, for example, add defer to javascript files: <script src="app.js" defer></script> they will be downloaded and executed after the document itself has been parsed, so it won't block rendering the html structure. ...
...d completion of loading, the user sees a blank page, which is a bad experience. to fix that we can, for example, add defer to javascript files: <script src="app.js" defer></script> they will be downloaded and executed after the document itself has been parsed, so it won't block rendering the html structure. ...
...And 3 more matches
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
modern browsers support using svg within css
styles to apply graphical effects to html content. you may specify svg in
styles either within the same document or an external
style sheet. there are 3 properties you can use: mask, clip-path, and filter. note: references to svg in external files must be to the same origin as the referencing document. using embedded svg to apply an svg effect using css
styles, you first need to create the css
style that references the svg to apply. <
style>p { mask: url(#my-mask); }</
style> in the above example, all paragraphs are masked by an svg <mask> with the id my-mask. example: masking for example, you can make a gradient mask for html content using svg and css code similar to the following, inside your html document: <svg height="0"> <mask ...
...dth: 300px; border: 1px solid #000; display: inline-block; } note that in the css, the mask is specified using a url to the id #mask-1, which is the id of the svg mask specified below it. everything else specifies details about the gradient mask itself. applying the svg effect to (x)html is accomplished by assigning the target class defined above to an element, like this: <p class="target"
style="background:lime;"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam. </p> <p> lorem ipsum dolor sit amet, consectetur adipisicing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. </p> the above example...
...or sit amet, consectetur adipisicing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. </p> the above example would be rendered with the mask applied to it. example: clipping this example demonstrates using svg to clip html content. notice that even the clickable areas for links are clipped. <p class="target"
style="background:lime;"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam. </p> <p> lorem ipsum dolor sit amet, consectetur adipisicing <b class="target">elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</b> ut enim ad minim veniam. </p> <button onclick="t...
...And 3 more matches
<symbol> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default ...
... value type: <length>|<percentage> ; default value: auto; animatable: yes preserveaspectratio this attribu...
... value type: <length>|<percentage> ; default value: auto; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be deformed if it is embed...
...And 3 more matches
xml:base - XML: Extensible Markup Language
he element. support was removed from blink (chrome and opera) in 2015: chromium bug 341854 blink-dev mailing list post and from firefox 66 in bug 903372. use cases if you have an inline svg you use as icons that needs to work in a document with a html baseelement , you can reset the uri on your icon sprite by setting the xml:base. ...
...341854 blink-dev mailing list post and from firefox 66 in bug 903372. use cases if you have an inline svg you use as icons that needs to work in a document with a html baseelement , you can reset the uri on your icon sprite by setting the xml:base. ...
...marker> </defs> <line x1="100" y1="100" x2="333" y2="333" marker-start="url(#arrow)" class="link"></line> </svg> </body> </html> imagine a svg with font references. e.g. ...
...And 3 more matches
Canvas code snippets - Archive of obsolete content
he pixel at position x and y of the canvas. this can be used to determine if the mouse cursor is inside a certain shape or not. function getpixelcolour(canvas, x, y) { var cx = canvas.getcontext('2d'); var pixel = cx.getimagedata(x, y, 1, 1); return { r: pixel.data[0], g: pixel.data[1], b: pixel.data[2], a: pixel.data[3] }; } chaining methods this class provides jquery-
style chained access to 2d context methods and properties. function canvas2dcontext(canvas) { if (typeof canvas === 'string') { canvas = document.getelementbyid(canvas); } if (!(this instanceof canvas2dcontext)) { return new canvas2dcontext(canvas); } this.context = this.ctx = canvas.getcontext('2d'); if (!canvas2dcontext.prototype.arc) { canvas2dcontext.setup.call(this, this.c...
...'stroketext', 'transform', 'translate']; var gettermethods = ['createpattern', 'drawfocusring', 'ispointinpath', 'measuretext', // drawfocusring not currently supported // the following might instead be wrapped to be able to chain their child objects 'createimagedata', 'createlineargradient', 'createradialgradient', 'getimagedata', 'putimagedata' ]; var props = ['canvas', 'fill
style', 'font', 'globalalpha', 'globalcompositeoperation', 'linecap', 'linejoin', 'linewidth', 'miterlimit', 'shadowoffsetx', 'shadowoffsety', 'shadowblur', 'shadowcolor', 'stroke
style', 'textalign', 'textbaseline']; for (let m of methods) { let method = m; canvas2dcontext.prototype[method] = function() { this.ctx[method].apply(this.ctx, arguments); return this; }; ...
...is.ctx, arguments); }; } for (let p of props) { let prop = p; canvas2dcontext.prototype[prop] = function(value) { if (value === undefined) return this.ctx[prop]; this.ctx[prop] = value; return this; }; } }; var canvas = document.getelementbyid('canvas'); // use context to get access to underlying context var ctx = canvas2dcontext(canvas) .stroke
style('rgb(30, 110, 210)') .transform(10, 3, 4, 5, 1, 0) .strokerect(2, 10, 15, 20) .context; // use property name as a function (but without arguments) to get the value var stroke
style = canvas2dcontext(canvas) .stroke
style('rgb(50, 110, 210)') .stroke
style(); code usable only from privileged code these snippets are only useful from privileged code, such as extensions or privileged apps.
...And 2 more matches
Forms related code snippets - Archive of obsolete content
t.appendchild(odecrmonth); ocapt.appendchild(oincryear); ocapt.appendchild(oincrmonth); ocapt.appendchild(this.display); this.container.appendchild(ocapt); this.container.appendchild(othead); this.current.setdate(1); this.writedays(); otarget.onclick = function () { if (otable.parentnode) { otable.parentnode.removechild(otable); return; } otable.
style.zindex = nzindex++; otable.
style.position = "absolute"; otable.
style.left = otarget.offsetleft + "px"; otable.
style.top = (otarget.offsettop + otarget.offsetheight) + "px"; otarget.parentnode.insertbefore(otable, otarget); }; ainstances.push(this); } datepicker.prototype.writedays = function () { const nendblanks = (this.current.getday() + bzeroi...
...-1 : 1, othiscal = ainstances[this.id.replace(rbgnnan, "")]; othiscal.current[bismonth ? "setmonth" : "setyear"](othiscal.current[bismonth ? "getmonth" : "getfullyear"]() + ndelta); othiscal.writedays(); return false; } function ondayclick () { co...
...ndex = 1000; window.addeventlistener ? addeventlistener("load", buildcalendars, false) : window.attachevent ? attachevent("onload", buildcalendars) : (onload = buildcalendars); document.addeventlistener ? document.addeventlistener("mousedown", ondocclick, false) : document.attachevent ? ...
...And 2 more matches
The Box Model - Archive of obsolete content
erride its dimensions using css. this is similarly the case for xul, except there are two flexibility directions to consider. an hbox is as big as its contents horizontally, but it will occupy all the available space vertically. you can make an hbox flexible horizontally with the css property -moz-box-flex or the flex attribute. the same applies to a vbox, but in the other direction. unlike most
style attributes, the flex attribute is considered acceptable to use in xul code. this is because this attribute is used much too often, and it would require a great deal of css code to avoid using it. at any rate, it can always be overriden using css, so your extension won't lose skinability because of it. flexibility is defined as a numeric value. the default value for most elements is 0, which mean...
...nts, in this case, the labels and paddings in the buttons. if the label of the "parrot" button was something much longer, the size ratio would not be kept. you can have even more control over the size of flexible elements using the minwidth, maxwidth, minheight and maxheight attributes, or their css counterparts: min-width, max-width, min-height and max-height. the latter are recommended to keep
style code in the skin section of the chrome. as their names should make clear, you can control the flexibility boundaries of elements, thus preventing them from growing or shrinking too much. all css properties involving lengths should be handled with caution. we recommended that you use proportional units (em, %) instead of absolute units (px) whenever possible. using the former allows the ui to s...
... practice. similarly as with wrapping, cropping will only occur is there is no room for the text to grow, so you'll need to restrict the width using css. text links xul makes it very easy for you to create a label that is also a link. all you need is to set the text-link class to the label, and add an onclick handler (oncommand won't work for this). the label is displayed with the expected link
style so that users can easily recognize it as a link. a trickier case is when you need only part of a label to be clickable, just like in html. since labels can't handle rich text, workarounds have to implemented using javascript. one possibility is to use special markup in a locale property so that the link can be easily recognized: xulschoolhello.linkedtext.label = go to <a>our site</a> for more...
...And 2 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
o the existing dhtml ticker application is able to handle it. special markup to support the model it's important to add special markup that fulfills the requirements of the application. this example uses an iframe element as the mechanism to establish the communication with the server side application. so the following piece of html defines an iframe element which is not visible to the user: <div
style="visibility:hidden; position:absolute; top:-1000px; left:-1000px"> <iframe id="bridgeframe" src=""></iframe> </div> the javascript code located in the data loader component will be interacting with this iframe element, requesting data from the server. note that when the data is available (a web page is loaded into the iframe) this will not affect the web page context because the iframe is not vis...
...// ie fix if(document.all) tagname="nde:"+tagname; paraa=article.getelementsbytagname(tagname).item(0).firstchild.nodevalue; linkk=article.getattribute("url"); strvalue="<div class='nde-blurb'><h3><a href='"+linkk+"'>"+valuee+"</a></h3><p>"+paraa+"</p></div>"; document.getelementbyid("container").innerhtml+=strvalue; } } if(previousele) { previousele.
style.backgroundcolor="white"; } ele.
style.backgroundcolor="#ddeeff"; previousele=ele; } var previousele=null; </script> <
style> .tab { position:relative;top:1px; border: 1px solid #dddddd; color:white; background-color:white; padding-left: 5px; border-bottom:white;padding-right: 5px; padding-top:3px; text-decoration:none;} .tab:hover { background-color:#ddeeff; } </
style> </head> <body ...
...ascript"> //// /// object detection // var xcomp=null; var testxmlhttprequest=false; try { xcomp = new xmlhttprequest(); if(xcomp) testxmlhttprequest=true; } catch (e) { try { xcomp = new activexobject("microsoft.xmlhttp"); if(xcomp) testxmlhttprequest=true; } catch (e) { } } if(testxmlhttprequest&&document.getelementsbytagname) { document.write("<span
style=\"margin-left:1em;\"> <a href=\"javascript:\" class=\"tab \" onclick=\"calldevedge('/viewsource/catalog-new_en.xml',this);return false;\">devedge news</a> <a href=\"javascript:\" class=\"tab\" onclick=\"calldevedge('/central/css/catalog-new_en.xml',this);return false;\" title=\"css articles\">css</a> <a href=\"javascript:\" class=\"tab\" onclick=\"calldevedge('/central/xml/catalog-new_en.xml',thi...
...And 2 more matches
Images, Tables, and Mysterious Gaps - Archive of obsolete content
call on these "fixes." setting images to be blocks the first choice, and one that will work for most graphically-intense designs, is to convert the image from being an inline element to a block-level element. do that, and it no longer generates a line box, and so the problem goes away-- assuming that the image is the only thing that occupies that table cell. ...
... within the textthere is an icon <img src="icon2.gif"> that indicates a link to another site. it's very worldly. ...
... within the textthere is an icon <img src="icon2.gif"> that indicates a link to another site. it's very worldly. lorem ipsum, dolor sit amet...</p></td></tr></table> as we see in figure 8, that works well in some cases but not so well in others. ...
...And 2 more matches
Making it into a static overlay - Archive of obsolete content
distribution, before we package it up we need to separate the modifications into a different file and add them back in at run time via a dynamic xul overlay. a xul overlay is a xul file containing elements to be inserted into another xul file when the other xul file is rendered into an application interface. static overlays are added to a xul file via a reference at the top of the file (much like
stylesheets and javascript scripts). dynamic overlays are added to a xul file via a reference in the chrome registry. overlays provide a way to break up a large xul file into several different files (one that describes the overall structure of an application window and the others to implement specific portions of the window) to improve code readability, maintainability, and extensability. dynamic overl...
...l file without actually changing the code of the file itself, which is necessary when installing an extension like ours. we'll first make the file into a static overlay, then we'll make it into a dynamic overlay. ...
...e://navigator/content/tinderstatus.js" /> <statusbar id="status-bar"> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" insertbefore="offline-status" status="none"/> </statusbar> </overlay> tinderstatusoverlay.xul starts with an xml processing instruction that identifies the file as xml (all xul files need to include this). its next line is the
stylesheet reference we previously added to navigator.xul. after that is a xul overlay element. this element is the top-level element in a xul overlay file and serves to identify the file as an overlay. within that element is the script reference we previously added to navigator.xul. then there is a statusbar element containing a statusbarpanel element. the value of the id attribute of the statusbar el...
...And 2 more matches
Specifying the appearance - Archive of obsolete content
now that we have defined a panel in which to display an icon, we use css to specify which icon to display. ...
...icon to display. ...
...ed), then create a set of css rules that displays the icon corresponding to the current tinderbox state: statusbarpanel#tinderbox-status { list-
style-image: url("chrome://navigator/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-
style-image: url("chrome://navigator/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="testfailed"] { list-
style-image: url("chrome://navigator/content/tb-testfailed.png"); } statusbarpanel#tinderbox-status[status="busted"] { list-
style-image: url("chrome://navigator/content/tb-busted.png"); } mozilla can have multiple sets of
stylesheets that govern its appearance, and we don't want to have to add these rules to each set (and have our extension break when a new set gets installed), so we'll put this st...
...And 2 more matches
In-Depth - Archive of obsolete content
y have to run the installer again. load mozilla and one browser window. then open the dom inspector (tools->web development->dom inspector). click file->inspect and select the browser window. what appears in a tree view below is the actual code for the interface. using this, we can figure out what objects are where, what classes/id's they have applied to them, and most importantly, which file the
style is located in. click on the inspect icon and then click on the back button in the browser window. what this will do is find the code for the back button and display it in the dom inspector. selected in the tree view will be xul:toolbarbutton. this is the portion of the icon with only the image. but the back button is made up of two parts (the back portion and the history portion), so if we move ...
... tree view will be xul:toolbarbutton. this is the portion of the icon with only the image. but the back button is made up of two parts (the back portion and the history portion), so if we move one level up in the tree we'll see toolbarbutton. this is what we want. on the right hand side of the dom inspector, what will be listed is the dom node information. but what we're interested in is the css
style rules. click the icon located above the dom information and choose css
style rules. the side bar will now be split into two parts. at the top, there is a list of all the groups of
styles that are applied to this object. when you select an item in the list the bottom portion will display the actual
styles that are applied. go through this list one item at a time and find the one which applies the ...
... there by default (chrome://navigator/skin/icons/btn1.gif) is actually a bunch of images grouped together in one file, so somewhere one of the css attributes is telling it what portion of the larger image to cut out and display. if you go back into the dom inspector and look at the rule column again, you'll see the #back-button id. select that one and it lists a bunch of -x-image-region-left type
styles in chrome://navigator/skin/. open up navigator.css, again (if you closed it), and look for the #back-button section. it has a -moz-image-region
style in there which you can change. if you look through the rest of this file, you'll also notice that there are regions for the different states of #back-button. change those to match your new image as well. just continue this process for everything th...
...And 2 more matches
Monitoring downloads - Archive of obsolete content
atement.getstring(0); row.setattribute("tooltiptext", sourcestr); sourcestr = sourcestr.slice(sourcestr.lastindexof("/")+1); cell.setattribute("label", sourcestr); // source row.appendchild(cell); cell = document.createelement('listcell'); cell.setattribute("label", (statement.getint64(1) / 1024).tofixed(1) + "kb"); // size cell.setattribute("
style", "text-align:right"); row.appendchild(cell); var thedate = new date(statement.getint64(2) / 1000); // start time cell = document.createelement('listcell'); var datestr = thedate.tolocalestring(); cell.setattribute("label", datestr); row.appendchild(cell); thedate = new date(statement.getint64(3)); // end time cell = docu...
...nt.getint64(3)); // end time cell = document.createelement('listcell'); datestr = thedate.tolocalestring(); cell.setattribute("label", datestr); row.appendchild(cell); var speed = statement.getdouble(4) / 1024.0; cell = document.createelement('listcell'); cell.setattribute("label", speed.tofixed(1) + "kb/sec"); cell.setattribute("
style", "text-align:right"); row.appendchild(cell); var status = statement.getint32(5); var
style = "color:black"; cell = document.createelement('listcell'); var statusstr; switch(status) { case 0: statusstr = "downloading"; break; case 1: statusstr = "complete";
style = "color:green"; ...
...atus = statement.getint32(5); var
style = "color:black"; cell = document.createelement('listcell'); var statusstr; switch(status) { case 0: statusstr = "downloading"; break; case 1: statusstr = "complete";
style = "color:green"; break; case 2: statusstr = "failed";
style = "color:red"; break; case 3: statusstr = "canceled";
style = "color:purple"; break; case 4: statusstr = "paused";
style = "color:blue"; break; case 5: statusstr = "queued";
style = "color:teal"; break; case 6: statusstr = "blocked"; ...
...And 2 more matches
XML in Mozilla - Archive of obsolete content
ations and drafts from the xml family of specifications are supported, as well as other related technologies. this page is outdated. please help updating it with current information. supported core xml w3c recommendations the core xml support includes parsing xml without validation (we use the expat parser), displaying xml with css, manipulating xml documents with scripts via dom, associating
stylesheets with xml documents, and namespaces in xml. the core support is very good with few bugs. dtds and other external entities mozilla does not load external entities from the web. mozilla can load external entities whose system identifier uses the chrome protocol. this feature is used mainly to localize mozilla to different languages (the ui strings are stored in external dtd files). another exc...
...may also make an exception with xhtml documents, see below. mozilla will read internal (dtd) subsets, and in special circumstances external dtds as explained above and will use this information to recognize id type attributes, default attribute values, and general entities. other notes a lot of the document object model (dom, w3c recommendations and drafts) applies to xml. likewise, the cascading
style sheets (css, w3c recommendations and drafts)
style language can be used to
style xml documents. the code for most the core xml can be found in the following directories on the mozilla mercurial repository: content/xml/, parser/expat/ and parser/htmlparser/. the newsgroup to discuss xml in mozilla depends a bit on the nature of the question. for example, dom related questions should probably be di...
...anguage can be used to
style xml documents. the code for most the core xml can be found in the following directories on the mozilla mercurial repository: content/xml/, parser/expat/ and parser/htmlparser/. the newsgroup to discuss xml in mozilla depends a bit on the nature of the question. for example, dom related questions should probably be discussed in the mozilla.dev.tech.dom newsgroup, while
style issues should be discussed on mozilla.dev.tech.css and so on. the catch-all newsgroup for xml discussion is mozilla.dev.tech.xml. ...
...And 2 more matches
Box Model Details - Archive of obsolete content
« previousnext » we've seen a lot of features of the box model. here, we'll find out some more details with some examples. more layout details the
style properties such as min-width and max-height can be applied to any element. we've added them to buttons and textboxes, but we can also add them to spacers or boxes. in addition, the flex attribute can be applied to any element. example 1 : source view <hbox flex="1"> <button label="left"
style="min-width: 100px;" flex="1"/> <spacer flex="1"/> <button label="right"
style="min-width: 100px;" flex="1"/> </hbox> in the example above, all three elements will resize themselves as they are all flexible. the two buttons indicate a minimum width of 100 pixels. the buttons will never be smaller than this size but they may grow larg...
...ls this behavior on a horizontal box. you can also prevent this stretching by placing a maximum height on the elements or, better, on the box itself. if a box has a maximum height, the elements inside it are constrained by this. however, the problem with this is that you need to know how big the element will be beforehand. example 2 : source view <hbox flex="1" align="top"> <button label="left"
style="min-width: 100px;" flex="1"/> <spacer flex="1"/> <button label="right"
style="min-width: 100px;" flex="1"/> </hbox> summary of the box model to achieve complicated layouts, you will generally need to add nested boxes, specify minimum and maximum sizes on some elements, and make certain elements flexible. the best interface is one that can be displayed at various sizes without problems. the ...
...including inside an html element such as a table. however, the layout will be partly controlled by the html element. that means that the flex might not work exactly as you want it. remember that flexibility only has meaning for elements that are directly inside a box or an element that is a type of box. layout examples using spacers example 3 : source view <hbox> <button label="one"/> <spacer
style="width: 5px"/> <button label="two"/> </hbox> here, a spacer is used as a separator between the two buttons, by setting an explicit width of 5 pixels. you could also set margins using the css margin property. centering buttons example 4 : source view <hbox pack="center" align="center" flex="1"> <button label="look at me!"/> <button label="push me!"/> </hbox> this example contains a horizon...
...And 2 more matches
Introduction to XBL - Archive of obsolete content
« previousnext » xul has a sister language, xbl (extensible bindings language). this language is used for declaring the behavior of xul widgets. bindings you can use xul to define the layout of a user interface for an application. you can customize the look of elements by applying
styles to them. you can also create new skins by changing the
styles. the basic appearance of all elements, such as scroll bars and check boxes may be modified by adjusting the
style or by setting attributes on the element. however, xul provides no means in which you can change how an element works (or add a new element which can be reused). for example, you might want to change how the pieces of a scroll bar function. for this, you need xbl. an xbl file contains a set of bindings. each binding describes the...
...e added to the element that the binding is bound to. properties: properties added to the element. they can be accessed through a script. methods: methods added to the element. they can be called from a script. events: events, such as mouse clicks and keypresses that the element will respond to. the binding can add scripts to provide default handling. in addition new events can be defined.
style: custom
style properties that the xbl defined element has. binding example the box is generic enough that you can use it to create custom widgets (although you can use any element, even one you make up yourself). by assigning a class to a box tag, you can associate a binding to only those boxes that belong to that class. the following example demonstrates this. xul (example.xul): <?xml version="...
...e properties that the xbl defined element has. binding example the box is generic enough that you can use it to create custom widgets (although you can use any element, even one you make up yourself). by assigning a class to a box tag, you can associate a binding to only those boxes that belong to that class. the following example demonstrates this. ...
...And 2 more matches
XUL Structure - Archive of obsolete content
in much the same way as html or other types of content are handled. when you type the url of an html page into the browser's address field, the browser locates the web site and downloads the content. the mozilla rendering engine takes the content in the form of html source and transforms it into a document tree. the tree is then converted into a set of objects that can be displayed on the screen.
style sheets (css), images, and other technologies are used to control the presentation. xul functions in much the same way. in fact, in mozilla, all document types, whether they are html or xul, or even svg, are all handled by the same underlying code. this means that the same css properties may be used to
style both html and xul, and many of the features can be shared between both. however, there ar...
...ss preferences and bookmarks and perform other privileged operations. obviously, web pages do not get these privileges, unless they are signed with a digital certificate and the user has granted permission to perform these operations. this chrome package registration is the way firefox extensions are able to add features to the browser. the extensions are small packages of xul files, javascript,
style sheets and images packed together into a single file. these packaged files can be created by using a zip utility. when the user downloads the zipped file, the packaged files will be installed onto the user's machine. the extension will hook into the browser using a xul specific feature called an overlay which allows the xul from the extension to mesh with the xul in the browser. to the user, it m...
...a similar way, but, of course, the xul for the application will be included as part of the installation, instead of having to be installed separately as an extension. however, this xul code will be registered in the chrome system such that the application can display the ui. it is worth noting that the mozilla browser itself is actually just a set of packages containing xul files, javascript and
style sheets. these files are accessed via a chrome url and have enhanced privileges and work just like any other package. of course, the browser is much larger and more sophisticated than most extensions. firefox and thunderbird, as well as number of other components are all written in xul and are all accessible via chrome urls. you can examine these packages by looking in the chrome directory where f...
...And 2 more matches
XUL Questions and Answers - Archive of obsolete content
a scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done. hidechrome="true" doesn’t work on a mac? unfortun...
... a scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done. hidechrome="true" doesn’t work on a mac? unfortunately, no simple solution to this was posted. a workaro...
... a scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done. hidechrome="true" doesn’t work on a mac? unfortunately, no simple solution to this was posted. a workaround is to open the c...
...And 2 more matches
listcell - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single cell of a listbox. by default it only contains text but iconic and checkbox listcells are also available. attributes crop, disabled, image, label, type properties disabled
style classes listcell-iconic, examples (example needed) attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the ...
...ts and sets the value of the disabled attribute. ...
...the label will take up extra space even when no label text is set. if it is desired to center the image, use css to hide the label. tips if you need to right-align a cell's contents, you can do so ...
...And 2 more matches
separator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] creates a small separating gap between elements. this type of separator should be used to separate parts of a dialog. it doesn't draw a bar visually, but is just a small space. it is functionally equivalent to a spacer except it defaults to a small size (usually 1.5 ems). attributes orient
style classes groove, groove-thin, thin examples <separator class="groove-thin"/> attributes orient type: one of the values below used to specify whether the separator is a horizontal or vertical separator. note that the values are the reverse of what seems more likely. horizontal the separator separates vertically placed elements. vertical the separator separates horizontally...
...licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
...And 2 more matches
titlebar - Archive of obsolete content
will move the panel. elements inside the titlebar usually don't receive any mouse events, so e.g. buttons inside it can't be clicked and textboxes can't be focused with the mouse. if you don't want this behavior, you can override it by setting allowevents="true" on the titlebar element. the titlebar will send a command event after the move is complete. ...
...titlebar element. the titlebar will send a command event after the move is complete. examples this xul file will create a hud-
style window that can be moved with the mouse. it will close if the mouse button is released. ...
... will create a hud-
style window that can be moved with the mouse. it will close if the mouse button is released. ...
...And 2 more matches
window - Archive of obsolete content
ing for the "activate" and "deactivate" events. see window activation events. more information is available in the xul tutorial. ...
...or its contents have a minimum or maximum height. the css height property may also be used. hidechrome type: boolean set this attribute to true to have the chrome including the titlebar hidden. id type: unique id a unique identifier so that you can identify the element with. you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in
style sheets. inactivetitlebarcolor type: color string specify background color of the window's titlebar when it is inactive (background). moreover this hides separator between titlebar and window contents. this affects only on mac os x. lightweightthemes type: boolean true if the window supports lightweight themes, otherwise false. lightweightthemesfooter type: id specifies the id...
...the screen. sizemode type: one of the values below the state of the window. it can have one of the following values: maximized the window is maximized, and occupies the full size of the screen. normal the window appears in a normal state at the desired size. this attribute is used to save and restore the state of a window (together with the persist attribute) and for css
styles (e.g. to hide the resizer grippy on maximized windows). note: when a window is minimized, the sizemode attribute is not updated. this is done so that if a window is closed while minimized, its persisted sizemode attribute wouldn't be minimized. setting this attribute does not change the window state. use window.maximize(), window.restore(), or window.minimize() to change the window state. to ...
...And 2 more matches
::-ms-ticks-after - Archive of obsolete content
a slider control is one possible representation of <input type="range">. these ticks are not shown by default. to show them, set the control's display property to block. it is possible to use the ::-ms-ticks-after, ::-ms-ticks-before, and ::-ms-track pseudo-elements together. to do so would create three sets of tick marks, but the best user experience is one set. to remove tick marks altogether, set the color property to transparent. ...
...ltogether, set the color property to transparent. allowable properties only the following css properties can be used in a rule with ::-ms-ticks-after in its selector. other properties are ignored. ...
...e properties only the following css properties can be used in a rule with ::-ms-ticks-after in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-ticks-before - Archive of obsolete content
a slider control is one possible representation of <input type="range">. these ticks are not shown by default. to show them, set the control's display property to block. it is possible to use the ::-ms-ticks-after, ::-ms-ticks-before, and ::-ms-track pseudo-elements together. to do so would create three sets of tick marks, but the best user experience is one set. to remove tick marks altogether, set the color property to transparent. ...
...together, set the color property to transparent. allowable properties only the following css properties can be used in a rule with ::-ms-ticks-before in its selector. other properties are ignored. ...
... properties only the following css properties can be used in a rule with ::-ms-ticks-before in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-value - Archive of obsolete content
d <input> control or the content of a <select> control. allowable properties only the following css properties can be used in a rule with ::-ms-value in its selector. other properties are ignored. ...
...lowable properties only the following css properties can be used in a rule with ::-ms-value in its selector. other properties are ignored. ...
...e used in a rule with ::-ms-value in its selector. other properties are ignored. ...
...And 2 more matches
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
it's a well-known maxim that if you stick around long enough, you get a chance to see the tides of history turn. if you're lucky, you get to ride the surf that second time around without being knocked over by the waves. i was privileged enough to have that chance recently: i was asked to redesign the amazing netscape fish cam page for a new millennium. ...
...div class="card"> <img src="thumb_clown_trigger.jpg" alt="clown trigger" border="0" width="150" height="115"> <h3>clown trigger</h3> <p> our clown trigger is a bold little fish, though for a few weeks he slept a lot and didn't look well in general. he's much better now. </p> </div> basically, that's all that was needed. the reason for the class value being card is that the original idea was to
style each fish's description like a trading card. although this design approach was abandoned fairly quickly, the class name stuck, kind of like a barnacle. giving the fish some
style with the markup all set, it was time to
style. the idea was to have the fish listed in a side-by-side arrangement, sort of like a two-column table, only without the table. this was most easily accomplished by floating ...
...next step was to place the images appropriately. this involved floating the image inside the floated div. it just seemed like a fish cam page should have a lot of floating for some reason. i also added a border to the image, so that it would have a nice frame. div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; border: 1px solid #339;} that done, it was time to
style the fish names. these are enclosed in h3 elements, so the field was pretty wide open in terms of what we could do. since the image was floated, any background or border we set on the h3 would "slide under" the image; this is an expected effect with floated elements. rather than try to fight it or push the image below the h3's element box, i let the image mostly overlap the h3, but with a slight o...
...And 2 more matches
Writing JavaScript for XHTML - Archive of obsolete content
necessary because of the < in the code; otherwise you could have ignored it. a third solution is to use only external scripts, neatly sidestepping the special-character problem. alternatively, the cdata section can be couched within comments so as to be able to work in either application/xhtml+xml or text/html: <script type="text/javascript"> //<![cdata[ ... ...
...the code; otherwise you could have ignored it. a third solution is to use only external scripts, neatly sidestepping the special-character problem. alternatively, the cdata section can be couched within comments so as to be able to work in either application/xhtml+xml or text/html: <script type="text/javascript"> //<![cdata[ ... ...
...ution is to use only external scripts, neatly sidestepping the special-character problem. alternatively, the cdata section can be couched within comments so as to be able to work in either application/xhtml+xml or text/html: <script type="text/javascript"> //<![cdata[ ... //]]> </script> <!-- (for
styles, it is different) --> <
style type="text/css"> /*<![cdata[*/ ... ...
...And 2 more matches
Move the ball - Game development
unction will be executed within setinterval every 10 miliseconds: function draw() { // drawing code } setinterval(draw, 10); thanks to the infinite nature of setinterval the draw() function will be called every 10 milliseconds forever, or until we stop it. now, let's draw the ball — add the following inside your draw() function: ctx.beginpath(); ctx.arc(50, 50, 10, 0, math.pi*2); ctx.fill
style = "#0095dd"; ctx.fill(); ctx.closepath(); try your updated code now — the ball should be repainted on every frame. making it move you won't notice the ball being repainted constantly at the moment, as it's not moving. let's change that. first, instead of a hardcoded position at (50,50) we will define a starting point at the bottom center part of the canvas in variables called x and y, then ...
...e to define the position the circle is drawn at. first, add the following two lines above your draw() function, to define x and y: var x = canvas.width/2; var y = canvas.height-30; next update the draw() function to use the x and y variables in the arc() method, as shown in the following highlighted line: function draw() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fill
style = "#0095dd"; ctx.fill(); ctx.closepath(); } now comes the important part: we want to add a small value to x and y after every frame has been drawn to make it appear that the ball is moving. let's define these small values as dx and dy and set their values to 2 and -2 respectively. add the following below your x and y variable definitions: var dx = 2; var dy = -2; the last thing to do...
...add the following below your x and y variable definitions: var dx = 2; var dy = -2; the last thing to do is to update x and y with our dx and dy variable on every frame, so the ball will be painted in the new position on every update. add the following two new lines indicated below to your draw() function: function draw() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fill
style = "#0095dd"; ctx.fill(); ctx.closepath(); x += dx; y += dy; } save your code again and try it in your browser. this works ok, although it appears that the ball is leaving a trail behind it: clearing the canvas before each frame the ball is leaving a trail because we're painting a new circle on every frame without removing the previous one. don't worry, because there's a metho...
...And 2 more matches
Gecko FAQ - Gecko Redirect 1
der development at mozilla.org. gecko has been known previously by the code names "raptor" and "nglayout"; the new name was chosen following a trademark infringement dispute. for more information see the wikipedia article on gecko. what is a layout engine? basically, a layout engine takes content (such as html, xml, image files, applets, and so on) and formatting information (such as cascading
style sheets, presentational html tags, etc.) and displays the formatted content on the screen. it paints the browser's content area, which is the blank area inside the browser window's chrome. formally, a layout engine defines the placement policy for a document and places content on a page. gecko's core is a very fast layout engine. gecko also offers the ability to parse various document types (html...
... scope-rowgroup, scope-colgroup, charoff, datasrc, datafld, dataformat, datapagesize, summary, event, dir, align on table columns, label attribute of option, alternate text of area elements, longdesc various metadata attributes: cite, datetime, lang, hreflang bidirectional text layout, which is only used in hebrew and arabic (ibm has begun work to add bidi support in a future release)
style sheets css 1 - full support, except for: the application of
styles to html column elements the ability to turn off author
styles the names of certain mozilla extension pseudo-classes lack the moz- prefix css 2 - partial support is expected and has already been built into gecko, including support for css2 positioning, but no commitment has been made to achieve...
...dom 3 support is also planned for a future release. xml 1.0: full support, except for processing to manipulate default attributes rdf: full support, except for abouteach, abouteachprefix, and parsetype javascript 1.5, including ecma-262 edition 3 (ecmascript) compliance, except for date.todatestring and date.totimestring, which are not implemented transfer protocols: ...
...And 2 more matches
Backgrounds and borders - Learn web development
rders. from adding gradients, background images, and rounded corners, backgrounds and borders are the answer to a lot of styling questions in css. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn how to
style the background and border of boxes. styling backgrounds in css the css background property is a shorthand for a number of background longhand properties that we will meet in this lesson. if you discover a complex background property in a
stylesheet, it might seem a little hard to understand as so many values can be passed in at once. .box { background: linear-gradient(105deg, rgba(255,...
...re they should be purely decoration; any important content should be part of the html page and not contained in a background. borders when learning about the box model, we discovered how borders affect the size of our box. in this lesson we will look at how to use borders creatively. ...
... with css we use a shorthand property that sets the color, width, and
style of the border in one line of css. we can set a border for all four sides of a box with border: .box { border: 1px solid black; } or we can target one edge of the box, for example: .box { border-top: 1px solid black; } the individual properties for these shorthands would be: .box { border-width: 1px; border-
style: solid; border-color: black; } and for the longhands: .box { border-top-width: 1px; border-top-
style: solid; border-top-color: black; } note: these top, right, bottom, and left border properties also have mapped logical properties that relate to the writing mode of the document (e.g. left-to-right or right-to-left text, or top-to-bottom). we'll be exploring these in the next lesson,...
...And 2 more matches
Images, media, and form elements - Learn web development
previous overview: building blocks next in this lesson we will take a look at how certain special elements are treated in css. images, other media, and form elements behave a little differently in terms of your ability to
style them with css than regular boxes. understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand the way that some elements behave unusually when
styled with css. replaced elements images and video are described as rep...
...if the user enters something unexpected, or leaves a required field blank, the browser can show an error message. different browsers are inconsistent in how much styling and customization they allow for such items. styling text input elements elements that allow for text input, such as <input type="text">, specific types such as <input type="email">, and the <textarea> element are quite easy to
style and tend to behave just like other boxes on your page. the default styling of these elements will differ however based on the operating system and browser that your user visits the site with. in the example below we have
styled some text inputs using css — you can see that things such as borders, margins and padding all apply as you would expect. we are using attribute selectors to target the ...
...t" as a final step, we can wrap up the various properties discussed above into the following "form reset" to provide a consistent base to work from. this includes all the items mentioned in the last three sections: button, input, select, textarea { font-family: inherit; font-size: 100%; box-sizing: border-box; padding: 0; margin: 0; } textarea { overflow: auto; } note: normalizing
stylesheets are used by many developers to create a set of baseline
styles to use on all projects. typically these do similar things to those described above, making sure that anything different across browsers is set to a consistent default before you do your own work on the css. they are not as important as they once were, as browsers are typically more consistent than in the past. however if you wan...
...And 2 more matches
create fancy boxes - Learn web development
making them nice looking is both fun and challenging. it's fun because it's all about turning a design idea into working code; it's challenging because of annoying constraints and crazy freedom in the use of css. let's do some fancy boxes. before we start getting into the practical side of it, make sure you are familiar with the css box model. it's also a good idea, but not a prerequisite, to be familiar with some css layout basics. on the technical side, creating fancy boxes are all about mastering css border and background properties and how to apply them to a given box. but beyond the technics its also all about unleashing your creativity. ...
...reative ways. if you want to see some crazy examples, take a look at lea verou's css patterns. just remember that such use of gradient is quite expensive, performance wise. if you want to learn more about gradient, feel free to get into our dedicated article. pseudo-elements when styling a single box, you could find yourself limited and could wish to have more boxes to create even more amazing
styles. most of the time, that leads to polluting the dom by adding extra html element for the unique purpose of
style. even if it is necessary, it's somewhat considered bad practice. one solution to avoid such pitfalls is to use css pseudo-elements. a cloud <div class="fancy">hi! i want to be fancy.</div> let's have an example by turning our box into a cloud: .fancy { text-align: center; /*...
... : 80px 1em 0 1em; /* we make room for the "ears" of our cloud */ margin : 0 100px; position: relative; background-color: #a4c9cf; /* well, actually we are not making a full circle as we want the bottom of our cloud to be flat. feel free to tweak this example to make a cloud that isn't flat at the bottom ;) */ border-radius: 100% 100% 0 0; } /* those are common
style that apply to both our ::before and ::after pseudo elements. */ .fancy::before, .fancy::after { /* this is required to be allowed to display the pseudo-elements, event if the value is an empty string */ content: ''; /* we positionnate our pseudo-elements on the left and right sides of the box, but always at the bottom */ position: absolute; bottom : 0; /* this mak...
...And 2 more matches
What’s in the head? Metadata in HTML - Learn web development
previous overview: introduction to html next the head of an html document is the part that is not displayed in the web browser when the page is loaded. it contains information such as the page <title>, links to css (if you choose to
style your html content with css), links to custom favicons, and other metadata (data about the html, such as the author, and important keywords that describe the document.) in this article we'll cover all of the above and more, in order to give you a good basis for working with markup. prerequisites: basic html familiarity, as covered in getting started with html. objective: to learn about the html head, its purpose, the most important items it can contain, and what effect it can have on the html document. what is the html ...
...t all websites you'll use in the modern day will employ css to make them look cool, and javascript to power interactive functionality, such as video players, maps, games, and more. these are most commonly applied to a web page using the <link> element and the <script> element, respectively. the <link> element should always go inside the head of your document. ...
... css to make them look cool, and javascript to power interactive functionality, such as video players, maps, games, and more. these are most commonly applied to a web page using the <link> element and the <script> element, respectively. the <link> element should always go inside the head of your document. this takes two attributes, rel="
stylesheet", which indicates that it is the document's
stylesheet, and href, which contains the path to the
stylesheet file: <link rel="
stylesheet" href="my-css-file.css"> the <script> element should also go into the head, and should include a src attribute containing the path to the javascript you want to load, and defer, which basically instructs the browser to load the javascript at the same time as the page's html. this is useful as it makes s...
...And 2 more matches
Third-party APIs - Learn web development
cated on third party servers. to access them from javascript you first need to connect to the api functionality and make it available on your page. this typically involves first linking to a javascript library available on the server via a <script> element, as seen in our mapquest example: <script src="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.js"></script> <link type="text/css" rel="
stylesheet" href="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.css"/> you can then start using the objects available in that library. for example: let map = l.mapquest.map('map', { center: [53.480759, -2.242631], layers: l.mapquest.tilelayer('map'), zoom: 12 }); here we are creating a variable to store the map information in, then creating a new map using the mapquest.map() method, wh...
...onal "callback url". you don't need to fill in a url here: just leave it blank.) open up your starting file, and replace the api key placeholder with your key. changing the type of map there are a number of different types of map that can be shown with the mapquest api. to do this, find the following line: layers: l.mapquest.tilelayer('map') try changing 'map' to 'hybrid' to show a hybrid-
style map. try some other values too. the tilelayer reference page shows the different available options, plus a lot more information. adding different controls the map has a number of different controls available; by default it just shows a zoom control. you can expand the controls available using the map.addcontrol() method; add this to your code, inside the window.onload handler: map.addcontrol(l...
... to the displayresults() function so the data can be displayed in our ui. displaying the data ok, let's look at how we'll display the data. add the following function below your fetchresults() function. ...
...And 2 more matches
Video and Audio APIs - Learn web development
the <video> element contains two <source> elements so that different formats can be loaded depending on the browser viewing the site. the controls html is probably the most interesting: we have four <button>s — play/pause, stop, rewind, and fast forward. each <button> has a class name, a data-icon attribute for defining what icon should be shown on each button...
...this is an icon font — all the characters of the alphabet equate to common icons you might want to use in an applicat...
...ns a capital "p". we apply the custom web font to our buttons using font-family. in this font, "p" is actually a "play" icon, so therefore the play button has a "play" icon displayed on it. icon fonts are very cool for many reasons — cutting down on http requests because you don't need to download those icons as image files, great scalability, and the fact that you can use text properties to
style them — like color and text-shadow. last but not least, let's look at the css for the timer: .timer { line-height: 38px; font-size: 10px; font-family: monospace; text-shadow: 1px 1px 0px black; color: white; flex: 5; position: relative; } .timer div { position: absolute; background-color: rgba(255,255,255,0.2); left: 0; top: 0; width: 0; height: 38px; z-index: 2; }...
...And 2 more matches
Getting started with Vue - Learn web development
create more sophisticated components. as a bonus, projects created with the vue cli are configured to use .vue files with webpack out of the box. in fact, if you look inside the src folder in the project we created with the cli, you'll see your first .vue file: app.vue. let's explore this now. app.vue open your app.vue file — you’ll see that it has three parts: <template>, <script>, and <
style>, which contain the component’s template, scripting, and styling information. all single file components share this same basic structure. <template> contains all the markup structure and display logic of your component. your template can contain any valid html, as well as some vue-specific syntax that we'll cover later. note: by setting the lang attribute on the <template> tag, you can use p...
...ur app necessarily needs every component. import helloworld from './components/helloworld.vue'; export default { name: 'app', components: { //you can register components locally here. helloworld } }; note: if you want to use typescript syntax, you need to set the lang attribute on the <script> tag to signify to the compiler that you're using typescript — <script lang="ts">. ...
...d.vue'; export default { name: 'app', components: { //you can register components locally here. helloworld } }; note: if you want to use typescript syntax, you need to set the lang attribute on the <script> tag to signify to the compiler that you're using typescript — <script lang="ts">. <
style> is where you write your css for the component. if you add a scoped attribute — <
style scoped> — vue will scope the
styles to the contents of your sfc. ...
...And 2 more matches
Introduction to automated testing - Learn web development
" } with this, you are ready to move on. setting up gulp automation let's look at setting up gulp and using it to automate some testing tools. to begin with, create a test npm project using the procedure detailed at the bottom of the previous section. next, you'll need some sample html, css and javascript content to test your system on — make copies of our sample index.html, main.js, and
style.css files in a subfolder with the name src inside your project folder. you can try your own test content if you like, but bear in mind that such tools won't work on internal js/css — you need external files. first, install gulp globally (meaning, it will be available across all projects) using the following command: npm install --global gulp-cli next, run the following command inside your...
... created. ...
...t csslint = require('gulp-csslint'); add the following test to the bottom of gulpfile.js: function css(cb) { return gulp.src('src/
style.css') .pipe(csslint()) .pipe(csslint.formatter('compact')) .pipe(autoprefixer({ browsers: ['last 5 versions'], cascade: false })) .pipe(gulp.dest('build')); cb(); } here we grab our
style.css file, run csslint on it (which outputs a list of any errors in your css to the terminal), then runs it through autoprefixer to add any prefixes needed to make nascent css features run in older browsers. at the end of the pipe chain, we output our modified prefixed css to the build directory. note that this only works if csslint doesn't find any errors — try removing a curly brace from your ...
...And 2 more matches
Commenting IDL for better documentation
s and notes and turn them into beautiful, easy to search and read documentation. but by following the guidelines here, you can help make sure that our tools can generate a "good start" version of the documentation for your interfaces, and that the writers will be able to easily figure out what the tools are not able to do automatically. comment format doxygen supports several comment formats; for
style and consistency reasons, we use the following: /** * */ note the two asterisks ("**") on the first line of the comment. that lets doxygen (and by extension, our automated documentation import tools) know that the comment should be absorbed into documentation. if you use any other format for your comments, our tools will ignore them. following the rules below will ensure that our tools are able...
...ill ensure that our tools are able to produce the best possible results, and will have the added bonus of making your comments easier to read! include documentation comments for everything, even if you think it is obvious what it means. automatic documentation generation tools can not see what is obvious to human brains. plus, what is obvious to you is likely not obvious to everyone. use doxygen
style comments only for information that is directly useful to someone using or implementing the interface. this helps keep the documentation tidy. be concise and to the point. writers will expand upon your documentation if necessary. keep in mind that people for whom english is not their native language will be reading your comments (as well as the generated documentation), so try to avoid slang and a...
...an one brief per interface. @param parameter description every parameter of a method should be documented, only use the parameter name, leave out things like [in]/[out]. @returns description if the method returns something then this should be included. @throws error description the error should be the actual name of the error constant, in all caps. @note description used to include a note
styled paragraph. @remarks remark a remark paragraph to be included in the remarks section of the documentation. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. @see description either an interface or a html link. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. - or . used at the be...
...And 2 more matches
Experimental features in Firefox
r point rather than radiating from it. see bug 1175958 for more details. release channel version added enabled by default? nightly 75 no developer edition 75 no beta 75 no release 75 no preference name layout.css.conic-gradient.enabled and gfx.webrender.all pseudo-class: :focus-visible allows focus
styles to be applied to elements like buttons and form controls, only when they are focused using the keyboard (e.g. when tabbing between elements), and not when they are focused using a mouse or other pointing device. see bug 1617600 for more details. release channel version added enabled by default? nightly 75 no developer edition 75 no beta ...
...applies filter effects to the area behind an element. see bug 1178765 for more details. release channel version added enabled by default? nightly 70 no developer edition 70 no beta 70 no release 70 no preference name layout.css.backdrop-filter.enabled grid: masonry layout adds support for a masonry
style layout based on grid layout where one axis has a masonry layout while having normal grid layout on the other. this allows to create gallery
style layouts like on pinterest. see bug 1607954 for more details. release channel version added enabled by default? nightly 77 no developer edition 77 no beta 77 no release 77 no...
... this on desktop, but you can track the state of that just in case it changes in bug 1551302. release channel version added enabled by default? nightly 63 no developer edition 63 no beta 63 no release 63 starting in firefox 68, on android only preference name dom.visualviewport.enabled constructable
stylesheets the addition of a constructor to the css
stylesheet interface as well as a variety of related changes makes it possible to directly create new
stylesheets without having to add the sheet to the html. this makes it much easier to create reusable
stylesheets for use with shadow dom. our implementation is not yet complete; see bug 1520690 for more details. release channel version ...
...And 2 more matches
Mozilla Quirks Mode Behavior
add padding if the very first node in an li is another ul or ol (bug 98636). obsolete since gecko 50 list bullets do not inherit the font size of the list (bug 97351). removed in firefox 50 (bug 648331). don't inherit font properties into tables except for font-family. make table borders gray rather than using the foreground color. ...
...lor. collapse top margin of body and td and bottom margin of td. collapse the bottom or top margins of empty elements (bug 97361). support <pre wrap>, <pre cols>, <pre width>. orphaned dd has generated content :before instead of margin (bug 5119). indent nested dl elements (bug 8749). map acts like an inline, not a block. give floated img a 3px margin (bug 58899). ...
... the css parser accepts colors not beginning with #, except in shorthands. ...
...And 2 more matches
Console messages - Firefox Developer Tools
ble ones: copy link location acts as you would expect, copying the url into the clipboard open in network panel switches context to the network tab, selects the request and shows you the details resend request sends the network request again. open url in new tab opens the url in a new browser tab. if the resource is an image, the image will be opened in a new tab. if the resource is a
stylesheet, you will see the css rules, etc. js javascript errors contain a "learn more" link that takes you to the javascript error reference containing additional advice for fixing issues: source maps the web console understands source maps. this means that if your javascript sources are compressed, you can supply a source map for them. then any messages or errors your source generates will...
...esized or some javascript modifies an element's css — the layout is not recalculated immediately. instead, the reflow happens asynchronously, the next time the browser decides it needs to be done (generally, the next time the browser repaints). in this way the browser can save up a collection of invalidating changes and recalculate their effect at once. ...
...low happens asynchronously, the next time the browser decides it needs to be done (generally, the next time the browser repaints). in this way the browser can save up a collection of invalidating changes and recalculate their effect at once. however, if some javascript code reads a
style that has been modified, then the browser must perform a synchronous reflow in order to calculate the computed
style to return. ...
...And 2 more matches
CSSRuleList - Web APIs
a cssrulelist is an (indirect-modify only) array-like object containing an ordered collection of cssrule objects. description each cssrule can be accessed as rules.item(index), or simply rules[index], where rules is an object implementing the cssrulelist interface (such as css
stylesheet.cssrules), and index is the 0-based index of the rule, in the order as it appears in the
style sheet css. the number of rules in the list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent
stylesheet. in fact, .insertrule() and .deleterule() are not even methods of cssrulelist, but only of css
stylesheet. if however, for some reason the list does need to be modified but has no ...
...ules in the list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the list directly, but instead here, only via its parent
stylesheet. in fact, .insertrule() and .deleterule() are not even methods of cssrulelist, but only of css
stylesheet. ...
...y, but instead here, only via its parent
stylesheet. in fact, .insertrule() and .deleterule() are not even methods of cssrulelist, but only of css
stylesheet. if however, for some reason the list does need to be modified but has no parent
stylesheet (perhaps being a livecopy of a list that does), it cannot just be assigned one (as it has no such property), and neither can it be assigned to one (as
stylesheet.cssrules is read-only), but it must unfortunately be inserted into one, rule by rule, and unless combining lists, after any existing list therein is deleted, rule by rule. ...
...And 2 more matches
CanvasRenderingContext2D.createPattern() - Web APIs
the canvasrenderingcontext2d.createpattern() method of the canvas 2d api creates a pattern using the specified image and repetition. this method returns a canvaspattern. this method doesn't draw anything to the canvas directly. the pattern it creates must be assigned to the canvasrenderingcontext2d.fill
style or canvasrenderingcontext2d.stroke
style properties, after which it is applied to any subsequent drawing. syntax canvaspattern ctx.createpattern(image, repetition); parameters image a canvasimagesource to be used as the pattern's image. it can be any of the following: htmlimageelement (<img>) svgimageelement (<image>) htmlvideoelement (<video>, by using the capture of the video) htmlcanvaselement (<canvas>) imagebitmap offscreencanvas repetition a domstring indi...
...f repetition is specified as an empty string ("") or null (but not undefined), a value of "repeat" will be used. return value canvaspattern an opaque object describing a pattern. examples creating a pattern from an image this example uses the createpattern() method to create a canvaspattern with a repeating source image. once created, the pattern is assigned to the canvas context's fill
style and applied to a rectangle. the original image looks like this: html <canvas id="canvas" width="300" height="300"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var img = new image(); img.src = 'https://udn.realityripple.com/samples/04/aaeaf9aac4.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); ct...
...pplied to a rectangle. the original image looks like this: html <canvas id="canvas" width="300" height="300"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var img = new image(); img.src = 'https://udn.realityripple.com/samples/04/aaeaf9aac4.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); ctx.fill
style = pattern; ctx.fillrect(0, 0, 300, 300); }; creating a pattern from a canvas in this example we create a pattern from the contents of an offscreen canvas. we then apply it to the fill
style of our primary canvas, and fill that canvas with the pattern. javascript // create a pattern, offscreen const patterncanvas = document.createelement('canvas'); const patterncontext = patterncanvas.get...
...And 2 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
set_background() { // get a list of all the body elements (there will only be one), // and then select the zeroth (or first) such element mybody = document.getelementsbytagname("body")[0]; // now, get all the p elements that are descendants of the body mybodyelements = mybody.getelementsbytagname("p"); // get the second item of the list of p elements myp = mybodyelements[1]; myp.
style.background = "rgb(255,0,0)"; } in this example, we set the myp variable to the dom object for the second p element inside the body: first, we get a list of all the body elements via mybody = document.getelementsbytagname("body")[0] since there is only one body element in any valid html document, this list will have only one item, which we retrieve by selecting the first element in that ...
...eve by selecting the first element in that list using [0]. next, we get all the p elements that are descendants of the body: mybodyelements = mybody.getelementsbytagname("p"); finally, we get the second item from the list of p elements via myp = mybodyelements[1]; once you have gotten the dom object for an html element, you can set its properties. for example, if you want to set the
style background color property, you just add: myp.
style.background = "rgb(255,0,0)"; // setting inline
style attribute creating textnodes with document.createtextnode("..") use the document object to invoke the createtextnode method and create your text node. you just need to pass the text content. the return value is an object that represents the text node. mytextnode = document.createtextnode("...
...nt of myceltext currenttext=document.createtextnode(myceltext.data); mybody.appendchild(currenttext); getting an attribute value at the end of sample1 there is a call to setattribute on the mytable object. this call was used to set the border property of the table. to retrieve the value of the attribute, use the getattribute method: mytable.getattribute("border"); hiding a column by changing
style properties once you have the object in your javascript variable, you can set
style properties directly. the following code is a modified version of sample1.html in which each cell of the second column is hidden and each cell of the first column is changed to have a red background. note that the
style property was set directly. <html> <body onload="start()"> </body> <script> function start()...
...And 2 more matches
EffectTiming.fill - Web APIs
that css looks like this: #box { width: 200px; height: 200px; left: 50px; top: 50px; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; } all this does is specify the size, border, and color information, as well as indicate that the box should be centered bot...
...line); alternatives to fill modes fill modes are primarily provided as a means of representing the animation-fill-mode feature of css animations. when used to persist the effect of an animation indefinitely, however, they have a number of drawbacks: the forwards fill of an animation (or backwards fill if the animation is playing in reverse) will continue to override any changes to specified
style indefinitely which can lead to confusing behavior. this is because animations take priority in the css cascade over normal author
styles. in order to avoid leaking memory when many filling animations overlap, the browser is required to remove overlapped animations which can lead to surprising results in some cases. rather than using fill modes to persist an animation, it is often simpler to se...
...use animations take priority in the css cascade over normal author
styles. in order to avoid leaking memory when many filling animations overlap, the browser is required to remove overlapped animations which can lead to surprising results in some cases. rather than using fill modes to persist an animation, it is often simpler to set the final value of the animation effect directly in specified
style: elem.animate({ transform: 'translatey(100px)' }, 200).finished.then(() => { elem.
style.transform = 'translatey(100px)'; }); alternatively, it may be simpler still to set the final value in specified
style before triggering the animation and then animate from the start value. this is the approach used in flip animation. ...
...And 2 more matches
Element.getClientRects() - Web APIs
lientrectsoverlay(elt) { /* absolutely position a div over each client rect so that its border width is the same as the rectangle's width. note: the overlays will be out of place if the user resizes or zooms. ...
...ion a div over each client rect so that its border width is the same as the rectangle's width. note: the overlays will be out of place if the user resizes or zooms. ...
...r (var i = 0; i != rects.length; i++) { var rect = rects[i]; var tablerectdiv = document.createelement('div'); tablerectdiv.
style.position = 'absolute'; tablerectdiv.
style.border = '1px solid red'; var scrolltop = document.documentelement.scrolltop || document.body.scrolltop; var scrollleft = document.documentelement.scrollleft || document.body.scrollleft; tablerectdiv.
style.margin = tablerectdiv.
style.padding = '0'; tablerectdiv.
style.top = (rect.top + scrolltop) + 'px'; tablerectdiv.
style.left = (rect.left + scrollleft) + 'px'; // we want rect.width to be the border width, so content width is 2px less. ...
...And 2 more matches
Using files from web applications - Web APIs
nts using the click() method you can hide the admittedly ugly file <input> element and present your own interface for opening the file picker and displaying which file or files the user has selected. you can do this by styling the input element with display:none and calling the click() method on the <input> element. ...
... using a label element to trigger a hidden file input element to allow opening the file picker without using javascript (the click() method), a <label> element can be used. ...
... 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); } /* separate rule for compatibility, :focus-within is required on modern firefox and chrome */ input.visually-hidden:focus + label { outline: thin dotted; } input.visually-hidden:focus-within + label { outline: thin dotted; } there is no need to add javascript code to call fileelem.click(). also in this case you can
style the label element as you wish. you need to provide a visual cue for the focus status of the hidden input field on its label, be it an outline as shown above, or background-color or box-shadow. (as of time of writing, firefox doesn’t show this visual cue for <input type="file"> elements.) selecting files using drag and drop you can also let the user drag and drop files into your web applicatio...
...And 2 more matches
HTMLCanvasElement.toDataURL() - Web APIs
lity = canvas.todataurl('image/jpeg', 0.1); example: dynamically change images you can use this technique in coordination with mouse events in order to dynamically change images (gray-scale vs. ...
... example: dynamically change images you can use this technique in coordination with mouse events in order to dynamically change images (gray-scale vs. ...
...tion with mouse events in order to dynamically change images (gray-scale vs. ...
...And 2 more matches
Node.isConnected - Web APIs
ct, and false if not. ...
... standard dom a standard dom example: let test = document.createelement('p'); console.log(test.isconnected); // returns false document.body.appendchild(test); console.log(test.isconnected); // returns true shadow dom a shadow dom example: // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create some css to apply to the shadow dom var
style = document.createelement('
style'); console.log(
style.isconnected); // returns false
style.textcontent = ` .wrapper { position: relative; } .info { font-size: 0.8rem; width: 200px; display: inline-block; border: 1px solid black; padding: 10px; background: white; border-radius: 10px; opacity: 0; transition: 0.6s all; positions: absolute; bottom: 20px; left: 10px; z-index: 3 } `; // attach the create...
... * no warranty expressed or implied. use at your own risk. ...
...And 2 more matches
Using the Payment Request API - Web APIs
he paymentrequest.show() method on it to initiate the payment request. this returns a promise that fulfills with a paymentresponse object if the payment is successful: request.show().then(function(paymentresponse) { // here we would process the payment. for this demo, simulate immediate success: paymentresponse.complete('success') .then(function() { // for demo purposes: intropanel.
style.display = 'none'; successpanel.
style.display = 'block'; }); }) this object provides the developer with access to details they can use to complete the logical steps required after the payment completes, such as an email address to contact the customer, a shipping address for mailing goods out to them, etc. in the code above, you'll see that we've called the paymentresponse.complete() method...
...on.addeventlistener('click', function() { var request = new paymentrequest(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); request.show().then(function(paymentresponse) { // here we would process the payment. ...
... request = new paymentrequest(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); request.show().then(function(paymentresponse) { // here we would process the payment. ...
...And 2 more matches
Pinch zoom gestures - Web APIs
uding fingers, mice, and pens. the pinch in (zoom out) gesture, which moves the two pointers toward each other, changes the target element's background color to lightblue. the pinch out (zoom in) gesture, which moves the two pointers away from each other, changes the target element's background color to pink. define touch target the application uses <div> to define the pointers' target areas. <
style> div { margin: 0em; padding: 2em; } #target { background: white; border: 1px solid black; } </
style> global state supporting a two-pointer gesture requires preserving a pointer's event state during various event phases. this application uses two global variables to cache the event state. // global vars to cache event state var evcache = new array(); var prevdiff = -1; ...
... gesture. // // if the distance between the two pointers has increased (zoom in), // the target element's background is changed to "pink" and if the // distance is decreasing (zoom out), the color is changed to "lightblue". // // this function sets the target element's border to "dashed" to visually // indicate the pointer's target received a move event. ...
...eak; } } // if two pointers are down, check for pinch gestures if (evcache.length == 2) { // calculate the distance between the two pointers var curdiff = math.abs(evcache[0].clientx - evcache[1].clientx); if (prevdiff > 0) { if (curdiff > prevdiff) { // the distance between the two pointers has increased log("pinch moving out -> zoom in", ev); ev.target.
style.background = "pink"; } if (curdiff < prevdiff) { // the distance between the two pointers has decreased log("pinch moving in -> zoom out",ev); ev.target.
style.background = "lightblue"; } } // cache the distance for the next move event prevdiff = curdiff; } } pointer up the pointerup event is fired when a pointer is raised from the contact surface.
...And 2 more matches
Using Pointer Events - Web APIs
point on the surface. example the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus, mouse, or other method of pointing at a location. create a canvas the touch-action property is set to none to prevent the browser from applying its default touch behavior to the application. ...
... pointing at a location. create a canvas the touch-action property is set to none to prevent the browser from applying its default touch behavior to the application. <canvas id="canvas" width="600" height="600"
style="border:solid black 1px; touch-action:none"> your browser does not support canvas element. </canvas> <br> <button onclick="startup()">initialize</button> <br> log: <pre id="log"
style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below should be called by our <body> element's onload attribute (but in the example we use a button to trigger it, due to limitations of the mdn live example system). function startup() { var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("pointerdown", ha...
...we're using a 4-pixel wide line, so a 4 pixel radius circle will show up neatly. drawing as the pointers move each time one or more pointers moves, a pointermove event is delivered, resulting in our handlemove() function being called. it...
...And 2 more matches
Using the Web Storage API - Web APIs
as a storageevent is fired. note: as well as viewing the example pages live using the above links, you can also check out the source code. testing whether your storage has been populated to start with, in main.js, we test whether the storage object has already been populated (i.e., the page was previously accessed): if(!localstorage.getitem('bgcolor')) { populatestorage(); } else { set
styles(); } the storage.getitem() method is used to get a data item from storage; in this case, we are testing to see whether the bgcolor item exists; if not, we run populatestorage() to add the existing customization values to the storage. if there are already values there, we run set
styles() to update the page styling with the stored values. note: you could also use storage.length to test whether t...
... already values there, we run set
styles() to update the page styling with the stored values. note: you could also use storage.length to test whether the storage object is empty or not. getting values from storage as noted above, values can be retrieved from storage using storage.getitem(). this takes the key of the data item as an argument, and returns the data value. ...
...eturns the data value. for example: function set
styles() { var currentcolor = localstorage.getitem('bgcolor'); var currentfont = localstorage.getitem('font'); var currentimage = localstorage.getitem('image'); document.getelementbyid('bgcolor').value = currentcolor; document.getelementbyid('font').value = currentfont; document.getelementbyid('image').value = currentimage; htmlelem.
style.backgroundcolor = '#' + currentcolor; pelem.
style.fontfamily = currentfont; imgelem.setattribute('src', currentimage); } here, the first three lines grab the values from local storage. next, we set the values displayed in the form elements to those values, so that they keep in sync when you reload the page. ...
...And 2 more matches
XSLT Basic Example - Web APIs
this first example demonstrates the basics of setting up an xslt transformation in a browser. the example will take an xml document that contains information (title, list of authors and body text) about an article and present it in an human readable form. figure 1 shows the source of the basic xslt example. the xml document (example.xml) contains the information about the article. using the ?xml-
stylesheet? processing instruction, it links to the xslt
stylesheet (example.xsl) via its href attribute. an xslt
stylesheet starts with the xsl:
stylesheet element, which contains all the templates used to create the final output. the example in figure 1 has two templates - one that matches the root node and one that matches author nodes. the template that matches the root node outputs the article's ti...
...utput. the example in figure 1 has two templates - one that matches the root node and one that matches author nodes. the template that matches the root node outputs the article's title and then says to process all templates (via apply-templates) that match author nodes which are children of the authors node. ...
...via apply-templates) that match author nodes which are children of the authors node. figure 1 : simple xslt example xml document (example.xml) : <?xml version="1.0"?> <?xml-
stylesheet type="text/xsl" href="example.xsl"?> <article> <title>my article</title> <authors> <author>mr. foo</author> <author>mr. ...
...And 2 more matches
XSLTProcessor - Web APIs
an xsltprocessor applies an xslt
stylesheet transformation to an xml document to produce a new xml document as output. it has methods to load the xslt
stylesheet, to manipulate <xsl:param> parameter values, and to apply the transformation to documents. syntax the constructor has no parameters. new xsltprocessor() methods [throws] void xsltprocessor.import
stylesheet(node
stylesheet) imports the xslt
stylesheet. if the given node is a document node, you can pass in a full xsl transform or a literal result element transform; otherwise, it must be an <xsl:
stylesheet> or <xsl:transform> element. ...
...oid xsltprocessor.import
stylesheet(node
stylesheet) imports the xslt
stylesheet. if the given node is a document node, you can pass in a full xsl transform or a literal result element transform; otherwise, it must be an <xsl:
stylesheet> or <xsl:transform> element. [throws] documentfragment xsltprocessor.transformtofragment(node source, document owner) transforms the node source by applying the
stylesheet imported using the xsltprocessor.import
stylesheet() function. the owner document of the resulting document fragment is the owner node. [throws] document xsltprocessor.transformtodocument(node source) transforms the node source applying the
stylesheet given importing using the xsltprocessor.import
stylesheet() function. ...
...g the
stylesheet imported using the xsltprocessor.import
stylesheet() function. the owner document of the resulting document fragment is the owner node. [throws] document xsltprocessor.transformtodocument(node source) transforms the node source applying the
stylesheet given importing using the xsltprocessor.import
stylesheet() function. the resultant object depends on the output method of the
stylesheet: output method result type html htmldocument xml xmldocument text xmldocument with a single root element <transformiix:result> with the text as a child [throws] void xsltprocessor.setparameter(string namespaceuri, string localname, any value) sets a parameter in the xslt
stylesheet that was imported. (sets t...
...And 2 more matches
<input type="file"> - HTML: Hypertext Markup Language
iles currently selected for upload</p> </div> <div> <button>submit</button> </div> </form> html { font-family: sans-serif; } form { width: 580px; background: #ccc; margin: 0 auto; padding: 20px; border: 1px solid black; } form ol { padding-left: 0; } form li, div > p { background: #eee; display: flex; justify-content: space-between; margin-bottom: 10px; list-
style-type: none; border: 1px solid black; } form img { height: 64px; order: 1; } form p { line-height: 32px; padding-left: 10px; } form label, form button { background-color: #7f9ccb; padding: 5px 10px; border-radius: 5px; border: 1px ridge black; font-size: 0.8rem; height: auto; } form label:hover, form button:hover { background-color: #2d5ba3; color: white; } form labe...
...ctive { background-color: #0d3f8f; color: white; } this is similar to what we've seen before — nothing special to comment on. next, let's walk through the javascript. in the first lines of script, we get references to the form input itself, and the <div> element with the class of .preview. ...
...javascript. in the first lines of script, we get references to the form input itself, and the <div> element with the class of .preview. next, we hide the <input> element — we do this because file inputs tend to be ugly, difficult to
style, and inconsistent in their design across browsers. you can activate the input element by clicking its <label>, so it is better to visually hide the input and
style the label like a button, so the user will know to interact with it if they want to upload files. ...
...And 2 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
t match elements that can't be required. :blank <input> and <textarea> elements that currently have no value. :user-invalid similar to :invalid, but is activated on blur. matches invalid input but only after the user interaction, such as by focusing on the control, leaving the control, or attempting to submit the form containing the invalid control. examples we can
style a checkbox label based on whether the checkbox is checked or not. in this example, we are styling the color and font-weight of the <label> that comes immediately after a checked input. we haven't applied any
styles if the input is not checked. <input id="checkboxinput" type="checkbox"> <label for="checkboxinput">toggle the checkbox on and off</label> input:checked + label { color: red; fo...
...hes a password input */ input[type="password"] {} /* matches a form control whose valid values are limited to a range of values*/ input[min][max] {} /* matches a form control with with a pattern attribute */ input[pattern] {} ::placeholder by default, the appearance of placeholder text is a translucent or light gray. the ::placeholder pseudo-element is the input's placeholder text. ...
... you could make a <div> look like a radio button with div {appearance: radio;} or a radio look like a checkbox with [type="checkbox] {appearance: checkbox;}, but don't. ...
...And 2 more matches
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
tion element (<u>) represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation. this is rendered by default as a simple solid underline, but may be altered using css. this element used to be called the "underline" element in older versions of html, and is still sometimes misused in this way. to underline text, you should instead apply a
style that includes the css text-decoration property set to underline. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. see the usage notes section for further details on when it's appropriate to use <u> and when it isn't. ...
... (as opposed to the non-textual annotations created with <u>), use the <ruby> element. to apply an underlined appearance without any semantic meaning, use the text-decoration property's value underline. ...
... result the result should be familiar to anyone who has used any of the more popular word processors available today. ...
...And 2 more matches
Content-Security-Policy-Report-Only - HTTP
t-uri the uri of the document in which the violation occurred. effective-directive the directive whose enforcement caused the violation. original-policy the original policy as specified by the content-security-policy-report-only http header. referrer the referrer of the document in which the violation occurred. script-sample the first 40 characters of the inline script, event handler, or
style that caused the violation. status-code the http status code of the resource on which the global object was instantiated. violated-directive the name of the policy section that was violated. sample violation report let's consider a page located at http://example.com/signup.html. it uses the following policy, disallowing everything but
stylesheets from cdn.example.com. content-security-pol...
...ode the http status code of the resource on which the global object was instantiated. violated-directive the name of the policy section that was violated. sample violation report let's consider a page located at http://example.com/signup.html. it uses the following policy, disallowing everything but
stylesheets from cdn.example.com. ...
...ation report let's consider a page located at http://example.com/signup.html. it uses the following policy, disallowing everything but
stylesheets from cdn.example.com. content-security-policy-report-only: default-src 'none';
style-src cdn.example.com; report-uri /_/csp-reports the html of signup.html looks like this: <!doctype html> <html> <head> <title>sign up</title> <link rel="
stylesheet" href="css/
style.css"> </head> <body> ... content ... </body> </html> can you spot the violation?
stylesheets are only allowed to be loaded from cdn.example.com, yet the website tries to load one from its own origin (http://example.com). a browser capable of enforcing csp will send the following violation report as a post request to http://example.com/_/csp-reports, when the docum...
...And 2 more matches
CSS and JavaScript animation performance - Web Performance
imations or javascript-based animations (using requestanimationframe()). in this article, we analyse the performance differences between css- and javascript-based animation. css transitions and animations both css transitions and animations can be used to write animation. they each have their own user scenarios: css transitions provide an easy way to make animations occur between the current
style and an end css state, e.g., a resting button state and a hover state. even if an element is in the middle of a transition, the new transition starts from the current
style immediately instead of jumping to the end css state. see using css transitions for more details. css animations, on the other hand, allow developers to make animations between a set of starting property values and a final set ...
...see using css animations for more details. ...
...see using css animations for more details. ...
...And 2 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
ted from the content width, not added to it. very useful! read more about this at * { box-sizing: border-box } ftw, by paul irish. flexible replaced elements things are working fairly well now, but there are still some issues just waiting to present themselves. for a start, let's have a look at what happens when we include the <video> and <img> elements inside our first two columns, naked and un
styled. because the size of replaced elements is dictated by the size of the media inserted into them, and the media is a fixed size, they explode out of their containing elements and make a mess of the layout. this is pretty horrible, but generally this kind of problem is easily fixed with some simple css: img, video { max-width: 100%; } this tells the replaced elements to remain constrained in...
...ectify the layout problem, and this can be done using media queries. note: media queries are a css3 feature that allow you to selectively apply css depending on the results of media feature tests — for more on the basics, read media queries. typical desktop layout in our example, we have a desktop layout, as we've already seen. this is created using the css rules included at the top of the
stylesheet, before any media queries are encountered. mid-width layout we also have a mid-width layout, which is aimed at working well on tablets and narrow laptop screens. this is created by all of the css inside the first media query: @media all and (max-width: 1024px) { x-card:nth-child(1), x-card:nth-child(2) { width: 50%; } x-card:nth-child(3) { width: 100%; clear: left; ...
... next up, the font-size of the buttons is set to 6.8vw. why? because the top-margin of the x-cards was set to 17vw earlier on. all buttons in the app have been set to...
...And 2 more matches
SVG Styling Attributes - SVG: Scalable Vector Graphics
the svg styling attributes are all the attributes that can be specified on any svg element to apply css styling effects. class
style attributes class assigns a class name or set of class names to an element. it functions identically to the class attribute in html. ...
... the svg styling attributes are all the attributes that can be specified on any svg element to apply css styling effects. class
style attributes class assigns a class name or set of class names to an element. it functions identically to the class attribute in html. ...
... the svg styling attributes are all the attributes that can be specified on any svg element to apply css styling effects. class
style attributes class assigns a class name or set of class names to an element. it functions identically to the class attribute in html. ...
...And 2 more matches
SVG Attribute reference - SVG: Scalable Vector Graphics
ve alignment-baseline allowreorder alphabetic amplitude arabic-form ascent attributename attributetype autoreverse azimuth b basefrequency baseline-shift baseprofile bbox begin bias by c calcmode cap-height class clip clippathunits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering contentscripttype content
styletype cursor cx cy d d decelerate descent diffuseconstant direction display divisor dominant-baseline dur dx dy e edgemode elevation enable-background end exponent externalresourcesrequired f fill fill-opacity fill-rule filter filterres filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-
style font-variant fon...
...t result rotate rx ry s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stddeviation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width
style surfacescale systemlanguage t tabindex tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to transform transform-origin type u u1 u2 underline-position underline-thickness unicode unicode-bidi unicode-range units-per-em v v-alphabetic v-hanging v-ideographic v-mathematical values vector-effect version vert-adv-y ver...
... xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate presentation attributes note that all svg presentation attributes can be used as css properties. alignment-baseline, baseline-shift, clip, clip-p...
...And 2 more matches
SVG and CSS - SVG: Scalable Vector Graphics
example make a new svg document as a plain text file, doc8.svg. ...
... example make a new svg document as a plain text file, doc8.svg. ...
...copy and paste the content from here, making sure that you scroll to get all of it: /*** svg demonstration ***/ /* page */ svg { background-color: beige; } #heading { font-size: 24px; font-weight: bold; } #caption { font-size: 12px; } /* flower */ #flower:hover { cursor: crosshair; } /* gradient */ #fade-stop-1 { stop-color: blue; } #fade-stop-2 { stop-color: white; } ...
...And 2 more matches
XML introduction - XML: Extensible Markup Language
y again."> ]> <body> <message> &warning; </message> </body> you can also use numeric character references to specify special characters; for example, © is the "©" symbol. displaying xml xml is usually used for descriptive purposes, but there are ways to display xml data. if you don't define a specific way for the xml to be rendered, the raw xml is displayed in the browser. ...
...so use numeric character references to specify special characters; for example, © is the "©" symbol. displaying xml xml is usually used for descriptive purposes, but there are ways to display xml data. if you don't define a specific way for the xml to be rendered, the raw xml is displayed in the browser. one way to
style xml output is to specify css to apply to the document using the xml-
stylesheet processing instruction. ...
...cify special characters; for example, © is the "©" symbol. displaying xml xml is usually used for descriptive purposes, but there are ways to display xml data. if you don't define a specific way for the xml to be rendered, the raw xml is displayed in the browser. one way to
style xml output is to specify css to apply to the document using the xml-
stylesheet processing instruction. ...
...And 2 more matches
dev/panel - Archive of obsolete content
however, it can receive messages from the add-on that created it, and the add-on can pass it the debuggee so it can communicate with the deb...
...clients connect to the server and send it messages to examine and modify the state of the program being debugged. the remote debugging protocol page describes the protocol in detail. when the user opens a panel and the panel is created, the framework calls the panel's setup method. the setup method will be pas...
...h gives you a javascript api to the remote debugging protocol. note that at the moment volcan.js does not support the complete remote debugging protocol. we're still working on documenting exactly which messages are supported by volcan.js. ...
...which is fulfilled with an object representing the root actor: volcan.connect(debuggee).then(gotroot); function gotroot(root) { // can use root actor here } actors actors in the remote debugging protocol are volcan.js objects. the messages actors can accept are methods of those objects. the message type becomes the method name. for example, the root actor object has a method listtabs and the
stylesheet actor object has a method get
stylesheets. any additional parameters sent in the message become arguments to the method. if a message is expected to get a reply, then the method returns a promise which is fulfilled with the reply. if the message reply in the remote debugging protocol would contain an actor id, then in volcan.js the object that fulfills the promise contains that actor instanc...
The Essentials of an Extension - Archive of obsolete content
nge namespace declarations when you mix different types of content in the same document, such as xul with html or svg. you may have noticed the naming we use on several places, such as the id xulschoolhello-browser-overlay. this is the namespacing standard that we use to avoid conflicts with firefox and other extensions, as well as making some development tasks easier. we namespace all ids and
style classes in overlay elements because they will be mixed with other elements in the main browser window. if we used generic ids like container or input, they will likely conflict with ids used within firefox, or with ids from other extension overlays. using namespaces minimizes compatibility problems with other extensions. we use camel casing for file names, and all lower case with dashes for eleme...
...rlay elements because they will be mixed with other elements in the main browser window. if we used generic ids like container or input, they will likely conflict with ids used within firefox, or with ids from other extension overlays. using namespaces minimizes compatibility problems with other extensions. we use camel casing for file names, and all lower case with dashes for element ids and css
style class names, but you're free to use your own system. <script type="application/x-javascript" src="chrome://xulschoolhello/content/browseroverlay.js" /> just like in html, this includes a javascript script file. you can have as many script elements in a xul document as you need. we'll look into its code later. you also probably noticed how we format our code, and wonder about the rule...
... this particular syntax, initializing an object as {} is the equivalent of initializing it to new object(). /** * controls the browser overlay for the hello world extension. */ xulschoolchrome.browseroverlay = { finally, browseroverlay is our object. naming and referencing objects in such a long and verbose manner can feel uncomfortable at first, but it's worth the cost. we use javadoc
style comments on all namespaces, objects and object members. this is a similar standard to the one used in mozilla code, and some tools can generate documentation automatically from javadoc. sayhello : function(aevent) { let stringbundle = document.getelementbyid("xulschoolhello-string-bundle"); let message = stringbundle.getstring("xulschoolhello.greeting.label"); window.alert(message); }...
...f plural forms that are also language-dependent. skin styling xul is very similar to styling html. we'll look into some of the differences when we cover the xul box model, and other more advanced topics. there isn't much styling you can do to a minimal menu and a very simple alert message, so the hello world extension only includes an empty css file and the compulsory global skin file: <?xml-
stylesheet type="text/css" href="chrome://global/skin/" ?> <?xml-
stylesheet type="text/css" href="chrome://xulschoolhello/skin/browseroverlay.css" ?> the global skin css file holds the default
styles for all xul elements and windows. forgetting to include this file in a xul window usually leads to interesting and often unwanted results. in our case we don't really need to include it, since we're...
Index of archived content - Archive of obsolete content
functional lang/type loader/cuddlefish loader/sandbox net/url net/xhr places/bookmarks places/favicon places/history platform/xpcom preferences/event-target preferences/service remote/child remote/parent
stylesheet/
style stylesheet/utils system/child_process system/environment system/events system/runtime system/unload system/xul-app tabs/utils test/assert test/harness test/httpd test/runner test/utils ui/butt...
...ension development environment signing an xpi signing an extension supporting search suggestions in search plugins tabbed browser techniques promises updating addons broken by private browsing changes using dependent libraries in extension components using the
stylesheet service bookmarks.export() bookmarks.import() adding preferences to an extension an interview with douglas bowman of wired news archived mozilla and build documentation activex control for hosting netscape plug-ins in ie archived spidermonkey docs ...
... in a java application using javaxpcom error console exception logging in javascript existing content extension frequently asked questions external cvs snapshots in mozilla-central fast graphics performance with html firefox block and line layout cheat sheet content states and the
style system disabling interruptible reflow document loading - from load start to finding a handler documentation for bidi mozilla downloading nightly or trunk builds jss build instructions for osx 10.6 layout faq layout system overview multiple firefox profiles repackaging firefox st...
...ds in your web pages developing cross-browser and cross-platform pages references summary of changes using the w3c dom using workers in extensions web standards choosing standards compliance over proprietary practices community correctly using titles with external
stylesheets describing microformats in javascript displaying a graphic with audio samples fixing incorrectly sized list item markers fixing table inheritance in quirks mode issues arising from arbitrary-element hover mozilla's doctype sniffing parsing microformats in javascript popup window controls rdf in fifty w...
Fast Graphics Performance With HTML - Archive of obsolete content
make content that has scrolling content underneath it opaque e.g. use <div><div
style="background:white; position:fixed">simple</div>lots of text...</div> instead of <div><div
style="position:fixed">simple</div>lots of text...</div> make the content of scrollable sub frames opaque e.g. ...
... make content that has scrolling content underneath it opaque e.g. use <div><div
style="background:white; position:fixed">simple</div>lots of text...</div> instead of <div><div
style="position:fixed">simple</div>lots of text...</div> make the content of scrollable sub frames opaque e.g. ...
... make content that has scrolling content underneath it opaque e.g. use <div><div
style="background:white; position:fixed">simple</div>lots of text...</div> instead of <div><div
style="position:fixed">simple</div>lots of text...</div> make the content of scrollable sub frames opaque e.g. ...
... use <div><div
style="background:white; position:fixed">simple</div>lots of text...</div> instead of <div><div
style="position:fixed">simple</div>lots of text...</div> make the content of scrollable sub frames opaque e.g. ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
a block consists of lines and other blocks, stacked vertically. a block frame has one nslinebox for each line, and one nslinebox for each block child. these are stored as a doubly-linked list in the mlines member of nsblockframe. nsinlineframe mflags ns_inline_frame_contains_percent_aware_child this flag is set if the inline frame has any children that have a percentage value set (via the
style context) for the width or height of the content area, padding, border, or margin. nshtmlreflowstate the current state of reflow, built up as reflow recursively descends the frame tree. this is "passed in" to a child frame from its parent, and provides the constraints in which the child frame must size itself; e.g. the width and height available to the child frame. mcomputedwidth mcomputedh...
...a child frame from its parent, and provides the constraints in which the child frame must size itself; e.g. the width and height available to the child frame. mcomputedwidth mcomputedheight mcomputedmargin mcomputedborderpadding mcomputedpadding mcomputedoffsets mcomputedminwidth mcomputedmaxwidth mcomputedminheight mcomputedmaxheight given the current container frame and the
style applied to the child, these values are the resolved values for the child frame's box. nshtmlreflowmetrics the structure that is "filled in" by a frame during reflow, and is used to communicate the frame's desired size information back to its container. mmaximumwidth the maximum width that the frame would consume if it were reflowed with an unconstrained available width. it might be better n...
... need to force a resize reflow when computing the final size. e.g., because...why? brs_isinlineincrreflow this flag is set in nsblockframe::reflow() if we detect that we're incrementally reflowing a linebox that contains inline frames. in this case, we can avoid some of the work that occurs during reflow. brs_nowrap this flag is set in the nsblockreflowstate constructor when the "white-space"
style of the block frame is pre or nowrap. it is cleared, otherwise. brs_istopmarginroot this flag is set in the nsblockreflowstate constructor when reflowing a "block margin root" frame (i.e., a frame with the ns_block_margin_root flag set, for which margins apply by default). the flag is also set when reflowing a frame whose computed top border padding is zero. (why?) brs_isbottommarginroot this ...
...incremental reflow, this member holds current frame in the reflow chain. nslinelayout encapsulates the transient reflow state for a nslinebox that contains inline frames. a new nslinelayout object is created for each inline linebox that is flowed. mflags ll_endsinwhitespace set to true by default when starting line layout. ...
Table Layout Regression Tests - Archive of obsolete content
seful, the testing information is much less relevant now than it has been, as the "rtest" testing framework described here has been superseded by the reftest framework. it is unclear whether or how well rtest continues to work and whether it is still used or not. subject overview changes in layout, parser and content code can have unintended side effects, also known as regressions. it is good
style to check for these unwanted regressions and fixing them before checkin rather than causing bugzilla avalanches. prerequisites in order to run these tests, you will need to have: make sure that your build is a debug build (in short you need ac_add_options --enable-debug in your .mozconfig file). to build the layoutdebugger itself, build either all extensions or include layoutdebug in your .m...
...s in rtest.lst (see: nsregressiontester::dumpframemodel). their name is generated by replacing the old extension .html or .xml with .rgd. for appendcells1.html a file appendcells1.rgd will be created in the baseline or verify subdirectory. ...
...textreset data="0 10[0xa]enum " /> <display data="0 1 0 0 0 0 0 0 0 0 0 0 " /> <visibility data="0 1 1.000000" /> <table data="0 0 4 -1 1 " /> <tableborder data="1 null null 0 2 " /> <content data="0 0 0 null " /> <quotes data="0 " /> <ui data="3 0 0 1 " /> <uireset data="7 0 4" /> <xul data="0 0 0 0 0 1 <svg data="0 1.000000 1.000000 0 1.000000" /> </
stylecontext> the baseline log will look like: type manifest file: e:\moz_src\mozilla\obj-i586-pc-msvc\dist\bin\components\xpti.dat +++ javascript debugging hooks installed. ++webshell == 1 ++domwindow == 1 ++webshell == 2 ++domwindow == 2 note:
styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running baseline test for e:\mo...
...y subdirectories (verify) and compares each frame dump with the corresponding reference frame dump. if they differ in critical points the test fails. a typical part of the verify log would look like: type manifest file: e:\moz_src\mozilla\obj-i586-pc-msvc\dist\bin\components\xpti.dat +++ javascript debugging hooks installed. ++webshell == 1 ++domwindow == 1 ++webshell == 2 ++domwindow == 2 note:
styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running verify test for e:\moz_src\mozilla\layout\html\tests\block\rtest.lst. writing regression data to e:\moz_src\mozilla\layout\html\tests\table\core\verify\standards1.rgd comparing to regression data from e:\moz_src\mozilla\layout\html\tests\table\core\baseline\standards1.rg...
XBL 1.0 Reference - Archive of obsolete content
scribes extensible binding language (xbl) 1.0 as implemented in gecko browsers. extensible binding language is a xml-based markup language to implement reusable components (bindings) that can be bound to elements in other documents. the element with a binding specified, called the bound element, acquires the new behavior specified by the binding. bindings can be bound to elements using cascading
style sheets (css) or dom. one element can be bound to several bindings at once. functionally bindings should be correlated with behaviors and viewlink but being implemented as one integrated xml solution. bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content th...
...e reflected yet in this document. the documentation process is still in progress: please keep it in your mind while using the provided information. xbl elements xbl 1.0 elements are in the http://www.mozilla.org/xbl namespace. ...
... mind while using the provided information. xbl elements xbl 1.0 elements are in the http://www.mozilla.org/xbl namespace. ...
... this example is targeted to demonstrate the xbl usage rather than to be a practically useful application. for this reason it contains many comments and some blocks could be avoided in a mo...
Complete - Archive of obsolete content
s component in each of the themes that it supports. these themes are: classic for firefox etc. classic for seamonkey modern for seamonkey to make it easier to support different themes, developers place anything that might depend on the theme in separate files in a separate directory. in this extension, the only things that depend on the theme are the icon images on the buttons and the css
style rules. for more information about themes, see the main themes page here. how a button gets themed when you look at button 1 in seamonkey, you see an image or
style that depends on your theme. this is how it happens: this extension does not support modern in firefox etc., but you can see the registration details for classic in chrome.manifest. for example, if you are using modern, it loads: skin/m...
...classic in chrome.manifest. for example, if you are using modern, it loads: skin/modern/allcustom/seamonkey/allcustom.css from inside the jar. when you restart after installing the extension, the skins classic and modern are both registered for the component allcustom. you can see the registration details in installed-chrome.txt and chrome.rdf. ...
...you are using modern, it loads: skin/modern/allcustom/seamonkey/allcustom.css from inside the jar. when you restart after installing the extension, the skins classic and modern are both registered for the component allcustom. you can see the registration details in installed-chrome.txt and chrome.rdf. when the xul file, allcustom.xul is loaded, the
stylesheet declaration near the top loads a
stylesheet from chrome://allcustom/skin/. the application's chrome registry converts this to the correct css file for the theme you are using. the xul toolbarbutton tag has an id all-custom-1. the css
stylesheet uses the corresponding selector #all-custom-1 to provide the appropriate image: button-1.png file structure in the new file structure, there is a skin directory for all the themes. each them...
...tton-1.png file structure in the new file structure, there is a skin directory for all the themes. each theme has its own directory there. in each theme's directory, there is an allcustom directory. this is useful when files from various components and extensions and all unpacked in the same place—it keeps each set of files separate. the allcustom directory contains the icon images and the css
stylesheet. the file contents.rdf contains registration data used by seamonkey. testing a theme to test a theme in seamonkey, choose view – apply theme, then choose the theme. restart seamonkey. application differences some differences between firefox etc. and seamonkey cause complications for this extension. to resolve the differences, the extension uses firefox etc. and seamonkey's different regist...
Adding Buttons - Archive of obsolete content
tag has the following syntax: <button id="identifier" class="dialog" label="ok" image="images/image.jpg" disabled="true" accesskey="t"/> the attributes are as follows, all of which are optional: id a unique identifier so that you can identify the button with. you'll see this attribute on all elements. you'll want to use this if you want to refer to the button in a
style sheet or script. however, you should add this attribute to almost all elements. it isn't always placed on elements in this tutorial for simplicity. class the
style class of the button. this works the same as in html. it is used to indicate the
style that the button appears in. in this case the value dialog is used. in most cases, you will not use a class for a button. label the label that w...
... disabled if this attribute is set to true, the button is disabled. this is usually drawn with the text in grey. if the button is disabled, the function of the button cannot be performed. if this attribute is left out entirely, the button is enabled. you can switch the disabled state of the button using javascript. ...
...he button appears in. in this case the value dialog is used. in most cases, you will not use a class for a button. label the label that will appear on the button. for example, ok or cancel. if this is left out, no text appears. image the url of the image to appear on the button. if this is attribute is left out, no image appears. you can also specify the image in a
stylesheet using the list-
style-image property. disabled if this attribute is set to true, the button is disabled. this is usually drawn with the text in grey. if the button is disabled, the function of the button cannot be performed. if this attribute is left out entirely, the button is enabled. you can switch the disabled state of the button using javascript. accesskey this should be set to a letter that is used as a sh...
...rmal browser windows. due to this, the buttons will appear to stretch across the window. you can add align="start" to the window tag to prevent the stretching. the findfile.xul example let's add this code to the file findfile.xul that we created in the previous section. the code needs to be inserted in-between the window tags. the code to add is shown in red below: <?xml version="1.0"?> <?xml-
stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button id="find-button" label="find"/> <button id="cancel-button" label="cancel"/> </window> you'll notice that the cancel button was added also. the window has been given a...
Creating a Window - Archive of obsolete content
« previousnext » we're going to be creating a simple find files utility throughout this tutorial. first, however, we should look at the basic syntax of a xul file. creating a xul file an xul file can be given any name but it really should have a .xul extension. the simplest xul file has the following structure: <?xml version="1.0"?> <?xml-
stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- other elements go here --> </window> this window will not do anything since it doesn't contain any ui elements. those will be added in the next section. in fact, there will not be shown any window at all. if you want to f...
...be added in the next section. in fact, there will not be shown any window at all. if you want to force the window to become visible you can add the width and height attribute to the window tag. here is a line by line breakdown of the code above: <?xml version="1.0"?> this line simply declares that this is an xml file. you would normally add this line as is at the top of each xul file. <?xml-
stylesheet href="chrome://global/skin/" type="text/css"?> this line is used to specify the
style sheets to use for the file. this is the syntax that xml files use to import
style sheets. in this case, we import the
styles found in the global part of a skin package. we didn't specify a specific file so mozilla will determine which files in the directory to use. in this case, the all-important global.c...
...ic file so mozilla will determine which files in the directory to use. in this case, the all-important global.css file is selected. this file contains all the default declarations for all of the xul elements. because xml does not have any knowledge of how elements should be displayed, the file indicates how. generally, you will put this line at the top of every xul file. you can also import other
style sheets using a similar syntax. note that you would normally import the global
style sheet from within your own
style sheet file. <window this line declares that you are describing a window. each user interface window is described in a separate file. this tag is much like the html tag which surrounds an entire html document, except that a user interface window is described instead of a document...
...top-level window without any browser chrome, such as the address field or menu. only chrome urls have additional privileges. the extension developer's extension contains an xul editor that allows you to type in xul code and see the results in real-time from within mozilla! troubleshooting if the xul window fails to show up on the desktop but has an icon on the desktop tool bar, check the xml-
stylesheet declaration. make sure that you have included the
stylesheet correctly: <?xml-
stylesheet href="chrome://global/skin/" type="text/css"?> in the next section, we will add some buttons to the window. « previousnext » ...
Localization - Archive of obsolete content
"> the example above uses two entities, one for the label on the undo menu item and the second for the access key. changing the find files example let's take a look at how we would put all of this together by modifying the find files dialog so that it uses a dtd file for all of its text strings. the entire xul file is shown below with the changes shown in red. ...
...he undo menu item and the second for the access key. changing the find files example let's take a look at how we would put all of this together by modifying the find files dialog so that it uses a dtd file for all of its text strings. the entire xul file is shown below with the changes shown in red. ...
...p> <menuitem label="rdf:http://www.xulplanet.com/rdf/recent#label" uri="rdf:*"/> </menupopup> </template> </menulist> </groupbox> </tabpanel> <tabpanel id="optionspanel" orient="vertical"> <checkbox id="casecheck" label="&casesensitive;"/> <checkbox id="wordscheck" label="&matchfilename;"/> </tabpanel> </tabpanels> </tabbox> <tree id="results"
style="display: none;" flex="1"> <treecols> <treecol id="name" label="&results.filename;" flex="1"/> <treecol id="location" label="&results.location;" flex="2"/> <treecol id="size" label="&results.size;" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="mozilla"/> <treecell label="/usr/local"/> <treecell label="&b...
...esults.location;" flex="2"/> <treecol id="size" label="&results.size;" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="mozilla"/> <treecell label="/usr/local"/> <treecell label="&bytes.before;2520&bytes.after;"/> </treerow> </treeitem> </treechildren> </tree> <splitter id="splitbar" resizeafter="grow"
style="display: none;"/> <spacer class="titlespace"/> <hbox> <progressmeter id="progmeter" value="50%"
style="display: none;"/> <spacer flex="1"/> <button id="find-button" label="&button.find;" oncommand="dofind()"/> <button id="cancel-button" label="&button.cancel;" oncommand="window.close();"/> </hbox> </vbox> </window> each text string has been replaced by a...
More Button Features - Archive of obsolete content
then the image is displayed on the button. the button below will have both a label and the image 'happy.png'. the image will appear to the left of the label. you can change this position by using two other attributes. this will be explained in a moment. ...
...ge is displayed on the button. the button below will have both a label and the image 'happy.png'. the image will appear to the left of the label. you can change this position by using two other attributes. this will be explained in a moment. ...
...le 1 : source view <button label="help" image="happy.png"/> button with css image another way to specify the image is by using the css list-
style-image
style property on the button. this is designed to allow the 'skin' (in this case, the appearance of the image) to be changed without changing the xul file. an example is shown below. example 2 : source view <button id="find-button" label="find"
style="list-
style-image: url('happy.png')"/> in this case, the image 'happy.png' is displayed on the button. the
style attribute functions similar to its html counterpart. in general, it can be used on all xul elements. note that you really should put the
style declarations in a separate
style sheet. positioning the images by default, the image on a button will appear to the left of the text label. th...
...with extra content buttons may have arbitrary markup contained inside them, and it will be rendered inside the button. you probably wouldn't use this very often, but you might use it when creating custom elements. for example, the following will create a button where two of the words are red: example 4 : source view <button> <description value="this is a"/> <description value="rather strange"
style="color: red;"/> <description value="button"/> </button> any xul element may be placed inside the button. html elements will be ignored, so you need to wrap them inside a description element. if you specify the label attribute on the button, it will override any content placed inside the button. button with menupopup you can place a menupopup inside the button to cause a menu to drop down when ...
description - Archive of obsolete content
| properties | methods | related ] this element is used to create a block of text. the text can be set either with the value attribute or by placing text inside the open and close description tags. the value attribute is used to set text that appears in a single line. if text appears as a child of the description, it will wrap to multiple lines. ...
...e description tags. the value attribute is used to set text that appears in a single line. if text appears as a child of the description, it will wrap to multiple lines. it may contain arbitrary markup, which can be
styled as needed. more information is available in the xul tutorial. attributes crop, disabled, tabindex value properties accessibletype, crop, disabled, tabindex, value
style classes header, indent, monospace, plain, small-margin examples this is a long section of text that will word wrap when displayed <description> this is a long section of text that will word wrap when displayed. </description> this is a long section of text that will not word wrap <description value="this is a long section of text that will not word wrap"> </description> this is a long se...
...ng section of text that will word wrap when displayed <description> this is a long section of text that will word wrap when displayed. </description> this is a long section of text that will not word wrap <description value="this is a long section of text that will not word wrap"> </description> this is a long section of dynamically controlled text that will word wrap <description id="desc"
style="width: 300px"></description> document.getelementbyid('desc').textcontent = "this is a long section of dynamic message text that will word wrap"; attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute. an ellipsis will be used in place of the cr...
...typically, this will cause the text to appear bold. indent this class causes the text to be indented on its left side. monospace this class causes the text to be displayed in a monospace font. plain this class causes the element to be displayed with no border or margin. small-margin this class causes the text to be displayed with a sma...
image - Archive of obsolete content
rmation is available in the xul tutorial. note: prior to gecko 8.0, images did not shrink down with the same ratio in both directions when specifying maximum sizes using maxheight or maxwidth. the new behavior aligns more with the html <img> element and shrinks both the width and height down proportionally. attributes onerror, onload, src, validate properties accessibletype, src
style classes alert-icon, error-icon, message-icon, question-icon examples <image src='firefoxlogo.png' width='135' height='130'/> attributes onerror type: script code this event is sent to an image element when an error occurs loading the image. image.onload type: script code this event handler will be called on the image element when the image has finished loading. this appl...
...mples <image src='firefoxlogo.png' width='135' height='130'/> attributes onerror type: script code this event is sent to an image element when an error occurs loading the image. image.onload type: script code this event handler will be called on the image element when the image has finished loading. this applies whether the image is applied via the src attribute or the list-
style-image
style property. if you change the image, the event will fire again when the new image loads. this event will not bubble up the element tree. src type: uri the uri of the content to appear in the element. validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are ...
...rl gets and sets the value of the src attribute. ...
...this typically looks like an exclamation mark. this and the other icon classes may be used by image elements or other elements which can have an image. error-icon class that adds an error icon. this will typically be a red "x" icon. message-icon class that adds a message box icon. question-icon class that adds a questio...
scrollbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a box that has additional functions that can be used to scroll the content. note that a scrollbox doesn't cause scrollbars to be displayed. it is intended to be used when an application wants to be able to adjust the scroll position itself. if you just want scrollbars to appear, add
style='overflow: auto;'. this may also be used with any other container element. examples the following shows the xul for a bunch of labels. they come out in a box. if their container doesn't give enough room to hold them (geometrically) what happens depends on the enclosing elements; often the content is just clipped off on the bottom or right (depending on what's too big to fit). <vbox> <label value="01 four s...
...r to scroll around the big content in the small view space. for the most part, the horizontal and vertical scrollbars will independently handle too-tall and too-wide cases, but each scroll bar takes up additional width and so the appearance of one scroll bar can trigger the other one if it's close to the edge anyway. use overflow:scroll if you want the scroll bars on all the time. ...
...licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
<statusbarpanel> - Archive of obsolete content
an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a label or an image but not both. this element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. ...
... gets and sets the value of the label attribute. ...
... « xul reference home statusbarpanel-iconic use this class to have an image appear on the statusbarpanel. specify the image using the src attribute. the image will appear instead ...
...tnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata
style classes the following classes may be used to
style the element. these classes should be used instead of changing the
style of the element directly since they will fit more naturally with the user's selected theme. « xul reference home statusbarpanel-iconic use this class to have an image appear on the statusbarpanel. specify the image using the src attribute. the image will appear instead of the label. statusbarpanel-iconic-text use this...
nsIContentPolicy - Archive of obsolete content
value description type_other 1 indicates content whose type is unknown, or is not interesting outside a limited use case. in general, you should try not to use this type unless none of the others is a fit. type_script 2 indicates an executable script (such as javascript). type_image 3 indicates an image (for example, <img> elements). type_
stylesheet 4 indicates a
stylesheet (for example, <
style> elements). type_object 5 indicates a generic object (plugin-handled content typically falls under this category). type_document 6 indicates a dom document at the top-level (that is, directly within a browser tab). type_subdocument 7 indicates a document contained within another document (fo...
...st by a plugin. type_dtd 13 indicates a dtd loaded by an xml document. type_font 14 indicates a font loaded via @font-face rule. type_media 15 indicates a video or audio load. type_websocket 16 indicates a websocket load. type_csp_report 17 indicates a content security policy report. type_xslt 18 indicates a
style sheet transformation. type_beacon 19 indicates a beacon post. type_fetch 20 indicates a load initiated by the globalfetch.fetch() method, which is available as a global in both window and worker contexts. type_imageset 21 indicates a request to load an <img> (with the srcset attribute or <picture>. type_web_manifest 22 indicates a reques...
... note: this rejection only applies to the current request on this server, not to future requests of the same type. accept 1 returned from shouldload() or shouldprocess() if the load or process request is not rejected. ...
...ading the requested resource. shouldload() can be called while the dom and layout of the document involved is in an inconsistent state. this means that implementers of this method must not do any of the following: modify the dom in any way (e.g., setting attributes is a no-no). query any dom properties that depend on layout (e.g., offset* properties). query any dom properties that depend on
style (e.g., computed
style). query any dom properties that depend on the current state of the dom outside the "context" node (e.g., lengths of node lists). [javascript implementations only] access properties of any sort on any object without using xpcnativewrapper (either explicitly or implicitly). due to various dom0 things, this leads to item 4. if you do any of these things in your shouldload()...
::-ms-clear - Archive of obsolete content
ties only the following css properties can be used in a rule with ::-ms-clear in its selector. other properties are ignored. ...
...le with ::-ms-clear in its selector. other properties are ignored. ...
...gnored. ...
...n background-position-x background-position-y background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-
style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-clear exam...
::-ms-expand - Archive of obsolete content
ies only the following css properties can be used in a rule with ::-ms-expand in its selector. other properties are ignored. ...
...e with ::-ms-expand in its selector. other properties are ignored. ...
...gnored. ...
...n background-position-x background-position-y background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-
style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-clear spec...
::-ms-fill-lower - Archive of obsolete content
e possible representation of <input type="range">. allowable properties only the following css properties can be used in a rule with ::-ms-fill-lower in its selector. other properties are ignored. ...
...le properties only the following css properties can be used in a rule with ::-ms-fill-lower in its selector. other properties are ignored. ...
...d in a rule with ::-ms-fill-lower in its selector. other properties are ignored. ...
...ound-color background-image background-origin background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-
style outline-width padding-bottom padding-left padding-right padding-...
::-ms-fill-upper - Archive of obsolete content
e possible representation of <input type="range">. allowable properties only the following css properties can be used in a rule with ::-ms-fill-upper in its selector. other properties are ignored. ...
...le properties only the following css properties can be used in a rule with ::-ms-fill-upper in its selector. other properties are ignored. ...
...d in a rule with ::-ms-fill-upper in its selector. other properties are ignored. ...
...ound-color background-image background-origin background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-
style outline-width padding-bottom padding-left padding-right padding-...
::-ms-reveal - Archive of obsolete content
element is specific to internet explorer 10 and later. allowable properties only the following css properties can be used in a rule with ::-ms-reveal in its selector. other properties are ignored. ...
...owable properties only the following css properties can be used in a rule with ::-ms-reveal in its selector. other properties are ignored. ...
... used in a rule with ::-ms-reveal in its selector. other properties are ignored. ...
...ound-color background-image background-origin background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-
style outline-width padding-bottom padding-left padding-right padding-...
::-ms-thumb - Archive of obsolete content
is one possible representation of <input type="range">. allowable properties only the following css properties can be used in a rule with ::-ms-thumb in its selector. other properties are ignored. ...
...lowable properties only the following css properties can be used in a rule with ::-ms-thumb in its selector. other properties are ignored. ...
...e used in a rule with ::-ms-thumb in its selector. other properties are ignored. ...
...ound-color background-image background-origin background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-
style outline-width padding-bottom padding-left padding-right padding-...
::-ms-track - Archive of obsolete content
arks altogether, set the color property to transparent. allowable properties only the following css properties can be used in a rule with ::-ms-track in its selector. other properties are ignored. ...
...lowable properties only the following css properties can be used in a rule with ::-ms-track in its selector. other properties are ignored. ...
...e used in a rule with ::-ms-track in its selector. other properties are ignored. ...
...ound-color background-image background-origin background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-
style outline-width padding-bottom padding-left padding-right padding-...
XForms Alert Element - Archive of obsolete content
the alert element can be bound to any simple content. representations can be represented in two ways: modeless window that contains the alert element's message (default representation). the alert element's message can also be displayed immediately after the containing form control element in the xforms document's layout. this representation is used if the alert element has an inline display
style. ...
...on). the alert element's message can also be displayed immediately after the containing form control element in the xforms document's layout. this representation is used if the alert element has an inline display
style. ...
...yout. this representation is used if the alert element has an inline display
style. ...
...the alert element has an inline display
style. ...
Extra lives - Game development
ibility is initially set to false. making our text styling dry as you probably noticed we're using the same styling for all three texts: scoretext, livestext and lifelosttext. if we ever want to change the font size or color we will have to do it in multiple places. ...
...tyling dry as you probably noticed we're using the same styling for all three texts: scoretext, livestext and lifelosttext. if we ever want to change the font size or color we will have to do it in multiple places. ...
... the lives handling...
...t text
style and place it before the text definitions: text
style = { font: '18px arial', fill: '#0095dd' }; we can now use this variable when stlying our text labels — update your code so that the multiple instances of the text styling are replaced with the variable: scoretext = game.add.text(5, 5, 'points: 0', text
style); livestext = game.add.text(game.world.width-5, 5, 'lives: '+lives, text
style); livestext.anchor.set(1,0); lifelosttext = game.add.text(game.world.width*0.5, game.world.height*0.5, 'life lost, click to continue', text
style); lifelosttext.anchor.set(0.5); lifelosttext.visible = false; this way changing the font in one variable will apply the changes to every place it is used. the lives handling code to implement lives in our game, let's first change the ball's function ...
CSS - MDN Web Docs Glossary: Definitions of Web-related terms
a css rule is a set of properties associated with a selector. ...
... a css rule is a set of properties associated with a selector. ...
... a css rule is a set of properties associated with a selector. ...
... a css rule is a set of properties associated with a selector. ...
WAI-ARIA basics - Learn web development
precise, and can only be used when the screenreader is reading from the top of the page. as another example, apps started to feature complex controls like date pickers for choosing dates, sliders for choosing values, etc. html5 provides special input types to render such controls: <input type="date"> <input type="range"> these are not well-supported across browsers, and it is also difficult to
style them, making them not very useful for integrating with website designs. as a result, developers quite often rely on javascript libraries that generate such controls as a series of nested <div>s or table elements with classnames, which are then
styled using css and controlled using javascript. the problem here is that visually they work, but screenreaders can't make any sense of what they are at ...
...ated like a notable landmark, beyond the actual input being called out as a search input (<input type="search">). in addition, some older browsers (most notably ie8) don't recognise the semantics of the html5 elements. let's improve it by the use of some aria features. first, we'll add some role attributes to our html structure. ...
...positioning. ...
...glemusician(bool) { let instruitem = formitems[formitems.length-1]; if(bool) { instruitem.input.disabled = false; instruitem.label.
style.color = '#000'; instruitem.input.setattribute('aria-disabled', 'false'); hiddenalert.textcontent = 'instruments played field now enabled; use it to tell us what you play.'; } else { instruitem.input.disabled = true; instruitem.label.
style.color = '#999'; instruitem.input.setattribute('aria-disabled', 'true'); instruitem.input.removeattribute('aria-label'); hiddenalert.textcontent = 'instruments played field now disabled.'; } } describing non-semantic buttons as buttons a few times in this course already, we've mentioned the native accessibilty of (and the accessibility issues behind using other elements to fake) bu...
CSS selectors - Learn web development
in this article and its sub-articles we'll run through the different types in great detail, seeing how they work. ...
...in this article and its sub-articles we'll run through the different types in great detail, seeing how they work. ...
...ine. h1, .special { color: blue; } in the live example below try combining the two selectors which have identical declarations. the visual display should be the same after combining them. when you group selectors in this way, if any selector is invalid the whole rule will be ignored. in the following example, the invalid class selector rule will be ignored, whereas the h1 would still be
styled. h1 { color: blue; } ..special { color: blue; } when combined however, neither the h1 nor the class will be
styled as the entire rule is deemed invalid. h1, ..special { color: blue; } types of selectors there are a few different groupings of selectors, and knowing which type of selector you might need will help you to find the right tool for the job. in this article's subarticles w...
...the :hover pseudo-class for example selects an element only when it is being hovered over by the mouse pointer: a:hover { } it also includes pseudo-elements, which select a certain part of an element rather than the element itself. for example, ::first-line always selects the first line of text inside an element (a <p> in the below case), acting as if a <span> was ...
Legacy layout methods - Learn web development
<div class="row"> <div class="col span1">13</div> <div class="col span6">14</div> <div class="col span3">15</div> <div class="col span2">16</div> </div> </div> the aim is to turn this into a demonstration grid of two rows on a twelve column grid — the top row demonstrating the size of the individual columns, the second row some different sized areas on the grid. in the <
style> element, add the following code, which gives the wrapper container a width of 980 pixels, with padding on the right hand side of 20 pixels. this leaves us with 960 pixels for our total column/gutter widths — in this case, the padding is subtracted from the total content width because we have set box-sizing to border-box on all elements on the site (see changing the box model completely for mor...
...on for creating a grid system. there are many flexbox-based grid systems available and flexbox can solve many of the issues that we’ve already discovered when creating our grid above. however, flexbox was never designed as a grid system and poses a new set of challenges when used as one. ...
...visit the skeleton website, and choose "download" to download the zip file. unzip this and copy the skeleton.css and normalize.css files into a new directory. make a copy of our html-skeleton.html file and save it in the same directory as the skeleton and normalize css. include the skeleton and normalize css in the html page, by adding the following to its head: <link href="normalize.css" rel="
stylesheet"> <link href="skeleton.css" rel="
stylesheet"> skeleton includes more than a grid system — it also contains css for typography and other page elements that you can use as a starting point. we’ll leave these at the defaults for now, however — it’s the grid we are really interested in here. note: normalize is a really useful little css library written by nicolas gallagher, which auto...
...ns">15</div> <div class="two columns">16</div> </div> try saving your html file and loading it in your browser to see the effect. note: if you are having trouble getting this example to work, try comparing it to our html-skeleton-finished.html file (see it running live also). if you look in the skeleton.css file you can see how this works. for example, skeleton has the following defined to
style elements with “three columns” classes added to them. .three.columns { width: 22%; } all skeleton (or any other grid framework) is doing is setting up predefined classes that you can use by adding them to your markup. it’s exactly the same as if you did the work of calculating these percentages yourself. as you can see, we need to write very little css when using skeleton. it deals with a...
Using CSS generated content - Learn web development
this article describes some ways in which you can use css to add content when a document is displayed. you modify your
stylesheet to add text content or images. one of the important advantages of css is that it helps you to separate a document's
style from its content. however, there are situations where it makes sense to specify certain content as part of the
stylesheet, not as part of the document. you can specify text or image content within a
stylesheet when that content is closely linked to the document's structure. note: content specified in a
stylesheet does not become part of the dom. specifying content in a
stylesheet can cause complications. for example, you might have different language versions of your document that share a
stylesheet. if you specify content in your ...
... this issue does not arise if the content you specify consists of symbols or images that apply in all languages and cultures. ...
... this issue does not arise if the content you specify consists of symbols or images that apply in all languages and cultures. ...
... css can insert text content before or after an element. to specify this, make a rule and add ::before or ::after to the selector. in the declaration, specify the content property with the text content as its value. html a text where i need to <span class="ref">something</span> css .ref::before { font-weight: bold; color: navy; content: "reference "; } output the character set of a
stylesheet is utf-8 by default, but it can also be specified in the link, in the
stylesheet itself, or in other ways. for details, see 4.4 css
style sheet representation in the css specification. individual characters can also be specified by an escape mechanism that uses backslash as the escape character. for example, "\265b" is the chess symbol for a black queen ♛. for details, see referring to ch...
Images in HTML - Learn web development
pelling the image url. set the image's correct width and height (hint: it is 200px wide and 171px high), then experiment with other values to see what the effect is. set a title on the image. if you make a mistake, you can always reset it using the reset button. ...
... you make a mistake, you can always reset it using the reset button. ...
...turn it into a figure: wrap it in a <figure> element. copy the text out of the title attribute, remove the title attribute, and put the text inside a <figcaption> element below the image. if you make a mistake, you can always reset it using the reset button. ...
...ou make a mistake, you can always reset it using the reset button. ...
Graceful asynchronous programming with Promises - Learn web development
as long as the app doesn't assume that streaming has begun, it can just keep on running. note: you can learn more about this somewhat advanced topic, if you're interested, in the article signaling and video calling. code similar to this, but much more complete, is used in that example. the trouble with callbacks to fully understand why promises are a good thing, it helps to think back to old-
style callbacks and to appreciate why they are problematic. let's talk about ordering pizza as an analogy. there are certain steps that you have to take for your order to be successful, which doesn't really make sense to try to execute out of order, or in order but before each previous step has quite finished: you choose what toppings you want. this can take a while if you are indecisive, and may f...
... can take a while if you are indecisive, and may fail if you just can't make up your mind, or decide to get a curry instead. you then place your order. this can take a while to return a pizza and may fail if the restaurant does not have the required ingredients to cook it. you then collect your pizza and eat. ...
...chronous nature is basically faked using settimeout(), although it does still show that promises are useful for creating a custom function with a sensible flow of operations, good error handling, etc. one example we'd like to invite you to study, which does show a useful async application of the promise() constructor, is jake archibald's idb library. this takes the indexeddb api, which is an old-
style callback-based api for storing and retrieving data on the client-side, and allows you to use it with promises. in the code you'll see the same kind of techniques we discussed above being used there. the following block converts the basic request model used by many indexeddb methods to use promises (see this code, for example). conclusion promises are a good way to build asynchronous application...
...s the basic request model used by many indexeddb methods to use promises (see this code, for example). conclusion promises are a good way to build asynchronous applications when we don’t know the return value of a function or how long it will take to return. they make it easier to express and reason about sequences of asynchronous operations without deeply nested callbacks, and they support a
style of error handling that is similar to the synchronous try...catch statement. promises work in the latest versions of all modern browsers; the only place where promise support will be a problem is in opera mini and ie11 and earlier versions. we didn't touch on all promise features in this article, just the most interesting and useful ones. as you start to learn more about promises, you'll come ac...
Arrays - Learn web development
his. we want you to change the line just below // number 5 so that the itemtext variable is made equal to "current item name — $current item price", for example "shoes — $23.99" in each case, so the correct information for each item is printed on the invoice. this is just simple string concatenation, which should be familiar to you. ...
...h item is printed on the invoice. this is just simple string concatenation, which should be familiar to you. ...
...ping it simple for now. to complete the app, we need you to: add a line below the // number 1 comment that adds the current value entered into the search input to the start of the array. this can be retrieved using searchinput.value. add a line below the // number 2 comment that removes the value currently at the end of the array. ...
...ber 2 comment that removes the value currently at the end of the array. ...
Getting started with Ember - Learn web development
imizing the trivial differences between applications — all while being a modern and light layer on top of native javascript. ember also has immense backwards and forwards compatibility to help businesses stay up to date with the latest versions of ember and latest community-driven conventions. what does it mean to be a component-service framework? components are individual bundles of behavior,
style, and markup — much like what other frontend frameworks provide, such as react, vue, and angular. the service side provides long-lived shared state, behavior, and an interface to integrating with other libraries or systems. for example, the router (which will be mentioned later in this tutorial) is a service. components and services make up the majority of any emberjs application. use cases ge...
...ur brand new project. if you don't have one configured already, the ember atlas has some guides on how to set up various editors. installing the shared assets for todomvc projects installing shared assets, as we're about to do, isn't normally a required step for new projects, but it allows us to use existing shared css so we don't need to try to guess at what css is needed to create the todomvc
styles. first, enter into your todomvc directory in the terminal, for example using cd todomvc in macos/linux. now run the following command to place the common todomvc css inside your app: npm install --save-dev todomvc-app-css todomvc-common next, find the ember-cli-build.js file inside the todomvc directory (it's right there inside the root) and open it in your chosen code edito...
...d the following lines underneath it before saving the file: app.import('node_modules/todomvc-common/base.css'); app.import('node_modules/todomvc-app-css/index.css'); for more information on what ember-cli-build.js does, and for other ways in which you can customize your build / pipeline, the ember guides have a page on addons and dependencies. finally, find app.css, located at app/
styles/app.css, and paste in the following: :focus, .view label:focus, .todo-list li .toggle:focus + label, .toggle-all:focus + label { /* !important needed because todomvc
styles deliberately disable the outline */ outline: #d86f95 solid !important; } this css overrides some of the
styles provided by the todomvc-app-css npm package, therefore allowing keyboard focus to be visible. this goes...
...(1) | 12ms the development server launches at http://localhost:4200, which you can visit in your browser to check out what your work looks like so far. if everything is working correctly, you should see a page like this: note: on windows systems without windows subsystem for linux (wsl), you will experience slower build-times overall compared to macos, linux, and window...
Command line crash course - Learn web development
as with some other programming tools, using the terminal (or command line) on windows has traditionally not been as simple or easy as on other operating systems. but things are getting better. windows has traditionally had its own terminal-like program called cmd (“the command prompt”) for a long time, but this definitely doesn’t have parity with unix commands, and is equivalent to the old-
style windows dos prompt. better programs exist for providing a terminal experience on windows, such as powershell (see here to find installers), and gitbash (which comes as part of the git for windows toolset) however, the best option for windows in the modern day is the windows subsystem for linux (wsl) — a compatibility layer for running linux operating systems directly from inside windows 10, ...
...ok more at local installs and why they're good in the next article. installing prettier for this article we will install prettier as a global command line utility. prettier is an opinionated code formatting tool for front end developers, focusing around javascript-based languages and adding support for html, css, scss, json and more. prettier can: save the cognitive overhead of getting the
style consistent manually across all your code files; prettier can do this for you automatically. help newcomers to web development format their code in best-practice fashion. be installed on any operating system and even as a direct part of project tooling, ensuring that colleagues and friends who work on your code use the code
style you’re using. be configured to run upon save, as you type, or e...
...code in a new file called index.js, inside your test directory: const myobj = { a:1,b:{c:2}} function printme(obj){console.log(obj.b.c)} printme(myobj) we can run prettier against a codebase to just check if our code wants adjusting. cd into your directory, and try running this command: prettier --check index.js you should get on output along the lines of checking formatting... ...
...{c:2}} function printme(obj){console.log(obj.b.c)} printme(myobj) we can run prettier against a codebase to just check if our code wants adjusting. cd into your directory, and try running this command: prettier --check index.js you should get on output along the lines of checking formatting... index.js code
style issues found in the above file(s). forgot to run prettier? so there's some code
styles that can be fixed. no problem. adding the --write option to the prettier command will fix those up, leaving us to focus on actually writing useful code. now try running this version of the command: prettier --write index.js you’ll get an output like this checking formatting... index.js code
style issues fixed in the above file(s). but more importantly, if you look back at your javascript ...
Accessibility information for UI designers and developers
e who cannot see the difference between the colors, can use the labels instead. or in this one, you could consider using patterns besides colored areas: again, if people are unable to distinguish the colors, they can rely on the patterns instead. see also: understanding sc 1.4.3: contrast the focus indicator users who navigate by keyboard (or other specialised input methods), rely on focus
styles to see where they are on the page. only one element has focus at a given time, typically revealed by browsers with a dotted outline. css lets authors change what the focus indicator look like, so you can design it to match branding. here's an example of someone tabbing through a footer, the focus moves around: note: don't remove the focus indicator, as without it, users that can't or don't ...
...focus indicator look like, so you can design it to match branding. here's an example of someone tabbing through a footer, the focus moves around: note: don't remove the focus indicator, as without it, users that can't or don't use a mouse cannot see where they are. it would be like removing the mouse indicator. see also: understanding sc 2.4.7: focus visible be ready for resizing and custom
styles on the web, users can use tools in their browser to make font sizes larger, or even provide custom css to meet their specific needs. ensure your design is flexible enough to allow for this. text sizing users should be able to enlarge their text size up to 200 percent without breaking functionality. text spacing users should be able to make the following changes to their text spacing: set...
... forms in forms, provide labels for all controls. this includes form elements like inputs and select boxes, but also buttons. for form elements, it should be clear what kind of input is expected. placeholders are best avoided for this, as they are often too low in contrast. it is more helpful to describe what an input element is for in text just above ...
...racter, say ‘k’, to jump directly to options starting with ‘k’. it is recommended to use native controls, visibly or under the hood. links vs buttons to keep your interface in line with user expectations, use links for interactions that go somewhere (on the current page or another page) and buttons for interactions that do something (like submit a form or open an overlay). links can be
styled as buttons and vice versa, but designers are advised to avoid this where possible. motion on pages with transitions and animations, note that some users could experience distraction, dizziness or nausea. pages with a parallax effect can particularly cause troubles. to help these users, you could offer a setting to turn off animations, or wrap the css in the prefers-reduce-motion media query. ...
Chrome-only CSS reference
-moz-window-draggingthe -moz-window-dragging css property specifies whether a window is draggable or not. ...
... -moz-window-draggingthe -moz-window-dragging css property specifies whether a window is draggable or not. ...
...ree-drop-feedbackactivated by the properties attribute.::-moz-tree-imageactivated by the properties attribute.::-moz-tree-indentationactivated by the properties attribute.::-moz-tree-lineactivated by the properties attribute.::-moz-tree-progressmeteractivated when the type attribute is set to progressmeter. ...
...ly
styles to tree rows.::-moz-tree-row(hover)the ::-moz-tree-row(hover) css pseudo-class will match an element if the mouse cursor is presently hovering over a tree row.::-moz-tree-separatoractivated by the properties attribute.::-moz-tree-twistyactivated by the properties attribute.css -moz-bool-pref() @supports functionthe -moz-bool-pref() @supports condition is available to gecko chrome and ua
stylesheets to check if a boolean preference is enabled.css <display-xul> component</display-xul>firefox supports the following -moz- prefixed xul display values:overflow-clip-boxthe overflow-clip-box css property specifies relative to which box the clipping happens when there is an overflow. it is short hand for the overflow-clip-box-inline and overflow-clip-box-block properties.overflow-clip-box-bloc...
MathML Demo: <mfrac> - fractions
inline, auto, normal line sin θ π , numerator and denominator should render script size. inline, display
style, normal line ln x y , numerator and denominator should render normal size. inline, text
style, normal line tan θ 67 , numerator and denominator should render script size. inline, auto, thick line x 2 + 1 x , the superscripted 2 should be script-script size. inline, display
style, thick line x - 1 0.98 × 10 2 + y , the superscripted 2 should be script size. inline, text
style, thick line x 2 + 1 x x 2 + 1 x the end. ...
...uld render script size. inline, auto, thick line x 2 + 1 x , the superscripted 2 should be script-script size. inline, display
style, thick line x - 1 0.98 × 10 2 + y , the superscripted 2 should be script size. inline, text
style, thick line x 2 + 1 x x 2 + 1 x the end. inline, auto, no line x 2 + 1 x the end. inline, display
style, no line 1.234567 89 + x the end. inline, text
style, no line x 2 + 1 x the end. inline binomial, auto, no line ( 5 8 ) the end. inline binomial, display
style, no line ( n - k n ) the end. inline binomial, text
style, no line ( log x y ) the end. inline built-in verts, auto, no line | sin θ m | the end. ...
...9 + x the end. inline, text
style, no line x 2 + 1 x the end. inline binomial, auto, no line ( 5 8 ) the end. inline binomial, display
style, no line ( n - k n ) the end. inline binomial, text
style, no line ( log x y ) the end. inline built-in verts, auto, no line | sin θ m | the end. inline up arrows, display
style, no line ↑ sin θ m ↑ the end. inline down arrows, text
style, no line ↓ sin θ m ↓ the end. inline floor, auto, normal line ⌊ sin θ m ⌋ the end. inline ceiling, display
style, normal line ⌈ sin θ m ⌉ the end. inline updown arrows, text
style, normal line ↕ sin θ m ↕ the end. inl...
......
Midas
n point. formatblock h1, h2, h3, h4, h5, h6, p, div, address, blockquote (more?) the selection surrounded by the given block element. heading h1, h2, h3, h4, h5, h6 selected block will be formatted as the given type of heading. hilitecolor a color code this command will set the hilite color of the selection or at the insertion point. it only works with
stylewithcss enabled. increasefontsize this command will add a <big> tag around selection or at insertion point. indent indent the block where the caret is located. if the caret is inside a list, that item becomes a sub-item one level deeper. insertbronreturn true/false selects whether pressing return inside a paragraph creates another paragraph or just in...
...ut key will automatically trigger this command (typically accel-a) strikethrough if there is no selection, the insertion point will set strikethrough for subsequently typed characters. if there is a selection and all of the characters are already striked, the strikethrough will be removed. otherwise, all selected characters will have a line drawn through them.
stylewithcss this command is used for toggling the format of generated content. by default (at least today), this is true. an example of the differences is that the "bold" command will generate <b> if the
stylewithcss command is false and generate css
style attribute if the
stylewithcss command is true. subscript if there is no selection, the insertion point will set subscript fo...
... ...
...s within a link or if the current selection contains a link, the link will be removed and the text will remain. readonly this command has been replaced with contentreadonly. it takes the same values as contentreadonly, but the meaning of true and false are inversed. usecss this command has been replaced with
stylewithcss. it takes the same values as
stylewithcss, but the meaning of true and false are inversed. ...
NSPR Contributor Guide
compatible across even major releases. this means that the behavior of an existing public api item in nspr cannot change. should you need to have a similar api, with some slightly different behavior or different function prototype, then suggest a new api with a different name. c language api the nspr api is a c language api. please do not contribute java, c or other language wrappers. coding
style nspr does not have a documented coding
style guide. look at the extant code. make yours look like that. some guidelines concerning naming conventions can be found in nspr naming conventions in the nspr reference. see also: xxx ownership of your contribution when you contribute something to nspr, you must have intellectual property rights to that contribution. this means that you cannot give u...
...ht to incorporate it into nspr exists. license under mpl or gpl when you contribute material to nspr, you agree to allow your contribution to be licensed under the mpl or gpl. bugfixes use bugzilla to track bugs. document the bug or use an existing report. be verbose in describing what you are doing and why. include your changes as diffs in an attachment to the bugzilla report. use a coding
style consistent with the source file you are changing. new features for purposes of this paper, a "new feature" is defined as some api addition that goes into the core nspr library, for example: libnspr4.dll nspr is mostly complete. new apis are driven mostly by the os vendors as they add new features. should you decide that there's something that nspr does not cover that should be covered, let's t...
...atform ports all nspr api items must be implemented platform specific headers in pr/include/md/_platformname.[h!cfg] platform specific code in pr/src/md/platform/*.c make rules in config/_platform.mk documentation the files for nspr's documentation are maintained using a proprietary word processing system [don't ask]. document your work as described in [#newfeatures new features]. use the
style of other nspr documentation. we will see that your documentation is transcribed into the appropriate word processor and the derived html shows up on mozilla.org test cases you should provide test cases for all new features and new libraries. give consideration to providing a test case when fixing a bug if an existing test case did not catch a bug it should have caught. the new test cases shoul...
...tion. we will see that your documentation is transcribed into the appropriate word processor and the derived html shows up on mozilla.org test cases you should provide test cases for all new features and new libraries. give consideration to providing a test case when fixing a bug if an existing test case did not catch a bug it should have caught. the new test cases should be implemented in the
style of other nspr test cases. test cases should prove that the added api items work as advertized. test cases should serve as an example of how to use the api items. test cases should provoke failure of every api item and report its failure. frequently asked questions (faq) q: why was my contribution rejected? a: check the bugzilla report covering your contribution. original document information...
Index
reference the nsiaccessnode implementations are instantiated lazily. the nsiaccessnode tree for a given dom window has a one to one relationship to the dom tree. if the dom node for this access node is "accessible", then a queryinterface to nsiaccessible will succeed. 233 domnode no summary! 234 getchildnodeat no summary! 235 getcomputed
stylecssvalue no summary! 236 getcomputed
stylevalue no summary! 237 accessibledocument no summary! 238 firstchildnode no summary! 239 innerhtml for the dom property, see element.innerhtml. 240 language no summary! 241 lastchildnode no summary! 242 nex...
... add a uri to global history. 675 nsiglobalhistory3 interfaces, interfaces:scriptable, places, xpcom, xpcom api reference, xpcom interface reference this interface was originally created as part of nsiglobalhistory2, but was split off during the transition to places. 676 nsihtmleditor interfaces, interfaces:scriptable, needscontent registers a default
style property with the editor. 677 nsihttpheaderlistener interfaces, interfaces:scriptable, needscontent, reference, référence(2), xpcom interface reference no summary! 678 nsihapticfeedback interfaces, interfaces:scriptable, mobile, xpcom interface reference implemented by: @mozilla.org/widget/hapticfeedback;1 as a service: 679 nsihttpactivitydis...
...r_true. this method is generally called within a loop to iterate over the strings in the enumerator. 928 nsistructuredclonecontainer interfaces, interfaces:scriptable, needscontent you can copy an object into an nsistructuredclonecontainer using initfromvariant() or initfrombase64(). it is an error to initialize an nsistructuredclonecontainer more than once. 929 nsi
stylesheetservice interfaces, interfaces:scriptable,
stylesheets, xpcom, xpcom api reference, xpcom interface reference allows extensions or embeddors to add to the built-in list of user or agent
style sheets. 930 nsisupports interfaces, interfaces:scriptable, xpcom, xpcom interface reference notifies the object that an interface pointer has been duplicated. 931 ...
...er message "senders" have a single "other side" to which messages are sent. for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. 994 nsitxttohtmlconv html, interfaces, interfaces:scriptable, xpcom interface reference prior versions of the interface named the methods using the initialcaps
style instead of the intercaps
style. 995 nsitaggingservice interfaces, interfaces:scriptable, places, xpcom, xpcom api reference, xpcom interface reference implemented by: @mozilla.org/browser/tagging-service;1. to use this service, use: 996 nsitaskbarpreview interfaces, interfaces:scriptable, taskbar, xpcom, xpcom interface reference you can not directly inst...
nsITreeBoxObject
view nsitreeview the view that backs the tree and that supplies it with its data. it is dynamically settable, either using a view attribute on the tree tag or by setting this attribute to a new value. focused boolean whether ...
...wcountchanged(rowindex+1, -1); beginupdatebatch() notify the tree that the view is about to perform a batch update, that is, add, remove or invalidate several rows at once. this must be followed by calling endupdatebatch(), otherwise the tree will get out of sync. ...
... the view is about to perform a batch update, that is, add, remove or invalidate several rows at once. this must be followed by calling endupdatebatch(), otherwise the tree will get out of sync. void beginupdatebatch(); endupdatebatch() notify the tree that the view has completed a batch update. ...
...ch update, that is, add, remove or invalidate several rows at once. this must be followed by calling endupdatebatch(), otherwise the tree will get out of sync. void beginupdatebatch(); endupdatebatch() notify the tree that the view has completed a batch update. ...
Mozilla
convenient to use for people with disabilities. mozilla strives to make its software accessible; the documents below cover the ways in which we do so. add-ons add-ons allow developers to extend and modify the functionality of firefox. adding a new css property this page describes how to add a new css property to the
style system. the
style system is the part of the code in gecko that is responsible for producing a computed value for every property for every element. see the gecko overview for more information about the
style system. adding a new event this draft document covers how to add a new event to the mozilla (firefox) source code. adding a new word to...
...ode is hosted on github. this article offers a quick guide for getting started with mozilla code on github. it also lists some interesting github repositories containing mozilla project code. mozilla quirks mode behavior the following is a rough list of the differences that exist between mozilla's standards mode and quirks mode behavior. ...
...ffers a quick guide for getting started with mozilla code on github. it also lists some interesting github repositories containing mozilla project code. mozilla quirks mode behavior the following is a rough list of the differences that exist between mozilla's standards mode and quirks mode behavior. ...
... some interesting github repositories containing mozilla project code. mozilla quirks mode behavior the following is a rough list of the differences that exist between mozilla's standards mode and quirks mode behavior. mozilla
style system the
style system is the module of mozilla's code responsible for the loading and parsing of css
style sheets, and the computation of computed values for all css properties. the handling of those computed values is the responsibility of other parts of the code. mozilla
style system documentation see also the
style techtalk for more complete although less detailed documentation. mozilla svg project since you have come this fa...
Examine and edit HTML - Firefox Developer Tools
context menu reference edit as html edit the element's html. (copy) inner html copy the inner html for the element. (copy) outer html copy the outer h...
...nner html outer html css selector css path xpath image data-url attribute paste inner html outer html before after as first child as last child expand all collapse all open link in new tab * open file in debugger * open file in
style-editor * copy link address * * these options only appear in certain contexts, for example the "open file in
style-editor" option only appears when you context-click over the top of a link to a css file. context menu reference edit as html edit the element's html. (copy) inner html copy the inner html for the element. (copy) outer html copy the outer html for the element. pressing ctrl + c (or cmd + c on a mac) also performs this action. (copy) uniq...
...attribute) edit the attribute. attribute/remove attribute (only when invoked on an attribute) remove the attribute. open link in new tab (only when invoked over a link, such as an href attribute) opens the linked item in a new tab. open file in debugger (only when invoked over a link to a js source) opens the linked source in the debugger. open file in
style-editor (only when invoked over a link to a css source) opens the linked source in the
style editor. copy link address (only when invoked over a url) copy the url. (change pseudo-class) hover set the :hover css pseudo-class. (change pseudo-class) active set the :active css pseudo-class. (change pseudo-class) focus set the :focus css pseudo-class. ...
...yling just as you would any other node in the document. you can access the same functionality using the "create new node" popup menu item. note that this button is disabled if the selected element's type is such that adding a last-child would have no effect (for example, if is is an <html> or <iframe> element). however, it is enabled in places where it is not valid to insert a <div>, such as <
style> or <link>. in these cases the element is added as text. ...
Animating CSS properties - Firefox Developer Tools
however, the performance cost of modifying a css property can vary from one property to another. animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. the css rendering waterfall the process the browser uses to update the page when a css property has changed can be described as a waterfall consisting of the following steps: recalculate
style: every time a css property for an element changes, the browser must recalculate computed
styles. layout: next, the browser uses the computed
styles to figure out the position and geometry for the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this sequence:...
...econd is the rate at which animations will appear smooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. css property cost in the context of the rendering waterfall, some properties are more expensive than others: property type cost examples properties that affect an element's geometry or position trigger a
style recalculation, a layout and a repaint. left max-width border-width margin-left font-size properties that don't affect geometry or position, but are not rendered in their own layer, do not trigger a layout. color properties that are rendered in their own layer don't even trigger a repaint, because the update is hand...
...though, is that the frame rate is very jagged, with lots of dips into the twenties and teens. it's unlikely you'll see a smooth animation here, especially when you add in user interaction. waterfall the rest of the recording shows the waterfall view. if you scroll through this, you'll see a pattern like this: this is showing us the rendering waterfall. in each animation frame, we recalculate
styles for every element, then perform a single layout, then a repaint. you can see that paint especially is hurting performance here. in the screenshot above we've highlighted a paint operation, and the box on the right tells us it took 13.11ms. with only 16.7ms in our total budget, it's not surprising we are missing a consistently high frame rate. you can experiment with this: try removing the box ...
...xt, we'll see how using transform instead of margin eliminates those expensive paints entirely. animating using transform now switch the radio button in the web page to "use transform", and make a new recording. it will look something like this: waterfall overview compared with the version that uses margin, we're seeing a lot less green and a lot more pink, which could be either layout or
style recalculation. frame rate compared with the version that uses margin, this is looking pretty good. we're averaging nearly 60fps, and apart from one dip near the start, we're getting a consistently high frame rate. waterfall the timeline view shows the reason for the improved frame rate. compared with the version that uses margin, we're not spending any time time in layout or (more important...
Waterfall - Firefox Developer Tools
andler stack call stack, with links to functions. parse html time spent parsing the page's html. stack call stack, with links to functions. parse xml time spent parsing the page's xml. stack call stack, with links to functions. ...
... call stack, with links to functions. parse html time spent parsing the page's html. stack call stack, with links to functions. parse xml time spent parsing the page's xml. stack call stack, with links to functions. recalculate
style calculating the computed
styles that apply to page elements. ...
... parse html time spent parsing the page's html. stack call stack, with links to functions. parse xml time spent parsing the page's xml. stack call stack, with links to functions. recalculate
style calculating the computed
styles that apply to page elements. re
style hint a string indicating what kind of restyling is needed. the hint may be any of: self subtree latersiblings csstransitions cssanimations svgattranimations
styleattribute
styleattribute_animations force forcedescendants layout calculating the position and size of page elements. this operation is sometimes called "...
...ms. rendering waterfall one pattern that you'll often see in the waterfall view is something like this: this is a visualization of the basic algorithm the browser uses to update the page in response to some event: javascript function call: some event - for example, a dom event - causes some javascript in the page to run. the javascript changes some of the page's dom or cssom. recalculate
style: if the browser thinks the computed
styles for page elements have changed, it must then recalculate them. layout: next, the browser uses the computed
styles to figure out the position and geometry for the elements. this operation is labeled "layout" but is also sometimes called "reflow". paint: finally, the browser needs to repaint the elements to the screen. one last step is not shown in this ...
Settings - Firefox Developer Tools
ersistent logs a setting to control whether or not the web console and network monitor clear their output when you navigate to a new page. if common preferences is not included in the settings, web console logs can be persisted by using the 'about:config' url in browser address bar, searching for: 'devtools.webconsole.persistlog' then toggling this value to true inspector show browser
styles a setting to control whether
styles applied by the browser (user-agent
styles) should be displayed in the inspector's rules view. note that this setting is independent of the "browser
styles" checkbox in the inspector's computed view. truncate dom attributes by default, the inspector truncates dom attributes that are more than 120 characters long. uncheck this box to prevent this behavior. th...
...ps controls whether the web console displays timestamps. the web console defaults to hiding timestamps. enable new console frontend switch to the experimental new console. this setting only exists in firefox nightly. debugger enable source maps enable source map support in the debugger. enable new debugger frontend enable the new debugger. this setting only exists in firefox nightly. ...
... new console frontend switch to the experimental new console. this setting only exists in firefox nightly. debugger enable source maps enable source map support in the debugger. enable new debugger frontend enable the new debugger. this setting only exists in firefox nightly.
style editor show original sources when a css preprocessor supporting source maps is used, this enables the
style editor to display the original, preprocessor, sources rather than the generated css. learn more about
style editor support for css source maps. with this setting checked, the page inspector rules view will also provide links to the original sources. autocomplete css enable the
style editor to offer autocomplete suggestions. screenshot behavior screenshot to clipboard when you click the ic...
... the screenshot image to the clipboard (the image will still be saved to your downloads directory). new in firefox 53. play camera shutter sound when you click the icon for the screenshot tool, play a shutter sound. new in firefox 53. editor preferences preferences for the codemirror source editor, which is included in firefox and used by several developer tools, including scratchpad and the
style editor. detect indentation auto-indent new lines based on the current indentation. autoclose brackets determines whether typing an opening character like [ or { will cause the editor to insert the matching closing character ] or } for you. indent using spaces when checked, indentation will be performed using spaces, when off, the editor will use tabs instead. tab size the frequency of t...
AnalyserNode - Web APIs
one input and one output. the node works even if the output is not connected. ...
...t may be left unconnected) channel count mode "max" channel count 2 channel interpretation "speakers" inheritance this interface inherits from the following parent interfaces: <div id="interfacediagram"
style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg
style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alig...
...me-domain, data into a uint8array (unsigned byte array) passed into it. examples note: see the guide visualizations with web audio api for more information on creating audio visualizations. basic usage the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope
style" output of the current audio input. for more complete applied examples/information, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new(window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); // ... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(...
... var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // get a canvas defined with id "oscilloscope" var canvas = document.getelementbyid("oscilloscope"); var canvasctx = canvas.getcontext("2d"); // draw an oscilloscope of the current audio source function draw() { requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fill
style = "rgb(200, 200, 200)"; canvasctx.fillrect(0, 0, canvas.width, canvas.height); canvasctx.linewidth = 2; canvasctx.stroke
style = "rgb(0, 0, 0)"; canvasctx.beginpath(); var slicewidth = canvas.width * 1.0 / bufferlength; var x = 0; for (var i = 0; i < bufferlength; i++) { var v = dataarray[i] / 128.0; var y = v * canvas.height / 2; if (i === 0) { canvasctx.move...
CSSImageValue - Web APIs
the cssimagevalue interface of the css typed object model api represents values for properties that take an image, for example background-image, list-
style-image, or border-image-source. the cssimagevalue object represents an <image> that involves an url, such as url() or image(), but not linear-gradient() or element() . properties none. methods none. ...
...linear-gradient() or element() . properties none. methods none. ...
...thods none. examples we create an element <button>magic wand</button> we add some css, including a background image requesting a binary file: button { display: inline-block; min-height: 100px; min-width: 100px; background: no-repeat 5% center url(https://mdn.mozillademos.org/files/16793/magicwand.png) aqua; } we get the element's
style map. ...
...uesting a binary file: button { display: inline-block; min-height: 100px; min-width: 100px; background: no-repeat 5% center url(https://mdn.mozillademos.org/files/16793/magicwand.png) aqua; } we get the element's
style map. we then get() the background-image from the
stylemap and stringify it: // get the element const button = document.queryselector( 'button' ); // retrieve all computed
styles with computed
stylemap() const allcomputed
styles = button.computed
stylemap(); // return the cssimagevalue example console.log( allcomputed
styles.get('background-image') ); console.log( allcomputed
styles.get('background-image').tostring() ); specifications specification status comment css typed om level 1the definition of 'cssimagevalue' in that specification. work...
CSSKeywordValue.CSSKeywordValue() - Web APIs
the csskeywordvalue constructor creates a new csskeywordvalue object which represents css keywords and other identifiers. syntax var csskeywordvalue = new csskeywordvalue(val) parameters value sets or returns the value of the new csskeywordvalue. ...
... the csskeywordvalue constructor creates a new csskeywordvalue object which represents css keywords and other identifiers. syntax var csskeywordvalue = new csskeywordvalue(val) parameters value sets or returns the value of the new csskeywordvalue. ...
...val) parameters value sets or returns the value of the new csskeywordvalue. examples the following example resets the css display property to its defaults, setting the inline
style attribute to
style="display: initial" if viewed in the developer tools inspector. ...
...ty to its defaults, setting the inline
style attribute to
style="display: initial" if viewed in the developer tools inspector. #myelement { display: flex; } <div id="myelement">check the developer tools to see the log in the console and to inspect the
style attribute on this div.</div> let keyword = new csskeywordvalue('initial'); let myelement = document.getelementbyid('myelement').attribute
stylemap; myelement.set('display', keyword); console.log( myelement.get('display').value); // 'initial' console.dir( keyword ); specifications specification status comment css typed om level 1the definition of 'csskeywordvalue' in that specification. working draft initial definition. ...
CSSMathValue.operator - Web APIs
thmax "max" cssmathclamp "clamp" cssmathnegate "negate" cssmathinvert "invert" examples we create an element with a width determined using a calc() function, then console.log() the operator. ...
... cssmathnegate "negate" cssmathinvert "invert" examples we create an element with a width determined using a calc() function, then console.log() the operator. ...
...negate" cssmathinvert "invert" examples we create an element with a width determined using a calc() function, then console.log() the operator. ...
...calc() function, then console.log() the operator. <div>my width has a <code>calc()</code> function</div> we assign a width with a calculation div { width: calc(50% - 0.5vw); } we add the javascript const
stylemap = document.queryselector('div').computed
stylemap(); console.log(
stylemap.get('width') ); // cssmathsum {values: cssnumericarray, operator: "sum"} console.log(
stylemap.get('width').values ); // cssnumericarray {0: cssunitvalue, 1: cssmathnegate, length: 2} console.log(
stylemap.get('width').operator ); // 'sum' console.log(
stylemap.get('width').values[1].operator ) // 'negate' the cssmathvalue.operator returns sum for the equation and negate for the operator on the second value. specifications specification status co...
CanvasPattern.setTransform() - Web APIs
syntax void pattern.settransform(matrix); parameters matrix an svgmatrix or dommatrix to use as the pattern's transformation matrix. examples using the settransform method this is just a simple code snippet which uses the settransform method to create a canvaspattern with the specified pattern transformation from an svgmatrix. the pattern gets applied if you set it as the current fill
style and gets drawn onto the canvas when using the fillrect() method, for example. html <canvas id="canvas"></canvas> <svg id="svg1"></svg> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var svg1 = document.getelementbyid('svg1'); var matrix = svg1.createsvgmatrix(); var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_cr...
...as = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var svg1 = document.getelementbyid('svg1'); var matrix = svg1.createsvgmatrix(); var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fill
style = pattern; ctx.fillrect(0, 0, 400, 400); }; note that newer browser versions started to support dommatrix as an input to settransform(), so for example you could replace the svgmatrix in the above example with the following: const matrix = new dommatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400"...
...r browser versions started to support dommatrix as an input to settransform(), so for example you could replace the svgmatrix in the above example with the following: const matrix = new dommatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <svg id="svg1"
style="display:none"></svg> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"
style="height:120px"> var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat');...
..."edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"
style="height:120px"> var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fill
style = pattern; ctx.fillrect(0, 0, 400, 400); };</textarea> var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; var svg1 = document.getelementbyid('svg1'); var matrix = svg1.createsvgmatrix(); function ...
CanvasRenderingContext2D.arcTo() - Web APIs
second control point. without arcto(), these two segments would form a sharp corner: arcto() creates a circular arc that fits this corner and smooths is out. in other words, the arc is tangential to both segments. ...
...his corner and smooths is out. in other words, the arc is tangential to both segments. ...
...tangent lines are gray, control points are red, and the start point is blue.
...tangent lines are gray, control points are red, and the start point is blue. creating a rounded corner this example creates a rounded corner using arcto(). ...
CanvasRenderingContext2D.createLinearGradient() - Web APIs
note: gradient coordinates are global, i.e., relative to the current coordinate space. when applied to a shape, the coordinates are not relative to the shape's coordinates. ...
... note: gradient coordinates are global, i.e., relative to the current coordinate space. when applied to a shape, the coordinates are not relative to the shape's coordinates. ...
... living standard ...
... living standard ...
CanvasRenderingContext2D.createRadialGradient() - Web APIs
note: gradient coordinates are global, i.e., relative to the current coordinate space. when applied to a shape, the coordinates are not relative to the shape's coordinates. ...
... note: gradient coordinates are global, i.e., relative to the current coordinate space. when applied to a shape, the coordinates are not relative to the shape's coordinates. ...
... living standard ...
... living standard ...
CanvasRenderingContext2D.fillRect() - Web APIs
parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. ...
... parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. ...
... parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. positive values are down, and negative are up. ...
...t. positive values are down, and negative are up. examples a simple filled rectangle this example draws a filled green rectangle using the fillrect() method. html <canvas id="canvas"></canvas> javascript the rectangle's top-left corner is at (20, 10). it has a width of 150 and a height of 100. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fill
style = 'green'; ctx.fillrect(20, 10, 150, 100); result filling the whole canvas this code snippet fills the entire canvas with a rectangle. this is often useful for creating a background, on top of which other things may then be drawn. to achieve this, the dimensions of the rectangle are set to equal the <canvas> element's width and height attributes. const canvas = document.getelementbyid('can...
CanvasRenderingContext2D.stroke() - Web APIs
strokes are aligned to the center of a path; in other words, half of the stroke is drawn on the inner side, and half on the outer side. the stroke is drawn using the non-zero winding rule, which means that path intersections will still get filled. syntax void ctx.stroke(); void ctx.stroke(path); parameters path a path2d path to stroke. examples a simple stroked rectangle this example creates a rectangle using the rect() method, and then draws it to the canvas using stroke(). ...
... get stroked every time you call the stroke() method. in some cases, however, this may be the desired effect. html <canvas id="canvas"></canvas> javascript this code strokes the first path three times, the second path two times, and the third path only once. ...
...s id="canvas"></canvas> javascript this code strokes the first path three times, the second path two times, and the third path only once. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // first sub-path ctx.linewidth = 26; ctx.stroke
style = 'orange'; ctx.moveto(20, 20); ctx.lineto(160, 20); ctx.stroke(); // second sub-path ctx.linewidth = 14; ctx.stroke
style = 'green'; ctx.moveto(20, 80); ctx.lineto(220, 80); ctx.stroke(); // third sub-path ctx.linewidth = 4; ctx.stroke
style = 'pink'; ctx.moveto(20, 140); ctx.lineto(280, 140); ctx.stroke(); result stroking and filling if you want to both stroke and fill a path, the order in which you perform these actions will determine the result. in this example, the square on the left is drawn with the stro...
...path, the order in which you perform these actions will determine the result. in this example, the square on the left is drawn with the stroke on top of the fill. the square on the right is drawn with the fill on top of the stroke. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.linewidth = 16; ctx.stroke
style = 'red'; // stroke on top of fill ctx.beginpath(); ctx.rect(25, 25, 100, 100); ctx.fill(); ctx.stroke(); // fill on top of stroke ctx.beginpath(); ctx.rect(175, 25, 100, 100); ctx.stroke(); ctx.fill(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.stroke' in that specification. living standard ...
Basic usage of canvas - Web APIs
pecifying your width and height attributes explicitly in the <canvas> attributes, and not using css. the id attribute isn't specific to the <canvas> element but is one of the global html attributes which can be applied to any html element (like class for instance). it is always a good idea to supply an id because this makes it much easier to identify it in a script. the <canvas> element can be
styled just like any normal image (margin, border, background…). these rules, however, don't affect the actual drawing on the canvas. we'll see how this is done in a dedicated chapter of this tutorial. when no styling rules are applied to the canvas it will initially be fully transparent. fallback content the <canvas> element differs from an <img> tag in that, like for <video>, <audio>, or <pictur...
...mbed a script inside html. we do it here to keep the example concise. <!doctype html> <html> <head> <meta charset="utf-8"/> <title>canvas tutorial</title> <script type="text/javascript"> function draw() { var canvas = document.getelementbyid('tutorial'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); } } </script> <
style type="text/css"> canvas { border: 1px solid black; } </
style> </head> <body onload="draw();"> <canvas id="tutorial" width="150" height="150"></canvas> </body> </html> the script includes a function called draw(), which is executed once the page finishes loading; this is done by listening for the load event on the document. this function, or one like it, could also be called ...
...raws two intersecting rectangles, one of which has alpha transparency. we'll explore how this works in more detail in later examples. ...
...ore how this works in more detail in later examples. ...
Drawing shapes with canvas - Web APIs
reenshotlive sample the fillrect() function draws a large black square 100 pixels on each side. the clearrect() function then erases a 60x60 pixel square from the center, and then strokerect() is called to create a rectangular outline 50x50 pixels within the cleared square. in upcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke
style of the rendered shapes. unlike the path functions we'll see in the next section, all three rectangle functions draw immediately to the canvas. drawing paths now let's look at paths. a path is a list of points, connected by segments of lines that can be of different shapes, curved or not, of different width and of different color. a path, or even a subpath, can be closed. to make shapes using p...
...ctx.beginpath(); ctx.moveto(83, 116); ctx.lineto(83, 102); ctx.beziercurveto(83, 94, 89, 88, 97, 88); ctx.beziercurveto(105, 88, 111, 94, 111, 102); ctx.lineto(111, 116); ctx.lineto(106.333, 111.333); ctx.lineto(101.666, 116); ctx.lineto(97, 111.333); ctx.lineto(92.333, 116); ctx.lineto(87.666, 111.333); ctx.lineto(83, 116); ctx.fill(); ctx.fill
style = 'white'; ctx.beginpath(); ctx.moveto(91, 96); ctx.beziercurveto(88, 96, 87, 99, 87, 101); ctx.beziercurveto(87, 103, 88, 106, 91, 106); ctx.beziercurveto(94, 106, 95, 103, 95, 101); ctx.beziercurveto(95, 99, 94, 96, 91, 96); ctx.moveto(103, 96); ctx.beziercurveto(100, 96, 99, 99, 99, 101); ctx.beziercurveto(99, 103, 100, 106, 103, 106); ctx.beziercurveto(...
... function roundedrect(ctx, x, y, width, height, radius) { ctx.beginpath(); ctx.moveto(x, y + radius); ctx.lineto(x, y + height - radius); c...
...ight-radius, radius); ctx.lineto(x + width, y + radius); ctx.arcto(x + width, y, x + width - radius, y, radius); ctx.lineto(x + radius, y); ctx.arcto(x, y, x, y + radius, radius); ctx.stroke(); } the resulting image looks like this: screenshotlive sample we won't go over this in detail, since it's actually surprisingly simple. the most important things to note are the use of the fill
style property on the drawing context, and the use of a utility function (in this case roundedrect()). using utility functions for bits of drawing you do often can be very helpful and reduce the amount of code you need, as well as its complexity. we'll take another look at fill
style, in more detail, later in this tutorial. here, all we're doing is using it to change the fill color for paths from the d...
Drawing text - Web APIs
« previousnext » after having seen how to apply
styles and colors in the previous chapter, we will now have a look at how to draw text onto the canvas. drawing text the canvas rendering context provides two methods to render text: filltext(text, x, y [, maxwidth]) fills a given text at the given (x,y) position. optionally with a maximum width to draw. stroketext(text, x, y [, maxwidth]) strokes a given text at the given (x,y) position. optionally with a maximum width to draw. a filltext example the text is filled using the current fill
style. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.font = '48px serif'; ctx.filltext('hello world', 10, 50); } <canvas id="canvas" width="300" height="100"></canvas> draw(); a st...
...n. optionally with a maximum width to draw. a filltext example the text is filled using the current fill
style. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.font = '48px serif'; ctx.filltext('hello world', 10, 50); } <canvas id="canvas" width="300" height="100"></canvas> draw(); a stroketext example the text is filled using the current stroke
style. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.font = '48px serif'; ctx.stroketext('hello world', 10, 50); } <canvas id="canvas" width="300" height="100"></canvas> draw(); styling text in the examples above we are already making use of the font property to make the text a bit larger than the default size. there are some more properties which le...
...t = '48px serif'; ctx.stroketext('hello world', 10, 50); } <canvas id="canvas" width="300" height="100"></canvas> draw(); styling text in the examples above we are already making use of the font property to make the text a bit larger than the default size. there are some more properties which let you adjust the way the text gets displayed on the canvas: font = value the current text
style being used when drawing text. this string uses the same syntax as the css font property. the default font is 10px sans-serif. textalign = value text alignment setting. possible values: start, end, left, right or center. the default value is start. textbaseline = value baseline alignment setting. possible values: top, hanging, middle, alphabetic, ideographic, bottom. the default value is alpha...
... textarea.focus(); }) textarea.addeventlistener('input', drawcanvas); window.addeventlistener('load', drawcanvas); advanced text measurements in the case you need to obtain more details about the text, the following method allows you to measure it. measuretext() returns a textmetrics object containing the width, in pixels, that the specified text will be when drawn in the current text
style. the following code snippet shows how you can measure a text and get its width. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); var text = ctx.measuretext('foo'); // textmetrics object text.width; // 16; } gecko-specific notes in gecko (the rendering engine of firefox, firefox os and other mozilla based applications), some prefixed apis were implemented...
DataTransfer.clearData() - Web APIs
event.datatransfer.cleardata(); // set the drag's format and data (use event target's id for data) event.datatransfer.setdata('text/plain', event.target.id); data.innerhtml = event.datatransfer.getdata('text/plain'); } function d...
...a) event.datatransfer.setdata('text/plain', event.target.id); data.innerhtml = event.datatransfer.getdata('text/plain'); } function dragendhandler (event) { if (!dropped) { status.innerhtml = 'drag canceled'; } data.innerhtml = event.datatransfer.getdata('text/plain') || 'empty'; // change border to signify drag is no longer in process event.currenttarget.
style.border = '1px solid black'; if (dropped) { // remove all event listeners draggable.removeeventlistener('dragstart', dragstarthandler); draggable.removeeventlistener('dragend', dragendhandler); dropable.removeeventlistener('dragover', dragoverhandler); dropable.removeeventlistener('dragleave', dragleavehandler); dropable.removeeventlistener('drop', drophand...
... living standard html 5.1the definition of 'datatransfer.clearda...
... living standard html 5.1the definition of 'datatransfer.cleardata()' in that specification. recomm...
Document: drag event - Web APIs
width: 200px; height: 20px; background: blueviolet; margin-bottom: 10px; padding: 10px; } javascript var dragged; /* events fired on the draggable target */ document.addeventlistener("drag", function(event) { }, false); document.addeventlistener("dragstart", function(event) { // store a ref. ...
...vents fired on the draggable target */ document.addeventlistener("drag", function(event) { }, false); document.addeventlistener("dragstart", function(event) { // store a ref. ...
...arget.
style.opacity = ""; }, false); /* events fired on the drop targets */ document.addeventlistener("dragover", function(event) { // prevent default to allow drop event.preventdefault(); }, false); document.addeventlistener("dragenter", function(event) { // highlight potential drop target when the draggable element enters it if (event.target.classname == "dropzone") { event.target.
style.background = "purple"; } }, false); document.addeventlistener("dragleave", function(event) { // reset background of potential drop target when the draggable element leaves it if (event.target.classname == "dropzone") { event.target.
style.background = ""; } }, false); document.addeventlistener("drop", function(event) { // prevent default action (open as link for some elements) ...
... living standard ...
Using the Gamepad API - Web APIs
you can find a working demo and look at the full source code on github...
...you can find a working demo and look at the full source code on github. var haveevents = 'ongamepadconn...
...amepad.axes.length; i++) { var p = document.createelement("progress"); p.classname = "axis"; //p.id = "a" + i; p.setattribute("max", "2"); p.setattribute("value", "1"); p.innerhtml = i; a.appendchild(p); } d.appendchild(a); // see https://github.com/luser/gamepadtest/blob/master/index.html var start = document.getelementbyid("start"); if (start) { start.
style.display = "none"; } document.body.appendchild(d); requestanimationframe(updatestatus); } function disconnecthandler(e) { removegamepad(e.gamepad); } function removegamepad(gamepad) { var d = document.getelementbyid("controller" + gamepad.index); document.body.removechild(d); delete controllers[gamepad.index]; } function updatestatus() { if (!haveevents) { scangamepads(); ...
...ment.getelementbyid("controller" + j); var buttons = d.getelementsbyclassname("button"); for (i = 0; i < controller.buttons.length; i++) { var b = buttons[i]; var val = controller.buttons[i]; var pressed = val == 1.0; if (typeof(val) == "object") { pressed = val.pressed; val = val.value; } var pct = math.round(val * 100) + "%"; b.
style.backgroundsize = pct + " " + pct; if (pressed) { b.classname = "button pressed"; } else { b.classname = "button"; } } var axes = d.getelementsbyclassname("axis"); for (i = 0; i < controller.axes.length; i++) { var a = axes[i]; a.innerhtml = i + ": " + controller.axes[i].tofixed(4); a.setattribute("value", controller.axes[i] + 1); ...
GlobalEventHandlers.onanimationiteration - Web APIs
#box { width: var(--boxwidth); height: var(--boxwidth); left: 0; top: 0; border: 1px solid #7788ff; ...
...lucida grande", "open sans", sans-serif; } leaving out some bits of the css that don't matter for the discussion here, let's take a look at the
styles for the box that we're animating. first is the box itself. we set its size, position, color, and layout. note that there's nothing there about animation. that's because we don't want the box to start animating right away. we'll add the animation
style later to start animating the box. #box { width: var(--boxwidth); height: var(--boxwidth); left: 0; top: 0; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; animation: 2s ease-in-out 0s infinite alternate both paused slidebox; } the animation's keyframes are defined next; they describe an animation...
...s slidebox { from { left:0; top:0; } to { left:calc(100% - var(--boxwidth)); top:calc(100% - var(--boxwidth)) } } javascript some javascript code will need to be written to handle the click on the button to start the next iteration. let's have a look. var box = document.getelementbyid("box"); var iterationcounter = 0; box.onanimationiteration = function(event) { box.
style.animationplaystate = "paused"; document.getelementbyid("play").innerhtml = "start iteration #" + (iterationcounter+1); }; this sets up two global variables: box, which references the "box" element that we're animating, and iterationcounter, which is initially zero, which indicates how many iterations of the animation have occurred. the onanimationiteration event handler is then set up. it si...
...teration event handler is then set up. it simply sets the box's animation-play-state to "paused", then updates the text displayed in the button to indicate that clicking the button will start playing the next iteration of theanimation. finally, we set up a handler for a click on the button that runs the animation: document.getelementbyid("play").addeventlistener("click", function(event) { box.
style.animationplaystate = "running"; iterationcounter++; }, false); this sets the box element's animation-play-state to "running" and increments the iteration counter. that's all there is to it! result assembled together, you get this: each time the box reaches the opposing corner, it stops, with the button reflecting which iteration number is up next, until you click the button to run the nex...
GlobalEventHandlers.ontransitioncancel - Web APIs
nd events to detect when the transition begins and ends, to cause a text update to occur during the transition. this could also be used to trigger animations or other effects, to allow chaining of reactions. in addition, we also use a click event to make the box dissappear (display: none;), showing how it triggers the transitioncancel event to fire. ...
... be used to trigger animations or other effects, to allow chaining of reactions. in addition, we also use a click event to make the box dissappear (display: none;), showing how it triggers the transitioncancel event to fire. html this simply creates a <div> which we'll
style with css below to make into a box that resizes and changes color and such. ...
... fire. html this simply creates a <div> which we'll
style with css below to make into a box that resizes and changes color and such. <div class="box"></div> css the css below
styles the box and applies a transition effect which makes the box's color and size change, and causes the box to rotate, while the mouse cursor hovers over it. ...
...tate(180deg); transform: rotate(180deg); } javascript next, we need to establish our event handlers to change the text content of the box when the transition begins and ends. let box = document.queryselector(".box"); box.ontransitionrun = function(event) { box.innerhtml = "zooming..."; } box.ontransitionend = function(event) { box.innerhtml = "done!"; } box.onclick = function() { box.
style.display = 'none'; timeout = window.settimeout(appear, 2000); function appear() { box.
style.display = 'block'; } } box.ontransitioncancel = function(event) { console.log('transitioncancel fired after ' + event.elapsedtime + ' seconds.'); } result the resulting content looks like this: notice what happens when you hover your mouse cursor over the box, then move it away. also note...
Using the MediaStream Recording API - Web APIs
rer 9. checkbox hack for showing/hiding this is fairly well documented already, but we thought we'd give a mention to the checkbox hack, which abuses the fact that you can click on the <label> of a checkbox to toggle it checked/unchecked. in web dictaphone this powers the information screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. ...
...z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: 5; cursor: pointer; } then we hide the actual checkbox, because we don't want it cluttering up our ui: input[type=checkbox] { position: absolute; top: -100px; } next, we
style the information screen (wrapped in an <aside> element) how we want it, give it fixed position so that it doesn't appear in the layout flow and affect the main ui, transform it to the position we want it to sit in by default, and give it a transition for smooth showing/hiding: aside { position: fixed; top: 0; left: 0; text-shadow: 1px 1px 1px black; width: 100%; height: 100%; ...
...the mediarecorder interface that allow you to control recording of the media stream; in web dictaphone we just make use of two, and listen to some events. first of all, mediarecorder.start() is used to start recording the stream once the record button is pressed: record.onclick = function() { mediarecorder.start(); console.log(mediarecorder.state); console.log("recorder started"); record.
style.background = "red"; record.
style.color = "black"; } when the mediarecorder is recording, the mediarecorder.state property will return a value of "recording". as recording progresses, we need to collect the audio data. we register an event handler to do this using mediarecorder.ondataavailable: let chunks = []; mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } note: th...
...ol this interval, or call mediarecorder.requestdata() to trigger an event when you need it. lastly, we use the mediarecorder.stop() method to stop the recording when the stop button is pressed, and finalize the blob ready for use somewhere else in our application. stop.onclick = function() { mediarecorder.stop(); console.log(mediarecorder.state); console.log("recorder stopped"); record.
style.background = ""; record.
style.color = ""; } note that the recording may also stop naturally if the media stream ends (e.g. if you were grabbing a song track and the track ended, or the user stopped sharing their microphone). grabbing and using the blob when recording has stopped, the state property returns a value of "inactive", and a stop event is fired. we register an event handler for thi...
Range.getBoundingClientRect() - Web APIs
working draft initial specificatio...
... working draft initial specification. ...
... working draft initial specification. ...
... working draft initial specification. ...
SVGElement - Web APIs
all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface. ...
... all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface. ...
...these can also be defined in svg using attributes of the form data-*, where * is the key name for the pair. this works just like html's htmlelement...
...tor <svg> element. null if the given element is the outermost <svg> element. svgelement.viewportelementread only the svgelement, which established the current viewport. often, the nearest ancestor <svg> element. null if the given element is the outermost <svg> element. methods this interface has no methods, but inherits methods from: documentandelementeventhandlers, element, elementcssinline
style, globaleventhandlers, htmlorforeignelement, svgelementinstance events listen to these events using addeventlistener() or by assigning an event listener to the equivalent on... handler property defined on globaleventhandlers or windoweventhandlers. abort fired when page loading is stopped before an svg element has been allowed to load completely. also available via the onabort property. er...
SVGRectElement - Web APIs
the svgrectelement interface provides access to the properties of <rect> elements, as well as methods to manipulate them. ...
... the svgrectelement interface provides access to the properties of <rect> elements, as well as methods to manipulate them. ...
...given <rect> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement. example here is a simple usage of rect interface. ...
... specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgrectelement' in that specification. ...
Storage.getItem() - Web APIs
ist, in the given storage object. syntax var avalue = storage.getitem(keyname); parameters keyname a domstring containing the name of the key you want to retrieve the value of. return value a domstring containing the value of the key. if the key does not exist, null is returned. ...
...t. syntax var avalue = storage.getitem(keyname); parameters keyname a domstring containing the name of the key you want to retrieve the value of. return value a domstring containing the value of the key. if the key does not exist, null is returned. example the following function retrieves three data items from local storage, then uses them to set custom
styles on a page. ...
... specifications specification status comment html living standardthe definition of 'storage.getitem' in that specification. ...
... specifications specification status comment html living standardthe definition of 'storage.getitem' in that specification. living standard ...
Touch events - Web APIs
ple tracks multiple touchpoints at a time, allowing the user to draw in a <canvas> with more than one finger at a time. it will only work on a browser that supports touch events. note: the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus or other contact method. create a canvas <canvas id="canvas" width="600" height="600"
style="border:solid black 1px;"> your browser does not support canvas element. </canvas> <br> log: <pre id="log"
style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below will be called. function startup() { var el = document.getelementbyid("canvas"); el.addeventlistener("touchstart", handlestart, false); el.addeventlistener...
...then we get the context and pull the list of changed touch points out of the event's touchevent.changedtouches property. after that, we iterate over all the touch o...
...nuing touch "+idx); ctx.beginpath(); console.log("ctx.moveto(" + ongoingtouches[idx].pagex + ", " + ongoingtouches[idx].pagey + ");"); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); console.log("ctx.lineto(" + touches[i].pagex + ", " + touches[i].pagey + ");"); ctx.lineto(touches[i].pagex, touches[i].pagey); ctx.linewidth = 4; ctx.stroke
style = color; ctx.stroke(); ongoingtouches.splice(idx, 1, copytouch(touches[i])); // swap in the new touch record console.log("."); } else { console.log("can't figure out which touch to continue"); } } } this iterates over the changed touches as well, but it looks in our cached touch information array for the previous information about each touch to determine the ...
...list. ...
VisualViewport - Web APIs
ow to write a simple bit of code that will hide an overlaid box (which might contain an advert, say) when the user zooms in. this is a nice way to improve the user experience when zooming in on pages. a live sample is also available. var bottombar = document.getelementbyid('bottombar'); var viewport = window.visualviewport; function resizehandler() { if (viewport.scale > 1.3) bottombar.
style.display = "none"; else bottombar.
style.display = "block"; } window.visualviewport.addeventlistener('resize', resizehandler); simulating position: device-fixed this example, also taken from the visual viewport readme, shows how to use this api to simulate position: device-fixed, which fixes elements to the visual viewport. a live sample is also available. var bottombar = document.getel...
...youtviewport = document.getelementbyid('layoutviewport'); // since the bar is position: fixed we need to offset it by the visual // viewport's offset from the layout viewport origin. ...
...document.getelementbyid('layoutviewport'); // since the bar is position: fixed we need to offset it by the visual // viewport's offset from the layout viewport origin. ...
...bar is position: fixed we need to offset it by the visual // viewport's offset from the layout viewport origin. var offsetleft = viewport.offsetleft; var offsettop = viewport.height - layoutviewport.getboundingclientrect().height + viewport.offsettop; // you could also do this by setting
style.left and
style.top if you // use width: 100% instead. ...
Matrix math for the web - Web APIs
0, 0, 1, 0, x, y, z, 1 ]; place the distances along the three axes in the corresponding positions in the translation matrix, then multiply it by the point or matrix you need to move through 3d space. manipulating the dom with a matrix a really easy way to start using a matrix is to use the css matrix3d() transform. first we'll set up a simple <div> with some content. the
style is not shown, but it's set to a fixed width and height and is centered on the page. the <div> has a transition set for the transform so that matrix is animated in making it easy to see what is being done. <div id='move-me' class='transformable'> <h2>move me with a matrix</h2> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit...</p> </div> finally, for each of the examples we will...
... height and is centered on the page. the <div> has a transition set for the transform so that matrix is animated in making it easy to see what is being done. ...
...tur adipisicing elit...</p> </div> finally, for each of the examples we will generate a 4x4 matrix, then update the <div>'s
style to have a transform applied to it, set to a matrix3d. bear in mind that even though the matrix is made up of 4 rows and 4 columns, it collapses into a single line of 16 values. matrices are always stored in one-dimensional lists in javascript. ...
...in typical (cartesian) coordinates. this causes stretching or contracting of the object in the corresponding directions. ...
Visualizations with Web Audio API - Web APIs
0, width, height); we now define the draw() function: function draw() { in here, we use requestanimationframe() to keep looping the drawing function once it has been started: var drawvisual = requestanimationframe(draw); next, we grab the time domain data and copy it into our array analyser.getbytetimedomaindata(dataarray); next, fill the canvas with a solid colour to start canvasctx.fill
style = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); set a line width and stroke colour for the wave we will draw, then begin drawing a path canvasctx.linewidth = 2; canvasctx.stroke
style = 'rgb(0, 0, 0)'; canvasctx.beginpath(); determine the width of each segment of the line to be drawn by dividing the canvas width by the array length (equal to the frequencybincount, as defined ea...
...we have one available in voice-change-o-matic; let's look at how it's done. first, we again set up our analyser and data array, then clear the current canvas display with clearrect(). the only difference from before is that we have set the fft size to be much smaller; this is so that each bar in the graph is big enough to actually look like a bar rather than a thin strand. ...
... uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); next, we start our draw() function off, again setting up a loop with requestanimationframe() so that the displayed data keeps updating, and clearing the display with each animation frame. function draw() { drawvisual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fill
style = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); now we set our barwidth to be equal to the canvas width divided by the number of bars (the buffer length). however, we are also multiplying that width by 2.5, because most of the frequencies will come back as having no audio in them, as most of the sounds we hear every day are in a certain lower frequency range. we don't want to di...
...rom the bottom of the canvas, not down from the top, as it would if we set the vertical position to 0. therefore, we instead set the vertical position each time to the height of the canvas minus barheight/2, so therefore each bar will be drawn from partway down the canvas, down to the bottom. for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]/2; canvasctx.fill
style = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-barheight/2,barwidth,barheight); x += barwidth + 1; } }; again, at the end of the code we invoke the draw() function to set the whole process in motion. draw(); this code gives us a result like the following: note: the examples listed in this article have shown usage of analysernode.getbytefreque...
Window.devicePixelRatio - Web APIs
correcting resolution in a <canvas> a <canvas> can appear too blurry on retina screens. use window.devicepixelratio to determine how much extra pixel density should be added to allow for a sharper image. html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); // set display size (css pixels). ...
...as> a <canvas> can appear too blurry on retina screens. use window.devicepixelratio to determine how much extra pixel density should be added to allow for a sharper image. html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); // set display size (css pixels). ...
...as.
style.width = size + "px"; canvas.
style.height = size + "px"; // set actual size in memory (scaled to account for extra pixel density). var scale = window.devicepixelratio; // change to 1 on retina screens to see blurry canvas. canvas.width = math.floor(size * scale); canvas.height = math.floor(size * scale); // normalize coordinate system to use css pixels. ...
..."px"; // set actual size in memory (scaled to account for extra pixel density). var scale = window.devicepixelratio; // change to 1 on retina screens to see blurry canvas. canvas.width = math.floor(size * scale); canvas.height = math.floor(size * scale); // normalize coordinate system to use css pixels. ...
Window - Web APIs
obal window seen by javascript code running within a given tab always represents the tab in which the code is running. that said, even in a tabbed browser, some properties and methods still apply to the overall window that contains the tab, such as resizeto() and innerheight. generally, anything that can't reasonably pertain to a tab pertains to the window instead. ...
...rowser, some properties and methods still apply to the overall window that contains the tab, such as resizeto() and innerheight. generally, anything that can't reasonably pertain to a tab pertains to the window instead. ...
...callback. window.clearimmediate() cancels the repeated execution set using setimmediate. window.close() closes the current window. window.confirm() displays a dialog with a message that the user needs to respond to. window.dump() writes a message to the console. window.find() searches for a given string in a window. window.focus() sets focus on the current window. window.getcomputed
style() gets computed
style for the specified element. computed
style indicates the computed values of all css properties of the element. window.getdefaultcomputed
style() gets default computed
style for the specified element, ignoring author
stylesheets. window.getselection() returns the selection object representing the selected item(s). window.matchmedia() returns a mediaquerylist object rep...
...r property. popstate fired when the active history entry changes. also available using the onpopstate event handler property. load & unload events beforeunload fired when the window, the document and its resources are about to be unloaded. also available via the onbeforeunload property. domcontentloaded fired when the document has been completely loaded and parsed, without waiting for
stylesheets, images, and subframes to finish loading. load fired when the whole page has loaded, including all dependent resources such as
stylesheets images. also available via the onload property. unload fired when the document or a child resource is being unloaded. also available via the onunload property. manifest events appinstalled fired when the browser has successfully installed a p...
Web accessibility for seizures and physical reactions - Accessibility
terchangably, they are not the same. according to the w3c, blinking is a distraction problem, whereas flashing refers to content that occurs more than 3 times per second, is large enough, and bright enough. section 508 prohibits flickering effects with a frequency greater than 3 hz (flickers per second) and lower than 55 hz. the epilepsy foundation's article "take advantage of media queries with <
style> in setting up media queries, you are enabling controls by the user; these controls are made available in the browser or in the os. see the mdn document, "accessibility: what users can to to browse more safely" to see more details of how a user accesses the controls. prefers-reduced-motion support for prefers-reduced-motion in modern browsers is growing. @media screen and (prefers-reduced-mot...
...dn document, prefers-reduced-motion, or see the example below from the section on new in chrome 74. button { animation: vibrate 0.3s linear infinite both; } @media (prefers-reduced-motion: reduce) { button { animation: none; } } prefers-color-scheme this can be useful if the ambient light api is not available. support is emerging. @media (prefers-color-scheme: dark) { /* adust
styles for dark mode */ } window.matchmedia() there is a powerful tool available to developers via window.matchmedia(). a great resource is mdn's document on window.matchmedia() media update feature the more often the screen is refreshed, the more stable it appears to the human eye, and the less it "flickers". the vast majority of modern technology refreshes at a rate that does not cause prob...
...he brightess of the screen automatically. the specifications also note the difference in technology, such as e-ink, which remains readable in bright daylight, versus liquid crystals, which do not. environment-blending from w3c's draft document, media queries level 5: "the environment-blending media feature is used to query the characteristics of the user’s display so the author can adjust the
style of the document. an author might choose to adjust the visuals and/or layout of the page depending on the display technology to increase the appeal or improve legibility." user preference media features (planned in media queries level 5) user preference media features in w3c editor's draft media queries level 5 are especially promising in providing user control over media. here are some highligh...
...r palette on the page". the user will need to be made aware of this ability, and it will need to play nice with the appropriate value for the prefers-color-scheme media query. light-level from w3c's draft document, media queries level 5 section on light-level: "the light-level media feature is used to query about the ambient light-level in which the device is used, to allow the author to adjust
style of the document in response." this will be a godsend to those who have motor-skills problems, or for some with cognitive difficulties, who cannot find the right "button" to change their screen settings. prefers-contrast from w3c's draft document, media queries level 5 section on prefers-contrast: "the prefers-contrast media feature is used to detect if the user has requested the system increase...
EXSLT
exslt modules to use an exslt function, you need to declare the namespace the function is in, and then use the appropriate prefix when calling the function. for example, to use the regular ex...
... (set)the exslt sets package offers functions that let you perform set manipulation.strings (str)the exslt strings package provides functions that allow the manipulation of strings. exslt modules to use an exslt function, you need to declare the namespace the function is in, and then use the appropriate prefix when calling the function. ...
...the namespace for the common package is http://exslt.org/common. ...
...) exsl:object-type() math the exslt math package provides functions for working with numeric values and comparing nodes. the namespace for the math package is http://exslt.org/math. functions math:highest() math:lowest() math:max() math:min() regular expressions the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript
style regular expressions. the exslt regular expressions namespace is http://exslt.org/regular-expressions. functions regexp:match() regexp:replace() regexp:test() sets the exslt sets package offers functions that let you perform set manipulation. the namespace for these functions is http://exslt.org/sets. functions set:difference() set:distinct() set:intersection() set:has-same-node...
Block formatting context - Developer guides
of flow-root makes sense when you understand you are creating something that acts like the root element (<html> element in browser) in terms of how it creates a new context for the flow layout inside it. ...
...html <section> <div class="box"> <div class="float">i am a floated box!</div> <p>i am content inside the container.</p> </div> </section> <section> <div class="box"
style="overflow:auto"> <div class="float">i am a floated box!</div> <p>i am content inside the <code>overflow:auto</code> container.</p> </div> </section> <section> <div class="box"
style="display:flow-root"> <div class="float">i am a floated box!</div> <p>i am content inside the <code>display:flow-root</code> container.</p> </div> </section> css section { height:150px; } .box { background-color: rgb(224, 206, 247); border: 5px solid rebeccapurple; } .box[
style] { background-color: aliceblue; border: 5px solid steelblue; } .float { f...
... columns layout, beacuse an element in the normal flow that establishes a new bfc must not overlap the margin box of any floats in the same block formatting context as the element itself. ...
...lass="float">try to resize this outer float</div> <div class="box"><p>normal</p></div> </section> <section> <div class="float">try to resize this outer float</div> <div class="box"
style="display:flow-root"><p><code>display:flow-root</code><p></div> </section> css section { height:150px; } .box { background-color: rgb(224, 206, 247); border: 5px solid rebeccapurple; } .box[
style] { background-color: aliceblue; border: 5px solid steelblue; } .float { float: left; overflow: hidden; /* required by resize:both */ resize: both; margin-right:25px; width: 200px; height: 100px; background-color: rgba(255, 255, 255, .75); border: 1px solid black; padding: 10px; } rather than inline-blocks with width:<percentage>, in ...
<input type="month"> - HTML: Hypertext Markup Language
ue="submit form"> </div> </form> if you try to submit the form without both the month and year specified (or with a date outside the set bounds), the browser displays an error. try playing with the example now: here's a screenshot for those of you who aren't using a supporting browser: here's the css used in the above example. here we make use of the :valid and :invalid css properties to
style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be
styled or shown effectively. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } in...
...d show the fallback picker ui instead. ...
... // define variables var nativepicker = document.queryselector('.nativedatepicker'); var fallbackpicker = document.queryselector('.fallbackdatepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var monthselect = document.queryselector('#month'); // hide fallback initially fallbackpicker.
style.display = 'none'; fallbacklabel.
style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'month'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.
style.display = 'none'; fallbackpicker.
style.
... a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'month'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.
style.display = 'none'; fallbackpicker.
style.display = 'block'; fallbacklabel.
style.display = 'block'; // populate the years dynamically // (the months are always the same, therefore hardcoded) populateyears(); } function populateyears() { // get the current year as a number var date = new date(); var year = date.getfullyear(); // make this year, and the 100 years before it available in the year <select> for(var i = 0; i <= 100; i++) { var option = documen...
<input type="number"> - HTML: Hypertext Markup Language
ad. the input for the height in meters accepts decimals to two places. the html looks like this: <form> <div class="metersinputgroup"> <label for="meters">enter your height — meters:</label> <input id="meters" type="number" name="meters" step="0.01" min="0" placeholder="e.g. ...
...e="submit" value="submit form"> </div> </form> you'll see that we are using many of the attributes we've already looked at in the article earlier on. since we want to accept a meter value in centimeters, we've set the step value to 0.01, so that values like 1.78 are not seen as invalid. we've also provided a placeholder for that input. we've hidden the feet and inches inputs initially using
style="display: none;", so that meters is the default entry type. now, onto the css. this looks very similar to the validation styling we saw before; nothing remarkable here. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } ...
...tor('#meters'); let feetinput = document.queryselector('#feet'); let inchesinput = document.queryselector('#inches'); let switchbtn = document.queryselector('input[type="button"]'); switchbtn.addeventlistener('click', function() { if(switchbtn.getattribute('class') === 'meters') { switchbtn.setattribute('class', 'feet'); switchbtn.value = 'enter height in meters'; metersinputgroup.
style.display = 'none'; feetinputgroup.
style.display = 'block'; feetinput.setattribute('required', ''); inchesinput.setattribute('required', ''); metersinput.removeattribute('required'); metersinput.value = ''; } else { switchbtn.setattribute('class', 'meters'); switchbtn.value = 'enter height in feet and inches'; metersinputgroup.
style.display = 'block'; feetin...
...= 'none'; feetinputgroup.
style.display = 'block'; feetinput.setattribute('required', ''); inchesinput.setattribute('required', ''); metersinput.removeattribute('required'); metersinput.value = ''; } else { switchbtn.setattribute('class', 'meters'); switchbtn.value = 'enter height in feet and inches'; metersinputgroup.
style.display = 'block'; feetinputgroup.
style.display = 'none'; feetinput.removeattribute('required'); inchesinput.removeattribute('required'); metersinput.setattribute('required', ''); feetinput.value = ''; inchesinput.value = ''; } }); after declaring a few variables, an event listener is added to the button to control the switching mechanism. this is pretty simple, mostly involving changing over the button's class...
<input type="time"> - HTML: Hypertext Markup Language
re setting a minimum time of 12:00 and a maximum time of 18:00: <form> <label for="appt-time">choose an appointment time (opening hours 12:00 to 18:00): </label> <input id="appt-time" type="time" name="appt-time" min="12:00" max="18:00"> <span class="validity"></span> </form> here's the css used in the above example. here we make use of the :valid and :invalid css properties to
style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be
styled or shown effectively. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } in...
...lback picker ui (<select>s) instead. ...
...// define variables var nativepicker = document.queryselector('.nativetimepicker'); var fallbackpicker = document.queryselector('.fallbacktimepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var hourselect = document.queryselector('#hour'); var minuteselect = document.queryselector('#minute'); // hide fallback initially fallbackpicker.
style.display = 'none'; fallbacklabel.
style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'time'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.
style.display = 'none'; fallbackpicker.
style.d...
...r a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'time'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.
style.display = 'none'; fallbackpicker.
style.display = 'block'; fallbacklabel.
style.display = 'block'; // populate the hours and minutes dynamically populatehours(); populateminutes(); } function populatehours() { // populate the hours <select> with the 6 open hours of the day for(var i = 12; i <= 18; i++) { var option = document.createelement('option'); option.textcontent = i; hourselect.appendchild(option); } } function populateminutes() { // popul...
<input type="week"> - HTML: Hypertext Markup Language
ing example we are setting a minimum value of week 01, 2017 and a maximum value of week 52, 2017: <form> <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" min="2017-w01" max="2017-w52"> <span class="validity"></span> </form> here's the css used in the above example. here we make use of the :valid and :invalid css properties to
style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be
styled or shown effectively. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } in...
...k picker ui (<select>s) instead. ...
...efine variables var nativepicker = document.queryselector('.nativeweekpicker'); var fallbackpicker = document.queryselector('.fallbackweekpicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var weekselect = document.queryselector('#fallbackweek'); // hide fallback initially fallbackpicker.
style.display = 'none'; fallbacklabel.
style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'week'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.
style.display = 'none'; fallbackpicker.
style.d...
...("0" + i) : i; weekselect.appendchild(option); } } note: remember that some years have 53 weeks in them (see weeks per yea...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
ny element that accepts flow content. implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree dom interface htmlulistelement attributes this element includes the global attributes. compact this boolean attribute hints that the list should be rendered in a compact
style. the interpretation of this attribute depends on the user agent, and it doesn't work in all browsers. warning: do not use this attribute, as it has been deprecated: use css instead. to give a similar effect as the compact attribute, the css property line-height can be used with a value of 80%. type this attribute sets the bullet
style for the list. the values defined under html3.2 and...
...mpact attribute, the css property line-height can be used with a value of 80%. type this attribute sets the bullet
style for the list. the values defined under html3.2 and the transitional version of html 4.0/4.01 are: circle disc square a fourth bullet type has been defined in the webtv interface, but not all browsers support it: triangle. if not present and if no css list-
style-type property applies to the element, the user agent selects a bullet type depending on the nesting level of the list. warning: do not use this attribute, as it has been deprecated; use the css list-
style-type property instead. usage notes the <ul> element is for grouping a collection of items that do not have a numerical ordering, and their order in the list is meaningless. typically, u...
... the <ul> and <ol> elements may be nested as deeply as desired. moreover, the nested lists may alternate between <ol> and <ul> without restriction. the <ol> and <ul> elements both represent a list of items. ...
... the <ul> and <ol> elements may be nested as deeply as desired. ...
Global attributes - HTML: Hypertext Markup Language
that non-editable elements are in, or the language that editable elements should be written in by the user. the attribute contains one “language tag” (made of hyphen-separated “language subtags”) in the format defined in tags for identifying languages (bcp47). xml:lang has priority over it. part a space-separated list of the part names of the element. part names allows css to select and
style specific elements in a shadow tree via the ::part pseudo-element. slot assigns a slot in a shadow dom shadow tree to an element: an element with a slot attribute is assigned to the slot created by the <slot> element whose name attribute's value matches that slot attribute's value. spellcheck an enumerated attribute defines whether the element may be checked for spelling errors. it may have th...
...lot> element whose name attribute's value matches that slot attribute's value. spellcheck an enumerated attribute defines whether the element may be checked for spelling errors. it may have the following values: true, which indicates that the element should be, if possible, checked for spelling errors; false, which indicates that the element should not be checked for spelling errors.
style contains css styling declarations to be applied to the element. note that it is recommended for
styles to be defined in a separate file or files. this attribute and the <
style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. tabindex an integer attribute indicating if the element can take input focus (is focusable), if it should participate to s...
...lobal attributes' in that specification. recommendation snapshot of html living standard. from html5, contextmenu, draggable, dropzone, and spellcheck have been added. html5the definition of 'global attributes' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, the concept of global attributes is introduced and the dir, lang,
style, id, class, tabindex, accesskey, and title are now true global attributes. xml:lang which was initially part of xhtml, is now also part of html. hidden, data-*, contenteditable, and translate have been added. html 4.01 specification recommendation there are no global attributes defined. several attributes that will become global attributes in subsequent specifications are d...
...e now true global attributes. xml:lang which was initially part of xhtml, is now also part of html. hidden, data-*, contenteditable, and translate have been added. html 4.01 specification recommendation there are no global attributes defined. several attributes that will become global attributes in subsequent specifications are defined on a subset of elements. class and
style are supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <
style>, and <title>. dir is supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. id is supported on all elements but <base>, <head>, <html>, <meta>, <script>, <
style>, and <title>. lang is supported on all elements ...
CSP: script-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. ...
......
...ce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or
styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or
style. when generating the hash, don't include the <script> or <
style> tags and note that capitalization and whitespace matter, including leading or trailing whitespace. see unsafe inline script for an example. in csp 2.0, this applie...
...however, if you absolutely have to use it, there are a few mechanisms that will allow them. to allow inline scripts and inline event handlers, 'unsafe-inline', a nonce-source or a hash-source that matches the inline block can be specified. content-security-policy: script-src 'unsafe-inline'; the above content security poli...
Index - HTTP
the accept request http header advertises which content types, expressed as mime types, the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-type response header. browsers set adequate values for this header depending on the context where the request is done: when fetching a css
stylesheet a different value is set for the request than when fetching an image, video or a script. 3 accept-charset content negotiation, http, http header, reference, request header the accept-charset request http header advertises which character set the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and informs the ...
...e user agent to report attempts to violate the content security policy. these violation reports consist of json documents sent via an http post request to the specified uri. 45 csp: require-sri-for csp, directive, http, reference, security the http content-security-policy require-sri-for directive instructs the client to require the use of subresource integrity for scripts or
styles on the page. 46 csp: sandbox csp, directive, http, security the http content-security-policy (csp) sandbox directive enables a sandbox for the requested resource similar to the <iframe> sandbox attribute. it applies restrictions to a page's actions including preventing popups, preventing the execution of plugins and scripts, and enforcing a same-origin policy. 47 ...
...enting the execution of plugins and scripts, and enforcing a same-origin policy. 47 csp: script-src csp, directive, http, reference, security the http content-security-policy (csp) script-src directive specifies valid sources for javascript. this includes not only urls loaded directly into <script> elements, but also things like inline script event handlers (onclick) and xslt
stylesheets which can trigger script execution. 48 csp:
style-src csp, directive, http, reference, security the http content-security-policy (csp)
style-src directive specifies valid sources for
stylesheets. 49 csp: upgrade-insecure-requests csp, directive, http, reference, security the http content-security-policy (csp) upgrade-insecure-requests directive inst...
...e media type of the resource. 54 cookie cookies, http, reference, header, request the cookie http request header contains stored http cookies previously sent by the server with the set-cookie header. 55 cookie2 http, obsolete, reference, header, request the obsolete cookie2 http request header used to advise the server that the user agent understands "new-
style" cookies, but nowadays user agents will use the cookie header instead, not this one. 56 dnt dnt, http, reference, header the dnt (do not track) request header indicates the user's tracking preference. it lets users indicate whether they would prefer privacy rather than personalized content. 57 date general header, http, reference, header the date general ...
Intl.ListFormat - JavaScript
nts of the list. intl.listformat.prototype.formattoparts() returns an array of objects representing the different components that can be used to format a list of values in a locale-aware fashion. examples using format the following example shows how to create a list formatter using the english language. ...
...that can be used to format a list of values in a locale-aware fashion. examples using format the following example shows how to create a list formatter using the english language. ...
...w to create a list formatter using the english language. ...
...b', {
style: 'short', type: 'disjunction' }).format(list)); // > motorcycle, bus or car console.log(new intl.listformat('en-gb', {
style: 'narrow', type: 'unit' }).format(list)); // > motorcycle bus car using formattoparts the following example shows how to create a list formatter returning formatted parts const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', {
style: 'long', type: 'conjunction' }).formattoparts(list)); // [ { "type": "element", "value": "motorcycle" }, // { "type": "literal", "value": ", " }, // { "type": "element", "value": "bus" }, // { "type": "literal", "value": ", and " }, // { "type": "element", "value": "car" } ]; specifications specification intl.listformatthe definition of 'listformat' in that speci...
<mo> - MathML
an operator in a broad sense. besides operators in strict mathematical meaning, this element also includes "operators" like parentheses, separators like comma and semicolon, or "absolute value" bars. attributes accent if the operator is used as an under- or overscript this attribute specifies whether the operator should be treated as an accent. allowed values are true or false. class, id,
style provided for use with
stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). fence there is no visual effect for this attribute, but it specifies whether the operator is a fence (such as parentheses). allowed values are true or false. form specifies the role of the operator in an enclosed expression, which affects spacing and other defa...
...ne argument.) infix, for separators. (it is the default value if the operator is not included in a <mrow> element.) postfix, closing fences. (it is the default value if the operator is the last argument in a <mrow> element with more than one argument.) href used to set a hyperlink to a specified uri. largeop specifies whether the operator should be drawn larger than normal when display
style="true" is set. allowed values are either true or false. lspace the amount of space before the operator (see length for values and units). the constant thickmathspace (5/18em) is the default value. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. s...
... html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this attribute specifies the logical class of the operator which varies in typography. that is, although the names suggest the typographic
style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; e...
...retchy is true, this attribute specifies the maximum size of the operator. allowed values are: infinity an arbitrary length minsize if stretchy is true, this attribute specifies the minimum size of the operator. allowed values are: infinity an arbitrary length movablelimits specifies whether attached under- and overscripts move to sub- and superscript positions when display
style is false. allowed values are either true or false. rspace the amount of space after the operator (see length for values and units). the constant thickmathspace (5/18em) is the default value. separator there is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas). allowed values are true or false. stretchy specifies whether the operator...
<mtable> - MathML
attributes align specifies the vertical alignment of the table with respect to its environment. ...
... attributes align specifies the vertical alignment of the table with respect to its environment. ...
...than the whole table. a negative integer value counts rows from the bottom of the table. starting with gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the interpretation of negative values has been corrected (bug 601436). in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) the parsing has been updated to treat whitespace correctly. alignmentscope unimplemented class, id,
style provided for use with
stylesheets. columnalign specifies the horizontal alignment of the cells. multiple values separated by space are allowed and apply to the corresponding columns (e.g. columnalign="left right center"). possible values are: left, center (default) and right. columnlines specifies column borders. multiple values separated by space are allowed and apply to the corresponding c...
...e values are: left, center (default) and right. columnlines specifies column borders. multiple values separated by space are allowed and apply to the corresponding columns (e.g. columnlines="none none solid"). possible values are: none (default), solid and dashed. columnspacing specifies the space between table columns. unimplemented columnwidth specifies the width of table columns. display
style a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. the main effect is that larger versions of operators are displayed, when display
style is set to true. unimplemented equalcolumns a boolean value indicating whether to force all columns to have the same total height. false is default. un...
Content type - SVG: Scalable Vector Graphics
for properties defined in css2, an angle unit identifier must be provided. ...
... #<elementid> or #xpointer(id<elementid>)). non-local iri references, where the iri reference does contain an <absoluteiri> or <relativeiri>. for the full specification of iri references in svg, see svg 1.1 (2nd edition): iri references. length <length> a length is a distance measurement, given as a number along with a unit. lengths are specified in one of two ways. when used in a
stylesheet, a <length> is defined as follows: length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"pc")? see the css2 specification for the meanings of the unit identifiers. for properties defined in css2, a length unit identifier must be provided. for length values in svg-specific properties and their corresponding presentation attributes, the length unit identifier is op...
...e t. for example, a <list-of-lengths> is represented in the svg dom using an svglengthlist or svganimatedlengthlist object. name <name> a name, which is a string where a few characters of syntactic significance are disallowed. name ::= [^,()#x20#x9#xd#xa] /* any char except ",", "(", ")" or wsp */ number <number> real numbers are specified in one of two ways. when used in a
stylesheet, a <number> is defined as follows: number ::= integer | [+-]? [0-9]* "." [0-9]+ this syntax is the same as the definition in css (css2, section 4.3.1). when used in an svg attribute, a <number> is defined differently, to allow numbers with large magnitudes to be specified more concisely: number ::= integer ([ee] integer)? | [+-]? [0-9]* "." [0-9]+ ([ee] integer)...
...iven graphics element. the available options and syntax for <paint> are described in specifying paint. within the svg dom, <paint> values are represented using svgpaint objects. percentage <percentage> percentages are specified as a number followed by a "%" character: percentage ::= number "%" note that the definition of <number> depends on whether the percentage is specified in a
stylesheet or in an attribute that is not also a presentation attribute. percentage values are always relative to another value (for example, a length). each attribute or property that allows percentages also defines the reference distance measurement to which the percentage refers. within the svg dom, a <percentage> is represented using an svgnumber or svganimatednumber object. time <time> ...
<feDropShadow> - SVG: Scalable Vector Graphics
value type: <number>; default value: 2; animatable: yes dy this attribute defines the y offset of the dro...
... value type: <number>; default value: 2; animatable: yes dy this attribute defines the y offset of the drop shadow. value type: <number>; default value: 2; animatable: yes stddeviation t...
...lood-color="cyan"/> </filter> <filter id="shadow3"> <fedropshadow dx="-0.8" dy="-0.8" stddeviation="0" flood-color="pink" flood-opacity="0.5"/> </filter> </defs> <circle cx="5" cy="50%" r="4"
style="fill:pink; filter:url(#shadow);"/> <circle cx="15" cy="50%" r="4"
style="fill:pink; filter:url(#shadow2);"/> <circle cx="25" cy="50%" r="4"
style="fill:pink; filter:url(#shadow3);"/> </svg> attributes dx this attribute defines the x offset of the drop shadow. value type: <number>; default value: 2; animatable: yes dy this attribute defines the y offset of the drop shadow. value type: <number>; default value: 2; animatable: yes stddeviation this attribute defines the standard deviation for the blur operation in the drop shadow...
...; default value: 2; animatable: yes dy this attribute defines the y offset of the drop shadow. value type: <number>; default value: 2; animatable: yes stddeviation this attribute defines the standard deviation for the blur operation in the drop shadow. ...
<glyph> - SVG: Scalable Vector Graphics
h> defines a single glyph in an svg font. usage context categoriestext content elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <
style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class
style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y unicode glyph-name orientation arabic-form lang dom interface this element implements the svgglyphelement interface. example svg <svg width="400px" height="300px" version="1.1" xmlns="ht...
...ientation arabic-form lang dom interface this element implements the svgglyphelement interface. ...
... recommendation initial definition ...
... recommendation initial definition ...
<metadata> - SVG: Scalable Vector Graphics
used by hub symbol --> <symbol id="hubplug"> <desc>a 10baset/100basetx socket</desc> <path d="m0,10 h5 v-9 h12 v9 h5 v16 h-22 z"/...
...used by hub symbol --> <symbol id="hubplug"> <desc>a 10baset/100basetx socket</desc> <path d="m0,10 h5 v-9 h12 v9 h5 v16 h-22 z"/> </symbol> <!-- hub symb...
...nds rdf:resource="#socket4"/> <connect:ends rdf:resource="#socket5"/> </rdf:description> </rdf:rdf> </metadata> <title>network</title> <desc>an example of a computer network based on a hub.</desc> <
style> svg { /* default
styles to be inherited */ fill: white; stroke: black; } text { fill: black; stroke: none; } path { fill: none; } </
style> <!-- define symbols used in the svg --> <defs> <!-- hubplug symbol. used by hub symbol --> <symbol id="hubplug"> <desc>a 10baset/100basetx socket</desc> <path d="m0,10 h5 v-9 h12 v9 h5 v16 h-22 z"/> </symbol> <!-- hub symbol --> <symbol id="hub"> <desc>a typical 10baset/100basetx network hub</desc> <text x="0" y="15">hub</text> <g transfor...
... 10 s 40 12 70 10 l 80 20z"/> </g> <g id="monitor"> <title>monitor</title> <desc>a very fancy monitor</desc> <rect width="160" height="120"/> <rect fill="lightgrey" width="138" height="95" x="11" y="12"/> </g> <g id="processor" transform="translate(0 142)"> <title>the computer</title> <desc>a desktop computer - broad flat box
style</desc> <rect width="160" height="60"/> <g id="discdrive" transform="translate(70 8)"> <title>disc drive</title> <desc>a built-in disc drive</desc> <rect width="58" height="3" x="12" y="8"/> <rect width="8" height="2" x="12" y="15"/> </g> <circle cx="135" cy="40" r="5"/> </g> </symbol> </defs> <text x="0" y="15...
<text> - SVG: Scalable Vector Graphics
possible to apply a gradient, pattern, clipping path, mask, or filter to <text>, like any other svg graphics element. if text is included in svg not inside of a <text> element, it is not rendered. this is different than being hidden by default, as setting the display property won't show the text. ...
...operty won't show the text. html,body,svg { height:100% } <svg viewbox="0 0 240 80" xmlns="http://www.w3.org/2000/svg"> <
style> .small { font: italic 13px sans-serif; } .heavy { font: bold 30px sans-serif; } /* note that the color of the text is set with the * * fill property, the color property is for html only */ .rrrrr { font: italic 40px serif; fill: red; } </
style> <text x="20" y="35" class="small">my</text> <text x="40" y="35" class="heavy">cat</text> <text x="55" y="55" class="small">is</text> <text x="65" y="55" class="rrrrr">grumpy!</text> </svg> attributes x the x coordinate of the starting point of the text baseline. value type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the starting point of t...
...w the text is stretched or compressed to fit the width defined by the textlength attribute. value type: spacing|spacingandglyphs; default value: spacing; animatable: yes textlength a width that the text should be scaled to fit. ...
...e textlength attribute. value type: spacing|spacingandglyphs; default value: spacing; animatable: yes textlength a width that the text should be scaled to fit. ...
SVG fonts - SVG: Scalable Vector Graphics
r plugin, batik and parts of inkscape support svg font embedding. the base for defining an svg font is the <font> element. defining a font there are some ingredients required for embedding a font in svg. let's show an example declaration (the one from the specification), and explain the details. ...
...ribute determines how wide a character is on average compared to the path definitions of the single glyphs. the value 1000 sets a reasonable value to work with. there are several accompanying attributes that help further define the basic glyph-box layout. the <font-face> element is the svg equivalent of the css @font-face declaration. it defines basic properties of the final font such as weight,
style, etc. in the example above the first and most important to be defined is font-family, the value of which can then be referenced in css and svg font-family properties. the font-weight and font-
style attributes have the same purpose as the equivalent descriptors in css. all following attributes are rendering instructions for the font layout engine, for example, how much of the glyphs' overall heigh...
...<font> <font-face font-family="super sans" /> <!-- and so on --> </font> <text font-family="super sans">my text uses super sans</text> however, you are free to combine several methods for great freedom of how and where to define the font. ...
...y="super sans">my text uses super sans</text> however, you are free to combine several methods for great freedom of how and where to define the font. ...
Texts - SVG: Scalable Vector Graphics
efer to gradients or patterns, which makes simple coloring text in svg very powerful compared to css 2.1. setting font properties an essential part of a text is the font in which it is displayed. svg offers a set of attributes, many similar to their css counterparts, to enable font selection. each of the following properties can be set as an attribute or via a css declaration: font-family, font-
style, font-weight, font-variant, font-stretch, font-size, font-size-adjust, kerning, letter-spacing, word-spacing and text-decoration. other text-related elements tspan this element is used to mark up sub-portions of a larger text. it must be a child of a text element or another tspan element. a typical usecase is to paint one word of a sentence bold red. <text> this is <tspan font-weight="bold"...
...ons of a larger text. it must be a child of a text element or another tspan element. a typical usecase is to paint one word of a sentence bold red. <text> this is <tspan font-weight="bold" fill="red">bold and red</tspan> </text> playable code <svg width="350" height="60" xmlns="http://www.w3.org/2000/svg"> <text> this is <tspan font-weight="bold" fill="red">bold and red</tspan> </text> <
style><![cdata[ text{ dominant-baseline: hanging; font: 28px verdana, helvetica, arial, sans-serif; } ]]></
style> </svg> the tspan element has the following custom attributes: x set a new absolute x coordinate for the containing text. this overwrites the default current text position. the attribute may also contain a list of numbers, that are one by one applied to the single charac...
...ext> <textpath xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#my_path"> a curve. ...
... playable code 2 <svg width="200" height="100" xmlns="http://www.w3.org/2000/svg"> <path id="my_path" d="m 20,20 c 80,60 100,40 120,20" fill="transparent" /> <text> <textpath xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#my_path"> a curve. </textpath> </text> <
style><![cdata[ text{ dominant-baseline: hanging; font: 28px verdana, helvetica, arial, sans-serif; } ]]></
style> </svg> « previousnext » ...
Subresource Integrity - Web security
urce-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin. how subresource integrity helps using content delivery networks (cdns) to host files such as scripts and
stylesheets that are shared among multiple sites can improve site performance and conserve bandwidth. however, using cdns also comes with a risk, in that if an attacker gains control of a cdn, the attacker can inject arbitrary malicious content into files on the cdn (or replace the files completely) and thus can also potentially attack all sites that fetch files from that cdn. subresource integrity en...
... hash: sha384-oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc so oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc is the "hash" part, and the prefix sha384 indicates that it's a sha384 hash. note: an integrity value's "hash" part is, strictly speaking, a cryptographic digest formed by applying a particular hash function to some input (for example, a script or
stylesheet file). but it’s common to use the shorthand "hash" to mean cryptographic digest, so that's what's used in this article. tools for generating sri hashes you can generate sri hashes from the command-line with openssl using a command invocation such as this: cat filename.js | openssl dgst -sha384 -binary | openssl base64 -a or with shasum using a command invocation such as this: shasum ...
...rx7hnqlgyl1kpzqho1wx4jwy8wc" crossorigin="anonymous"></script> note: for more details on the purpose of the crossorigin attribute, see cors settings attributes. how browsers handle subresource integrity browsers handle sri by doing the following: when a browser encounters a <script> or <link> element with an integrity attribute, before executing the script or before applying any
stylesheet specified by the <link> element, the browser must first compare the script or
stylesheet to the expected hash given in the integrity value. note: for subresource-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the res...
...ipt or
stylesheet to the expected hash given in the integrity value. note: for subresource-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin. if the script or
stylesheet doesn’t match its associated integrity value, the browser must refuse to execute the script or apply the
stylesheet, and must instead return a network error indicating that fetching of that script or
stylesheet failed. specifications specification status comment subresource integrity recommendation fetch living standard ...
Tutorials
. registering and logging in, sending feedback, buying products, and more. this module gets you started with creating the client-side parts of forms. tips for authoring fast-loading html pages optimize web pages to provide a more responsive site for visitors and reduce the load on your web server and internet connection. ...
... feedback, buying products, and more. this module gets you started with creating the client-side parts of forms. tips for authoring fast-loading html pages optimize web pages to provide a more responsive site for visitors and reduce the load on your web server and internet connection. css tutorials introductory level css basics css (cascading
style sheets) is the code you use to
style your webpage. ...
...oductory level css basics css (cascading
style sheets) is the code you use to
style your webpage. css basics takes you through what you need to get started. we'll answer questions like: how do i make my text black or red? how do i make my content show up in such-and-such a place on the screen? how do i decorate my webpage with background images and colors? css first steps css (cascading
style sheets) is used to
style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. ...
...undamentals, including setting font, boldness, and italics, line and letter spacing, and drop shadows and other text features. we round off the module by looking at applying custom fonts to your page, and styling lists and links. common css questions common questions and answers for beginners. intermediate level css layout at this point we've already looked at css fundamentals, how to
style text, and how to
style and manipulate the boxes that your content sits inside. now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. we have covered the necessary prerequisites so can now dive deep into css layout, looking at different display settings, traditional layout methods involving float and positioning, and new fangled layout to...
XUL Migration Guide - Archive of obsolete content
29 onwards. the tabs/utils module gives you direct access to the tabbrowser object and the xul tab objects it contains. ...
...ccess to the tabbrowser object and the xul tab objects it contains. ...
...this is usefu...
content/mod - Archive of obsolete content
experimental provides functions to modify a page content. globals constructors functions attachto(modification, window) function applies given modification to a given window. for example, the following code applies a
style to a content window, adding a border to all divs in page: var attachto = require("sdk/content/mod").attachto; var
style = require("sdk/
stylesheet/
style").
style; var
style =
style({ source: "div { border: 4px solid gray }" }); // assuming window points to the content page we want to modify attachto(
style, window); parameters modification : object the modification we want to apply to the target. window : nsidomwindow the window to be modified. detachfrom(modification, window) function removes attached modification from a given window. if window is not spec...
...(
style, window); parameters modification : object the modification we want to apply to the target. window : nsidomwindow the window to be modified. detachfrom(modification, window) function removes attached modification from a given window. if window is not specified, modification is removed from all the windows it's being attached to. for example, the following code applies and removes a
style to a content window, adding a border to all divs in page: var { attachto, detachfrom } = require("sdk/content/mod"); var
style = require("sdk/
stylesheet/
style").
style; var
style =
style({ source: "div { border: 4px solid gray }" }); // assuming window points to the content page we want to modify attachto(
style, window); // ... ...
...if window is not provided modification is removed from all targets it's being attached to. ...
Modifying Web Pages Based on URL - Archive of obsolete content
"); } }); the replacepage message isn't a built-in message: it's a message defined by the add-on in the port.emit() call. injecting css note that the feature described in this section is experimental at the moment. we'll most likely continue to support the feature, but api details may change. ...
...y the add-on in the port.emit() call. injecting css note that the feature described in this section is experimental at the moment. we'll most likely continue to support the feature, but api details may change. rather than injecting javascript into a page, you can inject css by setting the page-mod's content
style option. var pagemod = require("sdk/page-mod").pagemod({ include: "*", content
style: "body {" + " border: 5px solid green;" + "}" }); as with contentscript, there's a corresponding content
stylefile option that takes the url of a css file in your "data" directory; it's a good practice to use this option in preference to content
style if the css is even marginally complex. var pagemod = require("sdk/page-mod").pagemod({ include: "*", contents...
... solid green;" + "}" }); as with contentscript, there's a corresponding content
stylefile option that takes the url of a css file in your "data" directory; it's a good practice to use this option in preference to content
style if the css is even marginally complex. var pagemod = require("sdk/page-mod").pagemod({ include: "*", content
stylefile: require("sdk/self").data.url("my-
style.css") }); or, from firefox 34, you can use the simpler version: var pagemod = require("sdk/page-mod").pagemod({ include: "*", content
stylefile: "./my-
style.css" }); learning more to learn more about page-mod, see its api reference page. in particular, the pagemod constructor takes several additional options to control its behavior: by default, content scripts are not attached to a...
Dialogs and Prompts - Archive of obsolete content
w keyboard events (enter/esc and more), which is good for keyboard accessibility. add ok and cancel buttons in an order that is consistent with os default (but the button set and layout is highly customizable, see below). simple dialog code the following xul code defines a simple dialog with two buttons, ok and cancel (buttons="accept,cancel" attribute on dialog). <?xml version="1.0"?> <?xml-
stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." title="..." buttons="accept,cancel" ondialogaccept="return onaccept();" ondialogcancel="return oncancel();"> <script src="chrome://..."/> <!-- content --> </dialog> you need to implement onaccept and oncancel functions in your script. if the...
...file and add a dlgtype attribute to them. valid values for dlgtype are the six button types listed above. be sure to use ondialog* attributes on dialog element instead of putting oncommand on the button with dlgtype, because button's oncommand is executed only when the button is pressed, and ondialog* handlers are executed for keyboard and other events too. ...
...ialogheader element to add "headers" to windows. to get an idea of what it looks like, open options (or preferences) dialog in firefox or thunderbird (v1.0 and earlier only). the header to the right of the sections buttons is made with <dialogheader>: <dialogheader title="general" description="whatever"/> note, that you should only use this element in a <dialog>, because otherwise it may be not
styled properly. (although it seems to work in <window> as well). programmatic button access if you want to access the accept ("ok") and cancel buttons from script, use this: // disable the ok and cancel btns document.documentelement.getbutton("accept").disabled = true; document.documentelement.getbutton("cancel").disabled = true; links dialog.xml — xbl bindings for <dialog> and <dialogheade...
Label and description - Archive of obsolete content
this reduces all whitespace chunks (including newlines) to single spaces. ...
...whitespace chunks (including newlines) to single spaces. text is permitted to wrap. <description>i am your father's brother's nephew's cousin's former roommate. what's that make us? absolutely nothing!</description> with white-space: pre; all whitespace, including newlines, is rendered literally. text cannot wrap automatically but can still be achieved with <html:br/> if desired. <description
style="white-space: pre-wrap;">i am your father's brother's nephew's cousin's former roommate. what's that make us? absolutely nothing!</description> with white-space: pre-wrap; all whitespace is rendered literally, but text is additionally permitted to wrap at spaces. note: prior to firefox 3, it was necessary to use -moz-pre-wrap instead of -pre-wrap. you may wish to use both for backward compati...
...p;">i am your father's brother's nephew's cousin's former roommate. what's that make us? absolutely nothing!</description> with white-space: pre-wrap; all whitespace is rendered literally, but text is additionally permitted to wrap at spaces. note: prior to firefox 3, it was necessary to use -moz-pre-wrap instead of -pre-wrap. you may wish to use both for backward compatibility. <description
style="white-space: pre;">i am your father's brother's nephew's cousin's former roommate. what's that make us? absolutely nothing!</description> text can also be made to wrap by inserting an <html:br/> element regardless of the css
style, but this creates a hard-break that does not change as parent elements resize. <description>i am your father's brother's nephew's cousin's former roommate.<html:b...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
es such as xhtml and svg can be interspersed in one another as a means to extend the language. all elements can carry a "namespace uri" identifier, which is unique for each language. for example, even though xhtml and svg have elements with the same name, these can be distinguished. the namespace uri for xhtml is "http://www.w3.org/1999/xhtml" ; for svg is it "http://www.w3.org/2000/svg". ...
...extend the language. all elements can carry a "namespace uri" identifier, which is unique for each language. for example, even though xhtml and svg have elements with the same name, these can be distinguished. the namespace uri for xhtml is "http://www.w3.org/1999/xhtml" ; for svg is it "http://www.w3.org/2000/svg". ...
...is unique for each language. for example, even though xhtml and svg have elements with the same name, these can be distinguished. the namespace uri for xhtml is "http://www.w3.org/1999/xhtml" ; for svg is it "http://www.w3.org/2000/svg". css: a
style language to alter the display of xml documents like xml, cascading
style sheets (css) is a technical specification established by the w3c; it is a
style-description language defining the display of data marked up in xml and html. as shown in listing 1, it has an extremely simple syntax. by separating the structure of the data, expressed through html or xml, and the display
style, indicated by css, data can be reused better than it is when structural and stylistic markup are both embedded in html. there are three css specifications (level 1 throu...
Custom XUL Elements with XBL - Archive of obsolete content
is the file that associates the element name to the xbl file. it associates the xshelloperson element name to the binding defined in the xbl file. since you can have more than one binding per file, the "#person" part points to the id of the one we want. ...
...ou can have more than one binding per file, the "#person" part points to the id of the one we want. this css file is located in the content because it's not something we would normally want to be replaced by a skin, and it's not really defining
style; it defines content behavior instead. if you use bindings on toolbar elements, remember to include the css file in the customize dialog, using the
style directive in the chrome.manifest file. with those 2 files properly defined, we can now use the new element. if you look at file bindingdialog.xul, you'll see that the css
stylesheet is included, which means that the xshelloperson tag can now be used just like any xul tag. in this case we're adding the "persons" dynamically, so you'll have to look into the js file to see how xshelloperson element...
...the method uses the parent node to remove the person node. simple enough. you can do almost anything from xbl code, including using xpcom components, js code modules and available chrome scripts. the main setback is that you can't have script tags defined in a binding, so you depend on the scripts that have been included in the xul files that use the binding. also unlike scripts, you can include
stylesheets using the
stylesheet xbl element. dtd and properties files can be handled just like in regular xul. there are two conflicting patterns that you should always keep in mind: encapsulation and separation of presentation and logic. encapsulation mandates that you try to keep your xbl free of outside dependencies. that is, you shouldn't assume that script x will be included somewhere, because...
List of Mozilla-Based Applications - Archive of obsolete content
k xul remote remote control for amarok music player ample sdk javascript gui-framework aol instant messenger im client uses nss apache web server doesn't use nss by default, but can be configured to use nss with mod_nss ssl module apicawatch site performance monitoring tool uses firefox as part of its monitoring package a
style css editor editing tool atmail webmail client aviva for java mainframe connectivity product uses mozilla rhino babelgum internet tv service basilisk pre-servo xul-based web browser uses most of the firefox 55 source code batik java-based toolkit uses mozilla rhino bitbox security focused browser see...
...elbrot creates images of mandelbrot sets xulrunner application kazehakase gecko-based web browser for unix kirix strata data browser kiwix offline version of wikipedia kneemail prayer, praise, and journal application komodo and komodo edit and open komodo development tools mozilla-based application (pre-xulrunner
style), xul ui kompozer wysiwyg html editor unofficial bug-fix release of nvu kylo video browser uses gecko biofortis labmatrix web-accessible software application used for information management and integration of patient clinical, specimen, genetic and molecular assay data based on xul liaison groupware client for novell’s email and collabora...
...al kiosk app uses xulrunner telekast teleprompter tenfourfox browser for powerpc-based macs timberwolf browser for amiga os4 based on firefox - project page mozilla thunderbird email 47 million dl tomtom home 2 pc application to manage tomtom gps devices review article from gps magazine; over 2.4m users top
style html, xhtml and css editor seems to have optional gecko embedding but doesn't use it by default toxtox media browser for tv 5000 downloads trixul gui toolkit uses mozilla spidermonkey trustedbird email client thunderbird bundled with a set of extensions (formerly known as milimail) tuneup music collection organizer listed on xulrun...
Finding the file to modify - Archive of obsolete content
now that we have a hackable mozilla, it's time to find the file we want to hack. mozilla's ui is divided into three layers: the structure, the
style, and the behavior. the structure layer identifies the widgets (menus, buttons, etc.) and their position in the ui relative to each other, the
style layer defines how the widgets look (size, color,
style, etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals. mention the localization layer (note: these layers are not completely mutually exclusive. ...
...the structure layer consists of xul files. ...
... etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals. mention the localization layer (note: these layers are not completely mutually exclusive. in particular, positioning information can be specified in both the structure layer and the
style layer, and some behavior can be partly defined in the
style layer.) we're going to add code to all three ui layers, starting with the structure layer. the structure layer consists of xul files. xul, which is short for xml-based user interface language (and is pronounced like "zool"), is an xml-based language specifically designed for describing application interfaces. it contains elements for all common ui widgets (menus, buttons, toolbars, etc.) and man...
Creating regular expressions for a microsummary generator - Archive of obsolete content
hes any combination of characters, including no characters at all, so it works even if "viewitem&" and "item=" are right next to each other (as in our example url) as well as when there are some characters between them. matching another ebay url we now have a regular expression that matches auction item urls, including those with multiple query parameters in any order. but ebay uses a different
style of url in some cases (f.e. on its search results page). here's a url for the same item in that different
style: http://cgi.ebay.com/mozilla-firefox-logo-1-inch-pin-badge-button-browser_w0qqitemz280018439106qqihz018qqcategoryz2036qqcmdzviewitem to accommodate these urls, we can create a second regular expression that matches them. as before, we should distinguish the components of the url whic...
...m in that different
style: http://cgi.ebay.com/mozilla-firefox-logo-1-inch-pin-badge-button-browser_w0qqitemz280018439106qqihz018qqcategoryz2036qqcmdzviewitem to accommodate these urls, we can create a second regular expression that matches them. as before, we should distinguish the components of the url which are unique to the item from those which are common to all auction item urls of this
style. ...
....com/mozilla-firefox-logo-1-inch-pin-badge-button-browser_w0qqitemz280018439106qqihz018qqcategoryz2036qqcmdzviewitem to accommodate these urls, we can create a second regular expression that matches them. as before, we should distinguish the components of the url which are unique to the item from those which are common to all auction item urls of this
style. ...
Drag and Drop Example - Archive of obsolete content
ement to create an element of a particular type. first, we'll add the wrapper scripts: <script src="chrome://global/content/nsdraganddrop.js"/> <script src="chrome://global/content/nstransferable.js"/> <script src="dragboard.js"/> an additional script file dragboard.js is included which will contain the code we will write ourselves. the board will be created using a stack element. ...
...contain the code we will write ourselves. the board will be created using a stack element. we'll use some
style properties to set the width and height of the stack. a maximum size is also specified so that it doesn't resize when new elements are dragged onto it. the board will need to respond to the dragdrop event so that an element is created when the user drags onto it. <stack id="board"
style="width:300px; height: 300px; max-width: 300px; max-height: 300px" ondragover="nsdraganddrop.dragover(event, boardobserver)" ondragdrop="nsdraganddrop.drop(event, boardobserver)"> </stack> the board only needs to respond to the dragdrop and dragover events. we'll add a boardobserver to the file dragboard.js in a moment. next, a palette will be added to the right side of the window. ...
...y accept drags from the palette. ...
Twitter - Archive of obsolete content
for search, jetpack.lib.twitter.search(). replace slashes with dots. most of twitter's methods are supported, but not all. list methods, spam reporting methods, and oauth are not currently supported. if something is not supported but you would like it to be, please file a bug. (or write a patch!) arguments each and every method in the library takes a single argument, an object. there are two
styles you can use to define this object. the first is simple: define properties on the object corresponding to the parameters of the twitter method. for instance, some twitter methods have an id parameter, so you would define an id property and set its value to a user's id. (you can read about the parameters of the various methods at twitter's api reference.) there are two special, optional properties...
...called like so: success(data, textstatus) data is twitter's decoded json response. textstatus is a simple string describing the status. error(xmlhttprequest, textstatus, errorthrown) xmlhttprequest is the xhr used in the request. textstatus is a simple string describing the type of error. errorthrown is an exception object, if one was thrown. the examples below all use this first, simpler
style. the second
style will be familiar if you have used jquery.ajax() -- in fact the object is passed as-is (almost) to it. in other words, define a data property that is itself an object whose properties correspond to the parameters of the twitter method. with this
style you can use any of the various jquery.ajax() options in your request: data, success, complete, etc. example: jetpack.lib.twitter.s...
...options in your request: data, success, complete, etc. example: jetpack.lib.twitter.statuses.update({ data: { status: "o frabjous day!" }, username: "basic_auth_username", password: "basic_auth_password", success: function () console.log("hey!") }); user authentication you can supply a username and password to methods that require authentication using the second, more advanced call
style described above. or you can simply rely on firefox. when you call a method that requires authentication -- such as jetpack.lib.twitter.statuses.update() -- without providing a username or password, firefox will prompt the user for them if she is not already authenticated with twitter. both methods use http basic authentication. in the future, the library may support oauth. see twitter's authent...
Mozilla Application Framework in Detail - Archive of obsolete content
rewritten to describe why use xulrunner to create your own application. related: xulrunner:what xulrunner provides, xulrunner hall of fame ui in mozilla mozilla's philosophy of using "the right tool for the right job" is manifested most prominently in the design of the user interface. we provide an xml-based language called xul for defining the user interface of your application. css is used to
style these ui's and dtd's are used to localize the textual information - making your application extremely flexible and able to be utilized across the globe. javascript, considered by many to be the best scripting language ever designed is ideal for specifying the behavior of your interface widgets. where speed is the foremost consideration, we provide c++ libraries with multi-language interfaces for ...
...he technologies already mentioned, we go even further by allowing you to even create your own custom interface widgets. don't feel limited by the widgets that the framework already contains! xbl (extensible binding language) allows you to expand your library of interface elements, and even construct your own xml language for defining your ui. for instance imagine that you wanted to create a chess
style game. you could easily create xml elements such as <chessboard> or <chesspiece> and via xbl map these to images and application logic. this is very powerful since you could make improvements to the underlying application logic without having to rewrite the higher level code. our platform also can take advantage of other internet standards such as xslt and rdf. rdf, a core element to the framework...
...gy offers small size, speed and industry leading standards support. gecko is the premier cross-platform, full-featured, mature and well-tested layout engine available, providing robust and high quality support for a massive array of standards. its ability to render web content correctly is exceptional. gecko consists roughly of an html parser and xml parser, a dom implementation, a css parser and
style system, and the code for css-based and html-based layout and rendering. as personal connectivity expands from the desktop computer to new web-enabled products and devices, gecko is a browser engine that has been designed from the ground up to power a new generation of desktop browsers and browsing devices and to accelerate the growth and development of the next-generation internet. small, fast an...
Prism - Archive of obsolete content
asic desktop integration: support of desktop features can make using the app more natural and convenient for end users. this includes the ability to create desktop shortcuts, to place the application icon in the tray or dock and to display pop-up notifications. customization: apps can be run using a shared browser runtime and customized using client-side script (similar to greasemonkey). custom
stylesheets can be used to tweak the ui. architectural overview prism is a xulrunner application. in addition to the browser engine included in xulrunner, it consists of: web app bundle management: code for creating new web app bundles and loading existing bundles. shortcut creation ui: a dialog box lets the user specify attributes of the web app (name, uri, icon, shortcut locations). javascrip...
...r specify attributes of the web app (name, uri, icon, shortcut locations). javascript api: an api that can be used by scripts inside the bundle to customize the application. we are refining this approach to make the api applicable in as many environments as possible (e.g. it might be useful even for applications running in a normal browser). it should be possible for developers to include prism-
style extension directly in their web app. we would like to harmonize our api with those of similar projects such as adobe air and google gears. operating-system integration: binary components provided access to os-specific features like shortcut creation and dock/tray icons. we intend to propose these extensions for inclusion in future versions of xulrunner. firefox extension: a firefox extension,...
... a web application bundle is a zip archive that holds a configuration file, icons and an optional webapp js script. bundles can be installed locally, or directly from a website using the prism for firefox extension. configuration a webapp bundle should contain a webapp.ini configuration file. the configuration file is a simple, ini-
style text file that specifies some parameters about a web application. styling one of prism's goals is to make web applications feel more like desktop applications. one way to make the illusion seem more real is to use styling (or theming). prism supports a simple styling system that allows the user to add css files to the webapp bundle. ...
Remotely debugging Firefox for Metro - Archive of obsolete content
firefox running in classic "desktop" mode on windows, mac os x, or linux, either on a separate computer or in a separate profile on the same computer. ...
... firefox running in classic "desktop" mode on windows, mac os x, or linux, either on a separate computer or in a separate profile on the same computer. ...
...see one entry under "available remote processes": this is the browser process itself. you'll choose this option if you want to debug the browser's own code. let's choose to attach to the mozilla.org website. the toolbox will open in its own window, attached to the firefox for metro tab that's currently hosting mozilla.org: the toolbox, and the tools it hosts (including the console, debugger,
style editor, profiler, etc.), work in just the same way as they do when attached to local content. ...
A XUL Bestiary - Archive of obsolete content
ization strings are just a dtd, and the content is just the xul. the chrome url this concept of a chrome as an integrated, dynamic thing in some way divorced from the "appcore" is realized in the use of the chrome url to point to chunks of xul and their related files. the chrome url, which appears in place of the http url in pointers like the following global skin processing instruction: <?xml-
stylesheet href="chrome://global/skin/" type="text/css"?> specifies a chrome to be loaded by the gecko rendering engine. in the example above, the chrome is simply a skin file to be loaded into the xul file, but the chrome can also be used to load whole chromes, as when a <menuitem> in one window brings up a new chrome: <menuitem value="mozilla help" oncommand="window.opendialog('chrome://help/c...
...e advent of css2 and its new positioning capabilities. skinning is most often brought up in the context of dynamic changes to the overall look of an application. though this is not yet in the browser, very soon it will be possible to change the look of a whole application dynamically, but only to the extent that the skin is actually defined in the main global.css, or global skin. when you create
styles in <
style> tags, as
style attributes for individual elements, or in custom css files, you break the ability of gecko to skin the application to which your xul belongs. widgets widgets are the pieces that you assemble to make an interface. menus, toolbars, buttons, and scrollbars are widgets, and so are such general purpose pieces as boxes and springs. these widgets can be created and placed wi...
...is the element and both value and the id are attributes. <menu id="file" label="file"> <menupopup> <menuitem label="new" oncommand="createnewdoc()" /> <menuitem label="open" oncommand="opendoc()" /> <menuitem label="close" oncommand="closedoc()" /> </menupopup> </menu> element names the item, the widget, while attributes describes features of that element, such as its name, its
style, and so on. in object-oriented parlance, the element is analogous to the object itself while the attribute is like a property. the attribute has a value associated with it (such as the string "file" for the id attribute in the example above). note that the menu element includes both the opening tag at the top and the closing tag at the bottom of the example. in a way, the menu element comprises t...
treecol.type - Archive of obsolete content
nt as text. checkbox the content of the columns are checkboxes. progressmeter the content of the columns are a progress meters. this is used in mozilla's download manager window. text the content of the columns is text. if you are using type="checkbox", then the tree and each treecol must be editable. you need to apply css to make the checkbox toggle. here is an example css
style using the current theme's checkboxes: treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. this
style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */ list-
style-image: none; } treechildren::-moz-tree-checkbox(checked) { /* checked checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x so you sh...
...* unchecked checkbox treecells. this
style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */ list-
style-image: none; } treechildren::-moz-tree-checkbox(checked) { /* checked checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x so you should specify a url to an image in your extension or elsewhere. */ list-
style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x, so you should specify a url to an image in your extension or elsewhere. ...
...c os x so you should specify a url to an image in your extension or elsewhere. */ list-
style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x, so you should specify a url to an image in your extension or elsewhere. ...
MenuItems - Archive of obsolete content
lass="menuitem-iconic" label="add bookmark" image="addbookmark.png"/> as the image appears on a menu item, you will want to ensure you use a fairly small image. although the exact size will vary depending on the theme being used, the size of menu item images should generally be around 16 by 16 pixels. instead of specifying the icon with the image attribute, you can also reference the image in a
style sheet with the 'list-
style-image' property. #add-bookmark { list-
style-image: url('addbookmark.png'); } this technique can also be used to apply an image for the menu element, except you would want to use the "menu-iconic:" class instead. <menuitem id="bookmark" class="menu-iconic" label="bookmarks" image="bookmarks.png"/> menu icon animation in order to animate the menu item icon on hov...
...uare is the icon in normal state the bottom part in hovered state. note that the image element is on a child level underneath the menu or menuitem, and it will have the class menu-iconic-icon. ...
... checkbox menu items sometimes, you will want to have an item on a menu that acts as a toggle. for instance, a menuitem that can be used to toggle a toolbar on and off. ...
Positioning - Archive of obsolete content
s as to how the popup should be opened. positioning using coordinates a popup can be positioned further using the x and y arguments to openpopup. after the popup is positioned using the anchor, the x and y arguments may be used to offset the popup by a certain distance. the section on the openpopup method provides an example of this. ...
...opened. positioning using coordinates a popup can be positioned further using the x and y arguments to openpopup. after the popup is positioned using the anchor, the x and y arguments may be used to offset the popup by a certain distance. the section on the openpopup method provides an example of this. ...
...if you notice in the firefox browser when a tooltip is opened it appears not at the mouse position, but slightly below it. ...
Building Trees - Archive of obsolete content
in the tree cells. in this case, the member resource is used since that holds the photo’s url. however, it could be any other variable, a static value, or a combination of both. of course, we can’t really see the photos, since the tree’s rows are too small! it’s not normal to put photos in a tree like this—instead, the images would be used for icons. on the other hand, you could use a
stylesheet to change the default height of the tree rows. you cannot make each row a different height, but you can change the height of all rows with some css: treechildren::-moz-tree-row { height: 150px; } since no elements are constructed by the tree builder, you cannot use the
style or class attributes to change the
style of a cell (this is the case with all trees). you must use syntax like that ...
...give each node a unique "id" attribute. these are used to track the current state of the disclosure triangles. support for this was introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). using tree properties since we need to use special css for trees, the properties attribute on a cell becomes extremely useful. it can be used to define extra properties for reference later in a
stylesheet. for example, if the properties attribute was set to the value "?creator", you could
style the photos created by different people differently. alternatively, you could also use static values (in addition to variables) in the properties attribute. for instance, consider the following css: treechildren::-moz-tree-cell(dave) { background-color: lightgreen; } this would set the background col...
...differently. alternatively, you could also use static values (in addition to variables) in the properties attribute. for instance, consider the following css: treechildren::-moz-tree-cell(dave) { background-color: lightgreen; } this would set the background color of a cell to green for any cell with the “dave” property. you can also use the properties attribute on the treerow to change the
style for an entire row. this example sets the country associated with a photo as a property of a tree’s rows. we can use that property to change the appearance of each row. <rule> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://www.xulplanet.com/rdf/country" object="?country"/> <triple su...
Adding Labels and Images - Archive of obsolete content
s xul has an element to display images within a window. this element is appropriately named image. note that the tag name is different than html (image instead of img). you can use the src attribute to specify the url of the image file. ...
...ropriately named image. note that the tag name is different than html (image instead of img). you can use the src attribute to specify the url of the image file. the example below shows this: <image src="images/banner.jpg"/> although you can use this syntax, it would be better in order to support different themes to use a
style sheet to set the image url. a later section will describe how to use
style sheets, but an example will be shown here for completeness. ...
... img). you can use the src attribute to specify the url of the image file. the example below shows this: <image src="images/banner.jpg"/> although you can use this syntax, it would be better in order to support different themes to use a
style sheet to set the image url. a later section will describe how to use
style sheets, but an example will be shown here for completeness. you can use the list-
style-image css property to set the url for the image. here are some examples: xul: <image id="image1"/> <image id="search"/>
style sheet: #image1 { list-
style-image: url("chrome://findfile/skin/banner.jpg"); } #search { list-
style-image: url("http://example.com/images/search.png"); } these images come from within the chrome directory, in the skin for the findfile package. because images...
Broadcasters and Observers - Archive of obsolete content
ute directly on the button, all attributes will be observed. broadcast event there is an additional event handler that we can place on the observes element which is onbroadcast. the event is called whenever the observer notices a change to the attributes of the broadcaster that it is watching. an example is shown below. example 3 : source view <broadcasterset> <broadcaster id="colorchanger"
style="color: black"/> </broadcasterset> <button label="test"> <observes element="colorchanger" attribute="
style" onbroadcast="alert('color changed');"/> </button> <button label="observer" oncommand="document.getelementbyid('colorchanger').setattribute('
style','color: red');" /> two buttons have been created, one labeled test and the other labeled observer. if you click on the test button, noth...
...f you click on the test button, nothing special happens. however, if you click on the observer button, two things happen. first, the button changes to have red text and, second, an alert box appears with the message 'color changed'. what happens is the oncommand handler on the second button is called when the user presses on it. the script here gets a reference to the broadcaster and changes the
style of it to have a color that is red. the broadcaster is not affected by the
style change because it doesn't display on the screen. however, the first button has an observer which notices the change in
style. the element and the attribute on the observes tag detect the
style change. the
style is applied to the first button automatically. next, because the broadcast occured, the event handler onbroa...
...ver which notices the change in
style. the element and the attribute on the observes tag detect the
style change. the
style is applied to the first button automatically. next, because the broadcast occured, the event handler onbroadcast is called. this results in an alert message appearing. note that the broadcast only occurs if the attributes on the broadcaster element are changed. changing the
style of the buttons directly will not cause the broadcast to occur so the alert box will not appear. if you tried duplicating the code for the first button several times, you would end up with a series of alert boxes appearing, one for each button. this is because each button is an observer and will be notified when the
style changes. next, we'll look at using the document object model with xul elem...
Stacks and Decks - Archive of obsolete content
ng element. for example, a progress bar might be created using a bar and a label overlaid on top of it. shadowing with stacks one convenient use of the stack element however is that you could emulate a number of css properties with it. for example, you could create an effect similar to the text-shadow property with the following: example 1 : source view <stack> <description value="shadowed"
style="padding-left: 1px; padding-top: 1px; font-size: 15pt"/> <description value="shadowed"
style="color: red; font-size: 15pt;"/> </stack> both description elements create text with a size of 15 points. the first, however is offset one pixel to the right and down by adding a padding to its left and top sides. this has the result of drawing the same text 'shadowed' again but slightly offset from...
...eate text with a size of 15 points. the first, however is offset one pixel to the right and down by adding a padding to its left and top sides. this has the result of drawing the same text 'shadowed' again but slightly offset from the other. the second description element is drawn in red so the effect is more visible. this method has advantages over using text-shadow because you could completely
style the shadow apart from the main text. it could have its own font, underline or size. (you could even make the shadow blink). it is also useful as mozilla doesn't currently support css text shadowing. a disadvantage is that the area taken up by the shadow makes the size of the stack larger. shadowing is very useful for creating the disabled appearance of buttons: example 2 : source view <stack st...
... underline or size. (you could even make the shadow blink). it is also useful as mozilla doesn't currently support css text shadowing. a disadvantage is that the area taken up by the shadow makes the size of the stack larger. shadowing is very useful for creating the disabled appearance of buttons: example 2 : source view <stack
style="background-color: #c0c0c0"> <description value="disabled"
style="color: white; padding-left: 1px; padding-top: 1px;"/> <description value="disabled"
style="color: grey;"/> </stack> this arrangement of text and shadow colors creates the disabled look under some platforms. note that events such as mouse clicks and keypresses are passed to the element on the top of the stack, that is, the last element in the stack. that means that buttons will only work pro...
Tabboxes - Archive of obsolete content
ogress bar and the buttons can stay on the main dialog, outside of the tabs. <vbox flex="1"> <tabbox selectedindex="1"> <tabs> <tab label="search"/> <tab label="options"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="vertical"> <description> enter your search criteria below and select the find button to begin the search. ...
...lect the find button to begin the search. ...
...searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menulist> <spacer
style="width: 10px;"/> <menulist id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menulist> <spacer
style="height: 10px"/> <textbox id="find-text" flex="1"
style="min-width: 15em;"/> </groupbox> </tabpanel> <tabpanel id="optionspanel" orient="vertical"> <checkbox id="casecheck" label="case sensitive search"/> <checkbox id="wordscheck" label="match entire filename"/> </tabpanel> </tabpanels> </tabbox> the tab elements have been placed around the main content of the w...
Trees - Archive of obsolete content
which do most of the hard work for you. for most trees, especially when you first start to use trees, you will use one of these built-in types. however, you can create a view entirely from scratch if necessary. if you do, you might store the data in an array or javascript data structure, or load the data from an xml file. since the entire body of the tree is a single widget, you can't change the
style of individual rows or cells in the normal way. this is because there are no elements that display the individual cells, like there is with the listbox. instead, all drawing is done by the tree body using data supplied by the view. this is an important point and many xul developers have trouble understanding this aspect. to modify the appearance of a tree cell, the view must instead associate a se...
... are no elements that display the individual cells, like there is with the listbox. instead, all drawing is done by the tree body using data supplied by the view. this is an important point and many xul developers have trouble understanding this aspect. to modify the appearance of a tree cell, the view must instead associate a set of keywords for a row and cell. a special css syntax is used which
styles components of the tree body with those keywords. in a sense, it is somewhat like using css classes. tree styling will be discussed in detail in a later section. tree elements trees can be created with the tree element, which is described in the following sections. there are also two elements used to define the columns to be displayed in the tree. tree this is the outer element of a tree. ...
... by calling the view's getcelltext function, which in turn gets the data from the label of the appropriate treecell. however, the three elements listed above are not displayed directly. they are used only as the source for the data for the view. thus, only a handful of attributes apply to the treeitem and related elements. for instance, you cannot change the appearance of the tree rows using the
style attribute or with other css properties and the box related features such as flexibility and orientation cannot be used. in addition, mouse and other user interface events do not fire at these elements. in fact, apart from some tree specific attributes, the only attributes that will have any effect will be the label attribute to set a text label for a cell and the src attribute to set an image. h...
Writing Skinnable XUL and CSS - Archive of obsolete content
ndant selector without first getting usage of the rule approved. the matching for these rules (unless you're very careful) will be inefficient, and when only using generic tag names, can be positively grotesque. i'll show you the evil rule i put into the global skin a few months back that was making trees slow. treehead treerow treecell { bad! evil! yuck! ... } this evil rule caused the
style system, for every treecell that wasn't in a treehead (which is practically every treecell in a typical tree), to crawl up the whole parent chain to the root of the document in order to determine that the
style rule wasn't a match. i'm usually seeing this rule misused by people who really wanted to use the child selector instead. that was my mistake with the above rule. i should have used treeh...
...going to be installed with navigator. if it is possible that the sidebar is a separate component that could be installed or uninstalled, then the overlaying should not occur in the xul file. it should instead take place through the chrome registry. examples of overlays that should take place using the chrome registry include the security padlock icon and any messenger ui in the navigator window.
style="..." is prohibited in xul files without approval any usages of inline
style are extremely dangerous, since they are overriding the included skin, and must be approved before their usage will be allowed. image chrome urls should never occur in xul. any chrome url that references an image in the skin is strictly forbidden in the xul. if you find yourself needing to display an image from the skin,...
...the problem here is that you'll end up placing a restriction on the skin, which will force the skin designer to supply an image with the exact name you've specified. this is not healthy. note that some particularly evil people put images chrome urls in dtds. this is even worse, and it also is strictly forbidden. ...
label - Archive of obsolete content
hods | related ] this element is used to provide a label for a control element. if the user clicks the label, it will move the focus to the associated control, specified with the control attribute. more information is available in the xul tutorial. attributes accesskey, control, crop, disabled, href, value properties accesskey, accessibletype, control, crop, disabled, value
style classes header, indent, monospace, plain, small-margin, text-link examples <label value="email address" control="email"/> <textbox id="email"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. control type: id this att...
... header a class used for headings. typically, this will cause the text to appear bold. indent this class causes the text to be indented on its left side. monospace this clas...
...ultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata
style classes the following classes may be used to
style the element. these classes should be used instead of changing the
style of the element directly since they will fit more naturally with the user's selected theme. header a class used for headings. typically, this will cause the text to appear bold. indent this class causes the text to be indented on its left side. monospace this class causes the text to be displayed in a monospace fo...
listitem - Archive of obsolete content
t it contains a single listcell element of type and class appropriate to that of the listitem. more information is available in the xul tutorial. attributes accesskey, checked, command, crop, current, disabled, image, label, preference, selected, tabindex, type, value properties accesskey, accessible, checked, control, crop, current, disabled, image, label, selected, tabindex, value
style classes listitem-iconic examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for ...
... listitem-iconic use this class to have an image appear on the listitem. specify the image using the image attribute. related elements listbox, listcell, listcol, listcols, li...
...tnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata
style classes the following classes may be used to
style the element. these classes should be used instead of changing the
style of the element directly since they will fit more naturally with the user's selected theme. listitem-iconic use this class to have an image appear on the listitem. specify the image using the image attribute. related elements listbox, listcell, listcol, listcols, listhead, listheader interfaces nsiaccessibleprov...
menuitem - Archive of obsolete content
n a menu. more information is available in the xul tutorial. ...
...ing the textbox.value and menulist.value syntax. ...
...specify the image using the image attribute. menuitem-non-iconic normally, menuitems have a margin to the left for an image or checkmark. this class may be used to remove this margin so that the menuitem appears on the left edge of the menupopup. related elements menu, menubar, menulist, menupopup, menuse...
textbox - Archive of obsolete content
decimalplaces type: integer the number of decimal places to display. the default is 0, which doesn't show any decimal places. the value infinity may b...
... plain this class causes the element to be displayed with no border or margin. notes the maxlength attribute does not work when in multiline mode. a workaround using javascript a...
...tnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata
style classes the following classes may be used to
style the element. these classes should be used instead of changing the
style of the element directly since they will fit more naturally with the user's selected theme. plain this class causes the element to be displayed with no border or margin. notes the maxlength attribute does not work when in multiline mode. a workaround using javascript and the onkeypress event handler as shown in abstract...
treechildren - Archive of obsolete content
ill be placed inside this element. this element is also used to define container rows in the tree. more information is available in the xul tutorial. attributes alternatingbackground attributes alternatingbackground obsolete since gecko 2.0 type: boolean if true, the background of the tree's rows will alternate between two colors. you can use the :-moz-tree-row css
style to do this instead. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, p...
...licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
treerow - Archive of obsolete content
. children of the treerow should be treecell elements. if child rows are necessary, they should be placed in a treechildren element inside the parent treeitem. more information is available in the xul tutorial. attributes properties examples (example needed) attributes properties type: space-separated list of property names sets the properties of the element, which can be used to
style the element. for more information, see styling a tree. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordin...
...licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
treeseparator - Archive of obsolete content
for more information, see styling a tree. ...
...licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
Windows and menus in XULRunner - Archive of obsolete content
ile may also contain other top-level declarations for css and dtd, which i will discuss in a moment. <window> is the basic windowing element in xul. it has attributes to set the title/caption as well as to control its width and height. although i have not seen it mentioned yet, i am assuming that you can only have one <window> element per xul file. here is an example: <?xml version="1.0"?> <?xml-
stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> ... </window> notice the references to css and dtd files. the css is used to apply formatting to elements, just as it would in html. ...
...wn icons. you can learn how to do it in the article window icons. menus and toolbars most desktop applications are complex enough to require some sort of menu and/or toolbar to structure the application’s available commands. xul provides elements to support both menus and toolbars. ...
...id="save" command="cmd_save"/> ... we can add images to the toolbar buttons through the css file. we could hard-code the images in the xul file itself, but css is a better practice. here’s the css file: /* global skin --------------------------------------------------- */ @import url(chrome://global/skin/); /* toolbar ------------------------------------------------------- */ #open { list-
style-image: url(chrome://basicapp/skin/open.png); -moz-box-orient: vertical; } #save { list-
style-image: url(chrome://basicapp/skin/save.png); -moz-box-orient: vertical; } of course, you need to make sure the png files are included in the application. there are quite a few things xul offers for application ui. more than i can fit into a single article, so we will continue looking at building...
Building a Theme - Archive of obsolete content
've copied the global and mozapps folders, a handful of other folders from the browser/omni.ja archive are required. it is located in the browser folder in the location mentioned above. the files we will be needing from the browser/omni.ja archive are located under chrome/browser/skin/classic. copy the contents of the following directories to their respective folders. this gives us a base set of
styles to work with. browser to chrome/browser/ communicator to chrome/communicator/ you should end up with this directory structure: <ext path>/ /install.rdf /chrome.manifest /chrome/ browser/ communicator/ global/ mozapps/ after this, it would be a good idea to read the article setting up extens...
...l errors to you. see install manifests for a complete listing of the required and optional properties. save the file. styling the browser's ui with css firefox's user interface is written in xul and javascript. xul is an xml grammar that provides user interface widgets like buttons, menus, toolbars, trees, etc. user actions are bound to functionality using javascript. these xul elements are
styled using css. if you don't know css, it's going to be a steep learning curve, and you may want to try some html-based tutorials to start with. the browser ui has absolutely no styling on its own - if you try to start up with an empty theme, firefox will be unusable, as the button elements will be drawn as plain text. this is why we copied the default
styles in the setup step. when writing a theme...
... unused space on a toolbar. this should select a node of type "xul:toolbar" in the dom inspector. from here, you can play around with various different stylings for the toolbar and associated elements. by default, the right pane should show the dom node, which has useful styling information like the css class and node id. the element itself is of id navigator-toolbox, with no idea. to change its
style within our theme, we need to write a selector rule to select this class. open up the file chrome/browser/browser.css in your theme. search this file for the #navigator-toolbox selector, and add a background: orange; rule to it. save the file. chrome uris next, we have to tell firefox where to find the theme files for your theme. css, xul, and other files are part of "chrome packages" - bund...
Developing cross-browser and cross-platform pages - Archive of obsolete content
this method has the advantage of not requiring you to test for anything except whether the particular features you code are supported in the visiting browser. let's see a basic, simple object support detection example. ...
...or anything except whether the particular features you code are supported in the visiting browser. let's see a basic, simple object support detection example. function hideelement(id_attribute_value) { if (document.getelementbyid && document.getelementbyid(id_attribute_value) && document.getelementbyid(id_attribute_value).
style ) { document.getelementbyid(id_attribute_value).
style.visibility = "hidden"; }; } // example: // <button type="button" onclick="hideelement('d1');">hide div</button> // <div id="d1">some text</div> these repeated calls to document.getelementbyid are not the most efficient way to check for the existence of particular objects or features in the browser's dom implementation, but they serve to illustrate clearly how object support detection works. ...
... to illustrate clearly how object support detection works. the top-level if clause looks to see if there is support for a method called getelementbyid on the document object, which is the one of the most basic levels of support for the dom in a browser. if there is, the code sees if document.getelementbyid(id_attribute_value) returns a reference to an existing element, which it then checks for a
style object. if the
style object exists on the element, then it sets that object's visibility property. the browser will not error if you set this unimplemented property, so you do not need to check that the visiblity property itself exists. so, instead of needing to know which browsers and browser versions support a particular dom method (or dom attribute or dom feature), you can verify the support ...
-ms-scrollbar-3dlight-color - Archive of obsolete content
lpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...>? ...
...he -ms-scrollbar-3dlight-color property for a <textarea> element. code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarcolor.htm <!doctype html> <html> <head> <title>scrollbar-3dlight-color</title> <
style> .blue3dlight { -ms-scrollbar-3dlight-color: blue; scrollbar-3dlight-color: blue; /* use the standard when available. */ } </
style> </head> <body> <textarea class="blue3dlight">the top and left edges of the thumb and button-face elements in the scroll bar for this element will be blue.</textarea> </body> </html> specifications not part of any specification. ...
::-ms-browse - Archive of obsolete content
y the following css properties can be used in a rule with ::-ms-browse in its selector. other properties are ignored. ...
...:-ms-browse in its selector. other properties are ignored. ...
... -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust background-clip background-color background-image background-origin background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-
style outline-width padding-bottom padding-le...
::-ms-check - Archive of obsolete content
ly the following css properties can be used in a rule with ::-ms-check in its selector. other properties are ignored. ...
...::-ms-check in its selector. other properties are ignored. ...
... -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust background-clip background-color background-image background-origin background-repeat background-size border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-
style border-bottom-width border-left-color border-left-
style border-left-width border-right-color border-right-
style border-right-width border-top-color border-top-left-radius border-top-right-radius border-top-
style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-
style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-
style outline-width padding-bottom padding-le...
CSS - Archive of obsolete content
limit-zonethe -ms-hyphenate-limit-zone css property is a microsoft extension specifying the width of the hyphenation zone.-ms-ime-alignthe -ms-ime-align css property is a microsoft extension aligning the input method editor (ime) candidate window box relative to the element on which the ime composition is active. ...
...enate-limit-zone css property is a microsoft extension specifying the width of the hyphenation zone.-ms-ime-alignthe -ms-ime-align css property is a microsoft extension aligning the input method editor (ime) candidate window box relative to the element on which the ime composition is active. ...
...l field value rather than asterisks.::-ms-thumbthe ::-ms-thumb css pseudo-element is a microsoft extension that represents the thumb that the user moves within the track of a slider control to alter its numerical value. a slider control is one possible representation of <input type="range">.::-ms-ticks-afterthe ::-ms-ticks-after css pseudo-element is a microsoft extension that applies one or more
styles to the tick marks that appear after the track of a slider control. a slider control is one possible representation of <input type="range">.::-ms-ticks-beforethe ::-ms-ticks-before css pseudo-element is a microsoft extension that applies one or more
styles to the tick marks that appear before the track of a slider control. a slider control is one possible representation of <input type="range">.::...
Displaying a graphic with audio samples - Archive of obsolete content
the following example shows how to take samples from an audio stream and display them behind an image (in this case, the mozilla logo), giving the impression that the image is built from the samples. ...
...zilla logo), giving the impression that the image is built from the samples. ...
... signal = new float32array(fb.length / channels), magnitude; for (var i = 0, fbl = framebufferlength / 2; i < fbl; i++ ) { // assuming interlaced stereo channels, // need to split and merge into a stero-mix mono signal signal[i] = (fb[2*i] + fb[2*i+1]) / 2; } // clear the canvas before drawing spectrum ctx.fill
style = "rgb(0,0,0)"; ctx.fillrect (0,0, canvas.width, canvas.height); ctx.fill
style = "rgb(255,255,255)"; for (var i = 0; i < signal.length; i++ ) { // multiply spectrum by a zoom value magnitude = signal[i] * 1000; // draw rectangle bars for each frequency bin ctx.fillrect(i * 4, canvas.height, 3, -magnitude); } ...
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
in the context of css (cascading
style sheets), the term media refers to the destination to which the document is to be drawn by the rendering engine. typically, this is a screen—but it may also be a printer, a speech synthesizer, braille display, or another type of device. css offers several features that allow you to tweak your document's
styles—or even offer different
styles—according to the media type (such as screen or print, to name two) or media capabilities (such as width, resolution, or other values) of the viewer's device. ...
... window.matchmedia() test the viewing device against a media query. ...
... as screen or print, to name two) or media capabilities (such as width, resolution, or other values) of the viewer's device. learn more general knowledge using media queries technical reference media queries define a set of characteristics or parameters required to apply the css
styles that are specified within the curly braces of the media query; for example: only applying certain css
styles for devices below 768 pixels. @media at-rule conditionally apply part of a
stylesheet, based on the result of a media query. window.matchmedia() test the viewing device against a media query. ...
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
i elements representing different types of fruits. ...
...senting different types of fruits. ...
... with div > ul > li, or .fruits__item? semantics in html in html, for example, the <h1> element is a semantic element, which gives the text it wraps around the role (or meaning) of "a top level heading on your page." <h1>this is a top level heading</h1> by default, most browser's user agent
stylesheet will
style an <h1> with a large font size to make it look like a heading (although you could
style it to look like anything you wanted). on the other hand, you could make any element look like a top level heading. consider the following: <span
style="font-size: 32px; margin: 21px 0;">is this a top level heading?</span> this will render it to look like a top level heading, but it has no semantic value, so it will not get any extra benefits as described above. it is therefore a good idea to u...
A cool-looking box - Learn web development
equisites: before attempting this assessment, you should have already worked through all the articles in this module. objective: to test comprehension of the css box model and other box-related features such as borders and backgrounds. starting point to get this assessment started, you should: make local copies of the starting html and css — save them as index.html and
style.css in a new directory. alternatively, you could use a site like jsbin or glitch to do your assessment. you could paste the html and fill in the css into one of these online editors. if the online editor you are using doesn't have a separate css panel, feel free to put it in a <
style> element in the head of the document. note: if you get stuck, then ask us for help — see the assessment or f...
...use rems. write a comment about how you worked out the value. ...
...use rems. write a comment about how you worked out the value. a base color for the design. give the box this color as its background color. the same color for the text; make it readable using a black text shadow. a fairly subtle border radius. ...
Debugging CSS - Learn web development
rong and you are trying to work out which property is causing the problem. the following video provides some useful tips on debugging css using the firefox devtools: editing values in addition to turning properties on and off, you can edit their values. perhaps you want to see if another color looks better, or wish to tweak the size of something? devtools can save you a lot of time editing a
stylesheet and reloading the page. with box1 selected, click on the swatch (the small colored circle) that shows the color applied to the border. a color picker will open up and you can try out some different colors; these will update in real time on the page. in a similar fashion, you could change the width or
style of the border. adding a new property you can add properties using the devtools. p...
...st doesn't seem to take the css. what is generally happening here is that a more specific selector is overriding your changes, and here devtools will really help you out. in our example file there are two words that have been wrapped in an <em> element. one is displaying as orange and the other hotpink. in the css we have applied: em { color: hotpink; font-weight: bold; } above that in the
stylesheet however is a rule with a .special selector: .special { color: orange; } as you will recall from the lesson on cascade and inheritance where we discussed specificity, class selectors are more specific than element selectors, and so this is the value that applies. devtools can help you find such issues, especially if the information is buried somewhere in a huge
stylesheet. inspect the <e...
...hing for a while. sometimes the solution magically appears when you stop thinking about the problem, and even if not, working on it when feeling refreshed will be much easier. do you have valid html and css? browsers expect your css and html to be correctly written, however browsers are also very forgiving and will try their best to display your webpages even if you have errors in the markup or
stylesheet. if you have mistakes in your code the browser needs to make a guess at what you meant, and it might make a different decision to what you had in mind. in addition, two different browsers might cope with the problem in two different ways. a good first step therefore is to run your html and css through a validator, to pick up and fix any errors. css validator html validator is the prope...
Fundamental CSS comprehension - Learn web development
lesets that you'll need to study and combine to answer part of this assessment. alternatively, you could use a site like jsbin or glitch to do your assessment. you could paste the html and fill in the css into one of these online editors, and use this url to point the <img> element to the image file. if the online editor you are using doesn't have a separate css panel, feel free to put it in a <
style> element in the head of the document. note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. project brief you have been provided with some raw html and an image, and need to write the necessary css to
style this into a nifty little online business card, which can perhaps double as a gamer card or social media profile. the foll...
... link your css to your html file via a <link> element. the first two rulesets in the css resource file are yours, for free! after you've finished rejoicing at your good fortune, copy and paste them into the top of your new css file. use them as a test to make sure your css is properly applied to your html. ...
...o your html file via a <link> element. the first two rulesets in the css resource file are yours, for free! after you've finished rejoicing at your good fortune, copy and paste them into the top of your new css file. use them as a test to make sure your css is properly applied to your html. above the two rules, add a css comment with some text inside it to indicate that this is a set of general
styles for the overall page. "general page
styles" would do. also add three more comments at the bottom of the css file to indicate
styles specific to the setup of the card container,
styles specific to the header and footer, and
styles specific to the main business card contents. from now on, subsequent
styles added to the
stylesheet should be organized in an appropriate place. taking care of the se...
CSS building blocks - Learn web development
derstanding. cascade and inheritance the aim of this lesson is to develop your understanding of some of the most fundamental concepts of css — the cascade, specificity, and inheritance — which control how css is applied to html and how conflicts are resolved. css selectors there are a wide variety of css selectors available, allowing for fine-grained precision when selecting elements to
style. in this article and its sub-articles, we'll run through the different types in great detail, seeing how they work. the sub-articles are as follows: type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model everything in css has a box around it, and understanding these boxes is key to being able to create layouts with css, or to...
...design will be is important, and in this lesson, we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future. images, media, and form elements in this lesson we will take a look at how certain special elements are treated in css. images, other media, and form elements behave a little differently in terms of your ability to
style them with css than regular boxes. understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know. styling tables styling an html table isn't the most glamorous job in the world, but sometimes we all have to do it. this article provides a guide to making html tables look good, with some specific table styling techn...
...able styling techniques highlighted. debugging css sometimes when writing css you will encounter an issue where your css doesn't seem to be doing what you expect. this article will give you guidance on how to go about debugging a css problem, and show you how the devtools included in all modern browsers can help you find out what is going on. organizing your css as you start to work on larger
stylesheets and big projects you will discover that maintaining a huge css file can be challenging. in this article, we will take a brief look at some best practices for writing your css to make it easily maintainable, and some of the solutions you will find in use by others to help improve maintainability. assessments want to test your css skills? the following assessments will test your understand...
Introduction to CSS layout - Learn web development
display property the main methods of achieving page layout in css are all values of the display property. this property allows us to change the default way something displays. everything in normal flow has a value of display, used as the default way that elements they are set on behave. for example, the fact that paragraphs in english display one below the other is due to the fact that they are
styled with display: block. if you create a link around some text inside a paragraph, that link remains inline with the rest of the text, and doesn’t break onto a new line. this is because the <a> element is display: inline by default. you can change this default display behavior. for example, the <li> element is display: block by default, meaning that list items display one below the other in our e...
...e position: fixed. simple positioning example to provide familiarity with these page layout techniques, we'll show you a couple of quick examples. our examples will all feature the same html, which is as follows: <h1>positioning</h1> <p>i am a basic block level element.</p> <p class="positioned">i am a basic block level element.</p> <p>i am a basic block level element.</p> this html will be
styled by default using the following css: body { width: 500px; margin: 0 auto; } p { background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); padding: 10px; margin: 10px; border-radius: 5px; } the rendered output is as follows: relative positioning relative positioning allows you to offset an item from the position in normal flow it would have by default. ...
...y. html { font-family: sans-serif; } form { display: table; margin: 0 auto; } form div { display: table-row; } form label, form input { display: table-cell; margin-bottom: 10px; } form label { width: 200px; padding-right: 5%; text-align: right; } form input { width: 300px; } form p { display: table-caption; caption-side: bottom; width: 300px; color: #999; font-
style: italic; } this gives us the following result: you can also see this example live at css-tables-example.html (see the source code too.) multi-column layout the multi-column layout module gives us a way to lay out content in columns, similar to how text flows in a newspaper. while reading up and down columns is less useful in a web context as you don’t want to force users to scroll up and ...
Multiple-column layout - Learn web development
ng point contains some very simple html; a wrapper with a class of container inside which is a heading and some paragraphs. the <div> with a class of container will become our multicol container. we switch on multicol by using one of two properties column-count or column-width. the column-count property will create as many columns as the value you give it, so if you add the following css to your
stylesheet and reload the page, you will get three columns: .container { column-count: 3; } the columns that you create have flexible widths — the browser works out how much space to assign each column. column-count example body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 arial, helvetica, sans-serif; } <div class="container"> <h1>simple multicol example...
... dolor, sed pretium metus suscipit vel. mauris ultricies lectus sed lobortis finibus. vivamus eu urna eget velit cursus viverra quis vestibulum sem. aliquam tincidunt eget purus in interdum. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p> </div> .container { column-width: 200px; } styling the columns the columns created by multicol cannot be
styled individually. there is no way to make one column bigger than other columns, or to change the background or text color of a single column. you have two opportunities to change the way that columns display: changing the size of the gap between columns using the column-gap. adding a rule between columns with column-rule. using your example above, change the size of the gap by adding a column-...
...ange the size of the gap by adding a column-gap property: .container { column-width: 200px; column-gap: 20px; } you can play around with different values — the property accepts any length unit. now add a rule between the columns, with column-rule. in a similar way to the border property that you encountered in previous lessons, column-rule is a shorthand for column-rule-color, column-rule-
style, and column-rule-width, and accepts the same values as border. .container { column-count: 3; column-gap: 20px; column-rule: 4px dotted rgb(79, 185, 227); } try adding rules of different
styles and colors. styling the columns body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 arial, helvetica, sans-serif; } .container { column-count: 3; column-gap: 20px; c...
Responsive design - Learn web development
e. media queries responsive design was only able to emerge due to the media query. the media queries level 3 specification became a candidate recommendation in 2009, meaning that it was deemed ready for implementation in browsers. media queries allow us to run a series of tests (e.g. whether the user's screen is greater than a certain width, or a certain resolution) and apply css selectively to
style the page appropriately for the user's needs. for example, the following media query tests to see if the current web page is being displayed as screen media (therefore not a printed document) and the viewport is at least 800 pixels wide. the css for the .container selector will only be applied if these two things are true. @media screen and (min-width: 800px) { .container { margin: 1em 2em...
...ple, the following media query tests to see if the current web page is being displayed as screen media (therefore not a printed document) and the viewport is at least 800 pixels wide. the css for the .container selector will only be applied if these two things are true. @media screen and (min-width: 800px) { .container { margin: 1em 2em; } } you can add multiple media queries within a
stylesheet, tweaking your whole layout or parts of it to best suit the various screen sizes. the points at which a media query is introduced, and the layout changed, are known as breakpoints. a common approach when using media queries is to create a simple single-column layout for narrow-screen devices (e.g mobile phones), then check for larger screens and implement a multiple-column layout when you k...
...ote: the grid layout version is even simpler as we can define the columns on the .wrapper: example, source code. responsive images the simplest approach to responsive images was as described in marcotte's early articles on responsive design. basically, you would take an image that was at the largest size that might be needed, and scale it down. this is still an approach used today, and in most
stylesheets, you will find the following css somewhere: img { max-width: 100%; } there are obvious downsides to this approach. the image might be displayed a lot smaller than its intrinsic size, which is a waste of bandwidth — a mobile user may be downloading an image several times the size of what they actually see in the browser window. in addition, you may not want the same image aspect rati...
Using your new knowledge - Learn web development
this assessment gives you a chance to do that. prerequisites: before attempting this assessment you should have worked through the rest of the css basics module, and also have an understanding of html basics (study introduction to html). objective: to have a play with some css and test your new-found knowledge. ...
...ou prefer you could move this css to a separate file when you create the example on your local computer. alternatively use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. working with css the following live example shows a biography, which has been
styled using css. the css properties that i have used are as follows — each one links to its property page on mdn, which will give you more examples of its use. font-family color border-bottom font-weight font-size text-decoration i have used a mixture of selectors, styling elements such as h1 and h2, but also creating a class for the job title and styling that. use css to change how this ...
...is is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code. a link to the actual task or assessment page, so we can find the question you want help with. what's next? congratulations on finishing this first module. you should now have a good general understanding of css, and be able to understand much of what is happening in a
stylesheet. in the next module, css building blocks, we will go on to look at a number of key areas in depth. previous overview: first steps in this module what is css? getting started with css how css is structured how css works using your new knowledge ...
CSS first steps - Learn web development
this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e. ...
...king on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch. guides this module contains the following articles, which will take you through all the basic theory of css, and provide opportunities for you to test out some skills. what is css? css (cascading
style sheets) allows you to create great-looking web pages, but how does it work under the hood? this article explains what css is, with a simple syntax example, and also covers some key terms about the language. getting started with css in this article we will take a simple html document and apply css to it, learning some practical things about the language along the way. how css is structured now...
... how css is structured now that you have an idea about what css is and the basics of using it, it is time to look a little deeper into the structure of the language itself. we have already met many of the concepts discussed here; you can return to this one to recap if you find any later concepts confusing. how css works we have learned the basics of css, what it is for and how to write simple
stylesheets. in this lesson we will take a look at how a browser takes css and html and turns that into a webpage. using your new knowledge with the things you have learned in the last few lessons you should find that you can format simple text documents using css, to add your own
style to them. this article gives you a chance to do that. ...
Use CSS to solve common problems - Learn web development
how to use background-clip ...
... how to use background-clip to control how much of the box your background image cov...
... to control the part of a css box that the background is drawn under how do i define inline, block, and inline-block? how to create fancy boxes (also see the styling boxes module, generally). how to use background-clip to control how much of the box your background image covers. how to change the box model completely using box-sizing how to control backgrounds how to control borders how to
style an html table how to add shadows to boxes uncommon and advanced techniques css allows some advanced design techniques. these articles help demystify some of the more complicated use cases. general how to calculate specificity of a css selector how to control inheritance in css advanced effects how to use filters in css how to use blend modes in css layout using css flexible ...
Typesetting a community school homepage - Learn web development
you might just have some fun along the way. prerequisites: before attempting this assessment you should have already worked through all the articles in this module. objective: to test comprehension of css text styling techniques. ...
...he exercise, and the provided external link icon. make a copy of them on your local computer. alternatively, you could use a site like jsbin or glitch to do your assessment. you could paste the html and fill in the css into one of these online editors, and use this url to point the background image. if the online editor you are using doesn't have a separate css panel, feel free to put it in a <
style> element in the head of the document. note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. project brief you have been provided with some raw html for the homepage of an imaginary community college, plus some css that
styles the page into a three column layout and provides some other rudimentary styling. you are to write your...
...ist items works well with the styling of the overall page. each list item should have the same line-height as a paragraph line, and each list should have the same spacing at its top and bottom as you have between paragraphs. give your list items a nice bullet, appropriate for the design of the page. it is up to you whether you choose a custom bullet image or something else. navigation menu:
style your navigation menu so that it has an appropriate look for the look and feel for the page. hints and tips you don't need to edit the html in any way for this exercise. you don't necessarily have to make the nav menu look like buttons, but it needs to be a bit taller so that it doesn't look silly on the side of the page; also remember that you need to make this one a vertical nav menu. ex...
Styling text - Learn web development
s, you could try out (most of) the code examples in an online coding program such as jsbin, codepen or glitch. guides this module contains the following articles, which will teach you all of the essentials behind styling html text content. fundamental text and font styling in this article we go through all the basics of text/font styling in detail, including setting font weight, family and
style, font shorthand, text alignment and other effects, and line and letter spacing. styling lists lists behave like any other text for the most part, but there are some css properties specific to lists that you need to know about, and some best practices to consider. this article explains all. styling links when styling links, it is important to understand how to make use of pseudo-classes to sty...
...her effects, and line and letter spacing. styling lists lists behave like any other text for the most part, but there are some css properties specific to lists that you need to know about, and some best practices to consider. this article explains all. styling links when styling links, it is important to understand how to make use of pseudo-classes to
style link states effectively, and how to
style links for use in common varied interface features such as navigation menus and tabs. we'll look at all these topics in this article. web fonts here we will explore web fonts in detail — these allow you to download custom fonts along with your web page, to allow for more varied, custom text styling. assessments the following assessments will test your understanding of the text styling techn...
... ...
HTML forms in legacy browsers - Learn web development
ange. if you alter a property, that may impact the appearance of the widget in unexpected ways. for example, [value] { background-color: #ccc; } may have been used to target every <input> with a value attribute, but changing the background-color or border radius on a <meter> will lead to likely unexpected results that differ across browsers. you can declare appearance: none; to remove the browser
styles, but that generally defeats the purpose: as you lose all styling, removing the default look and feel your visitors are used to. to summarize, when it comes to styling form control widgets, the side effects of styling them with css can be unpredictable. so don't. as you can see from the complexity of the property compatibility table for form widgets article, it's very difficult. even if it's st...
... it comes to styling form control widgets, the side effects of styling them with css can be unpredictable. so don't. as you can see from the complexity of the property compatibility table for form widgets article, it's very difficult. even if it's still possible to do a few adjustments on text elements (such as sizing or font color), there are always side effects. the best approach remains to not
style html form widgets at all. but you can still apply
styles to all the surrounding items. and, if you must alter the default
styles of your form widgets, define a
style guide to ensure consistency among all your form controls so user experience is not destroyed. you can also investigate some hard techniques such as rebuilding widgets with javascript. but in that case, do not hesitate to charge your ...
...o ensure you don't break legacy browsers. before using features that aren't fully supported in the browsers your targeting, you should feature detect: css feature detection before styling a replaced form control widget, you can check to see if the browser supports the features you plan on using using @supports: @supports (appearance: none) { input[type="search"] { appearance: none; /* re
style the search input */ } theappearance property can be used to display an element using platform-native styling, or, as is done with the value of none, remove default platform-native based styling. unobtrusive javascript one of the biggest problems is the availability of apis. for that reason, it's considered best practice to work with "unobtrusive" javascript. it's a development pattern that de...
Dealing with files - Learn web development
when you're building a website, you need to assemble these files into a sensible structure on your local computer, make sure they can talk to one another, and get all your content looking right before you eventually upload them to a server. dealing with files discusses some issues you should be aware of so you can set up a sensible file structure for your website. ...
...e names lowercase with no spaces and with words separated by dashes, at least until you know what you're doing. that way you'll bump into fewer problems later down the road. what structure should your website have? next, let's look at what structure our test site should have. the most common things we'll have on any website project we create are an index html file and folders to contain images,
style files, and script files. let's create these now: index.html: this file will generally contain your homepage content, that is, the text and images that people see when they first go to your site. using your text editor, create a new file called index.html and save it just inside your test-site folder. images folder: this folder will contain all the images that you use on your site. create a fo...
... index.html: this file will generally contain your homepage content, that is, the text and images that people see when they first go to your site. using your text editor, create a new file called index.html and save it just inside your test-site folder. images folder: this folder will contain all the images that you use on your site. create a folder called images, inside your test-site folder.
styles folder: this folder will contain the css code used to
style your content (for example, setting text and background colors). create a folder called
styles, inside your test-site folder. scripts folder: this folder will contain all the javascript code used to add interactive functionality to your site (e.g. buttons that load data when clicked). create a folder called scripts, inside your test-sit...
HTML basics - Learn web development
an also have attributes that look like the following: attributes contain extra information about the element that you don't want to appear in the actual content. here, class is the attribute name and editor-note is the attribute value. the class attribute allows you to give the element a non-unique identifier that can be used to target it (and any other elements with the same class value) with
style information and other things. an attribute should always have the following: a space between it and the element name (or the previous attribute, if the element already has one or more attributes). the attribute name followed by an equal sign. the attribute value wrapped by opening and closing quotation marks. note: simple attribute values that don't contain ascii whitespace (or any of th...
...nt. this element wraps all the content on the entire page and is sometimes known as the root element. <head></head> — the <head> element. this element acts as a container for all the stuff you want to include on the html page that isn't the content you are showing to your page's viewers. this includes things like keywords and a page description that you want to appear in search results, css to
style our content, character set declarations and more. <meta charset="utf-8"> — this element sets the character set your document should use to utf-8 which includes most characters from the vast majority of written languages. essentially, it can now handle any textual content you might put on it. there is no reason not to set this and it can help avoid some problems later on. <title></title> — t...
..., chapter titles and subtitles, an html document can too. html contains 6 heading levels, <h1>–<h6>, although you'll commonly only use 3 to 4 at most: <h1>my main title</h1> <h2>my top level heading</h2> <h3>my subheading</h3> <h4>my sub-subheading</h4> now try adding a suitable title to your html page just above your <img> element. note: you'll see that your heading level 1 has an implicit
style. don't use heading elements to make text bigger or bold, because they are used for accessibility and other reasons such as seo. try to create a meaningful sequence of headings on your pages, without skipping levels. paragraphs as explained above, <p> elements are for containing paragraphs of text; you'll use these frequently when marking up regular text content: <p>this is a single paragraph<...
HTML Cheatsheet - Learn web development
ne elements can be implemented within the <body></body> tags. ...
...implemented within the <body></body> tags. ...
...ppet result a simple link <a href="https://realityripple.com/">a link to realityripple</a> a link to realityripple a simple image <img src="https://udn.realityripple.com/samples/6e/d6ed76c6c7.png" width="25" /> a generic inline container <p>p its used to <span
style="color:blue">
style and group</span> particular elements </p> p its used to
style and group particular elements another inline container <p>span its used to differentiate a part <span
style="color:blue">of the content</span> that we will work on differently </p> span its used to differentiate a part of the content that we will work on differently emphasize some text <em>i'm posh</em> i'm posh italic textt you can mark a p...
Document and website structure - Learn web development
following code (you can also find the example in our github repository). we'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. ...
...le in our github repository). we'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. ...
...epository). we'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. ...
From object to iframe — other embedding technologies - Learn web development
the share or embed map option. select the embed map option, which will give you some <iframe> code — copy this. insert it into the input box below, and see what the result is in the output. if you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see an answer. ...
...you make a mistake, you can always reset it using the reset button. if you get really stuck, press the show solution button to see an answer. ...
...src="https://www.youtube.com/embed/qh2-tgulwu4" frameborder="0" allowfullscreen>\n</iframe>\n\n<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d37995.65748333395!2d-2.273568166412784!3d53.473310471916975!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x487bae6c05743d3d%3a0xf82fddd1e49fc0a1!2sthe+lowry!5e0!3m2!1sen!2suk!4v1518171785211" width="600" height="450" frameborder="0"
style="border:0" allowfullscreen>\n</iframe>'; let solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode ==...
HTML table advanced features and accessibility - Learn web development
as caused the "sum" row to go down to the bottom of the table. next, add a colspan attribute to make the "sum" cell span across the first four columns, so the actual number appears at the bottom of the "cost" column. let's add some simple extra styling to the table, to give you an idea of how useful these elements are for applying css. inside the head of your html document, you'll see an empty <
style> element. inside this element, add the following lines of css code: tbody { font-size: 95%; font-
style: italic; } tfoot { font-weight: bold; } save and refresh, and have a look at the result. if the <tbody> and <tfoot> elements weren't in place, you'd have to write much more complicated selectors/rules to apply the same styling. note: we don't expect you to fully understand the cs...
...ect you to fully understand the css right now. you'll learn more about this when you go through our css modules (introduction to css is a good place to start; we also have an article specifically on styling tables). ...
... background-color: rgb(235,235,235); } td { text-align: center; } tr:nth-child(even) td { background-color: rgb(250,250,250); } tr:nth-child(odd) td { background-color: rgb(245,245,245); } caption { padding: 10px; } tbody { font-size: 90%; font-
style: italic; } tfoot { font-weight: bold; } </
style> </head> <body> <table> <caption>how i chose to spend my money</caption> <thead> <tr> <th>purchase</th> <th>location</th> <th>date</th> <th>evaluation</th> <th>cost (€)</th> </tr> </thead> ...
Build your own function - Learn web development
ion naming conventions, you should follow the same rules as variable naming conventions. this is fine, as you can tell them apart — function names appear with parentheses after them, and variables don't. start by accessing the function-start.html file and making a local copy. you'll see that the html is simple — the body contains just a single button. we've also provided some basic css to
style the custom message box, and an empty <script> element to put our javascript in. next, add the following inside the <script> element: function displaymessage() { } we start off with the keyword function, which means we are defining a function. this is followed by the name we want to give to our function, a set of parentheses, and a set of curly braces. any parameters we want to give to our f...
...ctor('html'); the next section uses another dom api function called document.createelement() to create a <div> element and store a reference to it in a constant called panel. this element will be the outer container of our message box. we then use yet another dom api function called element.setattribute() to set a class attribute on our panel with a value of msgbox. this is to make it easier to
style the element — if you look at the css on the page, you'll see that we are using a .msgbox class selector to
style the message box and its contents. finally, we call a dom function called node.appendchild() on the html constant we stored earlier, which nests one element inside the other as a child of it. we specify the panel <div> as the child we want to append inside the <html> element. we need...
...idth: 200px; to width: 242px; next, add the following lines inside the .msgbox p { ... } rule: padding-left: 82px; background-position: 25px center; background-repeat: no-repeat; now we need to add code to our displaymessage() function to handle displaying the icons. add the following block just above the closing curly brace (}) of your function: if (msgtype === 'warning') { msg.
style.backgroundimage = 'url(icons/warning.png)'; panel.
style.backgroundcolor = 'red'; } else if (msgtype === 'chat') { msg.
style.backgroundimage = 'url(icons/chat.png)'; panel.
style.backgroundcolor = 'aqua'; } else { msg.
style.paddingleft = '20px'; } here, if the msgtype parameter is set as 'warning', the warning icon is displayed and the panel's background color is set to red. if it is set ...
What is JavaScript? - Learn web development
volved. it is the third layer of the layer cake of standard web technologies, two of which (html and css) we have covered in much more detail in other parts of the learning area. html is the markup language that we use to structure and give meaning to our web content, for example defining paragraphs, headings, and data tables, or embedding images and videos in the page. css is a language of
style rules that we use to apply styling to our html content, for example setting background colors and fonts, and laying out our content in multiple columns. javascript is a scripting language that enables you to create dynamically updating content, control multimedia, animate images, and pretty much everything else. (okay, not everything, but it is amazing what you can achieve with a few lines of ja...
...crews, and then put them together to make a bookshelf. they generally fall into two categories. browser apis are built into your web browser, and are able to expose data from the surrounding computer environment, or do useful complex things. for example: the dom (document object model) api allows you to manipulate html and css, creating, removing and changing html, dynamically applying new
styles to your page, etc. every time you see a popup window appear on a page, or some new content displayed (as we saw above in our simple demo) for example, that's the dom in action. the geolocation api retrieves geographical information. this is how google maps is able to find your location and plot it on a map. the canvas and webgl apis allow you to create animated 2d and 3d graphics. people are d...
...ifferent in the two contexts, but related, and both approaches (server-side and client-side) usually work together. a web page with no dynamically updating content is referred to as static — it just shows the same content all the time. how do you add javascript to your page? javascript is applied to your html page in a similar manner to css. whereas css uses <link> elements to apply external
stylesheets and <
style> elements to apply internal
stylesheets to html, javascript only needs one friend in the world of html — the <script> element. let's learn how this works. internal javascript first of all, make a local copy of our example file apply-javascript.html. save it in a directory somewhere sensible. open the file in your web browser and in your text editor. you'll see that the htm...
Adding features to our bouncing balls demo - Learn web development
as a starting point, and add some new and interesting features to it. prerequisites: before attempting this assessment you should have already worked through all the articles in this module. ...
... note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. hints and tips a couple of pointers before you get started. this assessment is quite challenging. read the whole assessment before you start coding, and take each step slowly and carefully. ...
...ribed below. draw() this method has the same purpose as ball()'s draw() method: it draws the object instance on the canvas. it will work in a very similar way, so you can start by copying the ball.prototype.draw definition. you should then make the following changes: we want the evil circle to not be filled in, but rather just have an outer line (stroke). you can achieve this by updating fill
style and fill() to stroke
style and stroke(). we also want to make the stroke a bit thicker, so you can see the evil circle a bit more easily. this can be achieved by setting a value for linewidth somewhere after the beginpath() call (3 will do). checkbounds() this method will do the same thing as the first part of ball()'s update() function — look to see whether the evil circle is going to go of...
Properly configuring server MIME types - Learn web development
ime types as reported by web servers and web applications. what are mime types? mime types describe the media type of content either in email or served by web servers or web applications and are intended to help guide a web browser in how the content is to be processed and displayed. examples of mime types are: text/html for normal web pages text/plain for plain text text/css for cascading
style sheets text/javascript for scripts application/octet-stream meaning "download this file" application/x-java-applet for java applets application/pdf for pdf documents technical background registered values for mime types are available in iana | mime media types. the http specification defines a superset of mime which is used to describe the media types used on the web. why are correct mime...
... important for security reasons; it's possible for malicious content to affect the user's computer by pretending to be a safe type of document when it is in fact not. note: historically, firefox has loaded css files even if they had the wrong mime type, as long as the html document that requested them was being processed in quirks mode. for security reasons, gecko 2.0 will no longer do this for
stylesheets loaded from a different origin than the requesting document. if your
stylesheet comes from a different origin than the document, you must serve it with the correct mime type (text/css). gecko 1.9.1.11 (firefox 3.5.11) and gecko 1.9.2.5 (firefox 3.6.5) also implement this security fix, but to improve compatibility, there was a temporary heuristic that allows the load if the first line in th...
...eets loaded from a different origin than the requesting document. if your
stylesheet comes from a different origin than the document, you must serve it with the correct mime type (text/css). gecko 1.9.1.11 (firefox 3.5.11) and gecko 1.9.2.5 (firefox 3.6.5) also implement this security fix, but to improve compatibility, there was a temporary heuristic that allows the load if the first line in the
style sheet appears to be a well-formed css construct; the heuristic has been removed in firefox 4, and you have to properly set the text/css mime types to have your css pages recognized. why browsers should not guess mime types apart from violating the http specification, it is a bad strategy for browsers to guess mime types for the following reasons: loss of control if the browser ignores the re...
React resources - Learn web development
client-side javascript frameworks next our final article provides you with a list of react resources that you can use to go further in your learning. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to provide further resources for learning more about react. component-level
styles although this tutorial doesn't use this approach, many react applications define their
styles on a per-component basis, rather than in a single, monolithic
stylesheet. create-react-app makes it possible to import css files into javascript modules, so that css is only sent to your user when the corresponding component is rendered. for this app, we could have for example written a dedicated form...
...al doesn't use this approach, many react applications define their
styles on a per-component basis, rather than in a single, monolithic
stylesheet. create-react-app makes it possible to import css files into javascript modules, so that css is only sent to your user when the corresponding component is rendered. for this app, we could have for example written a dedicated form.css file to house the
styles of those respective components, then imported the
styles into their respective modules like this: import form from './form'; import './form.css' this approach makes it easy to identify and manage the css that belongs to a specific component. however, it also fragments your
stylesheet across your codebase, and this fragmentation might not be worthwhile. for larger applications with hundreds of ...
... this approach makes it easy to identify and manage the css that belongs to a specific component. however, it also fragments your
stylesheet across your codebase, and this fragmentation might not be worthwhile. for larger applications with hundreds of unique views and lots of moving parts, it makes sense to limit the amount of irrelevant code that's sent to your user. you'll likely have app-wide
styles and specific component
styles that built on top of those. you can read more about component
stylesheets in the create-react-app docs. react devtools we used console.log() to check on the state and props of our application in this tutorial, and you'll also have seen some of the useful warnings and error message that react gives you both in the cli and your browser's javascript console. but the...
Working with Svelte stores - Learn web development
w file named src/components/alert.svelte. ...
... at the beginning we import the alert store. next we import the ondestroy() lifecycle function, which lets us execute a callback after the component has been unmounted. we then create a local variable named alertcontent. remember that we can access top-level variables from the markup, and whenever they are modified the dom will update acco...
...f the component's dom. the subscribe() method also returns a clean-up function, which takes care of releasing the subscription. so we subscribe when the component is being initialized, and use ondestroy to unsubscribe when the component is unmounted. finally we use the alertcontent variable in our markup, and if the user clicks on the alert we clean it. at the end we include a few css lines to
style our alert component. this setup allows us to work with stores in a reactive way. when the value of the store changes, the callback is executed. there we assign a new value to a local variable, and thanks to svelte reactivity all our markup and reactive dependencies are updated accordingly. using the component let's now use our component. in app.svelte we'll import the component; add the...
Chrome registration
define the user interface are also contained within the content packages, as well as most xbl binding files. locale localizable applications keep all their localized information in locale providers. this allows translators to plug in a different chrome package to translate an application without altering the rest of the source code. the two main types of localizable files are dtd files and java-
style properties files. skin a skin provider is responsible for providing a complete set of files that describe the visual appearance of the chrome. typically a skin provider will provide css files and images. note: scripts (including those found in xbl) loaded from skin packages will not execute. the chrome registry the gecko runtime maintains a service known as the chrome registry that provid...
...preferences. skin a skin package is registered with the line: skin packagename skinname uri/to/files/ [flags] this will register a skin package when resolving the uri chrome://packagename/skin/... . the skinname is an opaque string identifying an installed skin. if more than one skin is registered for a package, the chrome registry will select the best-fit skin using the user's preferences.
style style overlays (custom css which will be applied to a chrome page) are registered with the following syntax:
style chrome://uri-to-
style chrome://
stylesheet-uri [flags] note: only
stylesheets at chrome uris can be applied in this way. override in some cases an extension or embedder may wish to override a chrome file provided by the application or xulrunner. in order to allow for this, the c...
...pported in bootstrapped add-ons the following instructions are supported in bootstrapped extensions: manifest content locale skin override debugging a chrome manifest file the chrome list extension shows all registered chrome. this is very helpful when trying to write a chrome.manifest file as you can inspect where the files are being mapped from (jar files, local directory, etc.) old-
style contents.rdf manifests before the plaintext manifests were introduced (which happened in firefox 1.5, toolkit 1.8), rdf manifests named "contents.rdf" were used to register chrome. this format is deprecated; however, seamonkey versions before version 2 do not support the plaintext manifest format yet, so contents.rdf manifests are required for extensions that wish to maintain backwards compatibi...
Getting from Content to Layout
/master/layout/base/nscssframeconstructor.cpp the frame constructor implements nsimutationobserver which allows it to "watch" the content tree. nscssframeconstructor gets notified from the document's presshell (which implements nsidocumentobserver and observes the document) about all nodes in the document. ...
...nts nsidocumentobserver and observes the document) about all nodes in the document. the frame constructor takes these notifications and does the following: dispatches "re
style events" which trigger the reprocessing of relevant css selectors and any restyling that needs to occur. adds and removes frames to make the frame tree a proper representation of the new content tree. restyling the re
styletracker maintains a list of re
styles to process. elements that need to be re
styled are marked with flags (e.g element_has_pending_re
style) and are stored in the mpendingre
styles hashtable. ...
...processing of relevant css selectors and any restyling that needs to occur. adds and removes frames to make the frame tree a proper representation of the new content tree. restyling the re
styletracker maintains a list of re
styles to process. elements that need to be re
styled are marked with flags (e.g element_has_pending_re
style) and are stored in the mpendingre
styles hashtable. a list of re
style roots (places in the content tree where all descendants need to be re
styled but nothing on the parent chain does) are also stored. the re
styles accumulated in the re
styletracker are dispensed with from various method on the presshell that involve reflow and flushing notifications. frame construction regardless of whether content nodes are inserted/appended/deleted, frames can be created and de...
WebRequest.jsm
the opt_extrainfospec argument. statuscode number http response code. types resource types the resource type string identifies the kind of resource being fetched. it's used in two places: filtering requests by type, and as the type property of the argument passed to the listener. ...
...esource://gre/modules/webrequest.jsm", {}); cu.import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern("https:/developer.mozilla.org/*"); webrequest.onbeforerequest.addlistener(logurl, {urls: pattern}); function logurl(e) { console.log("loading: " + e.url); } this listener will be invoked for requests matching any of the three patterns, where the resource type is "
stylesheet" or "image": let {webrequest} = cu.import("resource://gre/modules/webrequest.jsm", {}); cu.import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern(["https://mozorg.cdn.mozilla.net/*", "https://mdn.mozillademos.org/*", "https://developer.cdn.mozilla.net/*"]); webrequest.onbeforerequest.addlistener(lis...
...ules/matchpattern.jsm"); let pattern = new matchpattern(["https://mozorg.cdn.mozilla.net/*", "https://mdn.mozillademos.org/*", "https://developer.cdn.mozilla.net/*"]); webrequest.onbeforerequest.addlistener(listener, { urls: pattern, types: ["image", "
stylesheet"] }); function listener(e) { console.log("matched: " + e.url); } canceling this example cancels requests to load content from "http://example.org/": let {webrequest} = cu.import("resource://gre/modules/webrequest.jsm", {}); cu.import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern("http://example.org/*"); webrequest.on...
JavaScript code modules
repository.jsm provides a search of add-ons in the repository. assert.jsm implements the commonjs unit testing specification version 1.1, which provides a basic standardized interface for performing in-code logical assertions with optional, customizable error reporting. bookmarkhtmlutils.jsm provides utility functions for importing and exporting bookmarks from the old-school "bookmarks.html"
style bookmark files. ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an xpcom component. customizableui.jsm allows you to interact with customizable buttons and items in firefox's main window ui. deferredtask.jsm run a task after a delay. dict.jsm provides an api for key/value pair dictionaries. downloadlastdir.jsm su...
...es. http.jsm a wrapper for xmlhttprequest that provides convenient and simplified api for dealing with http requests. jni.jsm abstracts the js-ctypes to provide an interface that allows javascript code to call code running in native jvms. iso8601dateutils.jsm provides routines to convert between javascript date objects and iso 8601 date strings. log.jsm (formerly log4moz) provides a log4j
style api for logging, log messages to various endpoints, such as the browser console or a file on disk. netutil.jsm provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously. openlocationlasturl.jsm provides access to the last url opened using the "open location" option in the file menu. osfile.jsm allow...
...otifications to users. promise.jsm implements the promises/a+ proposal as known in april 2013. promiseworker.jsm a version of chromeworker which uses promises to return the worker's result instead of using an event to do so. services.jsm provides getters for conveniently obtaining access to commonly-used services. source-editor.jsm the source editor is used by developer tools such as, the
style editor; this interface implements the editor and lets you interact with it. sqlite.jsm a promise-based api to mozistorage/sqlite. task.jsm implements a subset of task.js to make sequential, asynchronous operations simple, using the power of javascript's yield operator. timer.jsm a pure js implementation of window.settimeout. webapps.jsm provides an interface to manage open web apps. webr...
Index
used in the mozilla source code. with that document, users can see immediately two localized files in their user interface by following closely and carefully the steps to create a language pack or a binary file that is ready for installation. repeating the process allows a localizer to create a testable package to see his or her work as they progress to a final version. 28 mozilla l10n
style guide localization cultural references, idioms, and slang require a full understanding of these references between the cultures of your source and target languages. an example of a cultural reference in english would be the phrase, "kick-off meeting." this is a reference that uses an american football term. it means a meeting to begin a project. to translate it, you can follow one of tw...
...ces between the cultures of your source and target languages. an example of a cultural reference in english would be the phrase, "kick-off meeting." this is a reference that uses an american football term. it means a meeting to begin a project. to translate it, you can follow one of two approaches: 29 mozilla content localized in your language localization, mdn, mozilla, reference,
style guide no summary! 30 mozilla content localized in your language localization this section of the
style guide is for you to author. the content here should be what you and your localization team have decided, together, to follow when localizing mozilla products and web sites. you are free to add, edit, remove, and localize everything in this section according to how the ...
...tion team have decided, together, to follow when localizing mozilla products and web sites. you are free to add, edit, remove, and localize everything in this section according to how the localization team for your language agrees. all we ask is that you name this page according to this example, "mozilla content in spanish (es-mx)" and add your locale code tag at the bottom. enjoy developing your
style guide! 31 patching a localization localization say you have found a problem with an existing localization. more specifically, it's a problem with an already released localization. what do you do now? well, you have come to the right place! this page will walk you through creating a patch for an existing localization. the steps below are fairly generic; for the most part they ...
MathML In Action
dy have a mathml-enabled build but what you see on the screenshot is not what you get? in that case you are probably missing some crucial mathml fonts. now that you are well-equipped, you should be able to see this inline equation with varying accents: x ^ + xy ^ + xyz ^ . next to it is this tiny formula, det | a c b d | = a d - b c , which can also be typeset in display
style as det | a b c d | = a d - b c . mathematical typesetting is picky. mathml in mozilla aims at complying with the mathml specification so that what you see is what you markup, or to put it another way what you see is what you made, or in short "wysiwym". the difference between these two is in the markup! ( ... ( ( a 0 + a 1 ) n 1 + a 2 ) n 2 + ... + a p ) ...
...n 2 + ... + a p ) n p the roots of this bold equation y 3 + p y + q = 0 are also bold y = - q 2 + q 2 4 + p 3 27 2 3 + - q 2 - q 2 4 + p 3 27 2 3 . ...
... addeventlistener("click", zoomtoggle, false); } window.add...
NSS Developer Tutorial
nss coding
style formatting line length should not exceed 80 characters. indentation level is 4. tabs are used heavily in many nss source files. try to stay consistent when you modify existing code. the proper use of tabs has often been confusing for new nss developers, so in nss/lib/ssl, we're gradually removing the use of tabs. curly braces: both of the following
styles are allowed: if (condition) { action1(); } else { action2(); } or: if (condition) { action1(); } else { action2(); } the former
style is more common. when modifying existing code, try to stay consistent. in new code, prefer the former
style, as it conserves vertical space. when a block of code consists of a single statement, nss doesn’t require curly braces, so both of these examples are...
...vertical space. when a block of code consists of a single statement, nss doesn’t require curly braces, so both of these examples are fine: if (condition) { action(); } or: if (condition) action(); although the use of curly braces is more common. ...
... miscellaneous goto can be used, to simplify resource deallocation, before returning from a function. ...
XPCOM array guide
g pointers, doesn't own the pointer. nsisupportsarray xpcom object yes no yes* no reference counted, strong (*) note: concrete c++ arrays can be made read-only by declaring them const. ...
...in the case of scriptable arrays like nsiarray however, the enumeration mechanism is often preferred because it avoids the addref / release overhead that comes from accessing each object. ...
...const, so we can modify the array void tweakarray(nscomarray<nsielement>& elements, nsielement* newelement) { elements.removeobjectat(0); elements.appendobject(newelement); } in-place enumeration the callback-based enumeration in nscomarray<t> is about as fast as, if not faster than, standard loop-based iteration. the callback mechanism can be useful when integrating with existing callback-
style code however. one particularly nice thing about the callback mechanism is that it is typesafe. for instance: pr_callback prbool getfirstvisible(nsielement* element, void* closure) { prbool isvisible; element->isvisible(&isvisible); // stop at first object if (isvisible) { ns_static_cast(closureobject*,closure)->element = element; return pr_false; } return pr_true; } ... // enumera...
nsIDOMWindow
nates from the de-facto dom level 0 standard. starting in firefox 3, dom windows are actually based on nsidomwindow2, which is a subclass of nsidomwindow that adds some new features to this interface. in gecko 7.0 nsidomwindow2 has been merged into this interface. in gecko 8.0 nsidomstoragewindow and nsidomwindowinternal have been merged into this interface. ...
...level 0 standard. starting in firefox 3, dom windows are actually based on nsidomwindow2, which is a subclass of nsidomwindow that adds some new features to this interface. in gecko 7.0 nsidomwindow2 has been merged into this interface. in gecko 8.0 nsidomstoragewindow and nsidomwindowinternal have been merged into this interface. ...
...me-content boundaries. this attribute is "replaceable" in javascript. read only. windowroot nsidomeventtarget the window root for this window. this is useful for connecting event listeners to this window as well as every other window nested in that window root. read only. native code only! note: prior to gecko 7.0 this attribute was part of nsidomwindow2. methods getcomputed
style() see dom-window-getcomputed
style for details. nsidomcss
styledeclaration getcomputed
style( in nsidomelement elt, in domstring pseudoelt optional ); parameters elt pseudoelt optional return value getselection() returns the nsiselection object indicating what if any content is currently selected in the window. nsiselection getselection(); parameters none. return value ...
nsIFile
n this nsifile references the top of the volume. for example, c:\ does not have a parent. read only. path astring this attribute exposes the full platform-specific path of the nsifile (including the leafname). read only. example, this could return "/home/user/foo.txt" or "c:\images\my.jpeg" permissions unsigned long the value of this attribute is a unix-
style file permission mask for this nsifile. changing the permissions of a nsifile operates on the underlying filesystem. as of gecko 1.7, changing the permissions of a non-existent file has undefined behavior. permissionsoflink unsigned long the value of this attribute is a unix-
style file permission mask for this nsifile. unlike permissions, this attribute corresponds to ...
... the file system corresponding to the file path represented by this nsifile. this method will create any path segments that do not already exist. void create( in unsigned long type, in unsigned long permissions ); parameters type this specifies the type of file system object to be made. the only two types at this time are file and directory which are defined above. permissions a unix-
style file permissions value. for example, the octal value 0600 may be used to limit read and write access to the current user of the system. this parameter may be ignored on systems that do not support file permissions. exceptions thrown ns_error_file_already_exists indicates that the file or directory already exists. ns_error_file_unknown_type indicates that the value of "type" does not corre...
...eaf name "suggestedname" until we find one that did not already exist. this method will create any path segments that do not already exist. void createunique( in unsigned long type, in unsigned long permissions ); parameters type this specifies the type of file system object to be made. the only two types at this time are file and directory which are defined above. permissions a unix-
style file permissions value. for example, the octal value 0600 may be used to limit read and write access to the current user of the system. this parameter may be ignored on systems that do not support file permissions. exceptions thrown ns_error_file_unknown_type indicates that the value of "type" does not correspond to a known type. ns_error_file_too_big indicates that the search for nonexis...
nsIHTMLEditor
returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br> at the caret. constants constant value description eleft 0 ecenter 1 eright 2 ejustify 3 methods adddefaultproperty() registers a default
style property with the editor. void adddefaultproperty( in nsiatom aproperty, in astring aattribute, in astring avalue ); parameters aproperty the property to set by default. aattribute the attribute of the property, if applicable. may be null. example: aproperty="font", aattribute="color" avalue if aattribute is not null, the value of the attribute. example: aproperty="font", aattrib...
...e entirelist abullettype nodeisblock() tests if a node is a block element according the the html 4.0 dtd. this does not consider css effect on display type. boolean nodeisblock( in nsidomnode node ); parameters node return value pastenoformatting() paste the text in the os clipboard at the cursor position, replacing the selected text (if any), but strip out any html
styles and formatting. void pastenoformatting( in long aselectiontype ); parameters aselectiontype rebuilddocumentfromsource() rebuild the entire document from source html needed to be able to edit head and other outside-of-body content. void rebuilddocumentfromsource( in astring asourcestring ); parameters asourcestring html source string of the entire new document. removealld...
... in long aselectiontype ); parameters aselectiontype rebuilddocumentfromsource() rebuild the entire document from source html needed to be able to edit head and other outside-of-body content. void rebuilddocumentfromsource( in astring asourcestring ); parameters asourcestring html source string of the entire new document. removealldefaultproperties() unregisters all default
style properties with the editor. void removealldefaultproperties(); parameters none. removeallinlineproperties() deletes all the inline properties from all text in the current selection. void removeallinlineproperties(); parameters none. removedefaultproperty() unregisters a default
style property with the editor. void removedefaultproperty( in nsiatom aproperty, in astring aattribute...
nsISelectionPrivate
pe(in nsidomrange range); void removeselectionlistener(in nsiselectionlistener listenertoremove); void scrollintoview(in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent); void setancestorlimiter(in nsicontent acontent); native code only! void setpresshell(in nsipresshell apresshell); native code only! void settextrange
style(in nsidomrange range, in consttextrange
styleref textrange
style); native code only! void startbatchchanges(); wstring tostringwithformat(in string formattype, in unsigned long flags, in print32 wrapcolumn); attributes attribute type description cancacheframeoffset boolean frame offset cache can be used just during calling nseditor::endp...
... entire frame to be visible horizontally (if possible). native code only!setancestorlimiter void setancestorlimiter( in nsicontent acontent ); parameters acontent native code only!setpresshell internal utility method to set the pres shell on a newly created selection. ...
...e horizontally (if possible). native code only!setancestorlimiter void setancestorlimiter( in nsicontent acontent ); parameters acontent native code only!setpresshell internal utility method to set the pres shell on a newly created selection. void setpresshell( in nsipresshell apresshell ); parameters apresshell native code only!settextrange
style set the painting
style for the range. the range must be a range in the selection. the textrange
style will be used by text frame when it is painting the selection. void settextrange
style( in nsidomrange range, in consttextrange
styleref textrange
style ); parameters range textrange
style startbatchchanges() will stop user interface updates while multiple selection methods are called. call endbatchchange...
XUL Overlays
l). the layout engine loads any overlay files and then flows the resulting xul document, so problems associated with incremental insertion in menus, boxes, tables, and forms are avoided. any number of overlays can be loaded into a master document, and an overlay can also load other overlays. because an overlay is superimposed on the master document, there are no ambiguities relating to scoping of
style sheets or scripts.
style sheets and scripts loaded by the overlay simply apply to the entire master document. loading overlays dynamically the chrome registry makes it possible to load xul overlays dynamically -- or only when necessary. the chrome registry, which is a special rdf datasource into which user-specific information is persisted, or stored, contains information about the components or ...
... unlike base files, overlays should never load the master skin file for a package. the navigatoroverlay.xul file, for example, does not and should never load the navigator.css file that defines the master skin for the navigator package. since the purpose of an overlay is to define new ui elements for a package within the context of that package's skin, the overlay should add structure but not new
style. any skins that are loaded by an overlay destructively replace the master skin for the base file, and can change the basic appearance of the package's skin in unfortunate ways. note: the master skin is not the same as the global skin. for any package, the master skin file is that css file named after the package itself. the master skin file for the bookmarks package, for example, is called book...
...dialog that wants to overlay these buttons just declares the overlay at the top: <?xul-overlay href="chrome://global/content/dialogoverlay.xul"?> and includes an empty box with an id of okcancelbuttons in the ui. the following snippet shows a dialog with custom ui elements at the top and a reference to the overlay's ok and cancel buttons at the bottom: <box align="horizontal" id="bx1" flex="100%"
style="margin-bottom: 1em; width: 100%;"> <html:input type="checkbox" id="dialog.newwindow"/> <html:label for="dialog.newwindow">&openwin.label;</html:label> <spring flex="100%"/> </box> <box id="okcancelbuttons"/> for more detail, see the ok and cancel button definitions being referenced here in the global component file platformdialogoverlay.xul. toolbars, submenus, boxes, and any other subtrees ...
Zombie compartments
── object-type-tables [2] │ │ │ │ └──0.01 mb (00.00%) -- sundries │ │ │ │ ├──0.01 mb (00.00%) ── malloc-heap [2] │ │ │ │ └──0.00 mb (00.00%) ── gc-heap [2] │ │ │ └───5.83 mb (01.17%) -- (4 tiny) │ │ │ ├──4.19 mb (00.84%) ++ layout │ │ │ ├──1.03 mb (00.21%) ──
style-sheets [2] │ │ │ ├──0.60 mb (00.12%) ++ dom │ │ │ └──0.01 mb (00.00%) ── property-tables [2] │ │ ├───8.86 mb (01.78%) -- cached/window(https://www.google.de/?gws_rd=ssl) │ │ │ ├──4.23 mb (00.85%) -- layout │ │ │ │ ├──3.80 mb (00.76%) ──
style-sets │ │ │ │ ├──0.29 mb (00.06%) ─...
...] │ │ ├───8.86 mb (01.78%) -- cached/window(https://www.google.de/?gws_rd=ssl) │ │ │ ├──4.23 mb (00.85%) -- layout │ │ │ │ ├──3.80 mb (00.76%) ──
style-sets │ │ │ │ ├──0.29 mb (00.06%) ── pres-shell │ │ │ │ ├──0.05 mb (00.01%) ── rule-nodes │ │ │ │ ├──0.04 mb (00.01%) ──
style-contexts │ │ │ │ ├──0.03 mb (00.01%) -- frames │ │ │ │ │ ├──0.02 mb (00.00%) ── sundries │ │ │ │ │ └──0.01 mb (00.00%) ── nsblockframe │ │ │ │ ├──0.01 mb (00.00%) ── pres-contexts │ │ │ │ ├──0.01 mb (00.00%) ── line-boxes │ │ │ │ └──0.00 mb (00.00%) ── ...
......
ctypes
ied as a pathname string. return value a library object representing the opened library. examples example of structtype() on windows let's say we need tb_button, this type needs to be created. so we look up on msdn what the tb_button structures is (msdn :: tb_button structure) and it says it is: typedef struct { int ibitmap; int idcommand; byte fsstate; byte fs
style; #ifdef _win64 byte breserved[6]; #else #if defined(_win32) byte breserved[2]; #endif #endif dword_ptr dwdata; int_ptr istring; } tbbutton, *ptbbutton, *lptbbutton; so now notice that if it's 64-bit process it's different than if it's 32-bit process. so we will figure that out and create the structure appropriately. this is what the final looks like: var struct_tbbutton; if ...
...at if it's 64-bit process it's different than if it's 32-bit process. so we will figure that out and create the structure appropriately. ...
...
style': ctypes.unsigned_char}, {'breserved': ctypes.unsigned_char}, {'breserved2': ctypes.unsigned_char}, {'dwdata': ctypes.uintptr_t}, {'istring': ctypes.intptr_t} ]); } else if (ctypes.voidptr_t.size == 8 /* 64-bit */) { struct_tbbutton = ctypes.structtype('tbbutton', [ {'ibitmap': ctypes.int}, {'idcommand': ctypes.int}, {'fbstate': ctypes.unsigned_char}, {'fs
style': ctypes.unsigned_char}, {'breserved': ctypes.unsigned_char}, {'breserved2': ctypes.unsigned_char}, {'breserved3': ctypes.unsigned_char}, {'breserved4': ctypes.unsigned_char}, {'breserved5': ctypes.unsigned_char}, {'breserved6': ctypes.unsigned_char}, {'dwdata': ctypes.uintptr_t}, {'istring': ctypes.intptr_t} ]); } else { throw new error("wut?!"); } console.lo...
Plug-in Basics - Plugins
using the object element. though the object element has no hidden attribute, you can create css rules to override the sizing attributes of the object element object { visibility: visible; } object.hiddenobject { visibility: hidden !important; width: 0px !important; height: 0px !important; margin: 0px !important; padding: 0px !important; border-
style: none !important; border-width: 0px !important; max-width: 0px !important; max-height: 0px !important; } in this case, the object element that picks up these special
style definitions would have a class of hidden. using the class attribute and the css block above, you can simulate the behavior of the hidden plug-in in the embed element: <object data="audiplay.aiff" type="...
...n references section below for more information about embedding activex controls in plug-ins or embedding plug-ins in activex applications. the following examples demonstrate this use of nested object elements with markup more congenial to gecko included as children of the parent object element. ...
... plug-ins or embedding plug-ins in activex applications. the following examples demonstrate this use of nested object elements with markup more congenial to gecko included as children of the parent object element. ...
All keyboard shortcuts - Firefox Developer Tools
toolbox (if the toolbox is in a separate window and in foreground) ctrl + shift + i or f12 cmd + opt + i or f12 ctrl + shift + i or f12 open web console 1 ctrl + shift + k cmd + opt + k ctrl + shift + k toggle "pick an element from the page" (opens the toolbox and/or focus the inspector tab) ctrl + shift + c cmd + opt + c ctrl + shift + c open
style editor shift + f7 shift + f7 * shift + f7 open profiler shift + f5 shift + f5 * shift + f5 open network monitor 2 ctrl + shift + e cmd + opt + e ctrl + shift + e toggle responsive design mode ctrl + shift + m cmd + opt + m ctrl + shift + m open browser console ctrl + shift + j cmd + shift + j ctrl + shift + j ...
...+ down arrow alt + down arrow (ctrl + down arrow from firefox 60 onwards). show/hide more information about current property (computed view only, when a property is selected) enter or space return or space enter or space open mdn reference page about current property (computed view only, when a property is selected) f1 f1 f1 open current css file in
style editor (computed view only, when more information is shown for a property and a css file reference is focused). enter return enter debugger command windows macos linux close current file ctrl + w cmd + w ctrl + w search for a string in the current file ctrl + f cmd + f ctrl + f search for a string in all files ct...
...xt autocomplete suggestion down arrow down arrow down arrow page up through autocomplete suggestions page up page up page up page down through autocomplete suggestions page down page down page down scroll to start of autocomplete suggestions home home home scroll to end of autocomplete suggestions end end end
style editor command windows macos linux open the
style editor shift + f7 shift + f7 shift + f7 open autocomplete popup ctrl + space cmd + space ctrl + space scratchpad command windows macos linux open the scratchpad shift + f4 shift + f4 shift + f4 run scratchpad code ctrl + r cmd + r ...
Edit fonts - Firefox Developer Tools
unit of measure from em to px, the value will become 30px. weight the font-weight for the inspected element. you can select values using the slider or enter a numeric value directly into the text box. for non-variable fonts the slider ranges from 100 to 900 in increments of 100. note: for variable fonts (see below) that define a wght variation axis, this range is custom. italic the font-
style for the inspected element. this setting toggles between italic and normal values for the font-
style css property. note: as you change settings, firefox applies inline
styles to the element to make the changes instantly visible on the page. all fonts on page the remaining area, at the bottom of the fonts tab, shows an expandable list of all of the fonts in use on the page. the list is u...
...n the case of fonts loaded from your computer (either default system fonts, or web fonts that you've also got installed on your system). you can copy the url to the font file by clicking on the icon to the right of the url. the @font-face descriptor that loads the font into the page, in the case of web fonts. the descriptor is expandable — when opened it shows its full syntax as defined in the
stylesheet. a text sample, to give you an idea of what the font looks like when rendered. the default text for the sample is "abc" but the preview text can be edited by clicking on the input field at the top of the section and entering a new value. once entered, all of the sample text will be set to the same custom value. variable font support in firefox developer tools firefox 62 added support for...
...aracteristics set using font-variation-settings will always override those set using the corresponding basic font properties, e.g. font-weight, no matter where they appear in the cascade. here are the registered axes along with their corresponding css properties: axis tag css property "wght" font-weight "wdth" font-stretch "slnt" (slant) font-
style: oblique + angle "ital" font-
style: italic "opsz" font-optical-sizing any axis that is not on the list of registered axes is considered a custom axis. custom axes do not have corresponding css font properties. font designers can define whatever axis they want; each one needs to be given a unique four-character tag. the axis name and its range is up to the f...
Paint Flashing Tool - Firefox Developer Tools
and css, determines how to lay it out, and then paints it to actually display the content on the screen. whenever an event happens that might change a visible part of the web page then the browser must repaint some portion of the page. for example, a repaint will be needed if the user scrolls the page or moves the mouse pointer over an element with a :hover pseudo-class that changes the element's
style. repainting can be an expensive operation, so the browser tries to minimise the amount of repainting that it needs to do. it tries to work out which parts of the screen are "damaged" and repaint only those. the browser also splits its model of the page into layers that it expects will be updated independently of each other. layers are painted independently and then composited, so a change in the...
...her it is repainting more than it needs to. using the paint flashing tool open the toolbox, then click the icon labeled "highlight painted area": then try using the page. after moving the mouse around and scrolling a bit, the above page looks like this: in this example, there are two main sources of repaints: moving the mouse over links makes the browser repaint them, because they have a
style applied using the :hover pseudo-class scrolling makes the browser repaint the new part of the page coming into view at the bottom of the screen, and also the scrollbar at the top-right to deactivate paint flashing, click the "highlight painted area" icon in the toolbox again. example: css transitions one area where implementation choices can affect repaint efficiency is in css transitions. t...
...ies of repaints as the element moves, while the transform version only causes repaints in the start and end positions. why? well, when you use transform, the browser creates a separate layer for the element. so when the element is moved, all that's changed is the relation of the two layers to each other, which is handled in composition: neither layer needs a repaint. in this case, with a simple
style, the extra repaints don't make much of a difference. but if the
style were computationally expensive to paint, they might. it's difficult to know what optimizations the browser will make to minimize repaints, and they are subject to change from one version to the next. so testing your website with the paint flashing tool helps ensure that it's still performing optimally. ...
AnalyserNode.fftSize - Web APIs
512, 1024, 2048, 4096, 8192, 16384, and 32768. defaults to 2048. note: if its value is not a power of 2, or it is outside the specified range, a domexception with the name indexsizeerror is thrown. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope
style" output of the current audio input. for more complete applied examples/information, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount ; var dataarray = new uint8array...
...analyser = audioctx.createanalyser(); ... ...
...y = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fill
style = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.stroke
style = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { var v = dataarray[i] / 128.0; var y = v * height/2; if(i === 0) { canvasctx.moveto(x, y); } else { canvasctx.lineto(x, y); } x += slicewidth; } canvasc...
AnalyserNode.frequencyBinCount - Web APIs
related to how the fast fourier transform is defined, it is always half the value of analysernode.fftsize. therefore, it will be one of 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, and 16384. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph
style" output of the current audio input. for more complete applied examples/information, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); analyser.mindecibels = -90; analyser.maxdecibels = -10; ... analyser.fftsize = 256; var bufferlength = anal...
...ioctx.createanalyser(); analyser.mindecibels = -90; analyser.maxdecibels = -10; ... ...
... working draft ...
AnalyserNode.getByteFrequencyData() - Web APIs
nity. if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped. if it has more elements than needed, excess elements are ignored. return value none. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph
style" output of the current audio input. for more examples/information, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new ui...
...text || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... ...
...asctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fill
style = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fill
style = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-barheight/2,barwidth,barheight/2); x += barwidth + 1; } }; draw(); parameters array the uint8array that the frequency domain data will be copied to. specifications specification status comment web audio apithe definition of 'getbytefrequencydata()' in that specification. working draf...
AnalyserNode.getByteTimeDomainData() - Web APIs
copied to. if the array has fewer elements than the analysernode.fftsize, excess elements are dropped. if it has more elements than needed, excess elements are ignored. return value void | none example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope
style" output of the current audio input. for more complete applied examples/information, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). const audioctx = new (window.audiocontext || window.webkitaudiocontext)(); const analyser = audioctx.createanalyser(); ... analyser.fftsize = 2048; const bufferlength = analyser.fftsize; const dataarray = new uint8array(bu...
...udiocontext)(); const analyser = audioctx.createanalyser(); ... ...
...ser.fftsize; const dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fill
style = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.stroke
style = 'rgb(0, 0, 0)'; const slicewidth = width * 1.0 / bufferlength; let x = 0; canvasctx.beginpath(); for(var i = 0; i < bufferlength; i++) { const v = dataarray[i]/128.0; const y = v * height/2; if(i === 0) canvasctx.moveto(x, y); else canvasctx.lineto(x, y); x += slicewidth; } canvasctx.lineto(width, height/2); canvasctx.stroke(); }; draw(); sp...
AnalyserNode.getFloatFrequencyData() - Web APIs
ncybincount); // fill the float32array with data returned from getfloatfrequencydata() analyser.getfloatfrequencydata(mydataarray); drawing a spectrum the following example shows basic usage of an audiocontext to connect a mediaelementaudiosourcenode to an analysernode. while the audio is playing, we collect the frequency data repeatedly with requestanimationframe() and draw a "winamp bargraph
style" to a <canvas> element. for more complete applied examples/information, check out our voice-change-o-matic-float-data demo (see the source code too). <!doctype html> <body> <script> const audioctx = new audiocontext(); //create audio source //here, we use an audio file, but this could also be e.g. microphone input const audioele = new audio(); audioele.src = 'my-audio.mp3';//insert file name h...
...dioele); //create analyser node const analysernode = audioctx.createanalyser(); analysernode.fftsize = 256; const bufferlength = analysernode.frequencybincount; const dataarray = new float32array(bufferlength); //set up audio node network audiosourcenode.connect(analysernode); analysernode.connect(audioctx.destination); //create 2d canvas const canvas = document.createelement('canvas'); canvas.
style.position = 'absolute'; canvas.
style.top = 0; canvas.
style.left = 0; canvas.width = window.innerwidth; canvas.height = window.innerheight; document.body.appendchild(canvas); const canvasctx = canvas.getcontext('2d'); canvasctx.clearrect(0, 0, canvas.width, canvas.height); function draw() { //schedule next redraw requestanimationframe(draw); //get spectrum data analysernode.getfloatfrequ...
...= 0; canvas.width = window.innerwidth; canvas.height = window.innerheight; document.body.appendchild(canvas); const canvasctx = canvas.getcontext('2d'); canvasctx.clearrect(0, 0, canvas.width, canvas.height); function draw() { //schedule next redraw requestanimationframe(draw); //get spectrum data analysernode.getfloatfrequencydata(dataarray); //draw black background canvasctx.fill
style = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, canvas.width, canvas.height); //draw spectrum const barwidth = (canvas.width / bufferlength) * 2.5; let posx = 0; for (let i = 0; i < bufferlength; i++) { const barheight = (dataarray[i] + 140) * 2; canvasctx.fill
style = 'rgb(' + math.floor(barheight + 100) + ', 50, 50)'; canvasctx.fillrect(posx, canvas.height - barheight / 2, barw...
AnalyserNode.getFloatTimeDomainData() - Web APIs
ied to. if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped. if it has more elements than needed, excess elements are ignored. return value none. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope
style" output of the current audio input. for more complete applied examples/information, check out our voice-change-o-matic-float-data demo (see the source code too). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... analyser.fftsize = 1024; var bufferlength = analyser.fftsize; console.log(bufferlength); var dataarray = new floa...
...diocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... ...
... var bufferlength = analyser.fftsize; console.log(bufferlength); var dataarray = new float32array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getfloattimedomaindata(dataarray); canvasctx.fill
style = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.stroke
style = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { var v = dataarray[i] * 200.0; var y = height/2 + v; if(i === 0) { canvasctx.moveto(x, y); } else { canvasctx.lineto(x, y); } x += slicewidth; } canvasctx.lineto(canvas.width, canvas.height/2); canvasctx.strok...
SVGSVGElement - Web APIs
the svgsvgelement interface provides access to the properties of <svg> elements, as well as methods to manipulate them. this interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. ...
... well as methods to manipulate them. this interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. ...
...ment. svgsvgelement.width read only an svganimatedlength corresponding to the width attribute of the given <svg> element. svgsvgelement.height read only an svganimatedlength corresponding to the height attribute of the given <svg> element. svgsvgelement.contentscripttype an svganimatedlength corresponding to the contentscripttype attribute of the given <svg> element. svgsvgelement.content
styletype an svganimatedlength corresponding to the content
styletype attribute of the given <svg> element. svgsvgelement.viewport an svgrect containing the position and size of the viewport (implicit or explicit) that corresponds to the given <svg> element. when the browser is actually rendering the content, then the position and size values represent the actual values when rendering. the position a...
Using the Screen Capture API - Web APIs
ing on browsers that support it but do not implement the current standard api. this works with at least chrome, edge, and firefox. capturing screen contents capturing screen contents as a live mediastream is initiated by calling navigator.mediadevices.getdisplaymedia(), which returns a promise that resolves to a stream containing the live screen contents. ...
...tions) { let capturestream = null; try { capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { console.error("error: " + err); } return capturestream; } you can write this code either using an asynchronous function and the await operator, as shown above, or using the promise directly, as seen below. starting screen capture: promise
style function startcapture(displaymediaoptions) { let capturestream = null; return navigator.mediadevices.getdisplaymedia(displaymediaoptions) .catch(err => { console.error("error:" + err); return null; }); } either way, the user agent responds by presenting a user interface that prompts the user to choose the screen area to share. both of these implementations of startcapture() return the me...
...ntents are streamed. a <pre> block into which logged text is placed by the intercepted consolemethod. css the css is entirely cosmetic in this example. the video is given a border, and its width is set to occupy nearly the entire available horizontal space (width: 98%). max-width is set to 860px to set an absolute upper limit on the video's size, the error, warn, and info classes are used to
style the corresponding console output types. #video { border: 1px solid #999; width: 98%; max-width: 860px; } .error { color: red; } .warn { color: orange; } .info { color: darkgreen; } result the final product looks like this. if your browser supports screen capture api, clicking "start capture" will present the user agent's interface for selecting a screen, window, or tab to share.
Visual Viewport API - Web APIs
iewport'); // since the bar is position: fixed we need to offset it by the // visual viewport's offset from the layout viewport origin. ...
... // since the bar is position: fixed we need to offset it by the // visual viewport's offset from the layout viewport origin. ...
...e // visual viewport's offset from the layout viewport origin. var viewport = event.target; var offsetleft = viewport.offsetleft; var offsettop = viewport.height - layoutviewport.getboundingclientrect().height + viewport.offsettop; // you could also do this by setting
style.left and
style.top if you // use width: 100% instead. ...
Keyboard-navigable JavaScript widgets - Accessibility
trol keyboard access <ul id="mb1" tabindex="0"> <li id="mb1_menu1" tabindex="-1"> font <ul id="fontmenu" title="font" tabindex="-1"> <li id="sans-serif" tabindex="-1">sans-serif</li> <li id="serif" tabindex="-1">serif</li> <li id="monospace" tabindex="-1">monospace</li> <li id="fantasy" tabindex="-1">fantasy</li> </ul> </li> <li id="mb1_menu2" tabindex="-1">
style <ul id="
stylemenu" title="
style" tabindex="-1"> <li id="italic" tabindex="-1">italics</li> <li id="bold" tabindex="-1">bold</li> <li id="underline" tabindex="-1">underlined</li> </ul> </li> <li id="mb1_menu3" tabindex="-1"> justification <ul id="justificationmenu" title="justication" tabindex="-1"> <li id="left" tabindex="-1">left</li> <li id="center"...
...to track a "virtual" focus. (for more information about aria, see this overview of accessible web applications and widgets.) the aria-activedescendant property identifies the id of the descendent element that currently has the virtual focus. the event handler on the container must respond to key and mouse events by updating the value of aria-activedescendant and ensuring that the current item is
styled appropriately (for example, with a border or background color). see the source code of this aria radiogroup example for a direct illustration of how this works. general guidelines use onkeydown to trap key events, not onkeypress ie will not fire keypress events for non-alphanumeric keys. use onkeydown instead. ensure that keyboard and mouse produce the same experience to ensure that the use...
...ick="dosomething()", you should bind dosomething() to the key down event as well: onkeydown="return event.keycode != 13 || dosomething();". always draw the focus for tabindex="-1" items and elements that receive focus programatically ie will not automatically draw the focus outline for items that programatically receive focus. choose between changing the background color via something like this.
style.backgroundcolor = "gray"; or add a dotted border via this.
style.border = "1px dotted invert". in the dotted border case you will need to make sure those elements have an invisible 1px border to start with, so that the element doesn't grow when the border
style is applied (borders take up space, and ie doesn't implement css outlines). prevent used key events from performing browser functions if ...
Event reference
mozilla specific a touch point is moved along the touch surface (use touchmove instead). moztouchup mozilla specific a touch point is removed from the touch surface (use touchend instead). overflow uievent mozilla specific an element has been overflowed by its content or has been rendered for the first time in this state (only works for elements
styled with overflow != visible). smartcard-insert mozilla specific a smartcard has been inserted. smartcard-remove mozilla specific a smartcard has been removed. stkcommand firefox os specific the stk proactive command is issued from icc. stksessionend firefox os specific the stk session is terminated by icc. touchent...
...pecific the stk proactive command is issued from icc. stksessionend firefox os specific the stk session is terminated by icc. touchenter touchevent touch events removed touchleave touchevent touch events removed underflow uievent mozilla specific an element is no longer overflowed by its content (only works for elements
styled with overflow != visible). uploadprogress progressevent mozilla specific upload is in progress (see progress). ussdreceived firefox os specific a new ussd message is received mscontentzoom microsoft specific msmanipulationstatechanged microsoft specific mspointerhover microsoft specific ...
... tabhide addons specific a tab has been hidden. tabpinned addons specific a tab has been pinned. tabunpinned addons specific a tab has been unpinned. developer tool-specific events event name event type specification fired when... cssruleviewrefreshed devtools specific the "rules" view of the
style inspector has been updated. cssruleviewchanged devtools specific the "rules" view of the
style inspector has been changed. cssruleviewcsslinkclicked devtools specific a link to a css file has been clicked in the "rules" view of the
style inspector. ...
Getting Started - Developer guides
let's send some data to the server and receive a response. our javascript will request a dynamic page this time, test.php, which will take the data we send and return a "computed" string - "hello, [user data]!" - which we'll alert(). ...
..., and the last timestamp, onto the page. this is repeated every 5 seconds, using a setinterval() call. the idea would be that a server-side script of some kind would continually update the text file with new timestamps, and our xhr code would be used to report the latest timestamp on the client-side. ...
... timestamp, onto the page. this is repeated every 5 seconds, using a setinterval() call. the idea would be that a server-side script of some kind would continually update the text file with new timestamps, and our xhr code would be used to report the latest timestamp on the client-side. ...
Cross-browser audio basics - Developer guides
"my-audio"> <source src="https://udn.realityripple.com/samples/6c/d385042de2.mp3" type="audio/mpeg"> <source src="https://udn.realityripple.com/samples/28/191a7bd2a5.ogg" type="audio/ogg"> <!-- place fallback here as <audio> supporting browsers will ignore it --> <a href="audiofile.mp3">audiofile.mp3</a> </audio> <div id="controls"> <span id="loading">loading</span> <button id="play"
style="display:none">play</button> <button id="pause"
style="display:none" >pause</button> </div> <div id="progress"> <div id="bar"></div> </div>
styled like so: #controls { width: 80px; float: left; } #progress { margin-left: 80px; border: 1px solid black; } #bar { height: 20px; background-color: green; width: 0; } now let's wire this thing up with javascript: window.onl...
...olor: green; width: 0; } now let's wire this thing up with javascript: window.onload = function(){ var myaudio = document.getelementbyid('my-audio'); var play = document.getelementbyid('play'); var pause = document.getelementbyid('pause'); var loading = document.getelementbyid('loading'); var bar = document.getelementbyid('bar'); function displaycontrols() { loading.
style.display = "none"; play.
style.display = "block"; } // check that the media is ready before displaying the controls if (myaudio.paused) { displaycontrols(); } else { // not ready yet - wait for canplay event myaudio.addeventlistener('canplay', function() { displaycontrols(); }); } play.addeventlistener('click', function() { myaudio.pl...
...; play.
style.display = "block"; } // check that the media is ready before displaying the controls if (myaudio.paused) { displaycontrols(); } else { // not ready yet - wait for canplay event myaudio.addeventlistener('canplay', function() { displaycontrols(); }); } play.addeventlistener('click', function() { myaudio.play(); play.
style.display = "none"; pause.
style.display = "block"; }); pause.addeventlistener('click', function() { myaudio.pause(); pause.
style.display = "none"; play.
style.display = "block"; }); // display progress myaudio.addeventlistener('timeupdate', function() { //sets the percentage bar.
style.width = parseint(((myaudio.currenttime / myaudio.duration) * 1...
Media buffering, seeking, and time ranges - Developer guides
io id="my-audio" controls> <source src="music.mp3" type="audio/mpeg"> </audio> </p> <p> <canvas id="my-canvas" width="300" height="20"> </canvas> </p> and a little bit of javascript: window.onload = function(){ var myaudio = document.getelementbyid('my-audio'); var mycanvas = document.getelementbyid('my-canvas'); var context = mycanvas.getcontext('2d'); context.fill
style = 'lightgray'; context.fillrect(0, 0, mycanvas.width, mycanvas.height); context.fill
style = 'red'; context.stroke
style = 'white'; var inc = mycanvas.width / myaudio.duration; // display timeranges myaudio.addeventlistener('seeked', function() { for (i = 0; i < myaudio.buffered.length; i++) { var startx = myaudio.buffered.start(i) * inc; var endx =...
...ally downloaded — this what the browser's native players seem to display. so let's build this. ...
...ad = function(){ var myaudio = document.getelementbyid('my-audio'); myaudio.addeventlistener('progress', function() { var duration = myaudio.duration; if (duration > 0) { for (var i = 0; i < myaudio.buffered.length; i++) { if (myaudio.buffered.start(myaudio.buffered.length - 1 - i) < myaudio.currenttime) { document.getelementbyid("buffered-amount").
style.width = (myaudio.buffered.end(myaudio.buffered.length - 1 - i) / duration) * 100 + "%"; break; } } } }); myaudio.addeventlistener('timeupdate', function() { var duration = myaudio.duration; if (duration > 0) { document.getelementbyid('progress-amount').
style.width = ((myaudio.currenttime / duration)*100) + "%"; } }); } the progres...
Index - Developer guides
in firefox and opera, this is changing fast. you can find compatibility information in the guide to media types and formats on the web. 7 adding captions and subtitles to html5 video html5, media, webvtt, captions, subtitles, track in other articles we looked at how to build a cross browser video player using the htmlmediaelement and window.fullscreen apis, and also at how to
style the player. this article will take the same player and show how to add captions and subtitles to it, using the webvtt format and the <track> element. 8 creating a cross-browser video player apps, html5, video, full screen this article describes a simple html5 video player that uses the media and fullscreen apis and works across most major desktop and mobile browsers. as well ...
...ement. 8 creating a cross-browser video player apps, html5, video, full screen this article describes a simple html5 video player that uses the media and fullscreen apis and works across most major desktop and mobile browsers. as well as working fullscreen, the player features custom controls rather than just using the browser defaults. the player controls themselves won't be
styled beyond the basics required to get them working; full styling of the player will be taken care of in a future article. 9 cross-browser audio basics apps, audio, guide, html5, media, events this article provides: a basic guide to creating a cross-browser html5 audio player with all the associated attributes, properties, and events explained a guide to custom controls crea...
... you do that? this article explains how, looking at two of the most common formats: mpeg-dash and hls (http live streaming.) 13 video player styling basics apps, guide, media, styling, video in the previous cross browser video player article we described how to build a cross-browser html5 video player using the media and fullscreen apis. this follow-up article looks at how to
style this custom player, including making it responsive. 14 web audio playbackrate explained apps, audio, media, video, playbackrate the playbackrate property of the <audio> and <video> elements allows us to change the speed, or rate, at which a piece of web audio or video is playing 15 writing web audio api code that works in every browser api you probably ha...
Printing - Developer guides
there may be times in which your web site or application would like to improve the user's experience when printing content. there are a number of possible scenarios: you wish to adjust layout to take advantage of the size and shape of the paper. you wish to use different
styles to enhance the appearance of your content on paper. you wish to use higher resolution images for a better result. ...
...ion images for a better result. you want to adjust the user experience of printing, such as presenting a specially-formatted version of your content before printing begins. there may be other cases in which you want to manage the printing process, but these are some of the most common scenarios. this article provides tips and techniques for helping your web content print better. using a print
style sheet add the following to your <head> tag. <link href="/path/to/print.css" media="print" rel="
stylesheet" /> using media queries to improve layout detecting print requests some browsers (including firefox 6 and later and internet explorer) send beforeprint and afterprint events to let content determine when printing may have occurred. you can use this to adjust the user interface presented...
...ild(this.__container__); } function setprint () { this.contentwindow.__container__ = this; this.contentwindow.onbeforeunload = closeprint; this.contentwindow.onafterprint = closeprint; this.contentwindow.focus(); // required for ie this.contentwindow.print(); } function printpage (surl) { var ohiddframe = document.createelement("iframe"); ohiddframe.onload = setprint; ohiddframe.
style.position = "fixed"; ohiddframe.
style.right = "0"; ohiddframe.
style.bottom = "0"; ohiddframe.
style.width = "0"; ohiddframe.
style.height = "0"; ohiddframe.
style.border = "0"; ohiddframe.src = surl; document.body.appendchild(ohiddframe); } </script> </head> <body> <p><span onclick="printpage('externalpage.html');"
style="cursor:pointer;text-decoration:underline;color:#0000ff;">print...
<button>: The Button element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ted with the button’s name when it’s submitted with the form data. this value is passed to the server in params when the form is submitted. notes a submit button with the attribute formaction set, but without an associated form does nothing. you have to set a form owner, either by wrapping it in a <form> or set the attribute form to the id of the form. <button> elements are much easier to
style than <input> elements. you can add inner html content (think <i>, <br>, or even <img>), and use ::after and ::before pseudo-elements for complex rendering. if your buttons are not for submitting form data to a server, be sure to set their type attribute to button. otherwise they will try to submit form data and to load the (nonexistent) response, possibly destroying the current state of the docu...
... separating them. this spacing is beneficial for people who are experiencing motor control issues, who may accidentally activate the wrong interactive content. spacing may be created using css properties such as margin. hand tremors and the giant-button-problem - axess lab firefox firefox will add a small dotted border on a focused button. this border is declared through css in the browser
stylesheet, but you can override it to add your own focused
style using button::-moz-focus-inner { }. if overridden, it is important to ensure that the state change when focus is moved to the button is high enough that people experiencing low vision conditions will be able to perceive it. color contrast ratio is determined by comparing the luminosity of the button text and background color values com...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
e triangle and the label inside <summary> (or a user agent-defined default string if no <summary>). this might look like the following: here we see a standard disclosure widget with the label "system requirements", in its default closed state. when the user clicks on the widget or focuses it then presses the space bar, it "twists" open, revealing its contents: from there, you can use css to
style the disclosure widget, and you can programmatically open and close the widget by setting/removing its open attribute. by default when closed, the widget is only tall enough to display the disclosure triangle and summary. when open, it expands to display the details contained within. note: unfortunately, at this time there's no built-in way to animate the transition between open and closed. f...
...is recommended.</p> </details> result customizing the disclosure widget the disclosure triangle itself can be customized, although this is not as broadly supported. there are variations in how browsers support this customization due to experimental implementations as the element was standardized, so we'll have to use multiple approaches for a while. the <summary> element supports the list-
style shorthand property and its longhand properties, such as list-
style-type, to change the disclosure triangle to whatever you choose (usually with list-
style-image). for example, we can remove the disclosure widget icon by setting list-
style: none. chrome doesn't support this yet, however, so we also need to use its non-standard ::-webkit-details-marker pseudo-element to customize the appearance in...
...e doesn't support this yet, however, so we also need to use its non-standard ::-webkit-details-marker pseudo-element to customize the appearance in that browser. css details { font: 16px "open sans", calibri, sans-serif; width: 620px; } details > summary { padding: 2px 6px; width: 15em; background-color: #ddd; border: none; box-shadow: 3px 3px 4px black; cursor: pointer; list-
style: none; } details > summary::-webkit-details-marker { display: none; } details > p { border-radius: 0 0 10px 10px; background-color: #ddd; padding: 2px 6px; margin: 0; box-shadow: 3px 3px 4px black; } this css creates a look similar to a tabbed interface, where activating the tab expands and opens it to reveal its contents. html <details> <summary>system requirements</summary> ...
<input type="button"> - HTML: Hypertext Markup Language
5px; padding: 5px; } input[type="color"], input[type="button"] { width: 90%; margin: 0 auto; display: block; } input[type="range"] { width: 70%; } span { position: relative; bottom: 5px; } var canvas = document.queryselector('.mycanvas'); var width = canvas.width = window.innerwidth; var height = canvas.height = window.innerheight-85; var ctx = canvas.getcontext('2d'); ctx.fill
style = 'rgb(0,0,0)'; ctx.fillrect(0,0,width,height); var colorpicker = document.queryselector('input[type="color"]'); var sizepicker = document.queryselector('input[type="range"]'); var output = document.queryselector('.output'); var clearbtn = document.queryselector('input[type="button"]'); // covert degrees to radians function degtorad(degrees) { return degrees * math.pi / 180; }; // update siz...
...t.documentelement.scrollleft ? document.documentelement.scrollleft : document.body.scrollleft); cury = (window.event) ? e.pagey : e.clienty + (document.documentelement.scrolltop ? ...
... living standard html5the definition...
<input type="color"> - HTML: Hypertext Markup Language
es the color picker. in both cases, you can determine the new value of the element by looking at its value. here's an example that watches changes over time to the color value: colorpicker.addeventlistener("input", updatefirst, false); colorpicker.addeventlistener("change", watchcolorpicker, false); function watchcolorpicker(event) { document.queryselectorall("p").foreach(function(p) { p.
style.color = event.target.value; }); } selecting the value if the <input> element's implementation of the color type on the user's browser doesn't support a color well, but is instead a text field for entering the color string directly, you can use the select() method to select the text currently in the edit field. if the browser instead uses a color well, select() does nothing. you should be awa...
... event. it changes the color of the first paragraph element in the document to match the new value of the color input. since input events are fired every time an adjustment is made to the value (for example, if the brightness of the color is increased), these will happen repeatedly as the color picker is used. function updatefirst(event) { var p = document.queryselector("p"); if (p) { p.
style.color = event.target.value; } } when the color picker is dismissed, indicating that the value will not be changing again (unless the user re-opens the color picker), a change event is sent to the element. we handle that event using the updateall() function, using event.target.value to obtain the final selected color: function updateall(event) { document.queryselectorall("p").foreach(functio...
...t.target.value; } } when the color picker is dismissed, indicating that the value will not be changing again (unless the user re-opens the color picker), a change event is sent to the element. we handle that event using the updateall() function, using event.target.value to obtain the final selected color: function updateall(event) { document.queryselectorall("p").foreach(function(p) { p.
style.color = event.target.value; }); } this sets the color of every <p> block so that its color attribute matches the current value of the color input, which is referred to using event.target. result the final result looks like this: specifications specification status comment html living standard living standard initial definition html5 recommen...
<input type="date"> - HTML: Hypertext Markup Language
t using a supporting browser: here's the css used in the above example. we make use of the :valid and :invalid pseudo-elements to add an icon next to the input, based on whether or not the current value is valid. we had to put the icon on a <span> next to the input, not on the input itself, because in chrome at least the input's generated content is placed inside the form control, and can't be
styled or shown effectively. label { display: flex; align-items: center; } span::after { padding-left: 5px; } input:invalid + span::after { content: '✖'; } input:valid+span::after { content: '✓'; } important: client-side form validation is no substitute for validating on the server. it's easy for someone to modify the html, or bypass your html entirely and submit the data directly t...
...e variables var nativepicker = document.queryselector('.nativedatepicker'); var fallbackpicker = document.queryselector('.fallbackdatepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var monthselect = document.queryselector('#month'); var dayselect = document.queryselector('#day'); // hide fallback initially fallbackpicker.
style.display = 'none'; fallbacklabel.
style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'date'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.
style.disp...
...l.
style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'date'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.
style.display = 'none'; fallbackpicker.
style.display = 'block'; fallbacklabel.
style.display = 'block'; // populate the days and years dynamically // (the months are always the same, therefore hardcoded) populatedays(monthselect.value); populateyears(); } function populatedays(month) { // delete the current set of <option> elements out of the // day <select>, ready for the next set to be injected while(dayselect.firstchild)...
<input type="datetime-local"> - HTML: Hypertext Markup Language
ype="submit" value="book party!"> </div> </form> if you try to submit the form with an incomplete date (or with a date outside the set bounds), the browser displays an error. try playing with the example now: here's a screenshot for those of you who aren't using a supporting browser: here's the css used in the above example. here we make use of the :valid and :invalid css properties to
style the input based on whether or not the current value is valid. we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be
styled or shown effectively. div { margin-bottom: 10px; display: flex; align-items: center; } label { display: inline-block; width: 300px; } input:inv...
...eryselector('.fallbackdatetimepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var monthselect = document.queryselector('#month'); var dayselect = document.queryselector('#day'); var hourselect = document.queryselector('#hour'); var minuteselect = document.queryselector('#minute'); // hide fallback initially fallbackpicker.
style.display = 'none'; fallbacklabel.
style.display = 'none'; // test whether a new datetime-local input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'datetime-local'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nat...
... 'none'; fallbacklabel.
style.display = 'none'; // test whether a new datetime-local input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'datetime-local'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.
style.display = 'none'; fallbackpicker.
style.display = 'block'; fallbacklabel.
style.display = 'block'; // populate the days and years dynamically // (the months are always the same, therefore hardcoded) populatedays(monthselect.value); populateyears(); populatehours(); populateminutes(); } function populatedays(month) { // delete the current set of <option> elements out of the // ...
<input type="radio"> - HTML: Hypertext Markup Language
e; background-color: black; padding: 5px 10px; border-radius: 0; border: 0; font-size: 14px; } button:hover, button:focus { color: #999; } button:active { background-color: white; color: black; outline: 1px solid black; } most notable here is the use of the -moz-appearance property (with prefixes needed to support some browsers). ...
...px 10px; border-radius: 0; border: 0; font-size: 14px; } button:hover, button:focus { color: #999; } button:active { background-color: white; color: black; outline: 1px solid black; } most notable here is the use of the -moz-appearance property (with prefixes needed to support some browsers). by default, radio buttons (and checkboxes) are
styled with the operating system's native
styles for those controls. by specifying appearance: none, you can remove the native styling altogether, and create your own
styles for them. here we've used a border along with border-radius and a transition to create a nice animating radio selection. notice also how the :checked pseudo-class is used to specify the
styles for the radio button's appearance when selected. compatibility note: if you wi...
...t is supported in most modern browsers, its implementation varies widely. in older browsers, even the keyword none does not have the same effect across different browsers, and some do not support it at all. the differences are smaller in the newest browsers. notice that when clicking on a radio button, there's a nice, smooth fade out/in effect as the two buttons change state. in addition, the
style and coloring of the legend and submit button are customized to have strong contrast. this might not be a look you'd want in a real web application, but it definitely shows off the possibilities. specifications specification status html living standardthe definition of '<input type="radio">' in that specification. living standard html5the definition o...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
> <th>major</th> </tr> </thead> <tbody> <tr> <td>3741255</td> <td>jones, martha</td> <td>computer science</td> </tr> <tr> <td>3971244</td> <td>nim, victor</td> <td>russian literature</td> </tr> <tr> <td>4100332</td> <td>petrov, alexandra</td> <td>astrophysics</td> </tr> </tbody> </table> css the css to
style our table is shown next. table { border: 2px solid #555; border-collapse: collapse; font: 16px "lucida grande", "helvetica", "arial", sans-serif; } first, the table's overall
style attributes are set, configuring the thickness,
style, and color of the table's exterior borders and using border-collapse to ensure that the border lines are shared among adjacent cells rather than each having ...
...yle attributes are set, configuring the thickness,
style, and color of the table's exterior borders and using border-collapse to ensure that the border lines are shared among adjacent cells rather than each having its own borders with space in between. font is used to establish an initial font for the table. th, td { border: 1px solid #bbb; padding: 2px 8px 0; text-align: left; } then the
style is set for the majority of the cells in the table, including all data cells but also those
styles shared between our <td> and <th> cells. the cells are given a light gray outline which is a single pixel thick, padding is adjusted, and all cells are left-aligned using text-align thead > tr > th { background-color: #cce; font-size: 18px; border-bottom: 2px solid #999; } finally, header cell...
...eir name. css table { border: 2px solid #555; border-collapse: collapse; font: 16px "lucida grande", "helvetica", "arial", sans-serif; } th, td { border: 1px solid #bbb; padding: 2px 8px 0; text-align: left; } thead > tr > th { background-color: #cce; font-size: 18px; border-bottom: 2px solid #999; } most of the css is unchanged. we do, however, add a slightly more subtle
style for header cells contained directly within a <tbody> (as opposed to those which reside in a <thead>). this is used for the headers indicating each table section's corresponding major. tbody > tr > th { background-color: #dde; border-bottom: 1.5px solid #bbb; font-weight: normal; } specifications specification status comment html living standardthe definition of 't...
<var>: The Variable element - HTML: Hypertext Markup Language
any dom interface htmlelement attributes this element only includes the global attributes. usage notes related elements other elements that are used in contexts in which <var> is commonly used include: <code>: the html code element <kbd>: the html keyboard input element <samp>: the html sample output element if you encounter code that is mistakenly using <var> for
style purposes rather than semantic purposes, you should either use a <span> with appropriate css or, an appropriate semantic element among the following: <em> <i> <q> default
style most browsers apply font-
style to "italic" when rendering <var>. this can be overridden in css, like this: var { font: bold 15px "courier", "courier new", monospace; } examples basic example here's a simple ex...
...in this example, variable names are rendered using bold courier if it's available, otherwise it falls back to the default monospace font. ...
...talic" when rendering <var>. this can be overridden in css, like this: var { font: bold 15px "courier", "courier new", monospace; } examples basic example here's a simple example, using <var> to denote variable names in a mathematical equation. <p>a simple equation: <var>x</var> = <var>y</var> + 2 </p> the output: overriding the default
style using css, you can override the default
style for the <var> element. in this example, variable names are rendered using bold courier if it's available, otherwise it falls back to the default monospace font. css var { font: bold 15px "courier", "courier new", monospace; } html <p>the variables <var>minspeed</var> and <var>maxspeed</var> control the minimum and maximum speed of the apparatus in revolutions per minute (rpm).</p> th...
Link types - HTML: Hypertext Markup Language
k types indicate the relationship between two documents, in which one links to the other using an <a>, <area>, <form>, or <link> element. list of the defined link types and their significance in html link type description allowed in these elements not allowed in these elements alternate if the element is <link> and the rel attribute also contains the
stylesheet type, the link defines an alternative
style sheet; in that case the title attribute must be present and not be the empty string. if the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed. the first one defined on the page is the default. otherwise, the link defines an alternative page, of one of these types: for another med...
...o 63 indicates that the hyperlink leads to a resource that would be better suited for a secondary browsing context, like a sidebar. browsers, that don't have such a context will ignore this keyword. while once part of the html specification, this has been removed from the spec and is only implemented by versions of firefox prior to firefox 63. <a>, <area>, <link> <form>
stylesheet defines an external resource to be used as a
stylesheet. if the type is not set, the browser should assume it is a text/css
stylesheet until further inspection. if used in combination with the alternate keyword, it defines an alternative
style sheet; in that case the title attribute must be present and not be the empty string. <link> <a>, <area>, <form> tag indi...
...arget="_blank" links. html5the definition of 'link types' in that specification. recommendation added tag, search, prefetch, noreferrer, nofollow, icon, and author. renamed copyright to license. removed start, chapter, section, subsection, and appendix html 4.01 specificationthe definition of 'link types' in that specification. recommendation added alternate,
stylesheet, start, chapter, section, subsection, appendix, and bookmark. renamed previous to prev. removed top, and search. unknownthe definition of '<link>' in that specification. obsolete added top, contents, index, glossary, copyright, next, previous, help, and search. rfc 1866: html 2.0 obsolete initial definition. ...
CSP: font-src - HTTP
the single quotes. 'unsafe-hashes' allows to enable specific inline event handlers. if you only need to allow inline event handlers and not inline <script> elements or javascript: urls, this is a safer method compared to using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <
style> elements. you must include the single quotes. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' a whitelist for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resourc...
...ce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or
styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or
style. when generating the hash, don't include the <script> or <
style> tags and note that capitalization and whitespace matter, including leading or trailing whitespace. see unsafe inline script for an example. in csp 2.0 this applied...
...ation and whitespace matter, including leading or trailing whitespace. see unsafe inline script for an example. in csp 2.0 this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: font-src https://example.com/ the following font resource loading is blocked and won't load: <
style> @font-face { font-family: "myfont"; src: url("https://not-example.com/font"); } body { font-family: "myfont"; } </
style> specifications specification status comment content security policy level 3the definition of 'font-src' in that specification. working draft no changes. content security policy level 2the definition of 'font-src' in ...
Content-Security-Policy - HTTP
refore it is recommended to restrict this fetch-directive (e.g., explicitly set object-src 'none' if possible). prefetch-src specifies valid sources to be prefetched or prerendered. script-src specifies valid sources for javascript. script-src-elem specifies valid sources for javascript <script> elements. script-src-attr specifies valid sources for javascript inline event handlers.
style-src specifies valid sources for
stylesheets.
style-src-elem specifies valid sources for
stylesheets <
style> elements and <link> elements with rel="
stylesheet".
style-src-attr specifies valid sources for inline
styles applied to individual dom elements. worker-src specifies valid sources for worker, sharedworker, or serviceworker scripts. document directives document directives govern...
...directive will be ignored. report-to fires a securitypolicyviolationevent. other directives block-all-mixed-content prevents loading any assets using http when the page is loaded using https. referrer used to specify information in the referer (sic) header for links away from a page. use the referrer-policy header instead. require-sri-for requires the use of sri for scripts or
styles on the page. require-trusted-types-for enforces trusted types at the dom xss injection sinks. trusted-types used to specify an allow-list of trusted types policies. trusted types allows applications to lock down dom xss injection sinks to only accept non-spoofable, typed values in place of strings. upgrade-insecure-requests instructs user agents to treat all of a site's insecure ur...
... ...
JavaScript modules - JavaScript
n a module is being pointed to, as you'll see below. exporting module features the first thing you do to get access to module features is export them. this is done using the export statement. the easiest way to use it is to place it in front of any items you want exported out of the module, for example: export const name = 'square'; export function draw(ctx, length, x, y, color) { ctx.fill
style = color; ctx.fillrect(x, y, length, length); return { length: length, x: x, y: y, color: color }; } you can export functions, var, let, const, and — as we'll see later — classes. they need to be top-level items; you can't use export inside a function, for example. a more convenient way of exporting all the items you want to export is to use a single export statement a...
... note that you could solve the problem in the module files instead, e.g. // in square.js export { name as squarename, draw as drawsquare, reportarea as reportsquarearea, reportperimeter as reportsquareperimeter }; // in main.js import { squarename, drawsquare, reportsquarearea, reportsquareperimeter } from './modules/square.js'; and it would work just the same. what
style you use is up to you, however it arguably makes more sense to leave your module code alone, and make the changes in the imports. this especially makes sense when you are importing from third party modules that you don't have any control over. creating a module object the above method works ok, but it's a little messy and longwinded. an even better solution is to import each module's features in...
..., reportlist); so you can now write the code just the same as before (as long as you include the object names where needed), and the imports are much neater. modules and classes as we hinted at earlier, you can also export and import classes; this is another option for avoiding conflicts in your code, and is especially useful if you've already got your module code written in an object-oriented
style. you can see an example of our shape drawing module rewritten with es classes in our classes directory. as an example, the square.js file now contains all its functionality in a single class: class square { constructor(ctx, listid, length, x, y, color) { ... } draw() { ... } ... } which we then export: export { square }; over in main.js, we import it like this: import { ...
Text formatting - JavaScript
al(firststring); // returns the number 4 eval(secondstring); // returns the string "2 + 2" a string object has one property, length, that indicates the number of utf-16 code units in the string. for example, the following code assigns hellolength the value 13, because "hello, world!" has 13 characters, each represented by one utf-16 code unit. you can access each code unit using an array bracket
style. you can't change individual characters because strings are immutable array-like objects: const hello = 'hello, world!'; const hellolength = hello.length; hello[0] = 'l'; // this has no effect, because strings are immutable hello[0]; // this returns "h" characters whose unicode scalar values are greater than u+ffff (such as some rare chinese/japanese/korean/vietnamese characters and some emoji...
... hour: '2-digit', minute: '2-digit', timezonename: 'short' }; const americandatetime = new intl.datetimeformat('en-us', options).format; console.log(americandatetime(july172014)); // 07/16/14, 5:00 pm pdt number formatting the numberformat object is useful for formatting numbers, for example currencies. ...
...ng the numberformat object is useful for formatting numbers, for example currencies. const gasprice = new intl.numberformat('en-us', {
style: 'currency', currency: 'usd', minimumfractiondigits: 3 }); console.log(gasprice.format(5.259)); // $5.259 const handecimalrmbinchina = new intl.numberformat('zh-cn-u-nu-hanidec', {
style: 'currency', currency: 'cny' }); console.log(handecimalrmbinchina.format(1314.25)); // ¥ 一,三一四.二五 collation the collator object is useful for comparing and sorting strings. for example, there are actually two different sort orders in german, phonebook and dictionary. phonebook sort emphasizes sound, and it’s as if “ä”, “ö”, and so on were expanded to “ae”, “oe...
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
the intl.displaynames.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and
style formatting options computed during the construction of the current displaynames object. syntax displaynames.resolvedoptions() return value an object with properties reflecting the locale and formatting options computed during the construction of the given displaynames object. description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. ...
...onstruction of the given displaynames object. description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale.
style the value provided for this property in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this property in the options argument of the constructor or the default value ("language"). its value is either "language", "region", "script", or "currency". fallback the value provided for this property ...
...rrency". fallback the value provided for this property in the options argument of the constructor or the default value ("code"). its value is either "code" or "none". examples using resolvedoptions const displaynames = new intl.displaynames(['de-de'], {type: 'region'}); const usedoptions = displaynames.resolvedoptions(); console.log(usedoptions.locale); // "de-de" console.log(usedoptions.
style); // "long" console.log(usedoptions.type); // "region" console.log(usedoptions.fallback); // "code" specifications specification intl.displaynamesthe definition of 'resolvedoptions()' in that specification. ...
Intl.ListFormat() constructor - JavaScript
alues are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. type the format of output message. possible values are "conjunction" that stands for "and"-based lists (default, e.g., a, b, and c), or "disjunction" that stands for "or"-based lists (e.g., a, b, or c). "unit" stands for lists of values with units (e.g., 5 pounds, 12 ounces).
style the length of the formated message. possible values are: "long" (default, e.g., a, b, and c); "short" (e.g., a, b, c), or "narrow" (e.g., a b c). when
style is short or narrow, unit is the only allowed value for the type option. examples using format the following example shows how to create a list formatter using the english language. const list = ['motorcycle', 'bus', 'car']; cons...
... possible values are: "long" (default, e.g., a, b, and c); "short" (e.g., a, b, c), or "narrow" (e.g., a b c). when
style is short or narrow, unit is the only allowed value for the type option. examples using format the following example shows how to create a list formatter using the english language. ...
...ort or narrow, unit is the only allowed value for the type option. examples using format the following example shows how to create a list formatter using the english language. const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', {
style: 'long', type: 'conjunction' }).format(list)); // > motorcycle, bus and car console.log(new intl.listformat('en-gb', {
style: 'short', type: 'disjunction' }).format(list)); // > motorcycle, bus or car console.log(new intl.listformat('en-gb', {
style: 'narrow', type: 'unit' }).format(list)); // > motorcycle bus car specifications specification intl.listformatthe definition of 'listformat()' in that specification. ...
Intl.ListFormat.prototype.formatToParts() - JavaScript
in a locale-aware fashion. syntax intl.listformat.prototype.formattoparts(list) parameters list an array of values to be formatted according to a locale. return value an array of components which contains the formatted parts from the list. ...
...ocale and
style options), formattoparts() returns an array of the different components of the formated string. each element of the resulting array has two properties: type and value. the type property may be either "element", which refers to a value from the list, or "literal" which refers to a linguistic construct. the value property gives the content, as a string, of the token. the locale and
style options used for formatting are given when constructing the intl.listformat instance. ...
..., which refers to a value from the list, or "literal" which refers to a linguistic construct. the value property gives the content, as a string, of the token. the locale and
style options used for formatting are given when constructing the intl.listformat instance. ...
Intl.ListFormat.prototype.resolvedOptions() - JavaScript
the intl.listformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and
style formatting options computed during the construction of the current listformat object. syntax listformat.resolvedoptions() return value an object with properties reflecting the locale and formatting options computed during the construction of the given listformat object. description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. ...
... construction of the given listformat object. description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale.
style the value provided for this property in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this property in the options argument of the constructor or the default value ("conjunction"). its value is either "conjunction", "disjunction", or "unit". examples using resolvedoptions const delistform...
...in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this property in the options argument of the constructor or the default value ("conjunction"). its value is either "conjunction", "disjunction", or "unit". examples using resolvedoptions const delistformatter = new intl.listformat("de-de", {
style: "short" }); const usedoptions = de.resolvedoptions(); console.log(usedoptions.locale); // "de-de" console.log(usedoptions.
style); // "short" console.log(usedoptions.type); // "conjunction" (the default value) specifications specification intl.listformatthe definition of 'resolvedoptions()' in that specification. ...
Intl.Locale.prototype.collation - JavaScript
by a particular locale. below is a table with the available collation types, taken from the unicode collation specification. valid collation types collation type description big5han pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary
style ordering (such as in sinhala) the direct collation type has been deprected. do not use. direct binary code point order (used in hindi) ducet the default unicode collation element table order emoji recommended ordering for emoji characters eor european ordering rules gb2312 pinyin ordering for latin, gb2312han char...
...been deprected. do not use. ...
... (used in chinese) reformed reformed ordering (such as in swedish) search special collation type for string search searchjl special collation type for korean initial consonant search standard default ordering for each language stroke pinyin ordering for latin, stroke order for cjk characters (used in chinese) trad traditional
style ordering (such as in spanish) unihan pinyin ordering for latin, unihan radical-stroke ordering for cjk characters (used in chinese) zhuyin pinyin ordering for latin, zhuyin order for bopomofo and cjk characters (used in chinese) examples like other locale subtags, the collation type can be added to the intl.locale object via the locale string, or a configu...
Microsummary XML grammar reference - Archive of obsolete content
attribute for them. child elements: <template> (required) defines how to transform pages into their microsummaries. <pages> (required) identifies the set of pages that the generator is able to summarize. <update> (optional) specifies how frequently firefox should update the microsummaries. the <template> element the <template> element contains the xslt
stylesheet which transforms web pages into their microsummaries. attributes: none. child elements: <
stylesheet> or <transform> (required) the xslt
stylesheet which performs the transformation. per xslt, you may specify the
stylesheet child element using either the <
stylesheet> or the <transform> tag, which are interchangeable. note: although the <template> element must be in the micr...
... the <pages> element the <pages> element identifies the set of pages that the generator is able to summarize. attributes: none. ...
Table Layout Strategy - Archive of obsolete content
en fixed and auto layout of tables has been introduced. the auto-layout mechanism is implemented in basictablelayoutstrategy.cpp the fixed-layout in fixedtablelayoutstrategy.cpp. all these files are in the layout/html/table/src subdirectory. the code the layout strategies are invoked from nstableframe::reflow. the overload of the initialize and balancecolumnwidths routines depends on the table
style and is decided at runtime. on the first reflow nstableframe::balancecolumnwidths is called. inside this routine the corresponding table layout strategy is created and initialized (basictablelayoutstrategy::initialize). later the column widths are balanced by basictablelayoutstrategy::balancecolumnwidths or the fixed layout counter part. in the following the basic table layout strategy is discusse...
...these informations are very often conflicting. for instance one cell could have a large min width,the next could have a specified fixed width and another a specified pct width. for a given width type the maximum wins. special cases note: the following examples are not shown correctly due to technical constraints on wiki...
Creating XPI Installer Modules - Archive of obsolete content
p unarchiver[zip] to open it. all of the resources described in this article are in the xpi archive and can be adapted for use in your own development. developing the resources needless to say, one of the first things you will have to create is the actual software you wish to make redistributable. ...
...ight="375" x="20" y="20" persist="width height x y" orient="vertical" autostretch="always"> <script src="barley.js"/> <image src="barley.gif" /> <box orient="horizontal" autostretch="never"> <button label="barley corn" /> <button label="show aphids" oncommand="bar();" /> </box> </window> the other files that the window imports are defined in dark blue. note that the
stylesheet processing instruction at the top of the xul file does not refer to any new skin, but imports communicator.css to make use of that skin's basic widget
styles. the javascript file barley.js contains a single function, bar(), defined as follows: function bar() { alert("aphids"); } if you want to use the same gif image that is used in the barley package, it can be grabbed from here. while ...
width - Archive of obsolete content
layed width may be different if the element or its contents have a minimum or maximum width, or the size is adjusted by the flexibility or alignment of its parent. the css width property may also be used. in this example, the preferred width of the inner hbox will be displayed at 40 pixels. the displayed width is also 40 pixels as no flexibility or alignment applies. ...
...d at 40 pixels. the displayed width is also 40 pixels as no flexibility or alignment applies. <hbox> <hbox width="40"
style="background-color: red;"> <label value="40"/> </hbox> </hbox> however, in the following example, despite that the preferred width of the box is 30 pixels, the displayed size of the box will be larger to accommodate the larger label. <vbox width="30" align="start"
style="background-color: red;"> <label value="vbox xul width 10px red"/> </vbox> note: when used on treecol objects, the width attribute can be used to allow a tree to be scrolled horizontally if the column widths add up to be wider than the containing object. ...
Textbox (XPFE autocomplete) - Archive of obsolete content
er key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e. ...
... titles associated with each url. if this attribute is not specified, the comment column doesn't appear. showpopup type: boolean note: applies to: thunderbird, seamonkeyif true, the popup will be shown. if false, the popup will not be shown, but the autocomplete results will still be available. you can set this to false and set the autofill attribute to true to emulate a communicator 4.x
style autocomplete textbox. the default value is true. size type: integer the number of characters that can be displayed in the textbox. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. tabscrolling obsolete since ge...
Tree Widget Changes - Archive of obsolete content
ribute to true, or leaving out the attribute. note that it's the value attribute you use, not the label attribute. <treecell/> <treecell value="true"/> you need to specify the checkbox image with css for the checkbox to display. (do not set id of the column to be 'checked' it will cause problems with the css) treechildren::-moz-tree-checkbox(checked) { /* css for checked cells */ list-
style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns support editing: <tree editable="true"> <treecols> <treecol type="checkbox" editable="true"> ... </treecol> </treecols> </tree> if the column is editable, the user can click the cell to change the state of the checkbox. when the user clicks the cell, the view's setcellvalue method w...
... nsitreeview.setcellvalue() and nsitreeview.setcelltext() functions to change the tree content with a script for other types of cells. for instance: var col = tree.columns.getprimarycolumn(); treecell.setcelltext(5, col, "banana"); this will change the label of the cell in row 5 and the primary column to banana. however, this paves the way in the future for more general tree editing features.
style improvements you can now specify the cursor to use for a cell using the css cursor property. treechildren::-moz-tree-cell-text { cursor: pointer; } this allows you to create separate cursors for cells. the :-moz-tree-separator pseudo has been improved to make it a proper box type and now has additional styling capabilities. example: treechildren::-moz-tree-separator { margin-top: ...
Anonymous Content - Archive of obsolete content
on each side of it. this would be created with a box to hold the image and two buttons. the image element has to be placed outside the xbl as it will differ with each use. xul: <box class="zoombox"> <image src="images/happy.jpg"/> <image src="images/angry.jpg"/> </box> xbl: <binding id="zoombox"> <content> <xul:box flex="1"> <xul:button label="zoom in"/> <xul:box flex="1"
style="border: 1px solid black"> <children includes="image"/> </xul:box> <xul:button label="zoom out"/> </xul:box> </content> </binding> the explicit children in the xul file will be placed at the location of the children tag. there are two images, so both will be added next to each other. this results in a display that is equivalent to the following: <binding id="zoombox"> ...
...utton label="zoom out"/> </xul:box> </content> </binding> the explicit children in the xul file will be placed at the location of the children tag. there are two images, so both will be added next to each other. this results in a display that is equivalent to the following: <binding id="zoombox"> <content> <xul:box flex="1"> <xul:button label="zoom in"/> <xul:box flex="1"
style="border: 1px solid black"> <xul:image src="images/happy.jpg"/> <xul:image src="images/angry.jpg"/> </xul:box> <xul:button label="zoom out"/> </xul:box> </content> </binding> from the dom's perspective, the child elements are still in their original location. that is, the outer xul box has two children, which are the two images. the inner box with the border has ...
Creating Dialogs - Archive of obsolete content
uct up to four buttons along the bottom of the dialog forok,cancel, and so on. you do not need to include the xul for each button; however, you do need to supply code to perform the appropriate tasks when the user presses each button. this mechanism is necessary because different platforms have a specific order in which the buttons appear. ...
...es are buttonlabelaccept - label to appear on the accept button egsave buttonaccesskeyaccept - access key to use for the accept button egs defaultbutton - button is activated when the enter key is pressed note: the label attributes are required by remote sites and are probably missing in the above examples due to bug 224996. ...
Focus and Selection - Archive of obsolete content
ontrol attribute pointing to the id of the textbox. finally, the other label which displays the tag name has no control attribute, so clicking it has no effect on the focused element. only focusable elements can be focused. making a label focusable if you were creating custom elements, you might have a need to change whether an element can have the focus or not. for this, you can use a special
style property -moz-user-focus. this property controls whether an element can be focused. for instance, you could make a label focusable, as in the example below. example 4 : source view <label id="focused"
style="-moz-user-focus: normal;" onkeypress="alert('label focused');" value="focus me"/> the
style property is set to normal. you can also set it to ignore to turn off the focus for an el...
...n the command dispatcher. these methods move the focus to the next element in sequence or the previous element respectively. this is what happens when the user presses tab or shift+tab. for textboxes, a special attribute, focused is added whenever the element has the focus. you can check for the presence of this attribute to determine if the element has the focus, either from a script or within a
style sheet. it will have the value true if the textbox has the focus and, if the textbox does not have the focus, the attribute will not be present. suppose you wanted to move the focus from where it currently is, to the next place the browser thinks it should be. a user typically does this by hitting the "tab" key. you can do this anywhere you have a xul browser document by simply: document.com...
Tree View Details - Archive of obsolete content
rack of this. the tree will call this method to determine which containers are open and which are closed. note that the tree will call neither iscontainerempty nor iscontaineropen for rows that are not containers as indicated by the return value of the iscontainer method. a container may be rendered differently than a non-container. for instance, a container may have a folder icon beside it. a
style sheet may be used to
style items based on various properties such as whether a row is open. this is described in a later section. a non-empty container will be displayed with a twisty next to it so that the user may open and close the row to see child items. empty containers will not have a twisty, but will still be treated like a container. when the user clicks the twisty to open a row, the tre...
...a row, we need to tell the tree to repaint the twisty in the new state. the easiest way to do this is to invalidate the row. complete example there are several other view functions we can implement but they don't need to do anything in this example, so we can create functions that do nothing for those. ...
Using the Editor from XUL - Archive of obsolete content
one loading. the xul contains an <editor> tag, e.g.: <editor type="content-primary" id="content-frame" src="about:blank" flex="1"/> the attribute type="content-primary" identifies this as the window content element, i.e. that which you get from window._content. having an id attribute, id="content-frame", allows us to find this element with document.getelementbyid("content-frame"), and to
style it from css. editoronload() is called. it does some getting of window.arguments (which is a way callers can pass parameters to new windows -- we use this to get the url to be loaded), then it calls editorstartup(), where the real work happens. it passes two parameters; the first indicates whether we want a plain text or html editor (pass text or html here), and the second is the <iframe>...
...handled entirely by the rules code, in the willdoaction()call. in composer, we are using nshtmleditrules, so we end up in nshtmleditrules::willdoaction(). for text insertion, this drops into nshtmleditrules::willinserttext(). this code first deletes the selection if there is one (e.g. you are typing over selected text), then calls a generic pre-insertion call willinsert(), which sets up inline
styles for the inserted text, and moves the selection to an appropriate place where the text is to be inserted. now we are ready to actually insert the text. recall that we're going through a generic inserttext() call, so this code deals with pasting long strings, as well as inserting single characters. the code thus has to do the correct thing with linebreaks, so has a special case for inserting in...
XUL accessibility guidelines - Archive of obsolete content
lbox and listbox, are made to scroll automatically. as a general rule, elements set to scroll are inaccessible if the user cannot scroll to all the content using the keyboard. the arrowscrollbox, for example, is a non-focusable element and cannot be scrolled using a keyboard. a listbox, however, can receive focus so its contents can scroll. almost any xul element can be set to scroll by setting a
style to "overflow: auto" or "overflow: scroll". this flexibility should be used carefully. maintaining focus the user should typically control where the current focus is located. avoid changing the focus automatically. however, disabling, hiding, or destroying the focus element (or any ancestor of the focus element) can cause a loss of focus. to prevent this, move the focus to the next element befor...
...he correct label for textbox is actually the same, but we don't want assistive technologies to read or show it twice. we need a way of specifying in the source that the checkbox, editbox, and nearby text labels are all part of a single entity, and that they essentially label each other. to solve this problem, we use the aria-labelledby attribute on both controls (note the double l—aria uses uk-
style spelling) to specify that the checkbox and the textbox are both labeled by the the entire group of components. put into xul, this looking something like the following. <checkbox id="rememberhistorydays" aria-labelledby="historydaysprelabel historybox historydayspostlabel"> <label id="historydaysprelabel">remember visited pages for the last</label> <textbox id="historydays" aria-labelledby=...
XML - Archive of obsolete content
l, its parent language. xul syntax & rules xul is a standards-based interface definition language. it attempts to balance precise control of layout with flexibility and ease of use, and in this respect it does a great job. using a combination of xul's ready-made widgets (e.g., menubar, scrollbar, progressmeter, and so on) and xul's incorporation of such standards as html4, dom1/2, and cascading
stylesheets, you can design any interface that you can imagine, using any number of different features, tools, and methodologies. there are many times, for example, when you may use javascript tricks to add extra behavior. but the necessary tradeoff for xul's flexibility is a lack of implicit functionality -- the lack ofintuition, you might say, that xul has in interpreting what it is you want. in orde...
...els on the screen. mozilla is a product made with all these technologies, but gecko is the thing sitting inside that renders that product. gecko was designed to be lightweight, standards-compliant and cross-platform, so rather than defining on its own how these widgets should be rendered, gecko depends for all but the most basic behavioral and presentational aspects of the widgets upon cascading
stylesheets. the combination of structure, as defined in the xul,
style as defined by the
stylesheets, and the other standards are rendered by gecko into the interface. the heavy lifting is done by the ingredients rather than the chef. this arrangement creates new possibilities for truly cross-platform web applications, application serving, web appliances and embedded systems, and all sort of other ...
XUL Event Propagation - Archive of obsolete content
nts, even by the event target itself. the combination of basic these two basic event flow mechanisms, event bubbling and event capturing, mean that events raised in the interface can be caught anywhere above the element that raised the event. this flexibility in the xul event model is the focus of this article. ...
... flexibility in the xul event model is the focus of this article. ...
action - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, r...
...ext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelements...
arrowscrollbox - Archive of obsolete content
if false, the mouse must be hovered over the arrows to scroll automatically. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. dis...
...ndex are later in the tab sequence. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width disabled type: boolean gets and sets the value of the disabled attribute. scrollboxobject type: nsiscrollboxobject the scroll box object implements the nsiscrollboxobject interface, which may be used to retrieve and adjust the scroll position of the list box. scrollincrement type: integer a read only property that lets...
assign - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
bbox - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
binding - Archive of obsolete content
it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate type: uri the predicate or property to match. this must be a uri of the property. subject type: string the subject of the element. it can be a variable reference or a...
...n be a variable reference or an rdf resource uri. ...
bindings - Archive of obsolete content
it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate type: uri the predicate or property to match. this must be a uri of the property. subject type: string the subject of the element. it can be a variable reference or an rdf ...
...le reference or an rdf resource uri. ...
box - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
broadcaster - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
broadcasterset - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
column - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
columns - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
conditions - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
deck - Archive of obsolete content
you may select an item by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected do not hide panels; the deck element only underst...
... to this property will modify the selected panel. ...
dialogheader - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a heading row for a dialog box. this element should be placed inside a dialog element. the header may have a title and a description. ...
...ear in the title bar of the window. ...
dropmarker - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , le...
...he type of accessibility object for the element. ...
grid - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
grippy - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
groupbox - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , le...
...he type of accessibility object for the element. ...
hbox - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
keyset - Archive of obsolete content
if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of form...
... need to update additional state. ...
listcol - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
listcols - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
listhead - Archive of obsolete content
disabled type: boolean gets and sets the value of the disabled attribute. inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , co...
...ts and sets the value of the disabled attribute. ...
listheader - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , le...
...he type of accessibility object for the element. ...
member - Archive of obsolete content
container type: ? a variable reference to a node that is expected to be a container. if the variable is the same as the uri attribute on the content ele...
...ce must be a container element in order to match. ...
menu - Archive of obsolete content
l. ...
...pecified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item.
style classes menu-iconic use this class to have an image appear on the menu. specify the image using the image attribute. related elements menubar, menuitem, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider, nsidomxulcontainerelement, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
observes - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
page - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
popupset - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
preferences - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...also executes code specified in onchanged attribute of the element. see also the description of change event of <preference>. void observe(in nsisupports asubject, in string atopic, in wstring adata); ...
progressmeter - Archive of obsolete content
max type: integer gets and sets the value of the max attribute. mode type: string gets and sets the value of the mode attribute. value type: string gets...
...ng the textbox.value and menulist.value syntax. ...
query - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
queryset - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
row - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
rows - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
script - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
scrollcorner - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
spacer - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
spinbuttons - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
stack - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
statusbar - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left...
...he type of accessibility object for the element. ...
stringbundleset - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
tab - Archive of obsolete content
as it may need to update additional state. fadein type: boolean this attribute is set to true if the tab is fading in or out. this typically means that the tab is in the process of appearing or disappearing. first-tab type: boolean this attribute will be set to true for the first tab. this attribute should not be set manually, but is useful in a theme if the first tab should be
styled differently. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is cop...
...he label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. last-tab type: boolean this attribute will be set to true for the last tab. this attribute should not be set manually, but is useful in a theme if the last tab should be
styled differently. linkedpanel type: id the id of the linked tabpanel element that will be displayed when the tab is selected. if this attribute is not used, the tab will be connected to the panel at the corresponding index in the tabpanels element that the tab is in its tabs container. however, if this attribute is used, this behavior is overridden, and the tab will always be linked to a spe...
tabpanel - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
template - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
textnode - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
toolbar - Archive of obsolete content
lem for extensions that depend on being able to identify all possible toolbar items by looking in the toolbarpalette. ...
...otherwise, this option will be ignored for this toolbar and it will always be visible. related elements toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspr...
toolbargrippy - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, m...
...returns the accessibility object for the element. ...
toolbaritem - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
toolbarpalette - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
toolbarseparator - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left,...
...the type of accessibility object for the element. ...
toolbarset - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, re...
...text, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsb...
toolbarspacer - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , le...
...he type of accessibility object for the element. ...
toolbarspring - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left...
...he type of accessibility object for the element. ...
toolbox - Archive of obsolete content
ts provided by the toolbox's externaltoolbars property. more information is available in the xul tutorial. if you'd like to detect when toolbars in a toolbox are changed, see toolbar customization events. ...
... customtoolbarcount firefox only type: integer the number of custom toolbars currently within the toolbox. externaltoolbars type: array of elements an array of external toolbars; t...
treecell - Archive of obsolete content
mines the type of progress meter to use. none no progress meter is displayed. the cell text is displayed instead. normal the cell uses its value attribute to determine the amount of the bar that is filled in. undetermined the progressmeter is indeterminate. properties type: space-separated list of property names sets the properties of the element, which can be used to
style the element. for more information, see styling a tree. ref type: uri for template-generated elements, this attribute is used to specify the root rdf node where content generation begins. this will correspond to the value of an about attribute on an rdf container. this attribute should be placed alongside the datasources attribute. src type: uri set this to the uri of an image to...
...contents displayed to the user. ...
treecols - Archive of obsolete content
inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , le...
...he type of accessibility object for the element. ...
triple - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
vbox - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
where - Archive of obsolete content
licatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext,
style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, ...
...xt, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext,
style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelement...
XMLHttpRequestEventTarget - Web APIs
xmlhttprequesteventtarget is the interface that describes the event handlers you can implement in an object that will handle events for an xmlhttprequest. ...
... xmlhttprequesteventtarget is the interface that describes the event handlers you can implement in an object that will handle events for an xmlhttprequest. ...
Introduction - Web APIs
introduction one noticeable trend in w3c standards has been the effort to separate content from
style. this would allow the same
style to be reused for multiple content, as well as simplify maintenance and allow a quick (only modify one file) way to change the look of content. css (cascade
style sheets) was one of the first ways proposed by the w3c. css is a simple way to apply
style rules to a web document. these
style rules define how the document (the content) should be laid out. however, it has several limitations, such as lack of programming structures and ability to create complex layout models. css also has limited support for changing the position of an element. ...
... sheets) was one of the first ways proposed by the w3c. css is a simple way to apply
style rules to a web document. these
style rules define how the document (the content) should be laid out. however, it has several limitations, such as lack of programming structures and ability to create complex layout models. css also has limited support for changing the position of an element. xsl (extensible
stylesheet language) transformations are composed of two parts: xsl elements, which allow the transformation of an xml tree into another markup tree and xpath, a selection language for trees. xslt takes an xml document (the content) and creates a brand new document based on the rules in the xsl
stylesheet. this allows xslt to add, remove and reorganize elements from the original xml document and thus a...
msPutPropertyEnabled - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msputpropertyenabled method sets whether a given property in the
style object is enabled or disabled. this proprietary method is specific to internet explorer and microsoft edge. syntax var retval =
style.msputpropertyenabled(propertyname, true); parameters name[in]: name of the property. (string) boolean[in]: true = enable the property. false = disable the property. return value type = hresult: if this method succeeds, it returns s_ok. otherwise, it returns an hresult error code. see...
...rietary method is specific to internet explorer and microsoft edge. syntax var retval =
style.msputpropertyenabled(propertyname, true); parameters name[in]: name of the property. (string) boolean[in]: true = enable the property. false = disable the property. return value type = hresult: if this method succeeds, it returns s_ok. ...
ARIA: button role - Accessibility
a-pressed the value of aria-pressed defines the state of a toggle button. this attribute has one of four possible values: true, false, mixed, undefined examples basic button example in this example, a span element has been given the button role. because a <span> element is used, the tabindex attribute is required to make the button focusable and part of the page's tab order. the included css
style is provided to make the <span> element look like a button, and to provide visual cues when the button has focus. the handlebtnclick and handlebtnkeydown event handlers perform the button's action when activated using a mouse click or the space or enter key. in this case, the action is to add a new name to the list of names. try the example by adding a name to the text box. the button will cause...
...our name: </label> <input type="text" id="newname"> <span role="button" tabindex="0" onclick="handlecommand()" onkeydown="handlecommand()">add name</span> css [role="button"] { padding: 2px; background-color: navy; color: white; cursor: default; } [role="button"]:hover, [role="button"]:focus, [role="button"]:active { background-color: white; color: navy; } ul { list-
style: none; } javascript function handlecommand(event) { // handles both mouse clicks and keyboard // activate with enter or space // get the new name value from the input element let newnameinput = document.getelementbyid('newname'); let name = newnameinput.value; newnameinput.value = ''; // clear the text field newnameinput.focus(); // give the text field focus to ena...
Web applications and ARIA FAQ - Accessibility
kind of widget it is. progressbar.setattribute("role", "progressbar"); progressbar.setattribute("aria-valuemin", 0); progressbar.setattribute("aria-valuemax", 100); // create a function that can be called at any time to update the value of the progress bar. ...
... my page
styles or behavior? no, aria is only made available to assistive technology apis, and doesn't affect native browser functionality with respect to the dom or styling. from the browser's point of view, the native html defines the semantic meaning and behavior of an element, with aria attributes acting as a layer on top to help support the at api. though on its own aria will not change any
styles, as with any html attributes, css can take advantage of aria attributes as element selectors. this may provide a convenient mechanism to
style aria-enabled widgets. .tab-panel[aria-hidden="true"] { display: none; } .tab-panel[aria-hidden="false"] { display: block; } what about validation? the new attributes introduced in aria, such as role and those prefixed with aria-, aren't offic...
An overview of accessible web applications and widgets - Accessibility
ab"> <a href="#ch1panel">chapter 1</a> </li> <li id="ch2tab"> <a href="#ch2panel">chapter 2</a> </li> <li id="quiztab"> <a href="#quizpanel">quiz</a> </li> </ol> <div> <div id="ch1panel">chapter 1 content goes here</div> <div id="ch2panel">chapter 2 content goes here</div> <div id="quizpanel">quiz content goes here</div> </div> example 2: how the tabs widget might be
styled visually. users might recognize it visually, but there are no machine-readable semantics for an assistive technology. aria aria enables developers to describe their widgets in more detail by adding special attributes to the markup. designed to fill the gap between standard html tags and the desktop-
style controls found in dynamic web applications, aria provides roles and states that describe...
...the web has been limited to the tab key. a user presses tab to focus each link, button, or form on the page in a linear order, using shift-tab to navigate backwards. it's a one-dimensional form of navigation—forward and back, one element at a time. on fairly dense pages, a keyboard-only user often has to press the tab key dozens of times before accessing the needed section. implementing desktop-
style keyboard conventions on the web has the potential to significantly speed up navigation for many users. here's a summary of how keyboard navigation should work in an aria-enabled web application: the tab key should provide focus to the widget as a whole. for example, tabbing to a menu bar should not put focus on the menu's first element. the arrow keys should allow for selection or navigation...
Accessibility Information for Web Authors - Accessibility
contrast by lighthouse international). a study has established that about 8 percent of all men have some form of color deficiency. color contrast analyzer algorithm is based on the formula provided in techniques for accessibility evaluation and repair tools from w3c. the juicy studio css analyzer will also analyze and report the color contrast and color brightness differences involved in your
stylesheets. the future: accessible dhtml dhtml accessibility roadmap: a peek into how dhtml will be made accessible in the future. this document gives a plan which is being developed by ibm, mozilla and wai protocols and formats working group (pfwg) to address the issue of accessible dhtml. dynamic web content is not accessible, because it uses vanilla <div>'s and <span>'s combined with javascri...
...th javascript rather than declarative markup to describe the behavior of custom widgets such as menus and tree views. these widgets are usually not even keyboard focusable. furthermore, assistive technologies do not understand what these widgets are supposed to be, or what state they are in or what they are capable of. this document tackles such difficulties and shows several interactive desktop-
style widgets such as tree views, menu bars and spreadsheets which are accessible both with the keyboard and assistive technologies such as screen readers, screen magnifiers and alternative input devices. join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effo...
Web Accessibility: Understanding Colors and Luminance - Accessibility
use color is as much about the physiology of the eye and human perception as it is about light emitting from a computer screen. environment matters. perception of color in a well-lit room will be different than perception of that same color on that same computer screen in a dark room. in terms of accessibility, the use of certain color-combinations have more impact than others. font size, font
style (some fonts are so thin or fancy that they present accessibility problems on their own), background color, the size of the background space around the text, even pixel densities and more all affect how color is delivered from the screen. (see understanding success criterion 1.4.3: contrast) a viewer's distance from the screen, the ambient background, the health of his eyes, and more all affect h...
...) measuring color & luminance methods that measures color exploring the rgb color space further, as it is the color space used by the data type <color>, note that there are actually multiple "versions" of the rgb color space, such as srgb, scrgb, and rgba. there are also different ways to refrence rgb: rgb decimal reference: 153, 0, 0 and an rgb percent reference: 60, 0, 0. window.getcomputed
style() returns values using rgb decimal reference scale. for example, calling window.getcomputed
style() on a div with a background-color: #990000; set returns the computed background color as rgb(153, 0, 0) -- the rgb decimal reference. window.getcomputed
style() measures color in terms of rgb. css color module level 3 added hsl color values, stating "css3 adds numerical hue-saturation-lightness (...
Perceivable - Accessibility
larly refer to good semantics, ui controls, and text alternatives. 1.3.2 meaningful content sequence (a) a sensible, logical reading order should be easy to determine for any content, even if it is visually presented in an unusual way. the order should be made obvious by use of correct semantic elements (e.g., headings, paragraphs), with css being used to create any unusual layout
styles, irrespective of the markup. again, refer to html: a good basis for accessibility. 1.3.3 sensory characteristics (a) instructions for operating controls or understanding content do not rely on a single sense. this may prove inaccessible to people with a disability related to that sense, or a device that does not support that sense. so, for example: "click the round...
... two-dimensional layout for usage or meaning (like a large data table) understanding reflow 1.4.11 non-text contrast(aa) added in 2.1 minimum color contrast ratio of 3:1 for user interface components and graphical objects. ...
Understandable - Accessibility
l (aaa) if text is provided that requires a higher reading level that lower secondary education level (typically children around 11-14 years old), provide supplementary explainer material to help people who can't read it, or provide an alternative version that is written at lower secondary level. this doesn't mean that all subject matter should be understood by everyone, but that the
style of writing should be accessible by everyone. it is better to just write all content at lower secondary level, even technical documentation like programming tutorials, unless there is a good reason not to (e.g. an alternative
style for poetic effect), or they have to be written in a strict
style (e.g. w3c specs). 3.1.6 pronunciation (aaa) a mechanism should be provided to ...
...rned/advised of the impending change before it occurs. again, sensible design should be implemented. for example, if pressing a button causes the application to exit the current view, the user should be asked to confirm this action, save their work if appropriate, etc. globaleventhandlers.oninput is useful here. 3.2.3 consistent navigation (aa) navigation menu/control
style and positioning should be consistent between different pages or views of a web page, and the existing items should appear in the same order, even if for example new iteam are added. if the user has initiated a change, e.g. choosing a different color scheme or position for the navigation, their choice should be respected across all pages. again, sensible design — make the navigation control...
Writing Web Audio API code that works in every browser - Developer guides
st, get a copy of audiocontext-monkeypatch by chris wilson. this little library will "normalise" the interfaces for you and make it look as if your code is running in a standards compliant browser, by aliasing prefixed names to the unprefixed versions. and it won't do anything if the unprefixed versions are already present. once you include it in your page, you can write in "modern web audio api"
style, and do things such as: var audiocontext = new audiocontext(); everywhere, including chrome/ium, opera, safari, and ---of course!--- firefox. also, if new methods such as start are not detected in some nodes, the library will also alias them to their old names. thus, start is mapped to noteon, stop to noteoff, and so on. if you're porting moderately "old" code (say, a year old) it's possible tha...
...and ---of course!--- firefox. also, if new methods such as start are not detected in some nodes, the library will also alias them to their old names. thus, start is mapped to noteon, stop to noteoff, and so on. if you're porting moderately "old" code (say, a year old) it's possible that it uses some methods that audiocontext-monkeypatch doesn't alias, because it helps you to write code in the new
style. for example, the way to create instances of gainnode used to be var gain = audiocontext.creategainnode(); but nowadays it is just var gain = audiocontext.creategain(); since the old method names are not present in firefox, existing code may crash with something like creategainnode is not a function, and you now know why. there's a section in the spec that lists the old names and their updated ...
Using device orientation with 3D transforms - Developer guides
ue should be -gamma finally, the order of the three different rotations is very important to accurately convert an orientation to a 3d rotation: rotatez, then rotatex and then rotatey. here's a simple code snippet to sum it up: var elem = document.getelementbyid("view3d"); window.addeventlistener("deviceorientation", function(e) { // remember to use vendor-prefixed transform property elem.
style.transform = "rotatez(" + ( e.alpha - 180 ) + "deg) " + "rotatex(" + e.beta + "deg) " + "rotatey(" + ( -e.gamma ) + "deg)"; }); orientation compensation compensating the orientation of the device can be useful to create parallax effects or augmented reality. this is achieved by inverting the previous order of rotations and negating the alpha value: var elem = document.getelementbyi...
...g)"; }); orientation compensation compensating the orientation of the device can be useful to create parallax effects or augmented reality. ...
Content categories - Developer guides
to read the relevant portions of the html specification. main content categories metadata content elements belonging to the metadata content category modify the presentation or the behavior of the rest of the document, set up links to other documents, or convey other out of band information. elements belonging to this category are <base>, <command>, <link>, <meta>, <noscript>, <script>, <
style> and <title>. flow content elements belonging to the flow content category typically contain text or embedded content. they are: <a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>...
..., <script>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, <template>, <textarea>, <time>, <ul>, <var>, <video>, <wbr> and text. a few other elements belong to this category, but only if a specific condition is fulfilled: <area>, if it is a descendant of a <map> element <link>, if the itemprop attribute is present <meta>, if the itemprop attribute is present <
style>, if the scoped attribute is present sectioning content elements belonging to the sectioning content model create a section in the current outline that defines the scope of <header> elements, <footer> elements, and heading content. elements belonging to this category are <article>, <aside>, <nav> and <section>. do not confuse this content model with the sectioning root category, which isol...
Making content editable - Developer guides
n edit. <div contenteditable="true"> this text can be edited by the user. </div> here's the above html in action: executing commands when an html element has contenteditable set to true, the document.execcommand() method is made available. this lets you run commands to manipulate the contents of the editable region. most commands affect the document's selection by, for example, applying a
style to the text (bold, italics, etc), while others insert new elements (like adding a link) or affect an entire line (indenting). when using contenteditable, calling execcommand() will affect the currently active editable element. differences in markup generation use of contenteditable across different browsers has been painful for a long time because of the differences in generated markup between ...
...intdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odoc.innerhtml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <
style type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </
style> </head> <body onload="initdoc();"> <f...
Constraint validation - Developer guides
.setcustomvalidity(""); } finally we hook the method with the correct event: window.onload = function () { document.getelementbyid("fs").onchange = checkfilesize; } you can see a live example of the file size constraint validation. visual styling of constraint validation apart from setting constraints, web developers want to control what messages are displayed to the users and how they are
styled. controlling the look of elements the look of elements can be controlled via css pseudo-classes. :required and :optional css pseudo-classes the :required and :optional pseudo-classes allow writing selectors that match form elements that have the required attribute, or that don't have it. :placeholder-shown css pseudo-class see :placeholder-shown :valid :invalid css pseudo-classes the :va...
...g selectors that match form elements that have the required attribute, or that don't have it. :placeholder-shown css pseudo-class see :placeholder-shown :valid :invalid css pseudo-classes the :valid and :invalid pseudo-classes are used to represent <input> elements whose content validates and fails to validate respectively according to the input's type setting. these classes allow the user to
style valid or invalid form elements to make it easier to identify elements that are either formatted correctly or incorrectly. controlling the text of constraint violation the following items can help with controlling the text of a constraint violation: element.setcustomvalidity(message) method on the following elements: <fieldset>. note: setting a custom validity message on fieldset eleme...