Search completed in 1.11 seconds.
2165 results for "width":
Your results are loading. Please wait...
border-width - CSS: Cascading Style Sheets
the border-width shorthand css property sets the width 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. ...
...width shorthand css property sets the width 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. ...
... property sets the width 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 20 more matches
width - SVG: Scalable Vector Graphics
Web › SVG › Attribute › width
the width attribute defines the horizontal length of an element in the user coordinate system. ...
... value <length> | <percentage> default value 100% animatable yes ...
...ropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <!-- with a width of 0 or less, nothing will be rendered --> <rect x="0" y="0" width="0" height="90"/> <rect x="0" y="100" width="60" height="90"/> <rect x="0" y="200" width="100%" height="90"/> </svg> feblend for <feblend>, width defines the horizontal length for the rendering area of the primitive. value <length> | <percentage> default value 100% animatable yes fecolormatrix for <fecolormatrix>, width defines the horizontal ...
...And 20 more matches
min-width - CSS: Cascading Style Sheets
Web › CSS › min-width
the min-width css property sets the minimum width of an element. it prevents the used value of the width property from becoming smaller than the value specified for min-width. 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 element's width is set to the value of min-width whenever min-width is larger than max-width or width. ...
...value specified for min-width. 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 element's width is set to the value of min-width whenever min-width is larger than max-width or width. syntax /* <length> value */ min-width: 3.5em; /* <percentage> value */ min-width: 10%; /* keyword values */ min-width: max-content; min-width: min-content; min-width: fit-content(20em); /* global values */ min-width: inherit; min-width: initial; min-width: unset; values <length> defines the min-width as an absolute value. <percentage> defines the min-width as a percentage of the containing block's width. auto the browser...
... fit-content(<length-percentage>) uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). ...
...And 15 more matches
max-width - CSS: Cascading Style Sheets
Web › CSS › max-width
the max-width css property sets the maximum width of an element. it prevents the used value of the width property from becoming larger than the value specified by max-width. 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. max-width overrides width, but min-width overrides max-width. ...
... width property from becoming larger than the value specified by max-width. 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. max-width overrides width, but min-width overrides max-width. syntax /* <length> value */ max-width: 3.5em; /* <percentage> value */ max-width: 75%; /* keyword values */ max-width: none; max-width: max-content; max-width: min-content; max-width: fit-content(20em); /* global values */ max-width: inherit; max-width: initial; max-width: unset; values <length> defines the max-width as an absolute value. <percentage> defines the max-width as a percentage of the containing block's width. ...
... fit-content(<length-percentage>) uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). ...
...And 10 more matches
border-bottom-width - CSS: Cascading Style Sheets
the border-bottom-width css property sets the width of the bottom border of an 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. syntax /* keyword values */ border-bottom-width: thin; border-bottom-width: medium; border-bottom-width: thick; /* <length> values */ border-bottom-width: 10em; border-bottom-width: 3vmax; border-bottom-width: 6px; /* global keywords */ border-bottom-width: inherit; border-bottom-width: initial; border-bottom-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword. if it's a keyword, it must be one of the fol...
... of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal definition initial valuemediumapplies toall elements. ...
...entation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal definition initial valuemediumapplies toall elements. ...
...And 9 more matches
border-image-width - CSS: Cascading Style Sheets
the border-image-width css property sets the width of an element's border image. 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 this property's value is greater than the element's border-width, the border image will extend beyond the padding (and/or content) edge. ...
...rce 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 this property's value is greater than the element's border-width, the border image will extend beyond the padding (and/or content) edge. ...
...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 this property's value is greater than the element's border-width, the border image will extend beyond the padding (and/or content) edge. ...
...And 9 more matches
Document.width - Web APIs
Web › API › Document › width
note: starting in gecko 6.0, document.width is no longer supported. instead, use document.body.clientwidth. see element.clientwidth. returns the width of the <body> element of the current document in pixels. not supported by internet explorer. ...
... note: starting in gecko 6.0, document.width is no longer supported. instead, use document.body.clientwidth. see element.clientwidth. returns the width of the <body> element of the current document in pixels. not supported by internet explorer. ...
... note: starting in gecko 6.0, document.width is no longer supported. instead, use document.body.clientwidth. see element.clientwidth. returns the width of the <body> element of the current document in pixels. not supported by internet explorer. ...
...And 7 more matches
HTMLElement.offsetWidth - Web APIs
this property will round the value to an integer. ...
... this property will round the value to an integer. ...
... this property will round the value to an integer. ...
...And 7 more matches
HTMLImageElement.naturalWidth - Web APIs
the htmlimageelement interface's read-only naturalwidth property returns the intrinsic (natural), density-corrected width of the image in css pixels. this is the width the image is if drawn with nothing constraining its width; if you neither specify a width for the image nor place the image inside a container that limits or expressly specifies the image width, this is the number of css pixels wide the image will be. the corresponding naturalheight method returns the natural height of the image. syntax let naturalwidth = htmlimageelement.naturalwidth; value an integer value indicating the intrinsic width of the image, in css pixels. ...
... for the image nor place the image inside a container that limits or expressly specifies the image width, this is the number of css pixels wide the image will be. the corresponding naturalheight method returns the natural height of the image. syntax let naturalwidth = htmlimageelement.naturalwidth; value an integer value indicating the intrinsic width of the image, in css pixels. this is the width at which the image is naturally drawn when no constraint or specific value is established for the image. this natural width is corrected for the pixel density of the device on which it's being presented, unlike the value of width. ...
... example this example simply displays both the natural, density-adjusted size of an image as well as its rendered size as altered by the page's css and other factors. ...
...And 7 more matches
width - CSS: Cascading Style Sheets
Web › CSS › @viewport › width
the width css descriptor is shorthand for setting both the min-width and the max-width descriptors of the viewport. by providing one viewport length value, that value will determine both the min-width and the max-width to the value provided. if two viewport values are provided the first value will be set to the min-width and the second value will be set max-width. syntax /* an example with one viewport value: */ @viewport { width: 320px; } /* an example with two viewport values: */ @viewport { width: 320px, 120px; } values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
... the second value will be set max-width. syntax /* an example with one viewport value: */ @viewport { width: 320px; } /* an example with two viewport values: */ @viewport { width: 320px, 120px; } values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
...lue is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
...And 7 more matches
width - CSS: Cascading Style Sheets
Web › CSS › width
the width css property sets an element's width. by default, it sets the width of the content area, but if box-sizing is set to border-box, it sets the width of the border area. 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 min-width and max-width properties override width. ...
...t area, but if box-sizing is set to border-box, it sets the width of the border area. 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 min-width and max-width properties override width. syntax /* <length> values */ width: 300px; width: 25em; /* <percentage> value */ width: 75%; /* keyword values */ width: max-content; width: min-content; width: fit-content(20em); width: auto; /* global values */ width: inherit; width: initial; width: unset; the width property is specified as either: one of the following keyword values: min-content, max-content, fit-content, auto. a <length> or a <percentage>. values ...
.../* <percentage> value */ width: 75%; /* keyword values */ width: max-content; width: min-content; width: fit-content(20em); width: auto; /* global values */ width: inherit; width: initial; width: unset; the width property is specified as either: one of the following keyword values: min-content, max-content, fit-content, auto. a <length> or a <percentage>. values <length> defines the width as an absolute value. <percentage> defines the width as a percentage of the containing block's width. auto the browser will calculate and select a width for the specified element. max-content the intrinsic preferred width. min-content the intrinsic minimum width. fit-content(<length-percentage>) uses the fit-content formula with the available space replaced by the specified argument, i.
...And 7 more matches
Window.innerWidth - Web APIs
Web › API › Window › innerWidth
the read-only window property innerwidth returns the interior width of the window in pixels. this includes the width of the vertical scroll bar, if one is present. more precisely, innerwidth returns the width of the window's layout viewport. the interior height of the window—the height of the layout viewport—can be obtained from the innerheight property. syntax let intviewportwidth = window.innerwidth; value an integer value indicating the width of the window's layout viewport in pixels. this property is read-only, and has no default value. to change the window's width, use one of the window methods for resizing windows, such as resizeby() or resizeto(). ...
......
...dow's width, use one of the window methods for resizing windows, such as resizeby() or resizeto(). usage notes if you need to obtain the width of the window minus the scrollbar and borders, use the root <html> element's clientwidth property instead. the innerwidth property is available on any window or object that behaves like a window, such as a frame or tab. ...
...And 6 more matches
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
this article explains a change that has occured in the way sizes are worked out on web documents when width and height attributes are set on them. this change means that the aspect ratio of the image is calculated by the browser early on and can then be used to correct the size needed to display the image before it has loaded, if css has been applied that causes problems with its display size. read on to find out more. ...
...em. this change means that the aspect ratio of the image is calculated by the browser early on and can then be used to correct the size needed to display the image before it has loaded, if css has been applied that causes problems with its display size. read on to find out more. jank problems when loading images in the olden days of web development, it was always seen as a good practice to add width and height attributes to your html <img> elements, so that when browsers first loaded the page, they could put a correctly-sized placeholder box in the layout for each image to appear in when it finally loads. without the width and height attributes, no placeholder space would be created, and when the image finally loaded you would get a noticeable jank in the page layout. this wasn't an attra...
... your users to see, and could also result in performance issues due to the repainting required after each image loads, hence adding the attributes being a good idea. let’s move forward a few years to the era of responsive design. to keep images from breaking out of their containers when the container becomes narrower than the image, developers started using css like the following: img { max-width: 100%; height: auto; } this is really useful for responsive layouts, but unfortunately it causes the jank problem to return — the above css overrides the width and height attribute information, meaning that if the image has not loaded for some reason, its height will be set to 0. when the image finally loads, the same jank will occur as the page layout is shifted to make space for it. a new...
...And 6 more matches
border-inline-end-width - CSS: Cascading Style Sheets
the border-inline-end-width css property defines the width of the logical inline-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width 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-width, border-bottom-width, or border-left-width 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-width'> values */ border-inline-end-width: 2px; border-inline-end-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-start-width, which define the other border widths of the element. ...
...s://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-width'> values */ border-inline-end-width: 2px; border-inline-end-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-start-width, which define the other border widths of the element. initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border. see border-width. ...
...And 5 more matches
mask-border-width - CSS: Cascading Style Sheets
the mask-border-width css property sets the width of an element's mask border. syntax /* keyword value */ mask-border-width: auto; /* <length> value */ mask-border-width: 1rem; /* <percentage> value */ mask-border-width: 25%; /* <number> value */ mask-border-width: 3; /* vertical | horizontal */ mask-border-width: 2em 3em; /* top | horizontal | bottom */ mask-border-width: 5% 15% 10%; /* top | right | bottom | left */ mask-border-width: 5% 2em 10% auto; /* global values */ mask-border-width: inherit; mask-border-width: initial; mask-border-width: unset; the mask-border-width property may be specified using one, two, three, or four values chosen from the list of values below. when one value is specified, it applies the same width to all four sides. when two values are specified, ...
...ottom | left */ mask-border-width: 5% 2em 10% auto; /* global values */ mask-border-width: inherit; mask-border-width: initial; mask-border-width: unset; the mask-border-width property may be specified using one, two, three, or four values chosen from the list of values below. when one value is specified, it applies the same width to all four sides. when two values are specified, the first width applies to the top and bottom, the second to the left and right. when three values are specified, the first width applies to the top, the second to the left and right, the third to the bottom. when four values are specified, the widths apply to the top, right, bottom, and left in that order (clockwise). ...
... sides. when two values are specified, the first width applies to the top and bottom, the second to the left and right. when three values are specified, the first width applies to the top, the second to the left and right, the third to the bottom. when four values are specified, the widths apply to the top, right, bottom, and left in that order (clockwise). values <length-percentage> the width of the mask border, specified as a <length> or a <percentage>. percentages are relative to the width of the border area for horizontal offsets and the height of the border area for vertical offsets. must not be negative. <number> the width of the mask border, specified as a multiple of the corresponding border-width. must not be negative. ...
...And 5 more matches
border-block-start-width - CSS: Cascading Style Sheets
the border-block-start-width css property defines the width of the logical block-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width 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-width, border-bottom-width, or border-left-width 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-width'> values */ border-block-start-width: 5px; border-block-start-width: thick; related properties are border-block-end-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. ...
...://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-width'> values */ border-block-start-width: 5px; border-block-start-width: thick; related properties are border-block-end-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border. see border-width. ...
...And 4 more matches
outline-width - CSS: Cascading Style Sheets
the css outline-width property sets the thickness 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. syntax /* keyword values */ outline-width: thin; outline-width: medium; outline-width: thick; /* <length> values */ outline-width: 1px; outline-width: 0.1em; /* global values */ outline-width: inherit; the outline-width property is specified as any one of the values listed below. ...
... thin depends on the user agent. typically equivalent to 1px in desktop browsers (including firefox). medium depends on the user agent. typically equivalent to 3px in desktop browsers (including firefox). ...
...n the user agent. typically equivalent to 3px in desktop browsers (including firefox). thick depends on the user agent. typically equivalent to 5px in desktop browsers (including firefox). ...
...And 4 more matches
HTMLObjectElement.width - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 3 more matches
column-width - 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. this property can help you create responsive designs that fit different screen sizes. ...
... 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. this property can help you create responsive designs that fit different screen sizes. ...
... 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. this property can help you create responsive designs that fit different screen sizes. especially in the presence of the column-count property (which has precedence), you must specify all related length values to achieve an exact column width. in horizontal text these are width, column-width, column-gap, and column-rule-width. syntax /* keyword value */ column-width: auto; /* <length> values */ column-width: 60px; column-width: 15.5em; column-width: 3.3vw; /* global values */ column-width: inherit; column-width: initial; column-width: unset; the column-width property is specified as one of the values listed below. values <le...
...And 3 more matches
scrollbar-width - CSS: Cascading Style Sheets
the scrollbar-width property allows the author to set the maximum thickness of an element’s scrollbars when they are shown. initial valueautoapplies toscrolling boxesinheritednocomputed valueas specifiedanimation typediscrete syntax /* keyword values */ scrollbar-width: auto; scrollbar-width: thin; scrollbar-width: none; /* global values */ scrollbar-width: inherit; scrollbar-width: initial; scrollbar-width: unset; values <scrollbar-width> defines the width of the scrollbar as a keyword. it must be one of the following values: auto the default scrollbar width for the platform. thin a thin scrollbar width variant on platforms that provide that option, or a thinner scrollbar than the default platform scrollbar width. none no scrollba...
...be one of the following values: auto the default scrollbar width for the platform. thin a thin scrollbar width variant on platforms that provide that option, or a thinner scrollbar than the default platform scrollbar width. none no scrollbar shown, however the element will still be scrollable. note: user agents must apply any scrollbar-width value set on the root element to the viewport. accessibility concerns use this property with caution — setting scrollbar-width to thin or none can make content hard or impossible to scroll if the author does not provide an alternative scrolling mechanism. while swiping gestures or mouse wheels can enable scrolling on such content, some devices have no scroll alternative. wcag criterion ...
...hanism. while swiping gestures or mouse wheels can enable scrolling on such content, some devices have no scroll alternative. wcag criterion 2.1.1 (keyboard) has been in place for a long time to advise on basic keyboard accessibility, and this should include scrolling of content areas. and introduced in wcag 2.1, criterion 2.5.5 (target size) advises that touch targets should be at least 44px in width and height (although the problem is compounded on high-resolution screens; thorough testing is advised). mdn understanding wcag, guideline 2.1 explanations mdn understanding wcag, guideline 2.5 explanations understanding success criterion 2.1.1 | w3c understanding wcag 2.1 understanding success criterion 2.5.5 | w3c understanding wcag 2.1 formal definition initial valueautoapplies toscro...
...And 3 more matches
stroke-width - SVG: Scalable Vector Graphics
the stroke-width attribute is a presentation attribute defining the width of the stroke to be applied to the shape. ...
...to be applied to the shape. ...
...to any element but it only has effect on shapes and text context elements, including: <altglyph>, <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <!-- default stroke width: 1 --> <circle cx="5" cy="5" r="3" stroke="green" /> <!-- stroke width as a number --> <circle cx="15" cy="5" r="3" stroke="green" stroke-width="3" /> <!-- stroke width as a percentage --> <circle cx="25" cy="5" r="3" stroke="green" stroke-width="2%" /> </svg> usage notes value <length> | <percentage> default value 1px animatable yes note: a percentage value is always computed as a percentage...
...And 3 more matches
DOMRectReadOnly.width - Web APIs
candidate recommendation latest spec version is an ed. ...
... candidate recommendation latest spec version is an ed. ...
... candidate recommendation latest spec version is an ed. ...
...And 2 more matches
Element.scrollWidth - Web APIs
the element.scrollwidth read-only property is a measurement of the width of an element's content, including content not visible on the screen due to overflow. the scrollwidth value is equal to the minimum width the element would require in order to fit all the content in the viewport without using a horizontal scrollbar. the width is measured in the same way as clientwidth: it includes the element's padding, but not its border, margin or vertical scrollbar (if present). it can also include the width of pseudo-elements such as ::before or ::after. if the element's content can fit without a need for horizontal scrollbar, its scrollwidth is equal to clientwidth this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). syntax var x...
...g, but not its border, margin or vertical scrollbar (if present). it can also include the width of pseudo-elements such as ::before or ::after. if the element's content can fit without a need for horizontal scrollbar, its scrollwidth is equal to clientwidth this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). syntax var xscrollwidth = element.scrollwidth; xscrollwidth is the width of the content of element in pixels. ...
...l value, use element.getboundingclientrect(). syntax var xscrollwidth = element.scrollwidth; xscrollwidth is the width of the content of element in pixels. ...
...And 2 more matches
HTMLCanvasElement.width - Web APIs
the htmlcanvaselement.width property is a positive integer reflecting the width html attribute of the <canvas> element interpreted in css pixels. when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used. this is one of the two properties, the other being htmlcanvaselement.height, that controls the size of the canvas. ...
...selement.width property is a positive integer reflecting the width html attribute of the <canvas> element interpreted in css pixels. when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used. this is one of the two properties, the other being htmlcanvaselement.height, that controls the size of the canvas. ...
... property is a positive integer reflecting the width html attribute of the <canvas> element interpreted in css pixels. when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used. this is one of the two properties, the other being htmlcanvaselement.height, that controls the size of the canvas. ...
...And 2 more matches
HTMLImageElement.width - Web APIs
the width property of the htmlimageelement interface indicates the width at which the image is drawn, in css pixels if the image is being drawn or rendered to any visual medium such as the screen or a printer; otherwise, it's the natural, pixel density corrected width of the image. syntax htmlimageelement.width = newwidth; let width = htmlimageelement.width; value an integer value indicating the width of the image. the terms in which the width is defined depends on whether the image is being rendered to a visual medium or not. if the image is being rendered to a visual medium such as a screen or printer, the width is expressed in css pixels. otherwise, the image's width is represented using its natural (intrinsic) width, adjusted for the display density as indicated by naturalwidth. ...
... the width is expressed in css pixels. otherwise, the image's width is represented using its natural (intrinsic) width, adjusted for the display density as indicated by naturalwidth. example in this example, two different sizes are provided for an image of a clock using the srcset attribute. one is 200px wide and the other is 400px wide. further, the sizes attribute is provided to specify the width at which the image should be drawn given the viewport's width. html specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 400px. ...
...xample, two different sizes are provided for an image of a clock using the srcset attribute. one is 200px wide and the other is 400px wide. further, the sizes attribute is provided to specify the width at which the image should be drawn given the viewport's width. html specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 400px. <p>image width: <span class="size">?</span>px (resize to update)</p> <img src="/files/16864/clock-demo-200px.png" alt="clock" srcset="/files/16864/clock-demo-200px.png 200w, /files/16797/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 400px"> javascript the javascript code looks at the width to determine the width of the image at the moment. this is done in the window's...
...And 2 more matches
SVGImageElement.width - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
...And 2 more matches
VisualViewport.width - Web APIs
draft initial definition. ...
... draft initial definition. ...
... draft initial definition. ...
...And 2 more matches
device-width - CSS: Cascading Style Sheets
candidate recommendation deprecated in media queries level 4. ...
... candidate recommendation deprecated in media queries level 4. ...
... candidate recommendation deprecated in media queries level 4. ...
...And 2 more matches
border-block-end-width - CSS: Cascading Style Sheets
the border-block-end-width css property defines the width of the logical block-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width 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-width, border-bottom-width, or border-left-width 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-width'> values */ border-block-end-width: 5px; border-block-end-width: thick; related properties are border-block-start-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-wid...
...width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
...And 2 more matches
border-block-width - CSS: Cascading Style Sheets
the border-block-width css property defines the width of the logical block borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-width and border-bottom-width, or border-left-width, and border-right-width property depending on the values defined for writing-mode, direction, and text-orientation. /* <'border-width'> values */ border-block-width: 5px; border-block-width: thick; the border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width. syntax values <'border-width'> the width of the border. see border-width. formal definition initial valuemediumapplies toall elementsinherit...
.../* <'border-width'> values */ border-block-width: 5px; border-block-width: thick; the border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...inline-width, which sets border-inline-start-width, and border-inline-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...And 2 more matches
border-inline-start-width - CSS: Cascading Style Sheets
the border-inline-start-width css property defines the width of the logical inline-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width 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-width, border-bottom-width, or border-left-width 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-width'> values */ border-inline-start-width: 5px; border-inline-start-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-...
...'> values */ border-inline-start-width: 5px; border-inline-start-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
...And 2 more matches
border-left-width - CSS: Cascading Style Sheets
the border-left-width css property sets the width of the left border of an 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. syntax /* keyword values */ border-left-width: thin; border-left-width: medium; border-left-width: thick; /* <length> values */ border-left-width: 10em; border-left-width: 3vmax; border-left-width: 6px; /* global keywords */ border-left-width: inherit; border-left-width: initial; border-left-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword. if it's a keyword, it must be one of the following values: ...
...ne of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal definition initial valuemediumapplies toall elements. ...
...ementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal definition initial valuemediumapplies toall elements. ...
...And 2 more matches
border-right-width - CSS: Cascading Style Sheets
the border-right-width css property sets the width of the right border of an 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. syntax /* keyword values */ border-right-width: thin; border-right-width: medium; border-right-width: thick; /* <length> values */ border-right-width: 10em; border-right-width: 3vmax; border-right-width: 6px; /* global keywords */ border-right-width: inherit; border-right-width: initial; border-right-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword. if it's a keyword, it must be one of the following valu...
...e of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal definition initial valuemediumapplies toall elements. ...
...mentation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal definition initial valuemediumapplies toall elements. ...
...And 2 more matches
border-top-width - CSS: Cascading Style Sheets
the border-top-width css property sets the width of the top border of an 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. syntax /* keyword values */ border-top-width: thin; border-top-width: medium; border-top-width: thick; /* <length> values */ border-top-width: 10em; border-top-width: 3vmax; border-top-width: 6px; /* global keywords */ border-top-width: inherit; border-top-width: initial; border-top-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword. if it's a keyword, it must be one of the following values: thin ...
...one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal definition initial valuemediumapplies toall elements. ...
...lementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal definition initial valuemediumapplies toall elements. ...
...And 2 more matches
markerWidth - SVG: Scalable Vector Graphics
a value of zero disables rendering of the element and negative values are an error. ...
... a value of zero disables rendering of the element and negative values are an error. ...
...is to be fitted when it is rendered according to the viewbox and preserveaspectratio attributes. only one element is using this attribute: <marker> usage notes value <length-percentage> | <number> default value 3 animatable yes <length-percentage> this value defines either an absolute or a relative width of the marker. ...
...And 2 more matches
-webkit-text-stroke-width - CSS: Cascading Style Sheets
the -webkit-text-stroke-width css property specifies the width of the stroke for text. syntax /* keyword values */ -webkit-text-stroke-width: thin; -webkit-text-stroke-width: medium; -webkit-text-stroke-width: thick; /* <length> values */ -webkit-text-stroke-width: 2px; -webkit-text-stroke-width: 0.1em; -webkit-text-stroke-width: 1mm; -webkit-text-stroke-width: 5pt; /* global values */ -webkit-text-stroke-width: inherit; -webkit-text-stroke-width: initial; -webkit-text-stroke-width: unset; values <line-width> the width of the stroke. ...
...oke-width: 1mm; -webkit-text-stroke-width: 5pt; /* global values */ -webkit-text-stroke-width: inherit; -webkit-text-stroke-width: initial; -webkit-text-stroke-width: unset; values <line-width> the width of the stroke. ...
...xt-stroke-width: initial; -webkit-text-stroke-width: unset; values <line-width> the width of the stroke. formal definition initial value0applies toall elementsinheritedyescomputed valueabsolute <length>animation typediscrete formal syntax <length> examples varying stroke widths css p { margin: 0; font-size: 4em; -webkit-text-stroke-color: red; } #thin { -webkit-text-stroke-width: thin; } #medium { -webkit-text-stroke-width: 3px; } #thick { -webkit-text-stroke-width: 1.5mm; } html <p id="thin">thin stroke</p> <p id="medium">medium stroke</p> <p id="thick">thick stroke</p> results specifications specification status comment compatibility standardthe definition of '-webkit-text-stroke-width' in that specification. living standar...
...roke-width: 1.5mm; } html <p id="thin">thin stroke</p> <p id="medium">medium stroke</p> <p id="thick">thick stroke</p> results specifications specification status comment compatibility standardthe definition of '-webkit-text-stroke-width' in that specification. living standard initial standardization safari css reference '-webkit-text-stroke-width' in that document. non-standard unofficial documentation initial documentation ...
width - CSS: Cascading Style Sheets
Web › CSS › @media › width
the width css media feature can be used to test the width of the viewport (or the page box, for paged media). syntax the width feature is specified as a <length> value representing the viewport width. it is a range feature, meaning that you can also use the prefixed min-width and max-width variants to query minimum and maximum values, respectively. ...
...ure can be used to test the width of the viewport (or the page box, for paged media). syntax the width feature is specified as a <length> value representing the viewport width. it is a range feature, meaning that you can also use the prefixed min-width and max-width variants to query minimum and maximum values, respectively. ...
...width of the viewport (or the page box, for paged media). syntax the width feature is specified as a <length> value representing the viewport width. it is a range feature, meaning that you can also use the prefixed min-width and max-width variants to query minimum and maximum values, respectively. examples html <div>watch this element as you resize your viewport's width.</div> css /* exact width */ @media (width: 360px) { div { color: red; } } /* minimum width */ @media (min-width: 35rem) { div { background: yellow; } } /* maximum width */ @media (max-width: 50rem) { div { border: 2px solid blue; } } result specifications specification status comment media queries level 4the definition of 'width' in that specification. candid...
... recommendation initial definition. ...
max-width - CSS: Cascading Style Sheets
the max-width css descriptor specifies the maximum width of the viewport of a document defined via the @viewport at-rule. by default, the width is set as close as possible to the initial viewport considering the maximum width constraint. syntax /* keyword value */ max-width: auto; /* <length> values */ max-width: 600px; max-width: 80em; max-width: 15cm; /* <percentage> value */ max-width: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width of the initial viewport at zoom factor 1.0 for horizontal lengths. must be non-negative. ...
...> value */ max-width: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width of the initial viewport at zoom factor 1.0 for horizontal lengths. must be non-negative. ...
... working draft initial definition ...
...percentagesrefer to the width of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport max width in pixels @viewport { max-width: 600px; } specifications specification status comment css device adaptationthe definition of '"max-width" descriptor' in that specification. working draft initial definition ...
min-width - CSS: Cascading Style Sheets
the min-width css descriptor specifies the minimum width of the viewport of a document defined via @viewport. by default, min-width is set as close as possible to the initial viewport considering the minimum width constraint. syntax /* keyword value */ min-width: auto; /* <length> values */ min-width: 320px; min-width: 40em; min-width: 5cm; /* <percentage> value */ min-width: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
... auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
... working draft initial definition ...
...opercentagesrefer to the width of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport min width in pixels @viewport { min-width: 200px; } specifications specification status comment css device adaptationthe definition of '"min-width" descriptor' in that specification. working draft initial definition ...
border-inline-width - CSS: Cascading Style Sheets
the border-inline-width css property defines the width of the logical inline borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top-width and border-bottom-width, or border-left-width, and border-right-width property depending on the values defined for writing-mode, direction, and text-orientation. /* <'border-width'> values */ border-inline-width: 5px 10px; border-inline-width: 5px; border-inline-width: thick; the border width in the other dimension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width. syntax values <'border-width'> the width of the border. see border-width. formal definition initial valuemediumapplies...
...border-inline-width: 5px 10px; border-inline-width: 5px; border-inline-width: thick; the border width in the other dimension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...er-block-width, which sets border-block-start-width, and border-block-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...idth of the border. see border-width. formal definition initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typediscrete formal syntax <'border-top-width'> 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: 1px solid blue; border-inline-width: 5px 10px; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-width' in that specification. editor's draft initial definition ...
width - Archive of obsolete content
« xul reference home width type: string (representing an integer) the preferred width of the element. the value should not include a unit as all values are in pixels. the actual displayed 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. ...
...actual displayed 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. <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. ...
...ner hbox will be displayed 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. ...
CanvasRenderingContext2D.lineWidth - Web APIs
the canvasrenderingcontext2d.linewidth property of the canvas 2d api sets the thickness of lines. note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods. syntax ctx.linewidth = value; options value a number specifying the line width, in coordinate space units. zero, negative, infinity, and nan values are ignored. this value is 1.0 by default. examples changing line width this example draws a line and a rectangle, using a line width of 15 units. ...
...number specifying the line width, in coordinate space units. zero, negative, infinity, and nan values are ignored. this value is 1.0 by default. examples changing line width this example draws a line and a rectangle, using a line width of 15 units. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.linewidth = 15; ctx.beginpath(); ctx.moveto(20, 20); ctx.lineto(130, 130); ctx.rect(40, 40, 70, 70); ctx.stroke(); result more examples for more examples and explanation about this property, see applying styles and color in the canvas tutorial. ...
...d'); ctx.linewidth = 15; ctx.beginpath(); ctx.moveto(20, 20); ctx.lineto(130, 130); ctx.rect(40, 40, 70, 70); ctx.stroke(); result more examples for more examples and explanation about this property, see applying styles and color in the canvas tutorial. specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.linewidth' in that specification. living standard ...
HTMLVideoElement.videoWidth - Web APIs
the htmlvideoelement interface's read-only videowidth property indicates the intrinsic width of the video, expressed in css pixels. in simple terms, this is the width of the media in its natural size. see about intrinsic width and height for more details. syntax width = htmlvideoelement.videowidth; value an integer value specifying the intrinsic width of the video in css pixels. if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available. about intrinsic width and height a user agent calculates the intrinsic width and height of the element's media by starting with the media's raw pixel width and height, then taking into account factors including: the media's aspect ratio. ...
...eo> element. this can happen when the element switches from displaying the poster frame to displaying video content, or when the displayed video track changes. example this example creates a handler for the resize event that resizes the <video> element to match the intrinsic size of its contents. let v = document.getelementbyid("myvideo"); v.addeventlistener("resize", ev => { let w = v.videowidth; let h = v.videoheight; if (w && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero. this avoids applying invalid changes when there's no true information available yet for dimensions. specifications specification status comment html living standardthe de...
... && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero. this avoids applying invalid changes when there's no true information available yet for dimensions. specifications specification status comment html living standardthe definition of 'htmlvideoelement.videowidth' in that specification. living standard html5the definition of 'htmlvideoelement.videowidth' in that specification. recommendation initial definition. ...
imageWidth - Web APIs
working draft initial definition. 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. ...
... working draft initial definition. 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. ...
...tion. 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. ...
PointerEvent.width - Web APIs
the width read-only property of the pointerevent interface represents the width of the pointer's contact geometry along the x-axis, measured in css pixels. depending on the source of the pointer device (such as a finger), for a given pointer, each event may produce a different value. if the input hardware cannot report the contact geometry to the browser, the width defaults to 1. syntax var contactwidth = pointerevent.width; return value contactwidth the width of the event's contact area (in css pixels). example this example illustrates using the pointerevent interface's width and height properties to calculate the contact area. ...
... obsolete initial definition. ...
... (in css pixels). example this example illustrates using the pointerevent interface's width and height properties to calculate the contact area. target.addeventlistener("pointerdown", function(ev) { // calculate the contact area var area = ev.width * ev.height; }, false); specifications specification status comment pointer events – level 2the definition of 'width' in that specification. recommendation non-stable version. pointer eventsthe definition of 'width' in that specification. obsolete initial definition. ...
WebGLRenderingContext.lineWidth() - Web APIs
the webglrenderingcontext.linewidth() method of the webgl api sets the line width of rasterized lines. the webgl spec, based on the opengl es 2.0/3.0 specs points out that the minimum and maximum width for a line is implementation defined. the maximum minimum width is allowed to be 1.0. the minimum maximum width is also allowed to be 1.0. because of these implementation defined limits it is not recommended to use line widths other than 1.0 since there is no guarantee any user's browser will display any other width. as of january 2017 most implementations of webgl only support a minimum of 1 and a maximum of 1 as the technology they are based on has these same limits. syntax void gl.linewidth(width); parameters width a glfloat specifying the width of rasterized lines. default value:...
...is no guarantee any user's browser will display any other width. as of january 2017 most implementations of webgl only support a minimum of 1 and a maximum of 1 as the technology they are based on has these same limits. syntax void gl.linewidth(width); parameters width a glfloat specifying the width of rasterized lines. default value: 1. return value none. examples setting the line width: gl.linewidth(5); getting the line width: gl.getparameter(gl.line_width); getting the range of available widths. returns a float32array. gl.getparameter(gl.aliased_line_width_range); specifications specification status comment webgl 1.0the definition of 'linewidth' in that specification. recommendation initial definition. opengl es 2.0the definition o...
... standard man page of the opengl api. ...
XRWebGLLayer.framebufferWidth - Web APIs
the read-only xrwebgllayer property framebufferwidth specifies the width of the framebuffer, in pixels. you can get the height of the framebuffer using the framebufferheight property. syntax let bufferwidth = xrwebgllayer.framebufferwidth; value the width in pixels of the xr device's framebuffer. each of the framebuffer's attachments (pixel, depth, color, and/or stencil buffers, for example) are all this many pixels wide. examples this snippet simply fetches the framebuffer's width and height for later use. ...
... working draft initial definition. ...
...th in pixels of the xr device's framebuffer. each of the framebuffer's attachments (pixel, depth, color, and/or stencil buffers, for example) are all this many pixels wide. examples this snippet simply fetches the framebuffer's width and height for later use. let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); framewidth = gllayer.framebufferwidth; frameheight = gllayer.framebufferheight; specifications specification status comment webxr device apithe definition of 'xrwebgllayer.framebufferwidth' in that specification. working draft initial definition. ...
column-rule-width - CSS: Cascading Style Sheets
the column-rule-width css property sets the width 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. syntax /* keyword values */ column-rule-width: thin; column-rule-width: medium; column-rule-width: thick; /* <length> values */ column-rule-width: 1px; column-rule-width: 2.5em; /* global values */ column-rule-width: inherit; column-rule-width: initial; column-rule-width: unset; the column-rule-width property is specified as a single <'border-width'> value. values <'border-width'> is a keyword defined by border-width describing the width of the rule. i...
...order-width'> value. values <'border-width'> is a keyword defined by border-width describing the width of the rule. it may be either a <length> or one of the thin, medium, or thick keywords. formal definition initial valuemediumapplies tomulticol elementsinheritednocomputed valuethe absolute length; 0 if the column-rule-style is none or hiddenanimation typea length formal syntax <'border-width'> examples setting a thick column rule html <p>this is a bunch of text split into three columns. the `column-rule-width` property is used to change the width of the line that is drawn between columns. ...
...style is none or hiddenanimation typea length formal syntax <'border-width'> examples setting a thick column rule html <p>this is a bunch of text split into three columns. the `column-rule-width` property is used to change the width of the line that is drawn between columns. don't you think that's wonderful?</p> css p { column-count: 3; column-rule-style: solid; column-rule-width: thick; } result specifications specification status comment css multi-column layout modulethe definition of 'column-rule-width' in that specification. working draft initial definition. ...
minWidth - Archive of obsolete content
...
... ...
width - Archive of obsolete content
Archive › Mozilla › XUL › Property › width
...
... ...
Bandwidth - MDN Web Docs Glossary: Definitions of Web-related terms
bandwidth is the measure of how much information can pass through a data connection in a given amount of time. it is usually measured in multiples of bits-per-second (bps), for example megabits-per-second (mbps) or gigabits-per-second (gbps). ...
... bandwidth is the measure of how much information can pass through a data connection in a given amount of time. it is usually measured in multiples of bits-per-second (bps), for example megabits-per-second (mbps) or gigabits-per-second (gbps). ...
Element.clientWidth - Web APIs
the element.clientwidth property is zero for inline elements and elements with no css; otherwise, it's the inner width of an element in pixels. it includes padding but excludes borders, margins, and vertical scrollbars (if present). when clientwidth is used on the root element (the <html> element), (or on <body> if the document is in quirks mode), the viewport's width (excluding any scrollbar) is returned. this is a special case of clientwidth. note: this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). syntax var intelemclientwidth = element.clientwidth; intelemclientwidth is an integer corresponding to the clientwidth of element in pixels. the clientwidth property is read–only. example specification speci...
...if you need a fractional value, use element.getboundingclientrect(). syntax var intelemclientwidth = element.clientwidth; intelemclientwidth is an integer corresponding to the clientwidth of element in pixels. the clientwidth property is read–only. example specification specification status comment css object model (cssom) view modulethe definition of 'clientwidth' in that specification. working draft notes clientwidth was first introduced in the ms ie dhtml object model. ...
HTMLTableElement.width - Web APIs
the htmltableelement.width property represents the desired width of the table. syntax htmltableelement.width = width; var width = htmltableelement.width; where width is a string representing the width in number of pixels or as a percentage value. ...
... the htmltableelement.width property represents the desired width of the table. syntax htmltableelement.width = width; var width = htmltableelement.width; where width is a string representing the width in number of pixels or as a percentage value. ...
MediaTrackConstraints.width - Web APIs
the mediatrackconstraints dictionary's width property is a constrainlong describing the requested or mandatory constraints placed upon the value of the width constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.width as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { width: constraint }; constraintsobject.width = constraint; value if this value is a number, the user agent will attempt to obtain media whose width is as close as possible to this number given the capabilities of the hardware and the other constraints specified. other...
...ct = { width: constraint }; constraintsobject.width = constraint; value if this value is a number, the user agent will attempt to obtain media whose width is as close as possible to this number given the capabilities of the hardware and the other constraints specified. otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required width (if exact is specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'width' in that specification. candidate recommendation initial...
MediaTrackSettings.width - Web APIs
the mediatracksettings dictionary's width property is an integer indicating the number of pixels wide mediastreamtrack is currently configured to be. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.width property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.width as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...n calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.width as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var width = mediatracksettings.width; value an integer value indicating the width, in pixels, of the video track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'width' in that specification. candidate reco...
MediaTrackSupportedConstraints.width - Web APIs
the mediatracksupportedconstraints dictionary's width property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the width constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax widthconstraintsupported = supportedconstraintsdictionary.width; value this property is present in the dictionary (and its value is always true) if the user agent supports the width constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you ...
...straint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().width) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'width' in that specification. candidate recommendation initial specification. ...
Screen.width - Web APIs
Web › API › Screen › width
returns the width of the screen. syntax lwidth = window.screen.width example // crude way to check that the screen is at least 1024x768 if (window.screen.width >= 1024 && window.screen.height >= 768) { // resolution is 1024x768 or above } notes note that not all of the width given by this property may be available to the window itself. when other widgets occupy space that cannot be used by the window object, there is a difference in window.screen.width and window.screen.availwidth. see also screen.height. internet explorer will take into account the zoom setting when reporting the screen width. it will only return the real width of the screen if the zoom is set to 100%. specification specification status comment css object model (cssom) view modulethe d...
...re is a difference in window.screen.width and window.screen.availwidth. see also screen.height. internet explorer will take into account the zoom setting when reporting the screen width. it will only return the real width of the screen if the zoom is set to 100%. specification specification status comment css object model (cssom) view modulethe definition of 'screen.width' in that specification. working draft initial definition. ...
widths - SVG: Scalable Vector Graphics
Web › SVG › Attribute › widths
the widths attribute indicates a list of range values, each followed by one or more glyph widths. only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value is a comma-separated list of ucs range values as defined in iso 10646, each followed by one or more glyph widths. if this attribute is used, the units-per-em attribute must also be used. if the range is omitted, a range of u+0-7fffffff is assumed which covers all characters and their glyphs. if not enough glyph widths are given, the last in the list is replicated to cover that range. if too many widths are provided, the extras are ignored. specifications specification status comment ...
...he range is omitted, a range of u+0-7fffffff is assumed which covers all characters and their glyphs. if not enough glyph widths are given, the last in the list is replicated to cover that range. if too many widths are provided, the extras are ignored. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'widths' in that specification. recommendation initial definition ...
maxwidth - Archive of obsolete content
« xul reference home maxwidth type: string (representing an integer) the maximum width of the element. this corresponds to the max-width css property. ...
minwidth - Archive of obsolete content
« xul reference home minwidth type: string (representing an integer) the minimum width of the element. this corresponds to the min-width css property. ...
treecol.width - Archive of obsolete content
« xul reference home width type: string (representing an integer) the preferred width of the tree column. the value should not include a unit as all values are in pixels. specifying widths for your columns causes gecko to allow the tree to be scrolled horizontally if it is wider than the available space. ...
maxWidth - Archive of obsolete content
« xul reference maxwidth type: integer gets and sets the value of the maxwidth attribute. note: prior to gecko 6.0, you could use this on <input> elements; this was never intended, was a violation of the html specification, and has been fixed. use the size to set the maximum width of input fields. ...
ImageBitmap.width - Web APIs
Web › API › ImageBitmap › width
specifications specification status comment html living standardthe definition of 'imagebitmap.height' in that specification. ...
ImageData.width - Web APIs
Web › API › ImageData › width
the readonly imagedata.width property returns the number of pixels per row in the imagedata object. syntax imagedata.width example this example creates an imagedata object that is 200 pixels wide and 100 pixels tall. thus, the width property is 200. let imagedata = new imagedata(200, 100); console.log(imagedata.width); // 200 specification specification status comment html living standardthe definition of 'imagedata.width' in that specification. living standard initial definition. ...
OffscreenCanvas.width - Web APIs
the width property returns and sets the width of an offscreencanvas object. syntax var pxl = offscreen.width; offscreen.width = pxl; examples creating a new offscreen canvas and returning or setting the width of the offscreen canvas: var offscreen = new offscreencanvas(256, 256); offscreen.width; // 256 offscreen.width = 512; specifications specification status comment html living standardthe definition of 'offscreencanvas.width' in that specification. living standard ...
Screen.availWidth - Web APIs
Web › API › Screen › availWidth
the screen.availwidth property returns the amount of horizontal space (in pixels) available to the window. syntax var width = window.screen.availwidth example var screenavailwidth = window.screen.availwidth; console.log(screenavailwidth); specifications specification status comment css object model (cssom) view modulethe definition of 'screen.availwidth' in that specification. working draft initial definition ...
TextMetrics.width - Web APIs
Web › API › TextMetrics › width
the read-only width property of the textmetrics interface contains the text's advance width (the width of that inline box) in css pixels. examples given this <canvas> element: <canvas id="canvas"></canvas> ... you can get a textmetrics object using the following code: const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let text = ctx.measuretext('foo'); // textmetrics object text.width; // 16; specifications specification html living standardthe definition of 'textmetrics.width' in that specification. ...
WebGLRenderingContext.drawingBufferWidth - Web APIs
the read-only webglrenderingcontext.drawingbufferwidth property represents the actual width of the current drawing buffer. it should match the width attribute of the <canvas> element associated with this context, but might differ if the implementation is not able to provide the requested width. syntax gl.drawingbufferwidth; examples given this <canvas> element: <canvas id="canvas"></canvas> you can get the width of the drawing buffer with the following lines: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.drawingbufferwidth; // 300 specifications specification status comment webgl 1.0the definition of 'webglrenderingcontext.drawingbufferwidth' in that specification. recommendation initial definition. ...
Window.outerWidth - Web APIs
Web › API › Window › outerWidth
window.outerwidth read-only property returns the width of the outside of the browser window. it represents the width of the whole browser window including sidebar (if expanded), window chrome and window resizing borders/handles. notes to change the size of a window, see window.resizeby() and window.resizeto(). to get the inner width of a window, i.e. the width of the page being displayed, see window.innerwidth. specification specification status comment css object model (cssom) view modulethe definition of 'window.outerwidth' in that specification. working draft initial definition. ...
XRViewport.width - Web APIs
Web › API › XRViewport › width
the read-only xrviewport property width specifies the width of the viewport, in pixels, onto the drawing surface the 3d scene is to be rendered into. this is defined using this property along with the viewport's height and its origin given by its properties x and y. syntax width = xrviewport.width; value the viewport's width in pixels. examples see the main xrviewport page for examples. specifications specification status comment webxr device apithe definition of 'xrviewport.width' in that specification. working draft initial definition. ...
Index - Web APIs
Web › API › Index
ly loading font resources. 393 css object model (cssom) api, cssom, overview, reference 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. 394 determining the dimensions of elements api, cssom view, client width, guide, intermediate, client height, offsetheight, offsetwidth, size of displayed content there are several properties you can look at in order to determine the width and height of elements, and it can be tricky to determine which is the right one for your needs. this article is designed to help you make that decision. note that all these properties are read-only. if you want to set the wid...
... 395 managing screen orientation api, advanced, cssom view, guide, screen orientation screen orientation is something slightly different than device orientation. ...
... 395 managing screen orientation api, advanced, cssom view, guide, screen orientation screen orientation is something slightly different than device orientation. ...
...And 56 more matches
filter - CSS: Cascading Style Sheets
Web › CSS › filter
-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td> <div class="svg-container"> <svg id="img3" overflow="visible" viewbox="0 0 212 161" color-interpolation-filters="srgb"> <filter id="svgblur" x="-5%" y="-5%" width="110%" height="110%"> <fegaussia...
... <td> <div class="svg-container"> <svg id="img3" overflow="visible" viewbox="0 0 212 161" color-interpolation-filters="srgb"> <filter id="svgblur" x="-5%" y="-5%" width="110%" height="110%"> <fegaussianblur in="sourcegraphic" stddeviation="3.5"/> </filter> <image xlink:href="/files/3710/test_form_2.jpeg" filter="url(#svgblur)" width="212px" height="161px"/> </svg> </div> </td> <td><img alt="test_form_s.jpg" id="img4" class="internal default" src="/files/3711/test_form_2_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande", "lucida sans unicode", "dejavu sans", lucida, arial, helvetica, sans-serif; color: rgb(51, 51...
...div> </td> <td><img alt="test_form_s.jpg" id="img4" class="internal default" src="/files/3711/test_form_2_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande", "lucida sans unicode", "dejavu sans", lucida, arial, helvetica, sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -webkit-filter:blur(5px); -ms-filter:blur(5px); filter:blur(5px); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0; margin: 0 0 1.286em; height: 100%; width: 85%; } table.standard-table th { border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 23...
...And 44 more matches
Legacy layout methods - Learn web development
idiculus mus.</p> </div> each one of the columns needs an outer element to contain its content and let us manipulate all of it at once. in this example case we've chosen <div>s, but you could choose something more semantically appropriate like <article>s, <section>s, and <aside>, or whatever. now for the css. ...
...</div> each one of the columns needs an outer element to contain its content and let us manipulate all of it at once. in this example case we've chosen <div>s, but you could choose something more semantically appropriate like <article>s, <section>s, and <aside>, or whatever. now for the css. ...
...hosen <div>s, but you could choose something more semantically appropriate like <article>s, <section>s, and <aside>, or whatever. now for the css. first, of all, apply the following to your html to provide some basic setup: body { width: 90%; max-width: 900px; margin: 0 auto; } the body will be 90% of the viewport wide until it gets to 900px wide, in which case it will stay fixed at this width and center itself in the viewport. by default, its children (the <h1> and the two <div>s) will span 100% of the width of the body. ...
...And 43 more matches
Border-image generator - CSS: Cascading Style Sheets
<!-- border-image-slice --> <div id="border-slice-control" class="category"> <div class="title"> border-image-slice </div> <div class="property"> <div class="name">fill</div> <div class="ui-checkbox" data-topic='slice-fill'></div> </div> </div> <!-- border-image-width --> <div id="border-width-control" class="category"> <div class="title"> border-image-width </div> </div> <!-- border-image-outset --> <div id="border-outset-control" class="category"> <div class="title"> border-image-outset </div> </div> <!-- other-settings --> <div id="aditional...
... </div> </div> <div class="property"> <div class="ui-input-slider" data-topic="font-size" data-info="em size" data-unit="px" data-value="12" data-sensivity="3"> </div> </div> <div class="property"> <div class="ui-input-slider" data-topic="preview-width" data-info="width" data-unit=" px" data-min="10" data-max="10000" data-sensivity="3"></div> </div> <div class="property"> <div class="ui-input-slider" data-topic="preview-height" data-info="height" data-unit=" px" data-min="10" data-max="10000" data-sensivity="3"> </div> ...
... <div id="output" class="category"> <div class="title"> css code </div> <div class="css-property"> <span class="name"> border-image-slice: </span> <span id="out-border-slice" class="value"> </span> </div> <div class="css-property"> <span class="name"> border-image-width: </span> <span id="out-border-width" class="value"> </span> </div> <div class="css-property"> <span class="name"> border-image-outset: </span> <span id="out-border-outset" class="value"> </span> </div> <div class="css-property"> <span class="name"> border...
...And 41 more matches
MathML Torture Test
n value="texgyreschola">tex gyre schola</option> <option value="texgyretermes">tex gyre termes</option> <option value="xits">xits</option> </select> <br/> </p> <table> <tr> <td></td> <th scope="col">as rendered by tex</th> <th scope="col">as rendered by your browser</th></tr> <tr> <td>1</td> <td><img src="https://udn.realityripple.com/samples/45/d5a0dbbca3.png" width="38" height="22" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </math> </td></tr> <tr> <td>2</td> <td><img src="https://udn.realityripple.com/samples/...
... alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </math> </td></tr> <tr> <td>2</td> <td><img src="https://udn.realityripple.com/samples/b8/da4a50ea34.png" width="30" height="17" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <!-- <mrow> <msub><mi></mi><mn>2</mn></msub> <msub><mi>f</mi><mn>3</mn></msub> </mrow> --> <mrow> <mmultiscripts> <mi>f</mi> <mn>3</mn><none/> <mprescripts/> <mn>2</mn><none...
... <msub><mi>f</mi><mn>3</mn></msub> </mrow> --> <mrow> <mmultiscripts> <mi>f</mi> <mn>3</mn><none/> <mprescripts/> <mn>2</mn><none/> </mmultiscripts> </mrow> </math> </td></tr> <tr> <td>3</td> <td><img src="https://udn.realityripple.com/samples/8a/1d0e6e073c.png" width="58" height="47" alt="texbook, 17-17.1" /></td> <td> <math display="block"> <mrow> <mfrac> <mrow> <mi>x</mi> <mo>+</mo> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> <mrow> <mi>k</mi> <mo>+</mo> <mn>1</mn> ...
...And 38 more matches
Using CSS transitions - CSS: Cascading Style Sheets
ccur instantaneously as usual. transition-duration specifies the duration over which transitions should occur. you can specify a single duration that applies to all properties during the transition, or multiple values to allow each property to transition over a different period of time. ...
...on-duration specifies the duration over which transitions should occur. you can specify a single duration that applies to all properties during the transition, or multiple values to allow each property to transition over a different period of time. ...
...ltiple values to allow each property to transition over a different period of time. ...
...And 38 more matches
Box-shadow generator - CSS: Cascading Style Sheets
60" data-max="360" data-step="1" data-value="0"> </div> <div class="ui-slider-btn-set" data-topic="rotate" data-type="add"></div> <div class="ui-slider-input" data-topic="rotate" data-unit="deg"></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> width </div> <div class="ui-slider-btn-set" data-topic="width" data-type="sub"></div> <div class="ui-slider" data-topic="width" data-min="0" data-max="1000" data-step="1" data-value="200"> </div> <div class="ui-slider-btn-set" data-topic="width" data-type="add"></div> ...
...-btn-set" data-topic="width" data-type="sub"></div> <div class="ui-slider" data-topic="width" data-min="0" data-max="1000" data-step="1" data-value="200"> </div> <div class="ui-slider-btn-set" data-topic="width" data-type="add"></div> <div class="ui-slider-input" data-topic="width" data-unit="px"></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> height </div> <div class="ui-slider-btn-set" data-topic="height" data-type="sub"></div> <div class="ui-slider" data-topic="height" data-min="0" data-max="400" data-step="1" ...
... </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=[&quot;&quot;] position=[absolute] width height top left z-index background-color box-shadow transform -webkit-transform -ms-transform"> </div> <...
...And 37 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
t-axes"></div> <div id="gradient-order"></div> </div> </div> </div> <div id="output"> <div class="css-property"> <span class="property">background:</span> <span class="value"></span> </div> </div> </div> css content /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: defau...
... hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -ms-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -o-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -o-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background-color: #f00; } .ui-color-picker .picker { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1px solid #fff; position: absolute; top: 45%; left: 45%; } .ui-color-picker .picker:before { width: 8px; height: 8px; content: ""; position: absolute; border: 1px solid #999; border-radius: 50%; } .ui-color-picker .hue, .ui-color-picker .alpha { width: 198px; height: 28px; margin: 5px; border: 1px solid #ff...
..., #f00 100%); background: -ms-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -o-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); } .ui-color-picker .alpha { border: 1px solid #ccc; background: url("images/alpha_mask.png"); } .ui-color-picker .slider-picker { width: 2px; height: 100%; margin: 0 0 0 -2px; border: 1px solid #777; background-color: #fff; position: relative; top: -1px; } /* input hsv and rgb */ .ui-color-picker .info { width: 200px; margin: 5px; float: left; } .ui-color-picker .info * { float: left; } .ui-color-picker .input { width: 64px; margin: 5px 2px; float: left; } .ui-color-picker .input .name { height: 20px; width: 3...
...And 37 more matches
Color picker tool - CSS: Cascading Style Sheets
v> </div> <div id="void-sample" class="icon"></div> </div> </div> <div id="canvas" data-tutorial="drop"> <div id="zindex" class="ui-input-slider" data-topic="z-index" data-info="z-index" data-max="20" data-sensivity="10"></div> </div> </div> css /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: defau...
... hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -ms-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -o-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -o-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background-color: #f00; } .ui-color-picker .picker { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff; position: absolute; top: 45%; left: 45%; } .ui-color-picker .picker:before { width: 8px; height: 8px; content: ""; position: absolute; border: 1px solid #999; border-radius: 50%; } .ui-color-picker .hue, .ui-color-picker .alpha { width: 198px; height: 28px; margin: 5px; border: 1px solid #fff; float: left; } .ui-...
...: -ms-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); background: -o-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); } .ui-color-picker .alpha { border: 1px solid #ccc; background: url("https://mdn.mozillademos.org/files/5705/alpha.png"); } .ui-color-picker .alpha-mask { width: 100%; height: 100%; background: url("https://mdn.mozillademos.org/files/6089/alpha_mask.png"); } .ui-color-picker .slider-picker { width: 2px; height: 100%; border: 1px solid #777; background-color: #fff; position: relative; top: -1px; } /* input hsv and rgb */ .ui-color-picker .info { width: 200px; margin: 5px; float: left; } .ui-color-picker .info * { float: left; } .ui-color-...
...And 34 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
more about responsive design advantages and disadvantages. you can also read our discussion on the basics of responsive design, if you need some more background information and basics. fluid grids the best place to start is with fluid measurements for our application layout — essentially, this means using a combination of percentages and ems/rems to size your containers and text, not fixed widths such as pixels. this has a lot of advantages in that the layout will adapt to different viewport dimensions. let's look at an example. we've written a simple-but-fun prototype for an application called snapshot, which takes a video stream from your webcam (using getusermedia()) then allows you to capture stills from that video stream (using html5 <canvas>), and save them to a gallery. you can t...
...> … </x-card> <x-card> … </x-card> <x-card> … </x-card> </x-deck> note: these weird x- elements may be unfamiliar; they are part of brick, mozilla's ui element library for mobile web apps. we have used brick to create the mobile layout for snapshot, which you will read more about below. to get these sitting side-by-side we have used the following rules: x-card { width: 100%; } x-card:nth-child(1), x-card:nth-child(2) { width: 30%; float: left; padding: 2rem; } x-card:nth-child(3) { width: 40%; float: left; height: 100%; overflow: auto; padding: 2rem; } so we're giving the first two columns a width of 30%, and the third a width of 40%, floating the columns all left. this way they end up side-by-side, and their proportions remain the same as t...
...m; } so we're giving the first two columns a width of 30%, and the third a width of 40%, floating the columns all left. this way they end up side-by-side, and their proportions remain the same as the browser window size varies. this is just a simple grid example, but you can apply this principle to more complex grid layouts as required. ...
...And 33 more matches
Debugging Table Reflow
.cpp. it can be invoked by set gecko_block_debug_flags=reflow the available options are: reflow really-noisy-reflow max-element-size space-manager verify-lines damage-repair lame-paint-metrics lame-reflow-metrics disable-resize-opt these options can be combined with a comma separated list messages generated by the reflow switch: block(div)(1)@00be5ac4: reflowing dirty lines computedwidth=9000 computedheight=1500 this message is generated inside of nsresult nsblockframe::reflowdirtylines(nsblockreflowstate& astate) it first shows the block id and address and then the computed width and height from the htmlreflowstate. debug_table_strategy editor's note: the following examples are not shown correctly due to the wiki's technical constraint. the table layout strategy can be...
...hows the block id and address and then the computed width and height from the htmlreflowstate. debug_table_strategy editor's note: the following examples are not shown correctly due to the wiki's technical constraint. ...
...the computed width and height from the htmlreflowstate. debug_table_strategy editor's note: the following examples are not shown correctly due to the wiki's technical constraint. ...
...And 30 more matches
Applying styles and colors - Web APIs
looks like the color palettes photoshop uses. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); for (var i = 0; i < 6; i++) { for (var j = 0; j < 6; j++) { ctx.fillstyle = 'rgb(' + math.floor(255 - 42.5 * i) + ', ' + math.floor(255 - 42.5 * j) + ', 0)'; ctx.fillrect(j * 25, i * 25, 25, 25); } } } <canvas id="canvas" width="150" height="150"></canvas> draw(); the result looks like this: screenshotlive sample a strokestyle example this example is similar to the one above, but uses the strokestyle property to change the colors of the shapes' outlines. we use the arc() method to draw circles instead of squares. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); for (var i ...
...this is done by either setting the globalalpha property or by assigning a semi-transparent color to the stroke and/or fill style. globalalpha = transparencyvalue applies the spec...
...using rgba() gives you a little more control and flexibility because we can set the fill and stroke style individually. function draw() { ...
...And 29 more matches
requiredFeatures - SVG: Scalable Vector Graphics
le>, <clippath>, <cursor>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <use> html, body, svg { height: 100%; } text { fill: white; } <svg viewbox="0 0 250 45" xmlns="http://www.w3.org/2000/svg"> <g> <rect fill="forestgreen" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures supported</text> </g> <g requiredfeatures=""> <rect fill="crimson" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures not supported</text> </g> </svg> usage notes value <list-of-features> default value true if not defined, false if null or empty string as value animatab...
...t>, <tspan>, <tref>, <textpath>, <altglyph>, <altglyphdef>, <altglyphitem> and <glyphref> elements. ...
...color, fill, fill-rule, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-width, color-interpolation and color-rendering attributes http://www.w3.org/tr/svg11/feature#basicpaintattribute the browser supports the color, fill, fill-rule, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-width and color-rendering attributes http://www.w3.org/tr/svg11/feature#opacityattribute the browser supports the opacity, stroke-opacity and fill-opacity attributes http://www.w3.org/tr/svg11/feature#graphicsattribute the browser supports the display, image-rendering, pointer-events, shape-rendering, text-rendering and visibility attributes http://www.w3.org/tr/svg11/feature#basicgraphi...
...And 27 more matches
Using CSS gradients - CSS: Cascading Style Sheets
ove on to radial, conic and repeating gradients using linear gradients a linear gradient creates a band of colors that progress in a straight line. a basic linear gradient to create the most basic type of gradient, all you need is to specify two colors. these are called color stops. you must have at least two, but you can have as many as you want. ...
.... you must have at least two, but you can have as many as you want. <div class="simple-linear"></div> div { width: 120px; height: 120px; } .simple-linear { background: linear-gradient(blue, pink); } changing the direction by default, linear gradients run from top to bottom. you can change their rotation by specifying a direction. <div class="horizontal-gradient"></div> div { width: 120px; height: 120px; } .horizontal-gradient { background: linear-gradient(to right, blue, pink); } diagonal gradients you can even make the gradient run diagonally, from corner to corner. ...
...gradients run from top to bottom. you can change their rotation by specifying a direction. <div class="horizontal-gradient"></div> div { width: 120px; height: 120px; } .horizontal-gradient { background: linear-gradient(to right, blue, pink); } diagonal gradients you can even make the gradient run diagonally, from corner to corner. <div class="diagonal-gradient"></div> div { width: 200px; height: 100px; } .diagonal-gradient { background: linear-gradient(to bottom right, blue, pink); } using angles if you want more control over its direction, you can give the gradient a specific angle. ...
...And 23 more matches
Element Positioning - Archive of obsolete content
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 button. an element will generally be as large as it needs to be to hold its contents, and no larger. some elements, such as textboxes have a default size, which will be used. a box will be large enough to hold the elements inside the box. a horizontal box with three buttons in it will be as wide as the three buttons, plus a small amount of padding. ...
...lements, such as textboxes have a default size, which will be used. a box will be large enough to hold the elements inside the box. a horizontal box with three buttons in it will be as wide as the three buttons, plus a small amount of padding. in the image, the first two buttons have been given a suitable size to hold their text. the third button is larger because it contains more content. ...
... will be used. a box will be large enough to hold the elements inside the box. a horizontal box with three buttons in it will be as wide as the three buttons, plus a small amount of padding. in the image, the first two buttons have been given a suitable size to hold their text. the third button is larger because it contains more content. the width of the box containing the buttons is the total width of the buttons plus the padding between them. ...
...And 22 more matches
Web audio codec guide - Web media technologies
the processing of audio data to encode and decode it is handled by an audio codec (coder/decoder). in this article, we look at audio codecs used on the web to compress and decompress audio, what their capabilities and use cases are, and offer guidance when choosing audio codecs to use for your content. ...
... reduced in kind. for more information about these and other features of audio data, see audio data format and structure in digital audio concepts. the effect of codec configuration on encoded audio output audio codecs typically employ cleverly-designed and highly-complex mathematical algorithms to take source audio data and compress it to take substantially less space in memory or network bandwidth. in addition to choosing the type of encoder to use, you may have the opportunity to adjust the encoder using parameters that choose specific algorithms, tune those algorithms, and specify how many passes to apply while encoding. audio encoder configuration effects on quality and size feature effect on quality effect on size lossless compression no loss of fidelit...
... joint stereo can reduce the size of the encoded audio to some e...
...And 22 more matches
Border-radius generator - CSS: Cascading Style Sheets
/div> <div id="blh" class="ui-input-slider" data-topic="bottom-left-h" data-unit=" px" data-sensivity="2"></div> </div> </div> </div> </div> <div id="controls" class="group section"> <div class="group section"> <div id="dimensions"> <div class="ui-input-slider" data-topic="width" data-info="width" data-unit=" px" data-min="150" data-max="700" data-sensivity="1"></div> <div class="ui-input-slider" data-topic="height" data-info="height" data-unit=" px" data-min="75" data-max="350" data-sensivity="1"></div> </div> <div id="output"></div> </div> <div class="group section"> ...
...-topic='bottom-right'></div> <div class="ui-checkbox" data-topic='bottom-left'></div> </div> <div id="unit-selection"> <div class="info"> select border units </div> </div> </div> </div> </div> css content /* grid of ten * ========================================================================== */ .span_12 { width: 100%; } .span_11 { width: 91.46%; } .span_10 { width: 83%; } .span_9 { width: 74.54%; } .span_8 { width: 66.08%; } .span_7 { width: 57.62%; } .span_6 { width: 49.16%; } .span_5 { width: 40.7%; } .span_4 { width: 32.24%; } .span_3 { width: 23.78%; } .span_2 { width: 15.32%; } .span_1 { width: 6.86%; } /* sections * ======================================================...
...n-left: 0; } /* all browsers except ie6 and lower */ /* * ui component */ .ui-input-slider-container { height: 20px; margin: 10px 0; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-user-select: none; user-select: none; } .ui-input-slider-container * { float: left; height: 100%; line-height: 100%; } /* input slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-transform: lowercase; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left...
...And 21 more matches
Drawing graphics - Learn web development
rowsers, with the exception of ie 8 and below for 2d canvas, and ie 11 and below for webgl. active learning: getting started with a <canvas> if you want to create a 2d or 3d scene on a web page, you need to start with an html <canvas> element. this element is used to define the area on the page into which the image will be drawn. this is as simple as including the element on the page: <canvas width="320" height="240"></canvas> this will create a canvas on the page with a size of 320 by 240 pixels. inside the canvas tags, you can put some fallback content, which is shown if the user's browser doesn't support canvas. <canvas width="320" height="240"> <p>your browser doesn't support canvas. boo hoo!</p> </canvas> of course, the above message is really unhelpful! in a real example you'd w...
...s on to. first make a local copy of our 0_canvas_start.html file, and open it in your text editor. ...
...g <body> tag: <canvas class="mycanvas"> <p>add suitable fallback here.</p> </canvas> we have added a class to the <canvas> element so it will be easier to select if we have multiple canvases on the page, but we have removed the width and height attributes for now (you could add them back in if you wanted, but we will set them using javascript in a below section). canvases with no explicit width and height default to 300 pixels wide by 150 pixels high. now add the following lines of javascript inside the <script> element: const canvas = document.queryselector('.mycanvas'); const width = canvas.width = window.innerwidth; const height = canvas.height = window.innerheight; here we have stored a reference to the canvas in the canvas constant. in the second line we set both a new ...
...And 20 more matches
Floats - Learn web development
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> now apply the following css to your html (using a <style> element or a <link> to a separate .css file — your choice): body { width: 90%; max-width: 900px; margin: 0 auto; font: .9em/1.2 arial, helvetica, sans-serif } .box { width: 150px; height: 100px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } if you save and refresh now, you'll see something much like what you'd expect — the box is sitting above the text, in normal flow. to float the text around it add the float and margin-r...
...nulla luctus aliquam dolor, eu lacinia lorem placerat vulputate. ...
... ut, facilisis sed est. nam id risus quis ante semper consectetur eget aliquam lorem. vivamus tristique elit 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. ...
...And 19 more matches
Responsive images - Learn web development
sics of html and how to add static images to a web page. objective: learn how to use features like srcset and the <picture> element to implement responsive image solutions on websites. why responsive images? let's examine a typical scenario. a typical website may contain a header image and some content images below the header. ...
... will likely span the whole of the width of the header, and the content image will fit somewhere inside the content column. here's a simple example: this works well on a wide screen device, such as a laptop or desktop (you can see the example live and find the source code on github.) we won't discuss the css much in this lesson, except to say that: the body content has been set to a maximum width of 1200 pixels — in viewports above that width, the body remains at 1200px and centers itself in the available space. in viewports below that width, the body will stay at 100% of the width of the viewport. the header image has been set so that its center always stays in the center of the header, no matter what width the heading is set at. if the site is being viewed on a narrower screen, the i...
...ader below looks ok, but it's starting to take up a lot of the screen height for a mobile device. and at this size, it is difficult to see the people within the first content image. an improvement would be to display a cropped version of the image which displays the important details of the image when the site is viewed on a narrow screen. a second cropped image could be displayed for a medium width screen device, like a tablet. this is commonly known as the art direction problem. in addition, there is no need to embed such large images on the page if it is being viewed on a mobile screen. and conversely, a small raster image starts to look grainy when displayed larger than its original size (a raster image is a set number of pixels wide and a set number of pixels tall, as we saw when we lo...
...And 19 more matches
Basic animations - Web APIs
function clock() { var now = new date(); var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.save(); ctx.clearrect(0, 0, 150, 150); ctx.translate(75, 75); ctx.scale(0.4, 0.4); ctx.rotate(-math.pi / 2); ctx.strokestyle = 'black'; ...
...enshotlive sample an animated clock this example draws an animated clock, showing your current time. ...
...hr - 12 : hr; ctx.fillstyle = 'black'; // write hours ctx.save(); ctx.rotat...
...And 19 more matches
Table Layout Strategy - Archive of obsolete content
apter 17).in css2 a distinction between 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 ba...
...le 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 discussed. the functionality is distributed over a large number of subroutines as shown in the chart below. ...
...alized (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 discussed. the functionality is distributed over a large number of subroutines as shown in the chart below. the words the table layout is width oriented and knows the following widths: minimum content width - min the minimum width that is required to layout the content, all linebreak possibilities will be used percent width - pct the cell width specified in percent, fixed width - fix the cell width specified as px, mm etc., proportional width - prop the cell width specified via 1*, 2* etc. ...
...And 18 more matches
begin - SVG: Scalable Vector Graphics
Web › SVG › Attribute › begin
when using the <discard> element. the <discard> element itself can be discarded prior to its activation, in which case it will never trigger the removal of its own target element. value <begin-value-list> default value 0s animatable no the definition of <begin-value-list> is the same as for the other animation elements. ...
...element. value <begin-value-list> default value 0s animatable no the definition of <begin-value-list> is the same as for the other animation elements. ...
... value 0s animatable no the definition of <begin-value-list> is the same as for the other animation elements. ...
...And 18 more matches
Responsive design - Learn web development
target a particular screen size. if the user had a larger or smaller screen than the designer expected, results ranged from unwanted scrollbars to overly long line lengths, and poor use of space. as more diverse screen sizes became available, the concept of responsive web design (rwd) appeared, a set of practices that allows web pages to alter their layout and appearance to suit different screen widths, resolutions, etc. it is an idea that changed the way we design for a multi-device web, and in this article, we'll help you understand the main techniques you need to know to master it. prerequisites: html basics (study introduction to html), and an idea of how css works (study css first steps and css building blocks.) objective: to understand the fundamental concepts an...
...study introduction to html), and an idea of how css works (study css first steps and css building blocks.) objective: to understand the fundamental concepts and history of responsive design. historic website layouts at one point in history you had two options when designing a website: you could create a liquid site, which would stretch to fill the browser window or a fixed width site, which would be a fixed size in pixels. these two approaches tended to result in a website that looked its best on the screen of the person designing the site! the liquid site resulted in a squashed design on smaller screens (as seen below) and unreadably long line lengths on larger ones. note: see this simple liquid layout: example, source code. when viewing the example, drag your b...
...result in a website that looked its best on the screen of the person designing the site! the liquid site resulted in a squashed design on smaller screens (as seen below) and unreadably long line lengths on larger ones. note: see this simple liquid layout: example, source code. when viewing the example, drag your browser window in and out to see how this looks at different sizes. the fixed-width site risked a horizontal scrollbar on screens smaller than the site width (as seen below), and lots of white space at the edges of the design on larger screens. note: see this simple fixed-width layout: example, source code. again, observe the result as you change the browser window size. note: the screenshots above are taken using the responsive design mode in firefox devtools. as the...
...And 17 more matches
Using the CSS Painting API - Web APIs
bset containing most of the features available in the full canvas api with the exception of the canvasimagedata, canvasuserinterface, canvastext, and canvastextdrawingstyles apis. we define the fillstyle 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 from the top of the content box. we can use the css background-size and background-position properties to re-size or relocate this background image, but this is the default size and placement of the yellow box we created in our paint ...
...e text is huge, the box might look like an bar above the first three letters. it would be better if the background image was relative to the size of the element — we can use the element's paintsize property to ensure the background image is proportional to the size of the element's box model size. in the above image, the background proportional to the size of the element. ...
...element. the 3rd example has width: 50%; set on the block level element, making the element narrower and therefore the background image narrower. the code to do this looks like so: registerpaint('headerhighlight', class { static get contextoptions() { return { alpha: true }; } /* ctx is the 2d drawing context size is the paintsize, the dimensions (height and width) of the box being painted */ paint(ctx, size) { ctx.fillstyle = 'hsla(55, 90%, 60%, 1.0)'; ctx.fillrect( 0, size.height / 3, size.width * 0.4, size.height * 0.6 ); } }); this code example has two differences from our first example: we've included a second argument, which is the paint size. we've changed the dimensions and positioning of our rectangle to be relative t...
...And 16 more matches
HTMLImageElement.sizes - Web APIs
this provides the ability to automatically select among different images—even images of different orientations or aspect ratios—as the document state changes to match different media conditions. each condition is specified using the same conditional format used by media queries. syntax let sizes = htmlimageelement.sizes; htmlimageelement.sizes = sizes; value a usvstring containing a comma-separated list of source size descriptors followed by an optional fallback size. ...
...by an optional fallback size. each source size descriptor is comprised of a media condition, then at least one whitespace character, then the source size value to use for the image when the media condition evaluates to true. media conditions each source size descriptor consists of a media condition as defined by the media queries standard. because a source size descriptor is used to specify the width to use for the image during layout of the page, the media condition is typically (but not necessarily) based entirely on width information. see syntax in using media queries for details on how to construct a media condition. source size values the source size value is a css length. it may be specified using font-relative units (such as em or ex), absolute units (such as px or cm), or the vw uni...
... note: the source size value must not be specified as a percentage of the container size; that is, lengths such as 50% or 100% are not allowed, as there would be uncertainty as to what the specified value is a percentage of. ...
...And 16 more matches
The box model - Learn web development
ox behaves in terms of page flow, and in relation to other boxes on the page: if a box is defined as a block, it will behave in the following ways: the box will break onto a new line. the box will extend in the inline direction to fill the space available in its container. in most cases this means that the box will become as wide as its container, filling up 100% of the space available. ...
... vertical padding, margins, and borders will apply but will not cause other inline boxes to move away from the box. horizontal padding, margins, and borders will apply and will cause other inline boxes to move away from the box. ...
...nstruction, our boxes lay out as block or inline boxes. examples of different display types let's move on and have a look at some examples. below we have three different html elements, all of which have an outer display type of block. the first is a paragraph, which has a border added in css. the browser renders this as a block box, so the paragraph begins on a new line, and expands to the full width available to it. the second is a list, which is laid out using display: flex. this establishes flex layout for the items inside the container, however, the list itself is a block box and — like the paragraph — expands to the full container width and breaks onto a new line. below this, we have a block-level paragraph, inside which are two <span> elements. these elements would normally be inl...
...And 15 more matches
Pixel manipulation with canvas - Web APIs
ixels of our canvas. with the imagedata object you can directly read and write a data array to manipulate pixel data. we will also look into how image smoothing (anti-aliasing) can be controlled and how to save images from your canvas. the imagedata object the imagedata object represents the underlying pixel data of an area of a canvas object. it contains the following read-only attributes: width the width of the image in pixels. height the height of the image in pixels. data a uint8clampedarray representing a one-dimensional array containing the data in the rgba order, with integer values between 0 and 255 (included). the data property returns a uint8clampedarray which can be accessed to look at the raw pixel data; each pixel is represented by four one-byte values (red, green, blu...
...s (red, green, blue, and alpha, in that order; that is, "rgba" format). each color component is represented by an integer between 0 and 255. each component is assigned a consecutive index within the array, with the top left pixel's red component being at index 0 within the array. pixels then proceed from left to right, then downward, throughout the array. ...
... each color component is represented by an integer between 0 and 255. each component is assigned a consecutive index within the array, with the top left pixel's red component being at index 0 within the array. pixels then proceed from left to right, then downward, throughout the array. the uint8clampedarray contains height × width × 4 bytes of data, with index values ranging from 0 to (height×width×4)-1. ...
...And 15 more matches
Viewport concepts - CSS: Cascading Style Sheets
fullscreen mode, the viewport is the entire screen. in fullscreen mode, the viewport is the device screen, the window is the browser window, which can be as big as the viewport or smaller, and the document is the website, which can be much taller or wider than the viewport. to recap, the viewport is basically the part of the document that is currently visible. ...
...tire screen. in fullscreen mode, the viewport is the device screen, the window is the browser window, which can be as big as the viewport or smaller, and the document is the website, which can be much taller or wider than the viewport. to recap, the viewport is basically the part of the document that is currently visible. viewport sizes are mutable the width of the viewport is not always the width of the window. ...
...viewport is the device screen, the window is the browser window, which can be as big as the viewport or smaller, and the document is the website, which can be much taller or wider than the viewport. to recap, the viewport is basically the part of the document that is currently visible. viewport sizes are mutable the width of the viewport is not always the width of the window. ...
...And 15 more matches
Grids - Learn web development
to css and styling boxes.) objective: to understand the fundamental concepts behind grid layout systems, and how to implement a grid layout using css grid. what is grid layout? a grid is a collection of horizontal and vertical lines creating a pattern against which we can line up our design elements. they help us to create designs where elements don’t jump around or change width as we move from page to page, providing greater consistency on our websites. a grid will typically have columns, rows, and then gaps between each row and column — commonly referred to as gutters. creating your grid in css having decided on the grid that your design needs, you can use css grid layout to create that grid in css and place items onto it. we will look at the basic features of g...
...rid. let's add three 200-pixel columns here. you can use any length unit, or percentages to create these column tracks. .container { display: grid; grid-template-columns: 200px 200px 200px; } add the 2nd declaration to your css rule, then reload the page, and you should see that the items have rearranged themselves one into each cell of the created grid. ...
...ee 200-pixel columns here. you can use any length unit, or percentages to create these column tracks. .container { display: grid; grid-template-columns: 200px 200px 200px; } add the 2nd declaration to your css rule, then reload the page, and you should see that the items have rearranged themselves one into each cell of the created grid. ...
...And 14 more matches
Positioning - Learn web development
css: top: 30px; left: 30px; note: the values of these properties can take any units you'd logically expect — pixels, mm, rems, %, etc. if you now save and refresh, you'll get a result something like this: <h1>relative positioning</h1> <p>i am a basic block level element. ...
... units you'd logically expect — pixels, mm, rems, %, etc. if you now save and refresh, you'll get a result something like this: <h1>relative positioning</h1> <p>i am a basic block level element. my adjacent block level elements sit on new lines below me.</p> <p class="positioned">by default we span 100% of the width of our parent element, and we are as tall as our child content. our total width and height is our content + padding + border width/height.</p> <p>we are separated by our margins. because of margin collapsing, we are separated by the width of one of our margins, not both.</p> <p>inline elements <span>like this one</span> and <span>this one</span> sit on the same line as one another, and adjacent text nodes, if there is space on the same line. overflowing inline elements <sp...
...ke this one</span> and <span>this one</span> sit on the same line as one another, and adjacent text nodes, if there is space on the same line. ...
...And 14 more matches
<blend-mode> - CSS: Cascading Style Sheets
should appear when elements overlap. it is used in the background-blend-mode and mix-blend-mode properties. syntax the <blend-mode> data type is defined using a keyword value chosen from the list below. values normal the final color is the top color, regardless of what the bottom color is. the effect is like two opaque pieces of paper overlapping. <div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: normal; } multiply the final color is the result of multiplying the top and bottom colors. a black layer leads to a black final layer, and a white layer leads to no change. the effect is like tw...
...png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: normal; } multiply the final color is the result of multiplying the top and bottom colors. a black layer leads to a black final layer, and a white layer leads to no change. the effect is like two images printed on transparent film overlapping. <div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: multiply; } screen the final color is the result of inverting the colors, multiplying them, and inverting that value. a black layer leads to no change, and a white layer leads to a white final lay...
... url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: multiply; } screen the final color is the result of inverting the colors, multiplying them, and inverting that value. a black layer leads to no change, and a white layer leads to a white final layer. the effect is like two images shone onto a projection screen. <div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: screen; } overlay the final color is the result of multiply if the bottom color is darker, or screen if the bottom color is lighter. this blend mode is equivalent to hard-light but with the layers sw...
...And 14 more matches
Used value - CSS: Cascading Style Sheets
the used value of a css property is its value after all calculations have been performed on the computed value. after the user agent has finished its calculations, every css property has a used value. the used values of dimensions (e.g., width, line-height) are in pixels. the used values of shorthand properties (e.g., background) are consistent with those of their component properties (e.g., background-color or background-size) and with position and float. ...
...els. the used values of shorthand properties (e.g., background) are consistent with those of their component properties (e.g., background-color or background-size) and with position and float. note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property. ...
...nsistent with those of their component properties (e.g., background-color or background-size) and with position and float. note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property. ...
...And 14 more matches
Drawing shapes with canvas - Web APIs
g, <canvas> only supports two primitive shapes: rectangles and paths (lists of points connected by lines). all other shapes must be created by combining one or more paths. luckily, we have an assortment of path drawing functions which make it possible to compose very complex shapes. first let's look at the rectangle. ...
...nd paths (lists of points connected by lines). all other shapes must be created by combining one or more paths. luckily, we have an assortment of path drawing functions which make it possible to compose very complex shapes. first let's look at the rectangle. there are three functions that draw rectangles on the canvas: fillrect(x, y, width, height) draws a filled rectangle. strokerect(x, y, width, height) draws a rectangular outline. clearrect(x, y, width, height) clears the specified rectangular area, making it fully transparent. each of these three functions takes the same parameters. x and y specify the position on the canvas (relative to the origin) of the top-left corner of the rectangle. width and height provide the rectangle's size. below is the draw() function from the previ...
...ch of these three functions takes the same parameters. x and y specify the position on the canvas (relative to the origin) of the top-left corner of the rectangle. width and height provide the rectangle's size. below is the draw() function from the previous page, but now it is making use of these three functions. rectangular shape example <html> <body onload="draw();"> <canvas id="canvas" width="150" height="150"></canvas> </body> </html> function draw() { var canvas = document.getelementbyid('canvas'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); ctx.fillrect(25, 25, 100, 100); ctx.clearrect(45, 45, 60, 60); ctx.strokerect(50, 50, 50, 50); } } this example's output is shown below. screenshotlive sample the fillrect() function draws a large b...
...And 13 more matches
border-image - CSS: Cascading Style Sheets
request. note: you should specify a separate border-style in case the border image fails to load. indeed, this is required according to the specification, although not all browsers implement this requirement. ...
...implement this requirement. constituent properties this property is a shorthand for the following css properties: border-image-outset border-image-repeat border-image-slice border-image-source border-image-width syntax /* source | slice */ border-image: linear-gradient(red, blue) 27; /* source | slice | repeat */ border-image: url("/images/border.png") 27 space; /* source | slice | width */ border-image: linear-gradient(red, blue) 27 / 35px; /* source | slice | width | outset | repeat */ border-image: url("/images/border.png") 27 23 / 50px 30px / 1rem round space; the border-image property may be specified with anywhere from one to five of the values listed below. note: if the computed value of border-image-source is none, or if the image cannot be displayed, the border-styl...
...ues listed below. note: if the computed value of border-image-source is none, or if the image cannot be displayed, the border-style will be displayed instead. values <'border-image-source'> the source image. see border-image-source. <'border-image-slice'> the dimensions for slicing the source image into regions. up to four values may be specified. see border-image-slice. <'border-image-width'> the width of the border image. up to four values may be specified. see border-image-width. <'border-image-outset'> the distance of the border image from the element's outside edge. up to four values may be specified. see border-image-outset. <'border-image-repeat'> defines how the edge regions of the source image are adjusted to fit the dimensions of the border image. up to two values may ...
...And 13 more matches
border-inline-end - CSS: Cascading Style Sheets
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 corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orienta...
...ionality, and text orientation. it corresponds to the border-top, border-right, border-bottom, or border-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-start, which define the other borders of the element. ...
...top, border-right, border-bottom, or border-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-start, which define the other borders of the element. ...
...And 13 more matches
border - CSS: Cascading Style Sheets
Web › CSS › border
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 order of the values does not matter. ...
... 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. note: the border will be invisible if its style is not defined.
...And 13 more matches
clip-path - CSS: Cascading Style Sheets
Web › CSS › clip-path
e reference box. stroke-box uses the stroke bounding box as the reference box. view-box uses the nearest svg viewport as the reference box. if a viewbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the size of the reference box is set to the width and height values of the viewbox attribute. none no clipping path is created. note: a computed value other than none results in the creation of a new stacking context the same way that css opacity does for values other than 1. formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinherite...
...one</div> <div class="row"> <div class="cell"> <span>html</span> <div class="container"> <p class="none"> i love<br><em>clipping</em> </p> </div> </div> <div class="cell"> <span>svg</span> <div class="container viewbox"> <svg viewbox="0 0 192 192"> <g class="none"> <rect x="24" y="24" width="144" height="144" /> <text x="96" y="91">i love</text> <text x="96" y="109" class="em">clipping</text> </g> </svg> </div> </div> </div> <div class="note">clip-path: url(#mypath)<br><br> assuming the following clippath definition: <pre> &lt;svg&gt; &lt;clippath id="mypath" clippathunits="objectboundingbox"&gt; ...
... </div> <div class="row"> <div class="cell"> <span>html</span> <div class="container"> <p class="svg"> i love<br><em>clipping</em> </p> </div> </div> <div class="cell"> <span>svg</span> <div class="container viewbox"> <svg viewbox="0 0 192 192"> <g class="svg"> <rect x="24" y="24" width="144" height="144" /> <text x="96" y="91">i love</text> <text x="96" y="109" class="em">clipping</text> </g> </svg> </div> </div> </div> <div class="note">clip-path: path('m15,45 a30,30,0,0,1,75,45 a30,30,0,0,1,135,45 q135,90,75,130 q15,90,15,45 z') </div> <div class="row"> <div class="cell"> <span>html</span> ...
...And 13 more matches
preserveAspectRatio - SVG: Scalable Vector Graphics
ttribute, if this attribute isn't set, the preserveaspectratio attribute has no effect (with one exception, the <image> element, as described below). ...
...on, the <image> element, as described below). ...
...<path id="smiley" d="m50,10 a40,40,1,1,1,50,90 a40,40,1,1,1,50,10 m30,40 q36,35,42,40 m58,40 q64,35,70,40 m30,60 q50,75,70,60 q50,75,30,60" /> </defs> <!-- (width>height) meet --> <svg preserveaspectratio="xmidymid meet" x="0" y="0" viewbox="0 0 100 100" width="20" height="10"><use href="#smiley" /></svg> <svg preserveaspectratio="xminymid meet" x="25" y="0" viewbox="0 0 100 100" width="20" height="10"><use href="#smiley" /></svg> <svg preserveaspectratio="xmaxymid meet" x="50" y="0" viewbox="0 0 100 100" width="20" height="10"><use href="#smiley" /></svg> <!-- (width>height) slice --> <svg preserveaspectratio="xmidymin slice" x="0" y="15" viewbox="0 0 100 100" width="20" height="10"><use href="#smiley" /></svg> <svg preserveaspectratio="xmidymid slice" x="25" ...
...And 13 more matches
SVG animation with SMIL - SVG: Scalable Vector Graphics
d an <animate> element inside the <circle> element. the important attributes for <animate> are: attributename the name of the attribute to animate. from the initial value of the attribute. to the final value. dur the duration of the animation (for example, write '5s' for 5 seconds). if you want to animate more attributes inside the same element, just add more <animate> elements. ...
...e: attributename the name of the attribute to animate. from the initial value of the attribute. to the final value. dur the duration of the animation (for example, write '5s' for 5 seconds). if you want to animate more attributes inside the same element, just add more <animate> elements. <svg width="300" height="100"> <title>attribute animation with smil</title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <circle cx="0" cy="50" r="15" fill="blue" stroke="black" stroke-width="1"> <animate attributename="cx" from="0" to="500" dur="5s" repeatcount="indefinite" /> </circle> </svg> animating the transform attributes the <animatetransform> element let you animate transform attributes. this new element is necessary because we...
...ributes the <animatetransform> element let you animate transform attributes. this new element is necessary because we are not animating a simple attribute like x which is just a number. rotation attributes look like this: rotation(theta, x, y), where theta is the angle in degrees, and x and y are absolute positions. in the example below, we animate the center of the rotation and the angle. ...
...And 13 more matches
Fills and Strokes - SVG: Scalable Vector Graphics
s painting basic coloring can be done by setting two attributes on the node: fill and stroke. using fill sets the color inside the object and stroke sets the color of the line drawn around the object. you can use the same css color naming schemes that you use in html, whether that's color names (that is red), rgb values (that is rgb(255,0,0)), hex values, rgba values, etc. <rect x="10" y="10" width="100" height="100" stroke="blue" fill="purple" fill-opacity="0.5" stroke-opacity="0.8"/> in addition, you can specify the opacity of either the fill or stroke separately in svg. these are controlled by the fill-opacity and stroke-opacity attributes. note: in firefox 3+, rgba values are also allowed, and will give the same effect. but for compatibility with other viewers, it's often best...
... give the same effect. but for compatibility with other viewers, it's often best to specify the fill/stroke opacity separately. if you specify both an rgba value and a fill/stroke opacity value, both will be applied. stroke in addition to its color properties, there are a few other attributes available to control the way a stroke is drawn on a line. ...
...cify both an rgba value and a fill/stroke opacity value, both will be applied. stroke in addition to its color properties, there are a few other attributes available to control the way a stroke is drawn on a line. <?xml version="1.0" standalone="no"?> <svg width="160" height="140" xmlns="http://www.w3.org/2000/svg" version="1.1"> <line x1="40" x2="120" y1="20" y2="20" stroke="black" stroke-width="20" stroke-linecap="butt"/> <line x1="40" x2="120" y1="60" y2="60" stroke="black" stroke-width="20" stroke-linecap="square"/> <line x1="40" x2="120" y1="100" y2="100" stroke="black" stroke-width="20" stroke-linecap="round"/> </svg> the stroke-width property defines the width of this stroke. strokes are drawn centered around the path. in the example above, the path is shown in pink, and the ...
...And 13 more matches
Multiple-column layout - Learn web development
ppropriate places. at the bottom of the section you can see a live example of what the final code should look like. our starting 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. ...
... 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</h1> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lorem placerat vulputate. du...
...iquam lorem. vivamus tristique elit 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. ...
...And 12 more matches
Images in HTML - Learn web development
own the image. you have received explicit, written permission from the image owner. you have ample proof that the image is, in fact, in the public domain. copyright violations are illegal and unethical. in addition, never point your src attribute at an image hosted on someone else's website that you don't have permission to link to. this is called "hotlinking". again, stealing someone's bandwidth is illegal. it also slows down your page, leaving you with no control over whether the image is removed or replaced with something embarrassing. our above code would give us the following result: note: elements like <img> and <video> are sometimes referred to as replaced elements. this is because the element's content and size are defined by an external resource (like an image or video file...
...t support the image type. some people still use text-only browsers, such as lynx, which displays the alt text of images. you may want to provide text for search engines to utilize; for example, search engines can match alt text with search queries. users have turned off images to reduce data transfer volume and distractions. this is especially common on mobile phones, and in countries where bandwidth is limited or expensive. what exactly should you write inside your alt attribute? it depends on why the image is there in the first place. in other words, what you lose if your image doesn't show up: decoration. you should use css background images for decorative images, but if you must use html, add a blank alt="". if the image isn't part of the content, a screen reader shouldn't waste time...
...supply the text inside the alt attribute. essentially, the key is to deliver a usable experience, even when the images can't be seen. this ensures all users are not missing any of the content. try turning off images in your browser and see how things look. you'll soon realize how helpful alt text is if the image cannot be seen. note: for more information, see our guide to text alternatives. width and height you can use the width and height attributes to specify the width and height of your image. you can find your image's width and height in a number of ways. for example on the mac you can use cmd + i to get the info display up for the image file. returning to our example, we could do this: <img src="images/dinosaur.jpg" alt="the head and torso of a dinosaur skeleton; it ...
...And 12 more matches
Plug-in Basics - Plugins
lug-in is installed. if it is, a movie is displayed. // can we display adobe flash movies? var mimetype = navigator.mimetypes["application/x-shockwave-flash"]; if (mimetype) { // yes, so can we display with a plug-in? var plugin = mimetype.enabledplugin; if (plugin) { // yes, so show the data in-line document.writeln("here\'s a movie: <object data='mymovie.swf' height='100' width='100'></object>"); } else { // no, so provide a link to the data document.writeln("<a href='mymovie.swf'>click here</a> to see a movie."); } } else { // no, so tell them so document.writeln("sorry, can't show you this movie."); } overview of plug-in structure this section is an overview of basic information you will need as you develop plug-ins. understanding the plu...
...nt is displayed. the plug-in is visible as a rectangular subpart of the page (unless it is hidden). embedded plug-ins are commonly used for multimedia images relating to text in the page, such as the adobe flash plug-in. when gecko encounters the object or embed element in a document, it attempts to find and display the file represented by the data and src attributes, respectively. the height and width attributes of the object element determine the size of the embedded plug-in in the html page. for example, this object element calls a plug-in that displays video: <object data="newave.avi" type="video/avi" width="320" height="200" autostart="true" loop="true"> </object> a hidden plug-in is a type of embedded plug-in that is not drawn on the screen when it is invoked. it is cre...
...r a plug-in is windowed or windowless is not meaningful if the plug-in is invoked with the hidden attribute. you can also create hidden plug-ins 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 clas...
...And 12 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
— screen readers read this description out to their users so they know what the image means. alt text is also displayed on the page if the image can't be loaded for some reason: for example, network errors, content blocking, or linkrot. there are many other attributes to achieve various purposes: referrer/cors control for security and privacy: see crossorigin and referrerpolicy. use both width and height to set the intrinsic size of the image, allowing it to take up space before it loads, to mitigate content layout shifts. responsive image hints with sizes and srcset (see also the <picture> element and our responsive images tutorial). supported image formats the html standard doesn't list what image formats to support, so each user agent supports different formats. a complete guide...
...ser agent. attributes this element includes the global attributes. alt defines an alternative text description of the image. note: browsers do not always display images. there are a number of situations in which a browser might not display images, such as: non-visual browsers (such as those used by people with visual impairments) the user chooses not to display images (saving bandwidth, privacy reasons) the image is invalid or an unsupported type in these cases, the browser may replace the image with the text in the element's alt attribute. for these reasons and others, provide a useful value for alt whenever possible. omitting alt altogether indicates that the image is a key part of the content and no textual equivalent is available. setting this attribute to an empt...
...e values: auto: no preference. the browser may use its own heuristics to prioritize the image. high: the image is of high priority. low: the image is of low priority. intrinsicsize this attribute tells the browser to ignore the actual intrinsic size of the image and pretend it’s the size specified in the attribute. specifically, the image would raster at these dimensions and naturalwidth/naturalheight on images would return the values specified in this attribute. explainer, examples ismap this boolean attribute indicates that the image is part of a server-side map. if so, the coordinates where the user clicked on the image are sent to the server. note: this attribute is allowed only if the <img> element is a descendant of an <a> element with a valid href attribute. this give...
...And 12 more matches
Beginner's guide to media queries - Learn web development
: there were a number of other media types defined in the level 3 media queries specification; these have been deprecated and should be avoided. note: media types are optional; if you do not indicate a media type in your media query then the media query will default to being for all media types. media feature rules after specifying the type, you can then target a media feature with a rule. width and height the feature we tend to detect most often in order to create responsive designs (and that has widespread browser support) is viewport width, and we can apply css if the viewport is above or below a certain width — or an exact width — using the min-width, max-width, and width media features. these features are used to create layouts that respond to different screen sizes. for examp...
...port width, and we can apply css if the viewport is above or below a certain width — or an exact width — using the min-width, max-width, and width media features. these features are used to create layouts that respond to different screen sizes. for example, to change the body text color to red if the viewport is exactly 600 pixels, you would use the following media query. @media screen and (width: 600px) { body { color: red; } } open this example in the browser, or view the source. the width (and height) media features can be used as ranges, and therefore be prefixed with min- or max- to indicate that the given value is a minimum, or a maximum. ...
... media query. @media screen and (width: 600px) { body { color: red; } } open this example in the browser, or view the source. the width (and height) media features can be used as ranges, and therefore be prefixed with min- or max- to indicate that the given value is a minimum, or a maximum. for example, to make the color blue if the viewport is narrower than 600 pixels, use max-width: @media screen and (max-width: 600px) { body { color: blue; } } open this example in the browser, or view the source. in practice, using minimum or maximum values is much more useful for responsive design so you will rarely see width or height used alone. there are a number of other media features that you can test for, although some of the newer features introduced in level 4...
...And 11 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
le below, i have a simple media object. in a non-supporting browser, i use float, however i have also defined the container as a grid container, in order to use the alignment properties that are implemented in css grids. ...
...ainer, in order to use the alignment properties that are implemented in css grids. ...
...x;} img { max-width: 100%; display: block; } .media { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 400px; display: grid; grid-template-columns: 1fr 2fr; grid-template-areas: "img content"; margin-bottom: 1em; } .media::after { content: ""; display: block; clear: both; } .media .image { float: left; width: 150px; margin-right: 20px; } .media .text { padding: 10px; align-self: end; } <div class="media"> <div class="image"><img src="https://udn.realityripple.com/samples/89/f993f273dd.png" alt="placeholder"></div> <div class="text">this is a media object example. i am using floats for older browsers and grid for new ones.</div> </div> the image below shows the media object ...
...And 11 more matches
box-sizing - CSS: Cascading Style Sheets
the box-sizing css property sets how the total width and height of an element is calculated. 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. by default in the css box model, the width and height you assign to an element is applied only to the element's content box. if the element has any border or padding, this is then added to the width and height to arrive at the size of the box that's rendered on the screen. this means that when you set width and height, you have to adjust the value you give to allow for any border or padding that may be added. ...
...you assign to an element is applied only to the element's content box. if the element has any border or padding, this is then added to the width and height to arrive at the size of the box that's rendered on the screen. this means that when you set width and height, you have to adjust the value you give to allow for any border or padding that may be added. for example, if you have four boxes with width: 25%;, if any has left or right padding or a left or right border, they will not by default fit on one line within the constraints of the parent container. ...
...low for any border or padding that may be added. for example, if you have four boxes with width: 25%;, if any has left or right padding or a left or right border, they will not by default fit on one line within the constraints of the parent container. the box-sizing property can be used to adjust this behavior: content-box gives you the default css box-sizing behavior. if you set an element's width to 100 pixels, then the element's content box will be 100 pixels wide, and the width of any border or padding will be added to the final rendered width, making the element wider than 100px. ...
...And 11 more matches
Video player styling basics - Developer guides
ic — 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. ...
...sponsive. 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. ...
...: 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. ...
...And 11 more matches
Digital audio concepts - Web media technologies
cy (or pitch) of the sound that's produced. computers, however, are digital. in order to represent a sound wave in a way computers can manipulate and work with (let alone transmit over a network), the sound has to be converted into a digital form. this process is called analog to digital conversion (a/d for short). the first factor affecting the fidelity of the captured audio is the audio bandwidth; that is, the range of audio frequencies the a/d converter is capable of capturing and converting into digital form. the audio bandwidth is also affected by the codec, if it chooses to discard any frequency bands while encoding the sound. sound enters the computer through a microphone or other input in the form of a stream of electrons whose voltage varies to represent the amplitude of the sound...
...corded as two 16-bit integers, one for the left channel and one for the right. that means each sample requires 32 bits of memory. at the common sample rate of 48 khz (48,000 samples per second), this means each second of audio occupies 192 kb of memory. therefore, a typical three-minute song requires about 34.5 mb of memory. that's a lot of storage, but worse, it's an insane amount of network bandwidth to use for a relatively short piece of audio. that's why most digital audio is compressed. the process of compressing and decompressing audio is performed by encoding and decoding it using an audio codec (coder/decoder). over the years, a large variety of codecs have been developed, several of which are commonly used on the web. for details about the most important and useful ones for web develo...
......
...And 11 more matches
end - SVG: Scalable Vector Graphics
Web › SVG › Attribute › end
. <wallclock-sync-value> this value defines the animation end time as a real-world clock time. a valid wallclock-sync-value consists of the function wallclock() with a time value as parameter. the time syntax is based upon the syntax defined in iso 8601. indefinite the end of the animation will be determined by an svganimationelement.endelement() method call. ...
...me value as parameter. the time syntax is based upon the syntax defined in iso 8601. indefinite the end of the animation will be determined by an svganimationelement.endelement() method call. ...
... defined in iso 8601. indefinite the end of the animation will be determined by an svganimationelement.endelement() method call. ...
...And 11 more matches
widget - Archive of obsolete content
exposing your interface as a widget, your add-on would automatically inherit such functionality. creation and content widgets can contain images or arbitrary web content. you can include this content inline as a string by using the content property, or point to content using a url with the contenturl property. upon creation, the widget is automatically added to the add-on bar. you can set the width of a widget, but the height is fixed so as to fit in the add-on bar. if the content is an image, it is automatically scaled to be 16x16 pixels. for example, this widget contains an image, so it looks like a simple icon: require("sdk/widget").widget({ id: "mozilla-icon", label: "my mozilla widget", contenturl: "http://www.mozilla.org/favicon.ico" }); you can make contenturl point to an ht...
... scripting widget content to interact with the widget's content you need to load a separate script into the panel. in the sdk these scripts are called "content scripts" because they're explicitly used for interacting with web content. while content scripts can access th...
...f the self module: var data = require("sdk/self").data; require("sdk/widget").widget({ id: "my-widget", label: "my widget", contenturl: data.url("my-content.html") }); this widget contains an entire web page: require("sdk/widget").widget({ id: "hello-display", label: "my hello widget", content: "hello!", width: 50 }); widgets are quite small by default, so this example used the width property to grow it in order to show all the text. scripting widget content to interact with the widget's content you need to load a separate script into the panel. in the sdk these scripts are called "content scripts" because they're explicitly used for interacting with web content. while content scripts can access the content they're attached to, they can't use the sdk's apis. so implementin...
...And 10 more matches
Introduction to CSS layout - Learn web development
herit — specifies that the value of the float property should be inherited from the element's parent element. in the example below we float a <div> left, and give it a margin on the right to push the text away from the element. this gives us the effect of text wrapped around that box, and is most of what you need to know about floats as used in modern web design. floats example body { width: 90%; max-width: 900px; margin: 0 auto; } p { line-height: 2; word-spacing: 0.1rem; } .box { background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); padding: 10px; border-radius: 5px; } <h1>simple float example</h1> <div class="box">float</div> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia ...
...et orci vel, viverra egestas ligula. curabitur vehicula tellus neque, ac ornare ex malesuada et. in vitae convallis lacus. aliquam erat volutpat. suspendisse ac imperdiet turpis. aenean finibus sollicitudin eros pharetra congue. duis ornare egestas augue ut luctus. proin blandit quam nec lacus varius commodo et a urna. ut id ornare felis, eget fermentum sapien.</p> .box { float: left; width: 150px; height: 150px; margin-right: 30px; } note: floats are fully explained in our lesson on the float and clear properties. prior to techniques such as flexbox and grid layout floats were used as a method of creating column layouts. you may still come across these methods on the web; we will cover these in the lesson on legacy layout methods. positioning techniques positioning...
...rovide 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. this means you could achieve a task such as moving an...
...And 10 more matches
CSS property compatibility table for form controls - Learn web development
t. text-decoration this property is not supported by opera on form widgets. text-overflow opera, safari, and ie9 do not support this property on form widgets. text-shadow opera does not support text-shadow on form widgets and ie9 does not support it at all. text fields see the text, search, and password input types. property n t note css box model width yes yes height partial[1][2] yes webkit browsers (mostly on mac osx and ios) use the native look & feel for the search fields. therefore, it's required to use -webkit-appearance:none to be able to apply this property to search fields. on windows 7, internet explorer 9 does not apply the border unless background:none is applied. border ...
... border unless background:none is applied. on opera the border-radius property is applied only if an explicit border is set. box-shadow no partial[1] ie9 does not support this property. buttons see the button, submit, and reset input types and the <button> element. property n t note css box model width yes yes height partial[1] yes this property is not applied on webkit based browsers on mac osx or ios. border partial yes margin yes yes padding partial[1] yes this property is not applied on webkit based browsers on mac osx or ios. text and font color ...
...an explicit border is set. box-shadow no partial[1] ie9 does not support this property. number see the number input type. there is no standard way to change the style of spinners used to change the value of the field, with the spinners on safari being outside the field. property n t note css box model width yes yes height partial[1] partial[1] on opera, the spinners are zoomed in, which can hide the content of the field. border yes yes margin yes yes padding partial[1] partial[1] on opera, the spinners are zoomed in, which can hide the content of the field. text an...
...And 10 more matches
Using the CSS Typed Object Model - Web APIs
t. with this type we can access the numeric value — cssunitvalue.value — and its unit — cssunitvalue.unit. let's write a plain paragraph, apply no styles, and inspect a few of its css properties by returning a table with the unit and value: <p> this is a paragraph with some content. open up this example in codepen or jsfiddle, and change some features. try adding some css, such as a width for this paragraph, or adding a css property to the ofinterst array. </p> <table id="regurgitation"> <thead> <tr> <th>property</th> <th>value</th> <th>unit</th> </tr> </table> for each property of interest, we list the name of the property, use .get(propertyname).value to return the value, and, if the object returned by the get() is a cssunitvalue, list the unit ty...
...p'); // get the table we'll be populating const stylestable = document.queryselector('#regurgitation'); // retrieve all computed styles with computedstylemap() const allcomputedstyles = myelement.computedstylemap(); // array of properties we're interested in const ofinterest = ['padding-top', 'margin-bottom', 'font-size', 'font-stretch', 'animation-duration', 'animation-iteration-count', 'width', 'height']; // iterate thru our properties of interest for ( let i = 0; i < ofinterest.length; i++ ) { // create a row const row = document.createelement( 'tr' ); // add the name of the property const cssproperty = document.createelement( 'td' ); cssproperty.appendchild( document.createtextnode( ofinterest[i] ) ); row.appendchild( cssproperty ); // and the uni...
...csskeywordval...
...And 10 more matches
CanvasRenderingContext2D.putImageData() - Web APIs
method is not affected by the canvas transformation matrix. note: image data can be retrieved from a canvas using the getimagedata() method. you can find more information about putimagedata() and general manipulation of canvas contents in the article pixel manipulation with canvas. syntax void ctx.putimagedata(imagedata, dx, dy); void ctx.putimagedata(imagedata, dx, dy, dirtyx, dirtyy, dirtywidth, dirtyheight); parameters imagedata an imagedata object containing the array of pixel values. dx horizontal position (x coordinate) at which to place the image data in the destination canvas. dy vertical position (y coordinate) at which to place the image data in the destination canvas. dirtyx optional horizontal position (x coordinate) of the top-left corner from which the image data...
...n the destination canvas. dy vertical position (y coordinate) at which to place the image data in the destination canvas. dirtyx optional horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. defaults to 0. dirtyy optional vertical position (y coordinate) of the top-left corner from which the image data will be extracted. defaults to 0. dirtywidth optional width of the rectangle to be painted. defaults to the width of the image data. dirtyheight optional height of the rectangle to be painted. defaults to the height of the image data. errors thrown notsupportederror thrown if any of the arguments is infinite. invalidstateerror thrown if the imagedata object's data has been detached. examples understanding putimagedata to unde...
...s data has been detached. examples understanding putimagedata to understand what this algorithm does under the hood, here is an implementation on top of canvasrenderingcontext2d.fillrect(). ...
...And 10 more matches
HTMLImageElement - Web APIs
the htmlimageelement interface represents an html <img> element, providing the properties and methods used to manipulate image elements. ...
...sed to manipulate image elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 10 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
he flex properties work to control ratios along the main axis. these relate to the natural size of flex items before any growing or shrinking takes place, and to the concept of free space. flex item sizing in order to work out how much space there is available to lay out flex items, the browser needs to know how big the item is to start with. how is this worked out for items that don’t have a width or a height applied using an absolute length unit? there is a concept in css of min-content and max-content — these keywords are defined in the css intrinsic and extrinsic sizing specification, and can be used in place of a length unit. in the live example below for instance i have two paragraph elements that contain a string of text. the first paragraph has a width of min-content. in a brows...
...ve 100 pixels of negative free space. this could be removed from the items in order to make them fit the container. it is this distribution of positive free space and removal of negative free space that we need to understand in order to understand the flex properties. in the following examples i am working with flex-direction set to row, therefore the size of items will always come from their width. we will be calculating the positive and negative free space created by comparing the total width of all the items with the container width. you could equally try out each example with flex-direction: column. the main axis would then be the column, and you would then need to compare the height of the items and that of the container they are in to work out the positive and negative free space. th...
...ve free space. the flex-basis property the flex-basis property specifies the initial size of the flex item before any space distribution happens. the initial value for this property is auto. if flex-basis is set to auto then to work out the initial size of the item the browser first checks if the main size of the item has an absolute size set. this would be the case if you had given your item a width of 200 pixels. in that case 200px would be the flex-basis for this item. if your item is instead auto-sized, then auto resolves to the size of its content. at this point your knowledge of min- and max-content sizing becomes useful, as flexbox will take the max-content size of the item as the flex-basis. the following live example can help to demonstrate this. in this example i have created a se...
...And 10 more matches
Layout and the containing block - CSS: Cascading Style Sheets
t, but that isn't necessarily true. let's investigate the factors that determine what an element's containing block is. effects of the containing block before learning what determines the containing block of an element, it's useful to know why it matters in the first place. the size and position of an element are often impacted by its containing block. percentage values that are applied to the width, height, padding, margin, and offset properties of an absolutely positioned element (i.e., which has its position set to absolute or fixed) are computed from the element's containing block. identifying the containing block the process for identifying the containing block depends entirely on the value of the element's position property: if the position property is static, relative, or sticky,...
...aged media). calculating percentage values from the containing block as noted above, when certain properties are given a percentage value, the computed value depends on the element's containing block. the properties that work this way are box model properties and offset properties: the height, top, and bottom properties compute percentage values from the height of the containing block. the width, left, right, padding, and margin properties compute percentage values from the width of the containing block. some examples the html code for all our examples is: <body> <section> <p>this is a paragraph!</p> </section> </body> only the css is altered in each instance below. example 1 in this example, the paragraph is statically positioned, so its containing block is <section> bec...
...his is a paragraph!</p> </section> </body> only the css is altered in each instance below. example 1 in this example, the paragraph is statically positioned, so its containing block is <section> because it's the nearest ancestor that is a block container. ...
...And 10 more matches
border-block-start - CSS: Cascading Style Sheets
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. it corresponds to the bord...
...ponds to the border-top, border-right, border-bottom, or border-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. ...
...border-top, border-right, border-bottom, or border-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. ...
...And 10 more matches
border-image-slice - CSS: Cascading Style Sheets
orner regions. each one is used a single time to form the corners of the final border image. zones 5-8 are edge regions. these are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element. zone 9 is the middle region. it is discarded by default, but is used like a background image if the keyword fill is set. the border-image-repeat, border-image-width, and border-image-outset properties determine how these regions are used to form the final border image. syntax /* all sides */ border-image-slice: 30%; /* vertical | horizontal */ border-image-slice: 10% 30%; /* top | horizontal | bottom */ border-image-slice: 30 30% 45; /* top | right | bottom | left */ border-image-slice: 7 12 14 5; /* using the `fill` keyword */ border-image-slice: 10% ...
...d, can be placed anywhere in the declaration. values <number> represents an edge offset in pixels for raster images and coordinates for vector images. for vector images, the number is relative to the element's size, not the size of the source image, so percentages are generally preferable in these cases. <percentage> represents an edge offset as a percentage of the source image's size: the width of the image for horizontal offsets, the height for vertical offsets. fill preserves the middle image region and displays it like a background image, but stacked above the actual background. its width and height are sized to match the top and left image regions, respectively. formal definition initial value100%applies toall elements, except internal table elements when border-collapse is col...
...order-collapse is collapse. ...
...And 10 more matches
border-inline-start - CSS: Cascading Style Sheets
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 writing-mode, direction, and tex...
...ponds to the border-top, border-right, border-bottom, or border-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. ...
...border-top, border-right, border-bottom, or border-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. ...
...And 10 more matches
textLength - SVG: Scalable Vector Graphics
the textlength attribute, available on svg <text> and <tspan> elements, lets you specify the width of the space into which the text will draw. the user agent will ensure that the text does not extend farther than that distance, using the method or methods specified by the lengthadjust attribute. by default, only the spacing between characters is adjusted, but the glyph size can also be adjusted if you change lengthadjust. by using textlength, you can ensure that your svg text displays at the same width regardless of conditions including web fonts failing to load (or not having loaded yet). four elements are using this attribute: <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 60" xmlns="http://www.w3.org/2000/svg"> <text y="20" textlen...
... <number> a numeric value outlines a length referring to the units of the current coordinate system. example let's create a simple example that presents text you can resize using an <input> element of type "range". css .controls { font: 16px "open sans", "arial", sans-serif; } svg let's start with the s...
...e outlines a length referring to the units of the current coordinate system. example let's create a simple example that presents text you can resize using an <input> element of type "range". css .controls { font: 16px "open sans", "arial", sans-serif; } svg let's start with the svg. it's pretty basic, with a 1000-by-300 pixel space mapped into a 10 centimeter by 3 centimeter box. <svg width="10cm" height="3cm" viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg"> <rect x="1" y="1" width="998" height="298" fill="none" stroke="green" stroke-width="2"/> <text id="hello" x="10" y="150" font-family="sans-serif" font-size="60" fill="green"> hello world! </text> </svg> first, a <rect> element is used to create and stroke a rectangle to contain the text. th...
...And 10 more matches
Using the Right Markup to Invoke Plugins - Archive of obsolete content
icrosoft internet explorer and by mozilla-based browsers such as netscape 7. in ie, the object element is used to invoke a plugin that is built on the activex architecture. ...
...sers support the netscape plugin architecture, which is not com based like activex (and thus, not invoked via a unique identifier) but rather, mime type based. mozilla-based browsers support the use of the object element along with a mime type. ...
...y are in series, and not nested. ...
...And 9 more matches
Styling Vue components with CSS - Learn web development
in the assets folder it will be processed automatically. ...
... inherit; line-height: normal; -webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { /* 1 */ overflow: visible; } input[type="text"] { border-radius: 0; } body { width: 100%; max-width: 68rem; margin: 0 auto; font: 1.6rem/1.25 "helvetica neue", helvetica, arial, sans-serif; background-color: #f5f5f5; color: #4d4d4d; -moz-osx-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 th...
...order-color: lightgrey; } .btn__danger:focus { outline-color: #c82333; } .btn__primary { color: #fff; background-color: #000; } .btn-group { display: flex; justify-content: space-between; } .btn-group > * { flex: 1 1 auto; } .btn-group > * + * { margin-left: 0.8rem; } .label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } [class*="__lg"] { display: inline-block; width: 100%; font-size: 1.9rem; } [class*="__lg"]:not(:last-child) { margin-bottom: 1rem; } @media screen and (min-width: 620px) { [class*="__lg"] { font-size: 2.4rem; } } .visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); clip-path: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [c...
...And 9 more matches
imgIContainer
a service: var imgicontainer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.imgicontainer); method overview void addrestoredata([array, size_is(acount), const] in char data, in unsigned long acount); native code only! ...
...ta, in unsigned long acount); native code only! obsolete since gecko 2.0 void appendframe(in print32 ax, in print32 ay, in print32 awidth, in print32 aheight, in gfximageformat aformat, [array, size_is(imagelength)] out pruint8 imagedata, out unsigned long imagelength); native code only! obsolete since gecko 2.0 void appendpalettedframe(in print32 ax, in print32 ay, in print32 awidth, in print32 aheight, in gfximageformat aformat, in pruint8 apalettedepth, [array, size_is(imagelength)] out pruint8 imagedata, out unsigned long imagelength, [array, size_is(palettelength)] out pruint32 palettedata, out unsigned long palettelength); native code only! obsolete since gecko 2.0 void clear(); obsolete since gecko 1.9.2 gfximagesurface copycurrentframe(); native cod...
...ext, in gfxgraphicsfilter afilter, [const] in gfxmatrix auserspacetoimagespace, [const] in gfxrect afill, [const] in nsintrect asubimage, [const] in nsintsize aviewportsize, in pruint32 aflags); native code only! void endframedecode(in unsigned long framenumber); obsolete since gecko 2.0 void ensurecleanframe(in unsigned long aframenum, in print32 ax, in print32 ay, in print32 awidth, in print32 aheight, in gfximageformat aformat, [array, size_is(imagelength)] out pruint8 imagedata, out unsigned long imagelength); native code only! obsolete since gecko 2.0 imgicontainer extractcurrentframe([const] in nsintrect arect); native code only! obsolete since gecko 2.0 imgicontainer extractframe(in pruint32 awhichframe, [const] in nsintrect arect, in pruint32 aflag...
...And 9 more matches
Advanced animations - Web APIs
n the last chapter we made some basic animations and got to know ways to get things moving. in this part we will have a closer look at the motion itself and are going to add some physics to make our animations more advanced. drawing a ball we are going to use a ball for our animation studies, so let's first draw that ball onto the canvas. the following code will set us up. <canvas id="canvas" width="600" height="300"></canvas> as usual, we need a drawing context first. to draw 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(th...
...canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var raf; var ball = { x: 100, y: 100, vx: 5, vy: 2, radius: 25, color: 'blue', draw: function() { ctx.beginpath(); ctx.arc(this.x, this.y, this.radius, 0, math.pi * 2, true); ctx.closepath(); ctx.fillstyle = this.color; ctx.fill(); } }; function draw() { ctx.clearrect(0,0, canvas.width, canvas.height); ball.draw(); ball.x += ball.vx; ball.y += ball.vy; raf = window.requestanimationframe(draw); } canvas.addeventlistener('mouseover', function(e) { raf = window.requestanimationframe(draw); }); canvas.addeventlistener('mouseout', function(e) { window.cancelanimationframe(raf); }); ball.draw(); boundaries without any boundary collision testing our ball runs out of ...
...daries without any boundary collision testing our ball runs out of the canvas quickly. we need to check if the x and y position of the ball is out of the canvas dimensions and invert the direction of the velocity vectors. ...
...And 9 more matches
HTMLCanvasElement - Web APIs
the htmlcanvaselement interface provides properties and methods for manipulating the layout and presentation of <canvas> elements. the htmlcanvaselement interface also inherits the properties and methods of the htmlelement interface. ...
...ods of the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 9 more matches
SVGRectElement - Web APIs
the svgrectelement interface provides access to the properties of <rect> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 9 more matches
-webkit-border-before - CSS: Cascading Style Sheets
border property values in a single place in the style sheet. /* border values */ -webkit-border-before: 1px; -webkit-border-before: 2px dotted; -webkit-border-before: medium dashed blue; /* global values */ -webkit-border-before: inherit; -webkit-border-before: initial; -webkit-border-before: unset; -webkit-border-before can be used to set the values for one or more of: -webkit-border-before-width, -webkit-border-before-style, and -webkit-border-before-color. it maps to a physical border depending 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 writing-mode, direction, and text-orientation. it relates to -webkit-border-after, -webkit-border-start,...
...rder-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element. this property is on the standard track as border-block-start. ...
...ottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element. this property is on the standard track as border-block-start. ...
...And 9 more matches
transition-delay - CSS: Cascading Style Sheets
otes the amount of time to wait between a property's value changing and the start of the transition effect. ...
...a property's value changing and the start of the transition effect. ...
...heritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-delay: 0.5s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top color; -webkit-transition-duration:2s; -webkit-transition-delay:0.5s; -webkit-transition-timing-function: linear; transition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } .box1{ width: 50px; height: 50px; backgr...
...And 9 more matches
Basic shapes - SVG: Scalable Vector Graphics
parameters to describe the size and position of those shapes. some are slightly redundant in that they can be created by other shapes, but they're all there for your convenience and to keep your svg documents as short and as readable as possible. all the basic shapes are shown in the image to the right. ...
... they can be created by other shapes, but they're all there for your convenience and to keep your svg documents as short and as readable as possible. all the basic shapes are shown in the image to the right. ...
...your convenience and to keep your svg documents as short and as readable as possible. all the basic shapes are shown in the image to the right. ...
...And 9 more matches
Index - Archive of obsolete content
ummary! 929 max xul attributes, xul reference no summary! 930 maxheight xul attributes, xul reference no summary! 931 maxlength xul attributes, xul reference no summary! 932 maxpos xul attributes, xul reference no summary! 933 maxrows xul attributes, xul reference no summary! 934 maxwidth xul attributes, xul reference no summary! 935 member xul attributes, xul reference no summary! 936 menu xul attributes, xul reference no summary! 937 menuactive xul attributes, xul reference no summary! 938 menuitem.key xul attributes, xul reference no summary! 939 menuitem.name xul attrib...
...no summary! 940 menuitem.type xul attributes, xul reference more information on adding checkmarks to menus in the xul tutorial 941 min xul attributes, xul reference no summary! 942 minheight xul attributes, xul reference no summary! 943 minresultsforpopup xul attributes, xul reference no summary! 944 minwidth xul attributes, xul reference no summary! 945 mode no summary! 946 modifiers xul attributes, xul reference no summary! 947 mousethrough xul attributes, xul reference no summary! 948 movetoclick no summary! 949 multiline xul attributes, xul reference no summary! 950 multi...
... xul attributes, xul reference no summary! 1130 treecell.src xul attributes, xul reference no summary! 1131 treecol.editable xul attributes, xul reference no summary! 1132 treecol.src xul attributes, xul reference no summary! 1133 treecol.type xul attributes, xul reference no summary! 1134 treecol.width xul attributes, xul reference no summary! 1135 treeitem.label xul attributes, xul reference no summary! 1136 treelines no summary! 1137 type no summary! 1138 unread xul, xul attributes, xul reference no summary! 1139 uri xul, xul attribute, xul reference no summary! 1140 ...
...And 8 more matches
Table Reflow Internals - Archive of obsolete content
table reflow table reflows ro...
... ↙ ↘ ↓ nstablecol groupframe nstablerow groupframe nsblockframe ↓ ↓ nstablecol frame nstablerow frame ↓ nstablecell frame ↓ nsblock frame table reflow outer table reflows table and caption (if present) table reflows row groups in multiple passes pass 1 - unconstrained width, height and requests max elem width. the table figures out the column widths (balances) given the style width constraints on the table, col groups, cols, cells the preferred and max element sizes of the cells (from the pass 1 reflow), and considers colspans pass 2 - cell widths are constrained by the column widths (heights are only constrained in paginated mode). table reflow table reflows row groups (continued) the row group ...
...s row groups (continued) the row group figures out the row heights given its style height constraints, its rows and cells, and the actual heights of its rows and cells from the pass 2 reflow. if the table has a style height, it allocates extra height to its row groups, rows and cells. in each pass, row groups reflow rows which reflow cells which reflow cell blocks. ...
...And 8 more matches
2D maze game with device orientation - Game development
tml> so far we have a simple html website with some basic content in the <head> section: charset, title, css styling and the inclusion of the javascript files. the <body> contains initialization of the phaser framework and the definitions of the game states. var game = new phaser.game(320, 480, phaser.canvas, 'game'); the line above will initialize the phaser instance — the arguments are the width of the canvas, height of the canvas, rendering method (we're using canvas, but there are also webgl and auto options available) and the optional id of the dom container we want to put the canvas in. if there's nothing specified in that last argument or the element is not found, the canvas will be added to the <body> tag. without the framework, to add the canvas element to the page, you would have...
...as, but there are also webgl and auto options available) and the optional id of the dom container we want to put the canvas in. if there's nothing specified in that last argument or the element is not found, the canvas will be added to the <body> tag. without the framework, to add the canvas element to the page, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'></canvas> the important thing to remember is that the framework is setting up helpful methods to speed up a lot of things like image manipulation or assets management, which would be a lot harder to do manually. note: you can read the building monster wants candy article for the in-depth introduction to the basic phaser-specific functions and methods. back to game states: ...
...u, howto and game. boot will take care of initializing a few settings, preloader will load all of the assets like graphics and audio, mainmenu is the menu with the start button, howto shows the "how to play" instructions and the game state lets you actually play the game. let's quickly go though the content of those states. boot.js the boot state is the first one in the game. ...
...And 8 more matches
From object to iframe — other embedding technologies - Learn web development
e 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. ...
...inserts a tab character).</p> <textarea id="code" class="input" style="width: 95%;min-height: 100px;"> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventl...
...ea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const htmlsolution = '<iframe width="420" height="315" 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="4...
...And 8 more matches
Starting our Svelte Todo list app - Learn web development
n statically analyze our html templates to provide accessibility warnings when components are being compiled. accessibility (shortened to a11y) isn't always easy to get right, but svelte will help by warning you if you write inaccessible markup. ...
... <img> element to our todos.svelte component without its corresponding alt prop: <h1>svelte to-do list</h1> <img height="32" width="88" src="https://udn.realityripple.com/samples/b0/98dase3c7d.png"> the compiler will issue the following warning: (!) plugin svelte: a11y: <img> element should have an alt attribute src/components/todos.svelte 1: <h1>svelte to-do list</h1> 2: 3: <img height="32" width="88" src="https://udn.realityripple.com/samples/b0/98dase3c7d.png"> ^ created public/build/bundle.js in 220ms [2020-07-15 04:07:43] waiting for changes... moreover, our editor can display this warning even before calling the compiler: you can tell svelte to ignore this warning for the next block of markup with a comment beginning with svelte-ignore, like this: <!-- svelte-ignore a11y-mis...
....com/samples/b0/98dase3c7d.png"> ^ created public/build/bundle.js in 220ms [2020-07-15 04:07:43] waiting for changes... moreover, our editor can display this warning even before calling the compiler: you can tell svelte to ignore this warning for the next block of markup with a comment beginning with svelte-ignore, like this: <!-- svelte-ignore a11y-missing-attribute --> <img height="32" width="88" src="https://udn.realityripple.com/samples/b0/98dase3c7d.png"> note: with vscode you can automatically add this ignore comment by clicking on the quick fix... link or pressing ctrl + +. if you want to globally disable this warning you can add this onwarn handler to your rollup.config.js file inside the configuration for the svelte plugin, like this: plugins: [ svelte({ dev: !prod...
...And 8 more matches
64-bit Compatibility
this article focuses on hacking tracemonkey code generation (jstracer.cpp, jsregex.cpp) in ways that will work on both 32-bit and 64-bit jit backends. what widths are the random typedefs everywhere? the following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms: pointers uintptr_t, intptr_t, ptrdiff_t, (probably) size_t jsval jsuword, jsword length of a string, though the actual length cannot exceed 30 bits jsuintptr, jsintptr, jsptrdiff, jsuptrdiff, jssize, jsuword, jsword (let's not use these, kthx) the following types are 32-bit on 32-bit platforms. for all intents and purposes they are also 32-bit on 64-bit platforms: intn, uintn jsintn, jsuintn, jsbool general problems with pointers when performing bitwise operations on point...
...ten - see bug 501324, bug 512866 for example. amd64 pointers if mucking with pointers on amd64 (or em64-t/intel64), it is important to keep in mind an invariant that bits 63-48 must be sign-extended from bit 47. if you use these bits to squirrel away a payload, they must be adjusted before attempting to dereference the pointer. for more information and platform specific details on virtual address widths, see this article on wikipedia. builtins and calls when passing arguments to lirwriter::inscall(), there are four types: argsize_f - floating point value argsize_i - 32-bit integer argsize_q - 64-bit integer argsize_p - 32-bit integer on 32-bit platforms, 64-bit integer on 64-bit platforms. remember to use argsize_p where appropriate - on pointers or natively sized integers (including jsva...
...r::inscall(), there are four types: argsize_f - floating point value argsize_i - 32-bit integer argsize_q - 64-bit integer argsize_p - 32-bit integer on 32-bit platforms, 64-bit integer on 64-bit platforms. remember to use argsize_p where appropriate - on pointers or natively sized integers (including jsvals). similarly, when adding types to jsbuiltins.h, remember to use _js_ptr for pointer-width values. lir safety it is not immediately clear from reading lir which opcodes should be used for 64-bit safety. if you make a mistake, there's an extremely good chance the sanityfilter in nanojit will catch it while generating code. if this happens you will get an assert that points directly to the ill-typed lir. not all pointer-width values are actually pointers. to avoid equivocating, the rest ...
...And 8 more matches
Using images - Web APIs
rawing images once we have a reference to our source image object we can use the drawimage() method to render it to the canvas. as we will see later the drawimage() method is overloaded and has several variants. in its most basic form it looks like this: drawimage(image, x, y) draws the canvasimagesource specified by the image parameter at the coordinates (x, y). svg images must specify a width and height in the root <svg> element. example: a simple line graph in the following example, we will use an external image as the backdrop for a small line graph. using backdrops can make your script considerably smaller because we can avoid the need for code to generate the background. in this example, we're only using one image, so i use the image object's load event handler to execute the d...
...ke your script considerably smaller because we can avoid the need for code to generate the background. in this example, we're only using one image, so i use the image object's load event handler to execute the drawing statements. the drawimage() method places the backdrop at the coordinate (0, 0), which is the top-left corner of the canvas. ...
...ctx.moveto(30, 96); ctx.lineto(70, 66); ctx.lineto(103, 76); ctx.lineto(170, 15); ctx.stroke(); }; img.src = 'https://mdn.mozillademos.org/files/5395/backdrop.png'; } the resulting graph looks like this: screenshotlive sample scaling the second variant of the drawimage() method adds two new parameters and lets us place scaled images on the canvas. drawimage(image, x, y, width, height) this adds the width and height parameters, which indicate the size to which to scale the image when drawing it onto the canvas. example: tiling an image in this example, we'll use an image as a wallpaper and repeat it several times on the canvas. this is done simply by looping and placing the scaled images at different positions. in the code below, the first for loop iterates over th...
...And 8 more matches
HTMLIFrameElement - Web APIs
the htmliframeelement interface provides special properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements. ...
...ntation of inline frame elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 8 more matches
HTMLTableElement - Web APIs
the htmltableelement interface provides special properties and methods (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an html document. ...
...on of tables in an html document. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 8 more matches
Visualizations with Web Audio API - Web APIs
s for the original code in voice-change-o-matic), we first follow the standard pattern described in the previous section to set up the buffer: analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); next, we clear the canvas of what had been drawn on it before to get ready for the new visualization display: canvasctx.clearrect(0, 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.fillstyle = '...
... 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.fillstyle = '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.strokestyle = '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 earlier on), then define an x variable to define the posi...
...ill draw, then begin drawing a path canvasctx.linewidth = 2; canvasctx.strokestyle = '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 earlier on), then define an x variable to define the position to move to for drawing each segment of the line. ...
...And 8 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
en bring in a three-column layout for wider screens. i am going to create this layout using the named template areas that we learned about in the guide grid template areas. my mark-up is a container with elements inside for a header, footer, main content, navigation, sidebar, and a block into which i am intending to place advertising. ...
...the grid-area property. .main-head { grid-area: header; } .content { grid-area: content; } .main-nav { grid-area: nav; } .side { grid-area: sidebar; } .ad { grid-area: ad; } .main-footer { grid-area: footer; } this will not create any layout, however our items now have names we can use to do so. staying outside of any media queries i am now going to set up the layout for the mobile width. here i am keeping everything in source order, trying to avoid any disconnect between the source and display as described in the guide grid layout and accessibility. i have not defined any column or row tracks but this layout dictates a single column, and rows will be created as needed for each of the items in the implicit grid. .wrapper { display: grid; grid-gap: 20px; grid-template-areas...
... in the implicit grid. .wrapper { display: grid; grid-gap: 20px; grid-template-areas: "header" "nav" "content" "sidebar" "ad" "footer"; } after setting up a mobile layout we will get this single column at all screen sizes, we can now add a media query and redefine our layout for the circumstance of having enough screen real estate to show two columns. @media (min-width: 500px) { .wrapper { grid-template-columns: 1fr 3fr; grid-template-areas: "header header" "nav nav" "sidebar content" "ad footer"; } nav ul { display: flex; justify-content: space-between; } } you can see the layout taking shape in the value of grid-template-areas. the header spans over two column tracks, as does the nav. in the third ro...
...And 8 more matches
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
erties. the algorithm, in summary the algorithm can for the most part be summarized by these four rules. there are some edge cases that aren't covered by these rules, but this covers the majority of cases. if background-size specifies a fixed dimension (that is, percentages and relative units are fixed by their context), that dimension wins. if the image has an intrinsic ratio (that is, its width:height ratio is constant, such as 16:9, 4:3, 2.39:1, 1:1, and so forth), the rendered size preserves that ratio. if the image specifies a size, and the size isn't modified by constrain or cover, that specified size wins. if none of the above cases are met, the image is rendered at the same size as the background area. it's worth noting that the sizing algorithm only cares about the image's di...
...e svg source. dimensionless and proportionless this image is both dimensionless and proportionless. it doesn't care what size it is, nor does it care about remaining at a particular aspect ratio. this would make a good gradient desktop background that would work regardless of your screen size and its aspect ratio. ...
...rdless of your screen size and its aspect ratio. svg source one specified dimension and proportionless this image specifies a width of 100 pixels but no height or intrinsic ratio. this is, basically, a thin strip of wallpaper that could be stretched across the entire height of a block. svg source one specified dimension with intrinsic ratio this image specifies a 100 pixel height but no width. it also specifies an intrinsic aspect ratio of 3:4. this ensures that its width:height ratio is always 3:4, unless it's deliberately scaled to a disproportionate size (that is, by explicitly specifying both width and height that aren't of that ratio). ...
...And 8 more matches
mask-border - CSS: Cascading Style Sheets
the mask-border css shorthand property lets you create a mask along the edge of an element's border. constituent properties this property is a shorthand for the following css properties: mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width syntax /* source | slice */ mask-border: url('border-mask.png') 25; /* source | slice | repeat */ mask-border: url('border-mask.png') 25 space; /* source | slice | width */ mask-border: url('border-mask.png') 25 / 35px; /* source | slice | width | outset | repeat | mode */ mask-border: url('border-mask.png') 25 / 35px / 12px space alpha; values <'mask-border-source'> the source image. see mask-border-source. <'mask-border-slice'> the dimensions for slicing the source i...
... <'mask-border-outset'> the distance of the border mask from the element's outside edge. up to four values may be specified. see mask-border-outset. ...
... <'mask-border-outset'> the distance of the border mask from the element's outside edge. up to four values may be specified. see mask-border-outset. ...
...And 8 more matches
right - CSS: Cascading Style Sheets
Web › CSS › right
horizontal position of a positioned element. it has no effect on non-positioned elements. 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 /* <length> values */ right: 3px; right: 2.4em; /* <percentage>s of the width of the containing block */ right: 10%; /* keyword value */ right: auto; /* global values */ right: inherit; right: initial; right: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the right edge of the containing block. for relatively positioned elements, the distance that the element is moved to the l...
...ues */ right: inherit; right: initial; right: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the right edge of the containing block. for relatively positioned elements, the distance that the element is moved to the left of its normal position. <percentage> a <percentage> of the containing block's width. auto specifies that: for absolutely positioned elements, the position of the element is based on the left property, while width: auto is treated as a width based on the content; or if left is also auto, the element is positioned where it should horizontally be positioned if it were a static element. for relatively positioned elements, the distance of the element from its normal position ...
...t from its normal position. when position is set to sticky, the right property is used to compute the sticky-constraint rectangle. when position is set to static, the right property has no effect. when both left and right are defined, if not prevented from doing so by other properties, the element will stretch to satisfy both. ...
...And 8 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
in their initial state. you can explicitly set or change this layout using the orient attribute, with options for horizontal and vertical. align and pack the align and pack attributes both specify the layout of elements within a box. they can both take the values start (top or left), center, end (bottom or right), or stretch (extend this element to match the element with the greatest height or width). the align attribute is defined as operating in the axis perpendicular to the orient attribute, while the pack attribute operates along the same axis as the orient attribute. figure 2 shows how setting align="center" pack="start" on two elements will result in completely different output with the only difference being the value for orient. <box flex="1" align="end" pack="end"> <button label=...
...te. figure 2 shows how setting align="center" pack="start" on two elements will result in completely different output with the only difference being the value for orient. <box flex="1" align="end" pack="end"> <button label="happy"/> <button label="sad"/> </box> listing 2: how align and pack respond to orient figure 2: output from listing 2 flex elements ordinarily have fixed height and width. the flex attribute indicates that an element should be expanded to take up all of a window's height or width. flex takes a positive integer as a value, which is a growth multiple on the axis of the parent element'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...
...ue, they will be laid out in the same relative order they appear in the source code. the default value for ordinal is 1. ...
...And 7 more matches
jspage - Archive of obsolete content
ase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in element.shortstyles){if(g!=f){continue; }for(var e in element.shortstyles[f]){a.push(this.getstyle(e));}return a.join(" ");}a=this.getcomputedstyle(g);}if(a){a=string(a);var c=a.match(/rgba?\([\d\s,]+\)/); if(c){a=a.replace(c[0],c[0].rgbtohex());}}if(browser.engine.presto||(browser.engine.trident&&!$chk(parseint(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0; b.each(function(h){d+=this.getstyle("border-"+h+"-width").toint()+this.getstyle("padding-"+h).toint();},this);return this["offset"+g.capitalize()]-d+"px"; }if((browser.engine.presto)&&string(a).test("px")){return a;}if(g.test(/(border(.+)width|margin|padding)/)){return"0px";}}return a;},setstyles:function(b){for(var a in b){this.setst...
...px"; }if((browser.engine.presto)&&string(a).test("px")){return a;}if(g.test(/(border(.+)width|margin|padding)/)){return"0px";}}return a;},setstyles:function(b){for(var a in b){this.setstyle(a,b[a]); }return this;},getstyles:function(){var a={};array.flatten(arguments).each(function(b){a[b]=this.getstyle(b);},this);return a;}});element.styles=new hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxwidth:"@px",maxheight:"@px",minwidth:"@px",minheight:"@px",backgroundcolor:"rgb(@, @, @)",backgroundposition:"@px @px",color:"rgb(@, @, @)",fontsize:"@px",letterspacing:"@px",lineheight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderwidth:"@px @px @px @px",bordersty...
...ight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderwidth:"@px @px @px @px",borderstyle:"@ @ @ @",bordercolor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zindex:"@",zoom:"@",fontweight:"@",textindent:"@px",opacity:"@"}); element.shortstyles={margin:{},padding:{},border:{},borderwidth:{},borderstyle:{},bordercolor:{}};["top","right","bottom","left"].each(function(g){var f=element.shortstyles; var b=element.styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px";});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"width",a=e+"style",c=e+"color"; f[e]={};f.borderwidth[d]=f[e][d]=b[d]="@px";f.borderstyle[a]=f[e][a]=b[a]="@";f.bordercolor[c]=f[e][c]...
...And 7 more matches
resizer - Archive of obsolete content
e is complete. note: starting in gecko 2.0, you can also specify a target element using the element attribute, to use the resizer to resize the specified element instead of the window. ...
...an also specify a target element using the element attribute, to use the resizer to resize the specified element instead of the window. ...
...he element attribute, to use the resizer to resize the specified element instead of the window. ...
...And 7 more matches
Examples - Archive of obsolete content
--> <!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 3 - comments in xml</t...
... </p> <p> this document contains inline css rules contained in a <code>style</code> element and surrounded by a sgml comment. </p> <p> note how the css rules for the background are appl...
...les contained in a <code>style</code> element and surrounded by a sgml comment. </p> <p> note how the css rules for the background are applied in netscape 7.x, mozilla, opera 7 and internet explorer 5.5+. ...
...And 7 more matches
HTML text fundamentals - Learn web development
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 id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; fon...
...ory i am a statistician and my name is trish. ...
...arning: marking up an unordered list try editing the live sample below to create your very own html unordered list. ...
...And 7 more matches
Manipulating documents - Learn web development
bvious bits you'll reference regularly in your code — consider the following diagram, which represents the main parts of a browser directly involved in viewing web pages: the window is the browser tab that a web page is loaded into; this is represented in javascript by the window object. using methods available on this object you can do things like return the window's size (see window.innerwidth and window.innerheight), manipulate the document loaded into that window, store data specific to that document on the client-side (for example using a local database or other storage mechanism), attach an event handler to the current window, and more. the navigator represents the state and identity of the browser (i.e. the user-agent) as it exists on the web. in javascript, this is represented b...
... 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. ...
...backgroundcolor versus background-color). make sure you don't get these mixed up, otherwise it won't work. ...
...And 7 more matches
Using the viewport meta tag to control layout on mobile browsers
which case the browser provides scrollbars for the user to scroll around and access all the content. narrow screen devices (e.g. mobiles) render pages in a virtual window or viewport, which is usually wider than the screen, and then shrink the rendered result down so it can all be seen at once. users can then pan and zoom to see different areas of the page. for example, if a mobile screen has a width of 640px, pages might be rendered with a virtual viewport of 980px, and then it will be shrunk down to fit into the 640px space. this is done because many pages are not mobile optimized, and break (or at least look bad) when rendered at a small viewport width. this virtual viewport is a way to make non-mobile-optimized sites in general look better on narrow screen devices. enter viewport meta t...
... example, safari's documentation says the content is a "comma-delimited list," but existing browsers and web pages use any mix of commas, semicolons, and spaces as separators. learn more about viewports in different mobile browsers in a tale of two viewports at quirksmode.org. viewport basics a typical mobile-optimized site contains something like the following: <meta name="viewport" content="width=device-width, initial-scale=1"> the width property controls the size of the viewport. it can be set to a specific number of pixels like width=600 or to the special value device-width, which is the width of the screen in css pixels at a scale of 100%. (there are corresponding height and device-height values, which may be useful for pages with elements that change size or position based on the vie...
...eference pixel. it is recommended that the reference pixel be the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length. for web developers, this means that the size of a page is much smaller than the actual pixel count and browsers may size their layouts and images accordingly. but remember that not all mobile devices are the same width; you should make sure that your pages work well in a large variation of screen sizes and orientations. the default pixel ratio depends on the display density. on a display with density less than 200dpi, the ratio is 1.0. on displays with density between 200 and 300dpi, the ratio is 1.5. for displays with density over 300dpi, the ratio is the integer floor(density/150dpi). note that the default r...
...And 7 more matches
Animated PNG graphics
Mozilla › Tech › APNG
layed by decoders that do not support apng. the canvas is the area on the output device on which the frames are to be displayed. the contents of the canvas are not necessarily available to the decoder. as per the png specification, if a 'bkgd' chunk exists it may be used to fill the canvas if there is no preferrable background. the output buffer is a pixel array with dimensions specified by the width and height parameters of the png 'ihdr' chunk. conceptually, each frame is constructed in the output buffer before being composited onto the canvas. the contents of the output buffer are available to the decoder. the corners of the output buffer are mapped to the corners of the canvas. fully transparent black means red, green, blue and alpha components are all set to zero. for purposes of chunk...
...in the png specification, with three additional chunk types describing the animation and providing additional frame data. to be recognized as an apng, an 'actl' chunk must appear in the stream before any 'idat' chunks. the 'actl' structure is described below. conceptually, at the beginning of each play the output buffer must be completely initialized to a fully transparent black rectangle, with width and height dimensions from the 'ihdr' chunk. the default image may be included as the first frame of the animation by the presence of a single 'fctl' chunk before 'idat'. otherwise, the default image is not part of the animation. subsequent frames are encoded in 'fdat' chunks, which have the same structure as 'idat' chunks, except preceded by a sequence number. information for each frame about ...
...rwise, the default image is not part of the animation. subsequent frames are encoded in 'fdat' chunks, which have the same structure as 'idat' chunks, except preceded by a sequence number. information for each frame about placement and rendering is stored in 'fctl' chunks. the full layout of 'fdat' and 'fctl' chunks is described below. the boundaries of the entire animation are specified by the width and height parameters of the png 'ihdr' chunk, regardless of whether the default image is part of the animation. the default image should be appropriately padded with fully transparent pixels if extra space will be needed for later frames. each frame is identical for each play, therefore it is safe for applications to cache the frames. chunk sequence numbers the 'fctl' and 'fdat' chunks have a...
...And 7 more matches
Examples of web and XML development using the DOM - Web APIs
this chapter provides some longer examples of web and xml development using the dom. wherever possible, the examples use common apis, tricks, and patterns in javascript for manipulating the document object. ...
... this chapter provides some longer examples of web and xml development using the dom. wherever possible, the examples use common apis, tricks, and patterns in javascript for manipulating the document object. ...
... this chapter provides some longer examples of web and xml development using the dom. wherever possible, the examples use common apis, tricks, and patterns in javascript for manipulating the document object. ...
...And 7 more matches
HTMLHRElement - Web APIs
the htmlhrelement interface provides special properties (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating <hr> elements. ...
...) for manipulating <hr> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 7 more matches
HTMLObjectElement - Web APIs
the htmlobjectelement interface provides special properties and methods (beyond those on the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources. ...
... representing external resources. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 7 more matches
HTMLTableCellElement - Web APIs
the htmltablecellelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either header or data cells, in an html document. ...
... data cells, in an html document. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 7 more matches
SVGCircleElement - Web APIs
the svgcircleelement interface is an interface for the <circle> element. ...
...terface for the <circle> element. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 700 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 7 more matches
SVGEllipseElement - Web APIs
the svgellipseelement interface provides access to the properties of <ellipse> elements. ...
...llipse> elements. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 7 more matches
SVGTSpanElement - Web APIs
the svgtspanelement interface represents a <tspan> element. ...
...ace represents a <tspan> element. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 7 more matches
SVGTextElement - Web APIs
the svgtextelement interface corresponds to the <text> elements. ...
... <text> elements. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 7 more matches
Taking still photos with WebRTC - Web APIs
some page layout fluff and a bit of text offering a link back to this page. the javascript code now let's take a look at the javascript code. we'll break it up into a few bite-sized pieces to make it easier to explain. initialization we start by wrapping the whole script in an anonymous function to avoid global variables, then setting up various variables we'll be using. (function() { var width = 320; // we will scale the photo width to this var height = 0; // this will be computed based on the input stream var streaming = false; var video = null; var canvas = null; var photo = null; var startbutton = null; those variables are: width whatever size the incoming video is, we're going to scale the resulting image to be 320 pixels wide. height the output height o...
... streaming indicates whether or not there is currently an active stream of video running. ...
...gins to flow. to avoid blocking until that happens, we add an event listener to video for the canplay event, which is delivered when the video playback actually begins. at that point, all the properties in the video object have been configured based on the stream's format. ...
...And 7 more matches
Using CSS animations - CSS: Cascading Style Sheets
ment so that the text slides in from off the right edge of the browser window. note that animations like this can cause the page to become wider than the browser window. to avoid this problem put the element to be animated in a container, and set overflow:hidden on the container. p { animation-duration: 3s; animation-name: slidein; } @keyframes slidein { from { margin-left: 100%; width: 300%; } to { margin-left: 0%; width: 100%; } } in this example the style for the <p> element specifies that the animation should take 3 seconds to execute from start to finish, using the animation-duration property, and that the name of the @keyframes at-rule defining the keyframes for the animation sequence is named “slidein”. if we wanted any custom styling on the <p> ele...
... would include it here as well; however, in this case we don’t want any custom styling other than the animation effect. the keyframes are defined using the @keyframes at-rule. in this case, we have just two keyframes. the first occurs at 0% (using the alias from). here, we configure the left margin of the element to be at 100% (that is, at the far right edge of the containing element), and the width of the element to be 300% (or three times the width of the containing element). this causes the first frame of the animation to have the header drawn off the right edge of the browser window. the second (and final) keyframe occurs at 100% (using the alias to). the left margin is set to 0% and the width of the element is set to 100%. this causes the header to finish its animation flush against th...
...e codepen button to see the animation in the codepen environment. adding another keyframe let’s add another keyframe to the previous example’s animation. let’s say we want the header’s font size to increase as it moves from right to left for a while, then to decrease back to its original size. ...
...And 7 more matches
Basic Concepts of Multicol - CSS: Cascading Style Sheets
ase examples. key concepts and terminology multicol is unlike any of the other layout methods we have in css in that it fragments the content, including all descendent elements, into columns. this happens in the same way that content is fragmented into pages when we work with css paged media, for example by creating a print stylesheet. the properties defined by the specification are: column-width column-count columns column-rule-color column-rule-style column-rule-width column-rule column-span column-fill column-gap by adding column-count or column-width to an element, that element becomes a multi-column container, or multicol container for short. the columns are anonymous boxes and described as column boxes in the specification. defining columns to create a multicol containe...
... the column-count property the column-count property specifies the number of columns that you would like the content to be displayed as. the browser will then assign the correct amount of space to each column box to create the requested number of columns. ...
... in the above example the content is wrapped in paragraph p tags with default styling. therefore, there is a margin above each paragraph. you can see how this margin causes the first line of text to be pushed down. this is because a multicol container creates a new block formatting context (bfc) which means margins on child elements do not collapse with any margin on the container. ...
...And 7 more matches
Grid template areas - CSS: Cascading Style Sheets
isplay: grid; grid-template-columns: repeat(9, 1fr); grid-auto-rows: minmax(100px, auto); grid-template-areas: "hd hd hd hd hd hd hd hd hd" "sd sd sd main main main main main main" "ft ft ft ft ft ft ft ft ft"; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 940px; margin: 0 auto; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div class="header">header</div> <div class="sidebar">sidebar</div> <div class="content">content</div> <div class="footer">footer</div> </div> using this method we do not need to...
...i want to only display the footer directly under the main content i would need to leave the three cells underneath the sidebar empty. ...
... rows just as easily as columns. for example we could make our sidebar span down to the end of the footer by replacing the . with sd. ...
...And 7 more matches
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
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. ...
...xt 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. ...
... property border-block-end border-bottom border-block-end-color border-bottom-color border-block-end-style border-bottom-style border-block-end-width border-bottom-width border-block-start border-top border-block-start-color border-top-color border-block-start-style border-top-style border-block-start-width border-top-width border-inline-end border-right border-inline-end-color border-right-color border-inline-end-style border-right-style border-inline-end-width border-right-width border-inline-start border-left border-inline-start-color border-left-color border-inline-start-style border-left-style border...
...And 7 more matches
transition-duration - CSS: Cascading Style Sheets
een the two states will be instantaneous. a negative value for the time renders the declaration invalid. ...
.... a negative value for the time renders the declaration invalid. ...
...itednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-duration: 0.5s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top transform -webkit-transform color; -webkit-transition-duration:0.5s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top transform -webkit-transform color; transition-duration:0.5s; transition-timing-function: ease-in-out; } .box1{ transform: rotate(270deg); -w...
...And 7 more matches
transform - SVG: Scalable Vector Graphics
1 \end{pmatrix} \begin{pmatrix} x_{\mathrm{prevcoordsys}} \\ y_{\mathrm{prevcoordsys}} \\ 1 \end{pmatrix} = \begin{pmatrix} a x_{\mathrm{prevcoordsys}} + c y_{\mathrm{prevcoordsys}} + e \\ b x_{\mathrm{prevcoordsys}} + d y_{\mathrm{prevcoordsys}} + f \\ 1 \end{pmatrix} example html,body,svg { height:100% } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="30" height="20" fill="green" /> <!-- in the following example we are applying the matrix: [a c e] [3 -1 30] [b d f] => [1 3 40] [0 0 1] [0 0 1] which transform the rectangle as such: top left corner: oldx=10 oldy=10 newx = a * oldx + c * oldy + e = 3 * 10 - 1 * 10 + 30 = 50 newy = b * oldx + d * oldy + f = 1 * 10 + 3 * 10 + 40 = 80 top right corner: oldx=40 oldy=...
...if y is not provided, it is assumed to be 0. in other words: xnew = xold + <x> ynew = yold + <y> example html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- no transl...
... transform="matrix(3 1 -1 3 30 40)" /> </svg> translate the translate(<x> [<y>]) transform function moves the object by x and y. if y is not provided, it is assumed to be 0. ...
...And 7 more matches
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
e is a presentation attribute defining the algorithm to use to determine the inside part of a shape. 74 filter svg, svg attribute, svg filter the filter attribute specifies the filter effects defined by the <filter> element that shall be applied to its element. 75 filterres needsexample, svg, svg attribute, svg filter the filterres attribute indicates the width and height of the intermediate images in pixels of a filter primitive. 76 filterunits needsexample, svg, svg attribute, svg filter the filterunits attribute defines the coordinate system for the attributes x, y, width and height. 77 flood-color svg, svg attribute, svg filter the flood-color attribute indicates what color to use to flood the current filter...
...e. 131 markerheight needsexample, svg, svg attribute the markerheight attribute represents the height of the viewport into which the <marker> is to be fitted when it is rendered according to the viewbox and preserveaspectratio attributes. 132 markerunits needsexample, svg, svg attribute the markerunits attribute defines the coordinate system for the markerwidth and markerunits attributes and the contents of the <marker>. 133 markerwidth needsexample, svg, svg attribute the markerwidth attribute represents the width of the viewport into which the <marker> is to be fitted when it is rendered according to the viewbox and preserveaspectratio attributes. 134 mask svg, svg attribute the mask attribute is a presentatio...
...t of the path for the initial current text position along the path after converting the path to the <textpath> element's coordinate system. 193 stddeviation filters, svg, svg attribute the stddeviation attribute defines the standard deviation for the blur operation. 194 stemh deprecated, svg, svg attribute the stemh attribute indicates the horizontal stem width of the font. 195 stemv deprecated, svg, svg attribute the stemv attribute indicates the vertical stem width of the font. 196 stitchtiles filters, svg, svg attribute the stitchtiles attribute defines how the perlin noise tiles behave at the border. 197 stop-color needsexample, svg, svg attribute the stop-color attribute indicates what ...
...And 7 more matches
Gradients in SVG - SVG: Scalable Vector Graphics
dial. you must give the gradient an id attribute; otherwise it can't be referenced by other elements inside the file. gradients are defined in a defs section as opposed to on a shape itself to promote reusability. linear gradient linear gradients change along a straight line. to insert one, you create a <lineargradient> node inside the definitions section of your svg file. ...
...inside the linear gradient are several <stop> nodes. these nodes tell the gradient what color it should be at certain positions by specifying an offset attribute for the position, a...
...inside the linear gradient are several <stop> nodes. these nodes tell the gradient what color it should be at certain positions by specifying an offset attribute for the position, and a stop-color attribute. this can be assigned directly or throug...
...And 7 more matches
Paths - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Paths
(y) to move to. if the cursor was already somewhere on the page, no line is drawn to connect the two positions. the "move to" command appears at the beginning of paths to specify where the drawing should start. for example: m x y (or) m dx dy in the following example there's only a point at (10,10). note, though, that it wouldn't show up if a path was just drawn normally. for example: <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <path d="m10 10"/> <!-- points --> <circle cx="10" cy="10" r="2" fill="red"/> </svg> there are three commands that draw lines. the most generic is the "line to" command, called with l. l takes two parameters—x and y coordinates—and draws a line from the current position to a new position. l x y (or) l dx dy there are two a...
... and vertical lines. h draws a horizontal line, and v draws a vertical line. both commands only take one parameter since they only move in one direction. h x (or) h dx v y (or) v dy an easy place to start is by drawing a shape. we will start with a rectangle (the same type that could be more easily made with a <rect> element). it's composed of horizontal and vertical lines only. ...
...line should end. the other two are control points. (x1,y1) is the control point for the start of the curve, and (x2,y2) is the control point for the end. the control points essentially describe the slope of the line starting at each point. the bézier function then creates a smooth curve that transfers from the slope established at the beginning of the line, to the slope at the other end. ...
...And 7 more matches
Stack Positioning - Archive of obsolete content
ere, all three children are buttons, but the elements do not have to be same type. they may be any element, including boxes and other stacks. the size of a stack is determined by the positions of the child elements. it is always sized so that all of the child elements are visible (excluding any children with -moz-stack-sizing: ignore). so if you set a left attribute to 400, the stack will have a width around 400 pixels plus the width of the element. you can override this size with the various style properties such as width and max-width. you can use a script to adjust the value of the left and top attributes and thus make the elements move around. stacks have the advantage that when one absolutely positioned element changes its position, the position of the other elements is not affected. if ...
...at is, the first child of the stack appears at the back, the next child appears next and so on. the last element appears on top. you can use the dom functions to move the order of the elements around. when responding to mouse events, the elements on top will capture the events first. that means that if two buttons overlap, the top button will capture a mouse click where it covers the other one. ...
... appears on top. you can use the dom functions to move the order of the elements around. when responding to mouse events, the elements on top will capture the events first. that means that if two buttons overlap, the top button will capture a mouse click where it covers the other one. width and height the bottom and right attributes can also be used in conjunction with top and left to set the width and/or height of the children of the stack. ...
...And 6 more matches
XUL element attributes - Archive of obsolete content
this value applies to horizontally oriented boxes only. it causes the child elements to be aligned so that their text labels are lined up. stretch this is the default value. the child elements are stretched to fit the size of the box. for a horizontal box, the children are stretched to be the height of the box. for a vertical box, the children are stretched to be the width of the box. if the size of the box changes, the children stretch to fit. use the flex attribute to create elements that stretch in the opposite direction. left the elements are aligned on their left edges. center the elements are centered horizontally. right the elements are aligned on their right edge...
...ppear in the xul code. empty type: boolean set to true if the element is a container that contains no children. this will be set by the template builder as needed. equalsize type: one of the values below this attribute can be used to make the children of the element equal in size. always for a horizontally oriented element, this will make all of its children have the width of the widest child. for a vertically oriented element, this will make its children all have the height of the tallest child. never all of the children are displayed at the size required by the content or as specified by the width and height attributes or the css width and height properties. flags type: space-separated list of the values below a set of flags used for miscellaneou...
...d and the first one found in the window is used. left type: string (representing an integer) for elements placed directly within a stack, specifies the pixel position of the left edge of the element relative to the left edge of the stack. maxheight type: string (representing an integer) the maximum height of the element. this corresponds to the max-height css property. ...
...And 6 more matches
Sizing items in CSS - Learn web development
ed, 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 different ways we can size things in css. the natural or intrinsic size of things html elements have a natural size, set before they are affected by any css. a straightforward example is an image. an image has a width and a height defined in the image file it is embedding into the page. this size is described as the intrinsic size — which comes from the image itself. if you place an image on a page and do not change its height and width, either using attributes on the <img> tag or css, it will be displayed using that intrinsic size. we have given the image in the example below a border so that you can see t...
...he image in the example below a border so that you can see the extent of the file. an empty <div> however, has no size of its own. if you add a <div> to your html with no content, then give it a border as we did with the image, you will see a line on the page. this is the collapsed border on the element — there is no content to hold it open. in our example below, that border stretches to the width of the container, because it is a block level element, a behavior that should be starting to become familiar to you. it has no height (or size in the block dimension) because there is no content. in the example above, try adding some text inside the empty element. the border now contains that text because the height of the element is defined by the content. therefore the size of this <div> in ...
...the size of the content. again, this is the intrinsic size of the element — its size is defined by its content. setting a specific size we can of course give elements in our design a specific size. when a size is given to an element (and the content of which then needs to fit into that size) we refer to it as an extrinsic size. take our <div> from the example above — we can give it specific width and height values, and it will now have that size no matter what content is placed into it. as we discovered in our previous lesson on overflow, a set height can cause content to overflow if there is more content than the element has space to fit inside it. due to this problem of overflow, fixing the height of elements with lengths or percentages is something we need to do very carefully on th...
...And 6 more matches
Styling tables - Learn web development
ry as your other files. ...
...normally, table columns tend to be sized acco...
...normally, table columns tend to be sized according to how much content they contain, w...
...And 6 more matches
CSS values and units - Learn web development
eful planning you can make it so the size of text or other elements scale relative to everything else on the page. some of the most useful units for web development are listed in the table below. unit relative to em font size of the parent, in the case of typographical properties like font-size, and font size of the element itself, in the case of other properties like width. ex x-height of the element's font. ch the advance measure (width) of the glyph "0" of the element's font. rem font size of the root element. lh line height of the element. vw 1% of the viewport's width. vh 1% of the viewport's height. vmin 1% of the viewport's smaller dimension. vmax 1% of the viewpor...
...e of the root element. lh line height of the element. vw 1% of the viewport's width. vh 1% of the viewport's height. vmin 1% of the viewport's smaller dimension. vmax 1% of the viewport's larger dimension. exploring an example in the example below you can see how some relative and absolute length units behave. the first box has a width set in pixels. as an absolute unit this width will remain the same no matter what else changes. the second box has a width set in vw (viewport width) units. this value is relative to the viewport width, and so 10vw is 10 percent of the width of the viewport. ...
...to see this in action you'll have to try the example after opening it in its own browser tab. the third box uses em units. ...
...And 6 more matches
create fancy boxes - Learn web development
vity. it will not be done in one day, and some web developers spend their whole life having fun with it. we are about to see many examples, but we will always work on the most simple piece of html possible, a simple element: <div class="fancy">hi! i want to be fancy.</div> ok, that's a very small bit of html, what can we tweak on that element? all of the following: its box model properties: width, height, padding, border, etc. its background properties: background, background-color, background-image, background-position, background-size, etc. its pseudo-element: ::before and ::after and some aside properties like: box-shadow, transform, outline, etc. so we have a very large playground. let the fun begin. box model tweak the box model alone allows us to do some basic stuff, like add...
...ies to the limit by having negative padding and/or- margin by having border-radius larger than the actual size of the box. making circles <div class="fancy">hi! i want to be fancy.</div> this is something that is both very simple and very fun. the border-radius property is made to create a rounded corner applied to boxes, but what happens if the radius size is equal or larger than the actual width of the box? .fancy { /* within a circle, centered text looks prettier. */ text-align : center; /* let's avoid our text touching the border. as our text will still flow in a square, it looks nicer that way, giving the feeling that it's a "real" circle. */ padding : 1em; /* the border will make the circle visible. you could also use a background, as backgrounds...
... square, it looks nicer that way, giving the feeling that it's a "real" circle. */ padding : 1em; /* the border will make the circle visible. you could also use a background, as backgrounds are clipped by border radius */ border : 0.5em solid black; /* let's make sure we have a square. if it's not a square, we'll get an ellipsis rather than a circle ;) */ width : 4em; height : 4em; /* and let's turn the square into a circle */ border-radius: 100%; } yes, we get a circle: backgrounds when we talk about a fancy box, the core properties to handle that are background-* properties. when you start fiddling with backgrounds it's like your css box is turned into a blank canvas you'll fill. before we jump to some practical examples, let's step back...
...And 6 more matches
How can we design for all types of users? - Learn web development
font size must be n% of the previous element whose font size was expressed. if no parent can be found, the default font size within the browser is considered as the base size for the calculation (usually the equivalent of 16 pixels). em-based sizes: em this unit is calculated the same way as percents, except that you compute in portions of 1 and not portions of 100. it is said that "em" is the width of a capital “m” in the alphabet (roughly speaking, an “m” fits into a square). rem-based sizes: rem this unit is proportional to the root element's font size and is expressed as portions of 1, like em. suppose we wanted a base font size of 16px and an h1 (main heading) at the equivalent of 32px, yet if within the h1 we find a span with the subheading class, it too must be rendered at...
...t older browsers display fonts with their own internal engine. browser's engines will ignore any property or value in the css if they can't cope with them, so that your website is still usable if not true to your designer's vision. older browsers are on the way out anyway. note: your mileage may vary. if you have to cater to older browsers, you'll have to use ems and do a bit more math. line width there is a longstanding debate about line length on the web, but here's the story. back when we had newspapers, printers realized that the reader's eyes would have trouble going from one line to the next if the lines were too long. the solution? columns. of course the problem doesn't go away when we switch to the web. the reader's eyes act like a shuttle going from line to line. to make it easi...
... about line length on the web, but here's the story. back when we had newspapers, printers realized that the reader's eyes would have trouble going from one line to the next if the lines were too long. the solution? columns. of course the problem doesn't go away when we switch to the web. the reader's eyes act like a shuttle going from line to line. to make it easier on people's eyes, limit line width to around 60 or 70 characters. to achieve this, you can specify a size for your text's container. let's consider this html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>font size experiment</title> </head> <body> <div class="container"> <h1>this is our main heading <span class="subheading">this is our subheading</span> </h1> <p>[lengthly te...
...And 6 more matches
Example 1 - Learn web development
{ 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 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellips...
... 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { 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 ...
.../ 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; color: #ffffff; } result for basic state active state html <div class="select active"> <span cl...
...And 6 more matches
Adding vector graphics to the Web - Learn web development
've got elements for creating simple shapes, like <circle> and <rect>. more advanced svg features include <fecolormatrix> (transform colors using a transformation matrix,) <animate> (animate parts of your vector graphic,) and <mask> (apply a mask over the top of your image.) as a simple example, the following code creates a circle and a rectangle: <svg version="1.1" baseprofile="full" width="300" height="200" xmlns="http://www.w3.org/2000/svg"> <rect width="100%" height="100%" fill="black" /> <circle cx="150" cy="100" r="90" fill="blue" /> </svg> this creates the following output: from the example above, you may get the impression that svg is easy to handcode. yes, you can handcode simple svg in a text editor, but for a complex image this quickly starts to get very diff...
...lain svg to save space. also, please refer to this article describing how to prepare svgs for the web. adding svg to your pages in this section we'll go through the different ways in which you can add svg vector graphics to your web pages. the quick way: <img> to embed an svg via an <img> element, you just need to reference it in the src attribute as you'd expect. you will need a height or a width attribute (or both if your svg has no inherent aspect ratio). if you have not already done so, please read images in html. <img src="equilateral.svg" alt="triangle with all three sides equal" height="87" width="100" /> pros quick, familiar image syntax with built-in text equivalent available in the alt attribute. you can make the image into a hyperlink easily by nesting the ...
... svg code inside your html you can also open up the svg file in a text editor, copy the svg code, and paste it into your html document — this is sometimes called putting your svg inline, or inlining svg. make sure your svg code snippet begins 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. you can assign classes and ids to svg elements and style them with css, either within the svg or wherever you put the css style rules for your html document. in fact, you can use any svg presentation attribute a...
...And 6 more matches
Looping code - Learn web development
r again! let's look at an example to perfectly illustrate why loops are such a good thing. ...
...splay: 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; 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.fillstyle = 'rgba(255,0,0,0...
...lientwidth; 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.fillstyle = '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.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(widt...
...And 6 more matches
Object building practice - Learn web development
ly serve to style and position the <h1>, and get rid of any scrollbars or margin around the edge of the page (so that it looks nice and neat). some javascript that serves to set up the <canvas> element and provide a general function that we're going to use. the first part of the script looks like so: const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); const width = canvas.width = window.innerwidth; const height = canvas.height = window.innerheight; this script gets a reference to the <canvas> element, then calls the getcontext() method on it to give us a context on which we can start to draw. the resulting constant (ctx) is the object that directly represents the drawing area of the canvas and allows us to draw 2d shapes on it. next, we set constants ca...
...nvas.width = window.innerwidth; const height = canvas.height = window.innerheight; this script gets a reference to the <canvas> element, then calls the getcontext() method on it to give us a context on which we can start to draw. the resulting constant (ctx) is the object that directly represents the drawing area of the canvas and allows us to draw 2d shapes on it. next, we set constants called width and height, and the width and height of the canvas element (represented by the canvas.width and canvas.height properties) to equal the width and height of the browser viewport (the area that the webpage appears on — this can be gotten from the window.innerwidth and window.innerheight properties). note that we are chaining multiple assignments together, to get the variables all set quicker — ...
... color, size) { this.x = x; this.y = y; this.velx = velx; this.vely = vely; this.color = color; this.size = size; } here we include some parameters that define the properties each ball needs in order to function in our program: x and y coordinates — the horizontal and vertical coordinates where the ball starts on the screen. this can range between 0 (top left hand corner) to the width and height of the browser viewport (bottom right hand corner). horizontal and vertical velocity (velx and vely) — each ball is given a horizontal and vertical velocity; in real terms these values are regularly added to the x/y coordinate values when we animate the balls, to move them by this much on each frame. color — each ball gets a color. size — each ball gets a size — this is its ...
...And 6 more matches
nsIScreen
changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) use nsiscreenmanager to obtain references to screens. ...
...enmanager to obtain references to screens. implemented by: @mozilla.org/gfx/screenmanager;1 as a service: var screen = components.classes["@mozilla.org/gfx/screenmanager;1"] .getservice(components.interfaces.nsiscreen); method overview void getavailrect(out long left, out long top, out long width, out long height); void getrect(out long left, out long top, out long width, out long height); void lockminimumbrightness(in unsigned long brightness); void unlockminimumbrightness(in unsigned long brightness); attributes attribute type description colordepth long the screen's color depth; this is the number of bits used to represent a color. read only. pixeldepth long the screen's pixel depth; this i...
... 3 270° of rotation. methods getavailrect() returns a rectangle indicating the portion of the screen that is available for use. note: this returns a rectangle representing the region of the screen that is available for application use. for example, this would exclude the area occupied by the menu bar and dock on mac os x. void getavailrect( out long left, out long top, out long width, out long height ); parameters left the left edge of the available screen rectangle. top the top edge of the available screen rectangle. width the width of the available screen rectangle. height the height edge of the available screen rectangle. getrect() returns a rectangle indicating the entire screen's coordinate space. void getrect( out long left, out ...
...And 6 more matches
CSSMathSum - Web APIs
returned when the stylepropertymapreadonly.get() method is used on a css property whosevalue is created with a calc() function. 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. ...
...n. 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. 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. ...
...sum.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. 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.drawImage() - Web APIs
the specification permits any canvas image source (canvasimagesource), specifically, a cssimagevalue, an htmlimageelement, an svgimageelement, an htmlvideoelement, an htmlcanvaselement, an imagebitmap, or an offscreencanvas. ...
...the specification permits any canvas image source (canvasimagesource), specifically, a cssimagevalue, an htmlimageelement, an svgimageelement, an htmlvideoelement, an htmlcanvaselement, an imagebitmap, or an offscreencanvas. ...
...the specification permits any canvas image source (canvasimagesource), specifically, a cssimagevalue, an htmlimageelement, an svgimageelement, an htmlvideoelement, an htmlcanvaselement, an imagebitmap, or an offscreencanvas. ...
...And 6 more matches
Compositing example - Web APIs
rves the luma and chroma of the bottom layer, while adopting the hue of the top layer.', 'preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.', 'preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.', 'preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.' ].reverse(); var width = 320; var height = 340; main program when the page loads, this code runs to set up and run the example: window.onload = function() { // lum in srgb var lum = { r: 0.33, g: 0.33, b: 0.33 }; // resize canvas canvas1.width = width; canvas1.height = height; canvas2.width = width; canvas2.height = height; lightmix() colorsphere(); ...
... 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. ...
...rsphere(); 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 6 more matches
HTMLEmbedElement - Web APIs
ent interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <embed> elements. this topic describes the htmlembedelement interface as defined in the standard. it does not address earlier, non-standardized version of the interface. ...
...rdized version of the interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
HTMLInputElement - Web APIs
the htmlinputelement interface provides special properties and methods for manipulating the options, layout, and presentation of <input> elements. ...
...presentation of <input> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
HTMLPreElement - Web APIs
the htmlpreelement interface exposes specific properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating a block of preformatted text (<pre>). ...
...ock of preformatted text (<pre>). ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
HTMLSourceElement - Web APIs
the htmlsourceelement interface provides special properties (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating <source> elements. ...
...r manipulating <source> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
HTMLTableColElement - Web APIs
the htmltablecolelement interface provides special properties (beyond the htmlelement interface it also has available to it inheritance) for manipulating single or grouped table column elements. ...
...or grouped table column elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
HTMLTextAreaElement - Web APIs
the htmltextareaelement interface provides special properties and methods for manipulating the layout and presentation of <textarea> elements. ...
...sentation of <textarea> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
HTMLVideoElement - Web APIs
ediaelement and htmlelement. the list of supported media formats varies from one browser to the other. you should either provide your video in a single format that all the relevant browsers supports, or provide multiple video sources in enough different formats that all the browsers you need to support are covered. ...
...port are covered. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGForeignObjectElement - Web APIs
the svgforeignobjectelement interface provides access to the properties of <foreignobject> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGImageElement - Web APIs
the svgimageelement interface corresponds to the <image> element. ...
... <image> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGLineElement - Web APIs
the svglineelement interface provides access to the properties of <line> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGPathElement - Web APIs
the svgpathelement interface corresponds to the <path> element. ...
...e <path> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGPolygonElement - Web APIs
the svgpolygonelement interface provides access to the properties of <polygon> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGPolylineElement - Web APIs
the svgpolylineelement interface provides access to the properties of <polyline> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
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. ...
...endering devices. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGTextContentElement - Web APIs
the svgtextcontentelement interface is implemented by elements that support rendering child text content. it is inherited by various text-related interfaces, such as svgtextelement, svgtspanelement, svgtrefelement, svgaltglyphelement and svgtextpathelement. ...
...phelement and svgtextpathelement. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGTextPathElement - Web APIs
the svgtextpathelement interface corresponds to the <textpath> element. ...
...extpath> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGTextPositioningElement - Web APIs
the svgtextpositioningelement interface is implemented by elements that support attributes that position individual text glyphs. it is inherited by svgtextelement, svgtspanelement, svgtrefelement and svgaltglyphelement. ...
...efelement and svgaltglyphelement. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
SVGUseElement - Web APIs
svg use dom interface the svguseelement interface corresponds to the <use> element. ...
...he <use> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 6 more matches
Using media queries - CSS: Cascading Style Sheets
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. ...
...ch media feature expression must be surrounded by parentheses. name summary notes any-hover does any available input mechanism allow the user to hover over elements? added in media queries level 4. any-pointer is any available input mechanism a pointing device, and if so, how accurate is it? added in media queries level 4. aspect-ratio width-to-height aspect ratio of the viewport color number of bits per color component of the output device, or zero if the device isn't color color-gamut approximate range of colors that are supported by the user agent and output device added in media queries level 4. color-index number of entries in the output device's color lookup table, or zero if the d...
...f bits per color component of the output device, or zero if the device isn't color color-gamut approximate range of colors that are supported by the user agent and output device added in media queries level 4. color-index number of entries in the output device's color lookup table, or zero if the device does not use such a table device-aspect-ratio width-to-height aspect ratio of the output device deprecated in media queries level 4. device-height height of the rendering surface of the output device deprecated in media queries level 4. device-width width of the rendering surface of the output device deprecated in media queries level 4. display-mode the display mode of the application, as specified ...
...And 6 more matches
max-block-size - CSS: Cascading Style Sheets
the max-block-size css property specifies the maximum size of an element in the direction opposite that of the writing direction as specified by writing-mode. that is, if the writing direction is horizontal, then max-block-size is equivalent to max-height; if the writing direction is vertical, max-block-size is the same as max-width. the other dimension's maximum length is specified using the max-inline-size property. ...
...ize of an element in the direction opposite that of the writing direction as specified by writing-mode. that is, if the writing direction is horizontal, then max-block-size is equivalent to max-height; if the writing direction is vertical, max-block-size is the same as max-width. the other dimension's maximum length is specified using the max-inline-size property. ...
.... the other dimension's maximum length is specified using the max-inline-size property. this is useful because the max-width is always used for horizontal sizes and max-height is always used for vertical sizes, and if you need to set lengths based on the size of your text content, you need to be able to do so with the writing direction in mind. any time you would normally use max-height or max-width, you should instead use max-block-size to set the maximum "height" of the content (even though this may not be a vertical value) and max-inline-size to set the maximum "width" of the content (although this may instead be vertical rather than horizontal). see the example in writing-mode, which shows the different writing modes in action. the source for this interactive example is stored in a gi...
...And 6 more matches
text-transform - CSS: Cascading Style Sheets
rectly reinserted by text-transform: lowercase). the language is defined by the lang html attribute or the xml:lang xml attribute. note: support for language-specific cases varies between browsers, so check the browser compatibility table. syntax /* keyword values */ text-transform: none; text-transform: capitalize; text-transform: uppercase; text-transform: lowercase; text-transform: full-width; text-transform: full-size-kana; /* global values */ text-transform: inherit; text-transform: initial; text-transform: unset; capitalize is a keyword that converts the first letter of each word to uppercase. other characters remain unchanged (they retain their original case as written in the element's text). a letter is defined as a character that is part of unicode's letter or number gen...
...cleans this mess up. the capitalize line in the browser compatibility table contains the version the different engines started to support this now precisely-defined behavior. uppercase is a keyword that converts all characters to uppercase. lowercase is a keyword that converts all characters to lowercase. none is a keyword that prevents the case of all characters from being changed. full-width is a keyword that forces the writing of a character — mainly ideograms and latin scripts — inside a square, allowing them to be aligned in the usual east asian scripts (like chinese or japanese). full-size-kana generally used for <ruby> annotation text, the keyword converts all small kana characters to the equivalent full-size kana, to compensate for legibility issues at the small font siz...
... may be difficult for people with cognitive concerns such as dyslexia to read. mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal definition initial valuenoneapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | capitalize | uppercase | lowercase | full-width | full-size-kana examples none <p>initial string <strong>lorem ipsum dolor sit amet, consectetur adipisicing elit, ...</strong> </p> <p>text-transform: none <strong><span>lorem ipsum dolor sit amet, consectetur adipisicing elit, ...</span></strong> </p> span { text-transform: none; } strong { float: right; } this demonstrates no text transformation. capitalize (general) <p>initial...
...And 6 more matches
Setting up adaptive streaming media sources - Developer guides
ia players with a link to lookup files or playlists specifying the name and location of these stream folders. mpeg-dash encoding mpeg-dash is an adaptive bitrate streaming technique that enables streaming of media content over the internet delivered from conventional http web servers. a media presentation description (mpd) file is used to hold the information on the various streams and the bandwidths they are associated with. in your video source (src) attribute you point to the mpd instead of to the media file as you would with non-adaptive media. the mpd file tells the browser where the various pieces of media are located, it also includes meta data such as mimetype and codecs and there are other details such as byte-ranges in there too - it is an xml document and in many cases will be ge...
...r both live transmission and vod at a later stage *sidx or segmentindexbox is a structure describing a segment by giving its earliest presentation time and other meta-data and can often make up a large portion of the mpd file. ondemand profile this profile will allow switching between streams 'on demand' - that is to say that you only need provide a set of contiguous files and specify the bandwidth for each one and the appropriate file will be chosen automatically. here's a simple example that provides an audio track representation and four separate video representations. <?xml version="1.0" encoding="utf-8"?> <mpd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011 dash-mpd.xsd" type="static" ...
...:2011 dash-mpd.xsd" type="static" mediapresentationduration="pt654s" minbuffertime="pt2s" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"> <baseurl>http://example.com/ondemand/</baseurl> <period> <!-- english audio --> <adaptationset mimetype="audio/mp4" codecs="mp4a.40.5" lang="en" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="1" bandwidth="64000"> <baseurl>elephantsdream_aac48k_064.mp4.dash</baseurl> </representation> </adaptationset> <!-- video --> <adaptationset mimetype="video/mp4" codecs="avc1.42401e" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="2" bandwidth="100000" width="480" height="360"> <baseurl>elephantsdream_h264bpl30_0100.264.dash</baseurl> <...
...And 6 more matches
<input type="image"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › image
image rather than text. 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. value none — the value attribute should not be specified. events none. supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none. methods none. value <input type="image"> elements do not accept value attributes. the path to the image to be displayed is specified in the src attribute. additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the ...
...if provided, it must be a non-empty string appropriate as a label for the button. for example, if ...
...if provided, it must be a non-empty string appropriate as a label for the button. for example, if you have a gr...
...And 6 more matches
stroke-linejoin - SVG: Scalable Vector Graphics
ect of the "arcs" value with fallback to "miter" if not supported. ...
... example html,body,svg { height:100% } <svg viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the "beve...
...the corner is formed by extending the outer edges of the stroke at the tangents of the path segments until they intersect. note: i...
...And 6 more matches
<feComposite> - SVG: Scalable Vector Graphics
egoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes » presentation attributes » filter primitive attributes » class style specific attributes in in2 operator k1 k2 k3 k4 dom interface this element implements the svgfecompositeelement interface. ...
...compositing operators. the first set wipes out the background image by flooding with opaque white. ...
...runits="objectboundingbox" x="-5%" y="-5%" width="110%" height="110%"> <feflood flood-color="#ffffff" flood-opacity="1" result="flood"/> <fecomposite in="sourcegraphic" in2="backgroundimage" operator="over" result="comp"/> <femerge> <femergenode in="flood"/> <femergenode in="comp"/> </femerge> </filter> <filter id="inflood" filterunits="objectboundingbox" x="-5%" y="-5%" width="110%" height="110%"> <feflood flood-color="#ffffff" flood-opacity="1" result="flood"/> <fecomposite in="sourcegraphic" in2="backgroundimage" operator="in" result="comp"/> <femerge> <femergenode in="flood"/> <femergenode in="comp"/> </femerge> </filter> <filter id="outflood" filterunits="objectboundingbox" x="-5%" y="-5%" width="110%" height="110%"> <feflood flood-...
...And 6 more matches
Block and Line Layout Cheat Sheet - Archive of obsolete content
frame tree that is "too deep". (see nsframe::isframetreetoodeep().) ns_frame_has_dirty_children ns_frame_has_view ns_frame_independent_selection ns_frame_is_special nsblockframe mflags these flags are the private flags that are meaningful to block frames. ns_block_shrink_wrap causes the block to "shrink-wrap" around its content. this means the block will determine its children's width and make its content area that wide. finally, it will add padding and border to determine the final width. is this where the "tending towards zero width" stuff comes in? ns_block_no_auto_margins ns_block_margin_root indicates that this is a frame from which child margins can be calculated. the absence of this flag implies that child margin calculations should ignore the frame and look further...
...nes 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. ...
...nline 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 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 th...
...And 5 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
ummary! 182 max xul attributes, xul reference no summary! 183 maxheight xul attributes, xul reference no summary! 184 maxlength xul attributes, xul reference no summary! 185 maxpos xul attributes, xul reference no summary! 186 maxrows xul attributes, xul reference no summary! 187 maxwidth xul attributes, xul reference no summary! 188 member xul attributes, xul reference no summary! 189 menu xul attributes, xul reference no summary! 190 menuactive xul attributes, xul reference no summary! 191 menuitem.key xul attributes, xul reference no summary! 192 menuitem.name xul attrib...
...no summary! 193 menuitem.type xul attributes, xul reference more information on adding checkmarks to menus in the xul tutorial 194 min xul attributes, xul reference no summary! 195 minheight xul attributes, xul reference no summary! 196 minresultsforpopup xul attributes, xul reference no summary! 197 minwidth xul attributes, xul reference no summary! 198 mode no summary! 199 modifiers xul attributes, xul reference no summary! 200 mousethrough xul attributes, xul reference no summary! 201 movetoclick no summary! 202 multiline xul attributes, xul reference no summary! 203 multi...
...e xul attributes, xul reference no summary! 399 treecell.src xul attributes, xul reference no summary! 400 treecol.editable xul attributes, xul reference no summary! 401 treecol.src xul attributes, xul reference no summary! 402 treecol.type xul attributes, xul reference no summary! 403 treecol.width xul attributes, xul reference no summary! 404 treeitem.label xul attributes, xul reference no summary! 405 treelines no summary! 406 type no summary! 407 unread xul, xul attributes, xul reference no summary! 408 uri xul, xul attribute, xul reference no summary! 409 usera...
...And 5 more matches
splitter - Archive of obsolete content
etermines which side of the splitter is collapsed when its grippy is clicked. if this attribute is not specified, the splitter will not cause a collapse. you should put a grippy element inside the splitter when it is used for collapsing. none no collapsing occurs. before when the grippy is clicked, the element immediately before the splitter in the same parent is collapsed so that its width or height is 0. after when the grippy is clicked, the element immediately after the splitter in the same parent is collapsed so that its width or height is 0. both either the element immediately before the splitter, or the element immediately after the splitter can be collapsed, if the size of that element would fall below the minimum size due to the position of the splitter. r...
...ect on earlier versions. before the element immediately before the splitter is collapsed. after the element immediately after the splitter is collapsed. ...
... before the element immediately before the splitter is collapsed. after the element immediately after the splitter is collapsed. ...
...And 5 more matches
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
fish themselves, it was necessary to strip out all of the tables, font tags, and other non-validating stuff. at the end of it, there were a series of div elements that contained a picture of the fish, the name of the fish, and one or more paragraphs of text about the fish. here's a typical (and short) example. <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 abando...
...he 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 the div elements themselves. ...
...le. 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 the div elements themselves. since i wanted them to be side by side, it was important to be sure the total width of the element boxes (including margins) was less than 50%, so the first step was this: div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} by making the content of each card 45% the width of the containing element, and adding 2% margin to both the left and right sides, each card's element box is 49% as wide as the parent. two of them side by side will take up 98% the width of the parent element. this leaves out 2% as "wasted space," so to speak. i did it that way because it's a lot less likely to trigg...
...And 5 more matches
Supporting older browsers - Learn web development
a grid item loses the float behaviour, which means that by turning the wrapper into a grid container, the floated items become grid items. if the browser supports grid layout it will display the grid view, if not it ignores the display: grid and related properties and the floated layout is used. ...
...ay find you can give a decent experience by using css in this way. we add a simpler layout based on older and well-supported techniques, then use the newer css to create the layout that over 90% of your audience will see. there are cases, however, when the fallback code will need to include something that the new browsers will also interpret. a good example of this is if we were to add percentage widths to our floated items to make the columns more like the grid display, stretching to fill the container. in the floated layout, the percentage is calculated from the container — 33.333% is a third of the container width. in grid however that 33.333% is calculated from the grid area the item is placed in, so it actually becomes a third of the size we want once the grid layout is introduced. * ...
...ainer. in the floated layout, the percentage is calculated from the container — 33.333% is a third of the container width. in grid however that 33.333% is calculated from the grid area the item is placed in, so it actually becomes a third of the size we want once the grid layout is introduced. ...
...And 5 more matches
How CSS is structured - Learn web development
pected because something else in the stylesheet has more specificity. recognizing that more than one rule could apply to an element, is the first step in fixing these kinds of issues. properties and values at its most basic level, css consists of two components: properties: these are human-readable identifiers that indicate which stylistic features you want to modify. for example, font-size, width, background-color. values: each property is assigned a value. this value indicates how to style the property. the example below highlights a single property and value. the property name is color and the value is blue. when a property is paired with a value, this pairing is called a css declaration. css declarations are found within css declaration blocks. in the example below, highlighting ...
...imary way of defining layout and styling for a document. the css engine calculates which declarations apply to every single element of a page. important: css properties and values are case-sensitive. the property and value in each pair is separated by a colon. (:) look up different values of properties listed below. write css rules that apply styling to different html elements: font-size width background-color color border important: if a property is unknown, or if a value is not valid for a given property, the declaration is processed as invalid. it is completely ignored by the browser's css engine. important: in css (and other web standards), it has been agreed that us spelling is the standard where there is language variation or uncertainty. for example, color should be spe...
...pelled color, as colour will not work. functions while most values are relatively simple keywords or numeric values, there are some values which take the form of a function. an example would be the calc() function, which can do simple math within css: <div class="outer"><div class="box">the inner box is 90% - 30px.</div></div> .outer { border: 5px solid black; } .box { padding: 10px; width: calc(90% - 30px); background-color: rebeccapurple; color: white; } this renders as: a function consists of the function name, and parentheses to enclose the values for the function. in the case of the calc() example above, the values define the width of this box to be 90% of the containing block width, minus 30 pixels. the result of the calculation isn't something that can be computed i...
...And 5 more matches
Styling links - Learn web development
e link styles build on one another, for example the styles in the first rule will apply to all the subsequent ones, and when a link is being activated, it is also being hovered over. if you put these in the wrong order, things won't work properly. to remember the order, you could try using a mnemonic like love fears hate. ...
...cooler and just as functional as our example above. 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 insert the example we showed above. ...
...helvetica,arial,sans-serif;"> <h2>html input</h2> <textarea id="code" class="html-input" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"><p>there are several browsers available, such as <a href="#">mozilla firefox</a>, <a href="#">google chrome</a>, and <a href="#">microsoft edge</a>.</p></textarea> <h2>css input</h2> <textarea id="code" class="css-input" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;">a { } a:link { } a:visited { } a:focus { } a:hover { } a:active { }</textarea> <h2>output</h2> <div class="output" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"></div> <div class="controls"> <input id="reset" type="button" value="reset" style="margin: 10px 10px 0 0;"> <input id="soluti...
...And 5 more matches
Client-side form validation - Learn web development
ion> </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 attributes for a complete list of attributes that can ...
...t here is that setting the novalidate attribute on the form is what stops the form from showing its own error message bubbles, and allows us to instead display the custom error messages in the dom in some manner of our own choosing. ...
...tead display the custom error messages in the dom in some manner of our own choosing. ...
...And 5 more matches
How to build custom form controls - Learn web development
essary in order to manage the differences between the active state and the open state that do not exactly match. .select .optlist.hidden { /* this is a simple way to hide the list in an accessible way; we will talk more about accessibility in the end */ max-height: 0; visibility: hidden; } note: we could also have used transform: scale(1, 0) to give the optionlist no height and full width. beautification so now that we have the basic functionality in place, the fun can start. the following is just an example of what is possible, and will match the screenshot at the beginning of this article. however, you should feel free to experiment and see what you can come up with. .select { /* the computations are made assuming 1em == 16px which is the default value in most browsers. ...
...== 16px which is the default value in most browsers. if you are lost with px to em conversion, try http://riddle.pl/emcalc/ */ font-size : 0.625em; /* this (10px) is the new font size context for em value in this context */ font-family : verdana, arial, sans-serif; box-sizing : border-box; /* we need extra room for the down arrow we will add */ padding : .1em 2.5em .2em .5em; width : 10em; /* 100px */ border : .2em solid #000; border-radius : .4em; box-shadow : 0 .1em .2em rgba(0,0,0,.45); /* the first declaration is for browsers that do not support linear gradients. */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { /* because the value can be wider than our control, we have to make su...
... .2em solid #000; border-radius : .4em; box-shadow : 0 .1em .2em rgba(0,0,0,.45); /* the first declaration is for browsers that do not support linear gradients. */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { /* because the value can be wider than our control, we have to make sure it will not change the control's width. if the content overflows, we display an ellipsis */ display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow: ellipsis; vertical-align: top; } we don't need an extra element to design the down arrow; instead, we're using the :after pseudo-element. it could also be implemented using a simple background image on the select class. .select:after ...
...And 5 more matches
Beginning our React todo list - Learn web development
styles paste the following css code into src/index.css so that it replaces what's currently there: /* resets */ *, *::before, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; outline-offset: 0; } html { font: 62.5% / 1.15 sans-serif; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow: visible; background: transparent; color: inherit; font: inherit; line-height: normal; -webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { ov...
...t; font: inherit; line-height: normal; -webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { overflow: visible; } input[type="text"] { border-radius: 0; } body { width: 100%; max-width: 68rem; margin: 0 auto; font: 1.6rem/1.25 arial, sans-serif; background-color: #f5f5f5; color: #4d4d4d; } @media screen and (min-width: 620px) { body { font-size: 1.9rem; line-height: 1.31579; } } /*end resets*/ /* global styles */ .form-group > input[type="text"] { display: inline-block; margin-top: 0.4rem; } .btn { padding: 0.8rem 1rem 0.7rem; bord...
... #f5f5f5; color: #4d4d4d; } @media screen and (min-width: 620px) { body { font-size: 1.9rem; line-height: 1.31579; } } /*end resets*/ /* global styles */ .form-group > input[type="text"] { display: inline-block; margin-top: 0.4rem; } .btn { padding: 0.8rem 1rem 0.7rem; border: 0.2rem solid #4d4d4d; cursor: pointer; text-transform: capitalize; } .btn.toggle-btn { border-width: 1px; border-color: #d3d3d3; } .btn.toggle-btn[aria-pressed="true"] { text-decoration: underline; border-color: #4d4d4d; } .btn__danger { color: #fff; background-color: #ca3c3c; border-color: #bd2130; } .btn__filter { border-color: lightgrey; } .btn__primary { color: #fff; background-color: #000; } .btn-group { display: flex; justify-content: space-between; } .btn-group > * ...
...And 5 more matches
MathML Demo: <mspace> - space
mathml demo: <mspace> - space the background color of <mspace> elements has been set to yellow for easier viewing. you can set the width ∑ x y height ∫ x y and depth [ x y ] of mspace elements (click the math text to view the numeric values that are set). interactive sizing html content <p> use the control buttons below to adjust the parameters of the <code>mspace</code> element and see the effects. ...
... elements (click the math text to view the numeric values that are set). interactive sizing html content <p> use the control buttons below to adjust the parameters of the <code>mspace</code> element and see the effects. ...
...umeric values that are set). interactive sizing html content <p> use the control buttons below to adjust the parameters of the <code>mspace</code> element and see the effects. ...
...And 5 more matches
Element - Web APIs
Web › API › Element
, the htmlelement interface is the base interface for html elements, while the svgelement interface is the basis for all svg elements. most functionality is specified further down the class hierarchy. languages outside the realm of the web platform, like xul through the xulelement interface, also implement element. ...
...implement element. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
GlobalEventHandlers.onanimationiteration - Web APIs
which automatically pauses at the end of each iteration, allowing the user to choose whether or not to start the next iteration. much of this code is the same as in other examples of animation events, so it may look familiar. ...
...es at the end of each iteration, allowing the user to choose whether or not to start the next iteration. much of this code is the same as in other examples of animation events, so it may look familiar. ...
...xt iteration. much of this code is the same as in other examples of animation events, so it may look familiar. ...
...And 5 more matches
HTMLAudioElement - Web APIs
the htmlaudioelement interface provides access to the properties of <audio> elements, as well as methods to manipulate them. it's based on, and inherits properties and methods from, the htmlmediaelement interface. ...
..., the htmlmediaelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLBRElement - Web APIs
the htmlbrelement interface represents a html line break element (<br>). it inherits from htmlelement. ...
...>). it inherits from htmlelement. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLBaseElement - Web APIs
the htmlbaseelement interface contains the base uri for a document. this object inherits all of the properties and methods as described in the htmlelement interface. ...
...bed in the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLButtonElement - Web APIs
the htmlbuttonelement interface provides properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <button> elements. ...
...r manipulating <button> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLDListElement - Web APIs
the htmldlistelement interface provides special properties (beyond those of the regular htmlelement interface it also has available to it by inheritance) for manipulating definition list (<dl>) elements. ...
... definition list (<dl>) elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLDataElement - Web APIs
the htmldataelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <data> elements. ...
...for manipulating <data> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLDivElement - Web APIs
the htmldivelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <div> elements. ...
... for manipulating <div> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLElement - Web APIs
the htmlelement interface represents any html element. some elements directly implement this interface, while others implement it via an interface that inherits it. ...
... that inherits it. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLFieldSetElement - Web APIs
the htmlfieldsetelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <fieldset> elements. ...
...sentation of <fieldset> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLHeadElement - Web APIs
the htmlheadelement interface contains the descriptive information, or metadata, for a document. this object inherits all of the properties and methods described in the htmlelement interface. ...
...bed in the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLHeadingElement - Web APIs
the htmlheadingelement interface represents the different heading elements, <h1> through <h6>. it inherits methods and properties from the htmlelement interface. ...
...s from the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLHtmlElement - Web APIs
the htmlhtmlelement interface serves as the root node for a given html document. this object inherits the properties and methods described in the htmlelement interface. you can retrieve the htmlhtmlelement object for a given document by reading the value of the document.documentelement property. ...
...ocument.documentelement property. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLLIElement - Web APIs
the htmllielement interface exposes specific properties and methods (beyond those defined by regular htmlelement interface it also has available to it by inheritance) for manipulating list elements. ...
...) for manipulating list elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLLabelElement - Web APIs
the htmllabelelement interface gives access to properties specific to <label> elements. it inherits methods and properties from the base htmlelement interface. ...
...m the base htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLLegendElement - Web APIs
the htmllegendelement is an interface allowing to access properties of the <legend> elements. it inherits properties and methods from the htmlelement interface. ...
...s from the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLMapElement - Web APIs
the htmlmapelement interface provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements. ...
...and presentation of map elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLMediaElement.onencrypted - Web APIs
the onencrypted property of the htmlmediaelement is an event handler, fired whenever an encrypted event occurs, denoting the media is encrypted. this interface inherits from the extendableevent interface. ...
...bleevent interface. ...
...isplay: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 60" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLMetaElement - Web APIs
the htmlmetaelement interface contains descriptive metadata about a document. it inherits all of the properties and methods described in the htmlelement interface. ...
...bed in the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLMeterElement - Web APIs
the html <meter> elements expose the htmlmeterelement interface, which provides special properties and methods (beyond the htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements. ...
...presentation of <meter> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLModElement - Web APIs
the htmlmodelement interface provides special properties (beyond the regular methods and properties available through the htmlelement interface they also have available to them by inheritance) for manipulating modification elements, that is <del> and <ins>. ...
...lements, that is <del> and <ins>. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLOListElement - Web APIs
the htmlolistelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating ordered list elements. ...
...nipulating ordered list elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLOptGroupElement - Web APIs
the htmloptgroupelement interface provides special properties and methods (beyond the regular htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <optgroup> elements. ...
...sentation of <optgroup> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLOptionElement - Web APIs
the htmloptionelement interface represents <option> elements and inherits all classes and methods of the htmlelement interface. ...
...ods of the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLParagraphElement - Web APIs
the htmlparagraphelement interface provides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <p> elements. ...
...s) for manipulating <p> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLParamElement - Web APIs
the htmlparamelement interface provides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element. ...
...arameter for an <object> element. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLProgressElement - Web APIs
the htmlprogresselement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <progress> elements. ...
...sentation of <progress> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLQuoteElement - Web APIs
the htmlquoteelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element. ...
... <q>, but not the <cite> element. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLScriptElement - Web APIs
s should be served with the application/javascript mime type, but browsers are lenient and block them only if the script is served with an image type (image/*), video type (video/*), audio type (audio/*), or text/csv. if the script is blocked, its element receives an error event; otherwise, it receives a load event. ...
...erwise, it receives a load event. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLShadowElement - Web APIs
the htmlshadowelement interface represents a <shadow> html element, which is used in shadow dom. ...
...ent, which is used in shadow dom. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLTableCaptionElement - Web APIs
the htmltablecaptionelement interface special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating table caption elements. ...
...ipulating table caption elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLTableRowElement - Web APIs
the htmltablerowelement interface provides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of rows in an html table. ...
...ntation of rows in an html table. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLTableSectionElement - Web APIs
the htmltablesectionelement interface provides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies, in an html table. ...
...ers and bodies, in an html table. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLTemplateElement - Web APIs
the htmltemplateelement interface enables access to the contents of an html <template> element. ...
...ts of an html <template> element. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLTimeElement - Web APIs
the htmltimeelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <time> elements. ...
...for manipulating <time> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLTitleElement - Web APIs
the htmltitleelement interface contains the title for a document. this element inherits all of the properties and methods of the htmlelement interface. ...
...ods of the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLTrackElement - Web APIs
the htmltrackelement interface represents an html <track> element within the dom. this element can be used as a child of either <audio> or <video> to specify a text track containing information such as closed captions or subtitles. ...
... as closed captions or subtitles. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
HTMLUListElement - Web APIs
the htmlulistelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating unordered list elements. ...
...pulating unordered list elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
Capabilities, constraints, and settings - Web APIs
nstraints in the order specified in the constraint set. the most important thing to understand is that most constraints aren't requirements; instead, they're requests. there are exceptions, and we'll get to those shortly. requesting a specific value for a setting most simply, each constraint may be a specific value indicating a desired value for the setting. for example: let constraints = { width: 1920, height: 1080, aspectratio: 1.777777778 }; mytrack.applyconstraints(constraints); in this case, the constraints indicate that any values are fine for nearly all properties, but that a standard high definition (hd) video size is desired, with the standard 16:9 aspect ratio. there's no guarantee that the resulting track will match any of these, but the user agent should do its best to m...
...ptable for a property's value. you can specify ranges with either or both minimum and maximum values, and you can even specify an ideal value within the range, if you choose. if you provide an ideal value, the browser will try to get as close as possible to matching that value, given the other constraints specified. ...
...provide an ideal value, the browser will try to get as close as possible to matching that value, given the other constraints specified. let supports = navigator.mediadevices.getsupportedconstraints(); if (!supports["width"] || !supports["height"] || !supports["framerate"] || !supports["facingmode"]) { // we're missing needed properties, so handle that error. ...
...And 5 more matches
SVGAnimateElement - Web APIs
the svganimateelement interface corresponds to the <animate> element. ...
...animate> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGAnimateMotionElement - Web APIs
the svganimatemotionelement interface corresponds to the <animatemotion> element. ...
...emotion> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGAnimateTransformElement - Web APIs
the svganimatetransformelement interface corresponds to the <animatetransform> element. ...
...ansform> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGDefsElement - Web APIs
the svgdefselement interface corresponds to the <defs> element. ...
...e <defs> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGFEFuncAElement - Web APIs
the svgfefuncaelement interface corresponds to the <fefunca> element. ...
...fefunca> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGFEFuncBElement - Web APIs
the svgfefuncbelement interface corresponds to the <fefuncb> element. ...
...fefuncb> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGFEFuncGElement - Web APIs
the svgfefuncgelement interface corresponds to the <fefuncg> element. ...
...fefuncg> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGFEFuncRElement - Web APIs
the svgfefuncrelement interface corresponds to the <fefuncr> element. ...
...fefuncr> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGFilterElement - Web APIs
the svgfilterelement interface provides access to the properties of <filter> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGGElement - Web APIs
the svggelement interface corresponds to the <g> element. ...
... the <g> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGGeometryElement - Web APIs
the svggeometryelement interface represents svg elements whose rendering is defined by geometry with an equivalent path, and which can be filled and stroked. this includes paths and the basic shapes. ...
...the basic shapes. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGLinearGradientElement - Web APIs
the svglineargradientelement interface corresponds to the <lineargradient> element. ...
...radient> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGMaskElement - Web APIs
the svgmaskelement interface provides access to the properties of <mask> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGPatternElement - Web APIs
the svgpatternelement interface corresponds to the <pattern> element. ...
...pattern> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGRadialGradientElement - Web APIs
the svgradialgradientelement interface corresponds to the <radialgradient> element. ...
...radient> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGSetElement - Web APIs
the svgsetelement interface corresponds to the <set> element. ...
...he <set> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
SVGSwitchElement - Web APIs
the svgswitchelement interface corresponds to the <switch> element. ...
...<switch> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 5 more matches
WebGLRenderingContext.texSubImage2D() - Web APIs
the webglrenderingcontext.texsubimage2d() method of the webgl api specifies a sub-rectangle of the current texture. ...
...ffset, yoffset, format, type, htmlcanvaselement? pixels); void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, htmlvideoelement? pixels); void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, imagebitmap? ...
..., format, type, htmlvideoelement? pixels); void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, imagebitmap? ...
...And 5 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. ...
...se variable fonts 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...
...more data being 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 us...
...And 5 more matches
CSS reference - CSS: Cascading Style Sheets
Web › CSS › Reference
r()b::backdropbackdrop-filterbackface-visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-size<basic-shape>::before (:before)bleed (@page)<blend-mode>block-sizeblur()borderborder-blockborder-block-colorborder-block-endborder-block-end-colorborder-block-end-styleborder-block-end-widthborder-block-startborder-block-start-colorborder-block-start-styleborder-block-start-widthborder-block-styleborder-block-widthborder-bottomborder-bottom-colorborder-bottom-left-radiusborder-bottom-right-radiusborder-bottom-styleborder-bottom-widthborder-collapseborder-colorborder-end-end-radiusborder-end-start-radiusborder-imageborder-image-outsetborder-image-repeatborder-image-sliceborder-image-s...
...border-block-start-colorborder-block-start-styleborder-block-start-widthborder-block-styleborder-block-widthborder-bottomborder-bottom-colorborder-bottom-left-radiusborder-bottom-right-radiusborder-bottom-styleborder-bottom-widthborder-collapseborder-colorborder-end-end-radiusborder-end-start-radiusborder-imageborder-image-outsetborder-image-repeatborder-image-sliceborder-image-sourceborder-image-widthborder-inlineborder-inline-colorborder-inline-endborder-inline-end-colorborder-inline-end-styleborder-inline-end-widthborder-inline-startborder-inline-start-colorborder-inline-start-styleborder-inline-start-widthborder-inline-styleborder-inline-widthborder-leftborder-left-colorborder-left-styleborder-left-widthborder-radiusborder-rightborder-right-colorborder-right-styleborder-right-widthborder-sp...
...order-inline-start-styleborder-inline-start-widthborder-inline-styleborder-inline-widthborder-leftborder-left-colorborder-left-styleborder-left-widthborder-radiusborder-rightborder-right-colorborder-right-styleborder-right-widthborder-spacingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearclipclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradie...
...And 5 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
prefixed with -epub-. webkit-only properties note: avoid using on websites. these properties will only work in webkit applications. ...
...kit applications. ...
...ct-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** -webkit-box-pack** -webkit-bo...
...And 5 more matches
border-block-end - CSS: Cascading Style Sheets
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 to the border-top, border...
...ponds to the border-top, border-right, border-bottom, or border-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. ...
...border-top, border-right, border-bottom, or border-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. ...
...And 5 more matches
border-bottom - 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. 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; ... ...
...-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. constituent properties this property is a shorthand for the following css properties: border-bottom-color border-bottom-style border-bottom-width syntax border-bottom: 1px; border-bottom: 2px dotted; border-bottom: medium dashed blue; 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-bottom-width. <br-style> see border-bottom-style. <color> see border-bottom-color. formal definition initial valueas each of the properties of the shor...
...ttom: 1px; border-bottom: 2px dotted; border-bottom: medium dashed blue; 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-bottom-width. <br-style> see border-bottom-style. <color> see border-bottom-color. formal definition initial valueas each of the properties of the shorthand:border-bottom-width: mediumborder-bottom-style: noneborder-bottom-color: currentcolorapplies toall elements. ...
...And 5 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). ...
...awn 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. 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;...
...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: initial; column-rule: unset; the column-rule property is specified as one, two, or three of the values listed below, in any order. ...
...And 5 more matches
flex-basis - CSS: Cascading Style Sheets
y sets the initial main size of a flex item. it sets the size of the content box unless otherwise set with box-sizing. 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. ...
...e 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: in case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority. ...
...negative values are invalid. defaults to auto. content indicates automatic sizing, based on the flex item’s content. note: this value was not present in the initial release of flexible box layout, and thus some older implementations will not support it. the ...
...And 5 more matches
flex - CSS: Cascading Style Sheets
Web › CSS › flex
o 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: flex-grow flex-shrink flex-basis syntax /* keyword values */ flex: auto; flex: initial; flex: none; /* one value, unitless number: flex-grow */ flex: 2; /* one value, width/height: flex-basis */ flex: 10em; flex: 30%; flex: min-content; /* two values: flex-grow | flex-basis */ flex: 1 30px; /* two values: flex-grow | flex-shrink */ flex: 2 2; /* three values: flex-grow | flex-shrink | flex-basis */ flex: 2 2 10%; /* global values */ flex: inherit; flex: initial; flex: unset; the flex property may be specified using one, two, or three values. one-value synta...
... this case it is interpreted as flex: <number> 1 0; the <flex-shrink> value is assumed to be 1 and the <flex-basis> value is assumed to be 0. one of the keywords: none, auto, or initial. two-value syntax: the first value must be a <number> and it is interpreted as <flex-grow>. the second value must be one of: a <number>: then it is interpreted as <flex-shrink>. a valid value for width: then it is interpreted as <flex-basis>. three-value syntax: the values must be in the following order: a <number> for <flex-grow>. a <number> for <flex-shrink>. a valid value for width for <flex-basis>. values initial the item is sized according to its width and height properties. it shrinks to its minimum size to fit the container, but does not grow to absorb any ex...
...for <flex-grow>. a <number> for <flex-shrink>. a valid value for width for <flex-basis>. values initial the item is sized according to its width and height properties. it shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container. this is equivalent to setting "flex: 0 1 auto". auto the item is sized according to its width and height properties, but grows to absorb any extra free space in the flex container, and shrinks to its minimum size to fit the container. this is equivalent to setting "flex: 1 1 auto". none the item is sized according to its width and height properties. it is fully inflexible: it neither shrinks nor grows in relation to the flex container. this is equivalent to setting "flex: 0 0 auto". <'...
...And 5 more matches
font-variant-east-asian - CSS: Cascading Style Sheets
ruby t...
... ruby this keyword forces the use of ...
... ruby this keyword forces the use of special glyphs for ruby characters. as these are usuall...
...And 5 more matches
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
Web › HTML › Element › source
element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlsourceelement attributes this element includes the global attributes. media media query of the resource's intended media; this should be used only in a <picture> element. ...
... the sizes attribute has an effect only when the <source> element is the direct child of a <picture> element. src required for <audio> and <video>, address of the media resource. ...
...> element. src required for <audio> and <video>, address of the media resource. the value of this attribute is ignored when the <source> element is placed inside a <picture> element. srcset a list of one or more strings separated by commas indicating a set of possible images represented by the source for the browser to use. each string is composed of: one url specifying an image. a width descriptor, which consists of a string containing a positive integer directly followed by "w", such as 300w. the default value, if missing, is the infinity. a pixel density descriptor, that is a positive floating number directly followed by "x". the default value, if missing, is 1x. each string in the list must have at least a width descriptor or a pixel density descriptor to be valid. amon...
...And 5 more matches
Classes - JavaScript
s are in fact "special functions", and just as you can define function expressions and function declarations, the class syntax has two components: class expressions and class declarations. class declarations one way to define a class is using a class declaration. to declare a class, you use the class keyword with the name of the class ("rectangle" here). class rectangle { constructor(height, width) { this.height = height; this.width = width; } } hoisting an important difference between function declarations and class declarations is that function declarations are hoisted and class declarations are not. you first need to declare your class and then access it, otherwise code like the following will throw a referenceerror: const p = new rectangle(); // referenceerror class recta...
... const p = new rectangle(); // referenceerror class rectangle {} class expressions a class expression is another way to define a class. class expressions can be named or unnamed. the name given to a named class expression is local to the class's body. (it can be retrieved through the class's (not an instance's) name property, though). ...
...or class rectangle {} class expressions a class expression is another way to define a class. class expressions can be named or unnamed. the name given to a named class expression is local to the class's body. (it can be retrieved through the class's (not an instance's) name property, though). // unnamed let rectangle = class { constructor(height, width) { this.height = height; this.width = width; } }; console.log(rectangle.name); // output: "rectangle" // named let rectangle = class rectangle2 { constructor(height, width) { this.height = height; this.width = width; } }; console.log(rectangle.name); // output: "rectangle2" note: class expressions are subject to the same hoisting restrictions as described in the class declarations section. class body and method ...
...And 5 more matches
Patterns - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Patterns
« previousnext » patterns patterns are arguably one of the more confusing fill types to use in svg. they're also very powerful, so they're worth talking about and getting at least a fundamental grasp on. like gradients, the <pattern> element should be put in the <defs> section of your svg file. ...
...ttp://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient1"> <stop offset="5%" stop-color="white"/> <stop offset="95%" stop-color="blue"/> </lineargradient> <lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1"> <stop offset="5%" stop-color="red"/> <stop offset="95%" stop-color="orange"/> </lineargradient> <pattern id="pattern" x="0" y="0" width=".25" height=".25"> <rect x="0" y="0" width="50" height="50" fill="skyblue"/> <rect x="0" y="0" width="25" height="25" fill="url(#gradient2)"/> <circle cx="25" cy="25" r="20" fill="url(#gradient1)" fill-opacity="0.5"/> </pattern> </defs> <rect fill="url(#pattern)" stroke="black" width="200" height="200"/> </svg> screenshotlive sample inside the <pattern> element, you ...
... can be styled using any of the styles you've learned before, including gradients and opacity. here, we've just drawn two rectangle elements inside the pattern (which overlap, and one of which is twice the size of the other and is used to fill in the entire pattern), and one circle. the confusing thing about patterns is defining a unit system and their size. in the example above, we've defined a width and height attribute on the pattern element to describe how far the pattern should go before it begins repeating itself again. there are also x and y attributes available if you want to offset the start point of this rectangle somewhere within your drawing. the reason they've been used here is described below. as with the gradientunits attribute used above, patterns also have an attribute, patte...
...And 5 more matches
Compiling an Existing C Module to WebAssembly - WebAssembly
a. luckily, the canvas api has canvasrenderingcontext2d.getimagedata — that gives you an uint8clampedarray containing the image data in rgba: async function loadimage(src) { // load image const imgblob = await fetch(src).then(resp => resp.blob()); const img = await createimagebitmap(imgblob); // make canvas same size as image const canvas = document.createelement('canvas'); canvas.width = img.width; canvas.height = img.height; // draw image onto canvas const ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); return ctx.getimagedata(0, 0, img.width, img.height); } now it's "only" a matter of copying the data from javascript into wasm. for that, you need to expose two additional functions — one that allocates memory for the image inside wasm and one that frees i...
...the pointer returned by malloc() is the address of the first memory cell of that buffer. ...
...the pointer returned by malloc() is the address of the first memory cell of that buffer. when the pointer is returned to javascript land, it is treated as just a number. ...
...And 5 more matches
panel - Archive of obsolete content
ned by a different add-on sdk based extension. if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method. panel content the panel's content is specified as html, which is loaded from the url supplied in the contenturl option to the panel's constructor. you can load remote html into the panel: var mypanel = require("sdk/panel").panel({ width: 180, height: 180, contenturl: "https://en.wikipedia.org/w/index.php?title=jetpack&useformat=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is most probably how you will create dialogs. to do this, save the html in your add-on's data directory and load it using the data.url() method exported by the self module, like this: var mypanel = ...
...ntrusted" warning) does not work, so panels which trigger it will be broken (bug 1031554). mouse button shortcuts, such as using the middle button to open a link in a new page, don't work. scrolling using keyboard doesn't work properly (bug 1001914) globals constructors panel(options) creates a panel. parameters options : object optional options: name type width number the width of the panel in pixels. optional. height number the height of the panel in pixels. optional. position object, button, widget the position of the panel. ignored if the panel is opened by a widget. this may be one of three things: a toggle button. if this is supplied the panel will be shown attached...
...} }).show(); // show the panel centered vertically and // aligned to the left of the content area require("sdk/panel").panel({ position: { left: 0 } }).show(); // centered panel, default behavior require("sdk/panel").panel({}).show(); as with the css top, bottom, left, and right properties, setting both top and bottom or both left and right will implicitly set the panel's height or width relative to the content window: // show the panel centered horizontally, with: // - the top edge 40px from the top // of the content window // - the bottom edge 100px from the bottom // of the content window require("sdk/panel").panel({ position: { top: 40, bottom: 100 } }).show(); if you set both top and bottom, but also set the panel's height explicitly using the height p...
...And 4 more matches
Canvas code snippets - Archive of obsolete content
number of pixels of a certain color in a canvas the following function will return the number of pixels in a canvas that have the rgb color of r, g and b. this can be very useful to compare for example if a user has painted over another area as explained in this blog post. ...
...sring', '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', 'fillstyle', 'font', 'globalalpha', 'globalcompositeoperation', 'linecap', 'linejoin', 'linewidth', 'miterlimit', 'shadowoffsetx', 'shadowoffsety', 'shadowblur', 'shadowcolor', 'strokestyle', 'textalign', 'textbaseline']; for (let m of methods) { let method = m; canvas2dcontext.prototype[method] = function() { this.ctx[method].apply(this.ctx, arguments); return this; }; } for (let m of gettermethods) { let method = m; canvas2dcontext.prototype[metho...
...d, the remotepageloaded method fires. this method gets a reference to the iframe's window and draws this window to a canvas object. note that this only works if you are running the page from chrome. if you try running the code as a plain webpage, you will get a 'security error" code: "1000' error. ...
...And 4 more matches
The Box Model - Archive of obsolete content
, screen sizes and resolutions. the xul box model is a significant improvement over the html layout model, which is mostly vertical. with xul you can define vertically oriented as well as horizontally oriented interfaces, providing greater flexibility in interface design. any xul interface can be broken down into the following basic components: boxes text images alignment and flexibility widths and heights margins and paddings menus, toolbar buttons, and even the most complex elements in xul are composed of these simple ingredients. complex elements are created from simpler ones through xbl, which will be covered later on. once you grasp this simple idea, you'll be able to use the dom inspector and css to mold xul elements and layouts with great precision and flexibility. most of t...
...e "parrot" button still has a flex value of 1. the "cat" button is now larger in a 3 to 1 proportion. note that, again, this can depend on the contents of the elements, 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 b...
...enever possible. using the former allows the ui to scale proportionately depending on font size settings, which are often changed by users with accessibility limitations. a common exception to this rule is when your css is directly related to images, where you'll usually handle measurements in pixels (px). also, just like in html, you can control the dimensions of inflexible elements using the width and height css properties and attributes. these attributes won't have any effect on flexible elements. margins, paddings and spacers margins and paddings are frequently used in both html and xul to define spacing between elements and inside of elements. the margin determines the space between an element and the elements surrounding it, while the padding determines the space between the borders ...
...And 4 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
are specified. ...
... javascript and css since mozil...
... javascript and css since mozilla supports the css standards, it also supports the css dom standard for setting css through javascript. ...
...And 4 more matches
Things I've tried to do with XUL - Archive of obsolete content
short answer: you can't easily, at least not yet. ...
...xperiences here. how do i use percentage-based height/width with xul? short answer: you can't easily, at least not yet. this means that creating any sort of visual display (not necessarily "ui"; my use case is for creating a calendar time display) that sizes sanely when the user resizes the 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. <vbox flex="1"> <box height="30%" flex="1" style="background: green;"/> <box height="20%" flex="1" style="background: red;"/> <box height="50%" flex="1" ...
...ways maintaining a 30%-20%-50% ratio to the height of the parent vbox. <vbox flex="1"> <box height="30%" flex="1" style="background: green;"/> <box height="20%" flex="1" style="background: red;"/> <box height="50%" flex="1" style="background: blue;"/> </vbox> workaround: no real good ones; the closest i've gotten is to use a div instead of a box container: <html:div style="-moz-box-flex: 1; width: 100%; height: 100%;"> <box style="height: 30%" flex="1" style="background: green;"/> <box style="height: 20%" flex="1" style="background: green;"/> <box style="height: 50%" flex="1" style="background: green;"/> </html:div> using flex="3" flex="2" flex="5" would give the right display visually for the empty boxes; however, flex only applies to how empty space is allocated. so, as soon as you ...
...And 4 more matches
menulist - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. ...
...if the text does not match any of the items in the list, the menu selection is cleared. if this attribute is false, the selection is never updated to match the text box. ...
...And 4 more matches
stack - Archive of obsolete content
Archive › Mozilla › XUL › stack
element is placed on the bottom and each successive child is placed above the previous. all elements are displayed at once. child elements may also be placed at absolute positions within the stack. the top, right, bottom, and left attributes on a child of the stack specify the position of that element. ...
... stack. the top, right, bottom, and left attributes on a child of the stack specify the position of that element. the bottom and right attributes can also be used in conjunction with top and left to set the width and/or height of the children of the stack. note that bottom and right attributes, unlike rect, are relative to the bottom and right of the stack. when using these attributes to set width or height, both attributes for the given axis must be explicitly set, eg, if setting width, both "left" and "right" must be set. in some case, setting the width or height this way may even be necessary because using the width/height attributes (eg, "width", "minwidth" and "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results. more information is available in th...
...nd "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results. more information is available in the xul tutorial. examples <stack> <hbox flex="1"> <image src="chrome://xulschoolhello/skin/stack-bg.png" flex="1"left="10"right="10" top="10" bottom="10"/> </hbox> <hbox> <!-- some content here. --> </hbox> </stack> in this example, the resulting width of the top-most hbox will be 400px (600px - 200px - 0) : <stack width="600"> <hbox flex="1"> <!-- content --> </hbox> <hbox left="0" right="200" > <!-- some content here. --> </hbox> </stack> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, ...
...And 4 more matches
titlebar - Archive of obsolete content
etting allowevents="true" on the 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. ...
... properties inherited propertie...
... properties inherited properties align, , allowevents, , ...
...And 4 more matches
treecol - Archive of obsolete content
place splitter elements between the columns 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"/> ...
... the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } cycler type: boolean if true, then the column is a cycler column. in the case, clicking on a cell in the col...
...And 4 more matches
Fundamental text and font styling - Learn web development
testing as you go. the five names are defined as follows: term definition example serif fonts that have serifs (the flourishes and other small details you see at the ends of the strokes in some typefaces) my big red elephant sans-serif fonts that don't have serifs. my big red elephant monospace fonts where every character has the same width, typically used in code listings. my big red elephant cursive fonts that are intended to emulate handwriting, with flowing, connected strokes. my big red elephant fantasy fonts that are intended to be decorative. my big red elephant font stacks since you can't guarantee the availability of the fonts you want to use on your webpages (even a web font could f...
...uch as percentages), however the most common units you'll use to size text are: px (pixels): the number of pixels high you want the text to be. this is an absolute unit — it results in the same final computed value for the font on the page in pretty much any situation. ems: 1 em is equal to the font size set on the parent element of the current element we are styling (more specifically, the width of a capital letter m contained inside the parent element.) this can become tricky to work out if you have a lot of nested elements with different font sizes set, but it is doable, as you'll see below. why bother? it is quite natural once you get used to it, and you can use em to size everything, not just text. you can have an entire website sized using em, which makes maintenance easy. rems: th...
...numeric boldness values that provide finer grained control than the above keywords, if needed. text-transform: allows you to set your font to be transformed. values include: none: prevents any transformation. uppercase: transforms all text to capitals. lowercase: transforms all text to lower case. capitalize: transforms all words to have the first letter capitalized. full-width: transforms all glyphs to be written inside a fixed-width square, similar to a monospace font, allowing aligning of e.g. latin characters along with asian language glyphs (like chinese, japanese, korean). text-decoration: sets/unsets text decorations on fonts (you'll mainly use this to unset the default underline on links when styling them.) available values are: none: unsets any text...
...And 4 more matches
Styling web forms - Learn web development
"range"> <input type="file"> elements involved in creating dropdown widgets, including <select>, <option>, <optgroup> and <datalist>. <progress> and <meter> again, we'll describe what can be done in terms of styling these elements in advanced form styling. the real problem with all these controls is that they have a very complex structure, and beyond some basic styling (such as changing the width or margin of the control) you generally don't have the ability to style the controls' internal components (such as the date picker calendar, or the button on the <select> that causes the options list to display) making up those widgets. if you want to thoroughly customize those widgets, you really have to create your own using html, css, and javascript. this is beyond the scope of the core form ...
...reason to use <button> elements over their equivalent input types! there's a lot of debate as to whether forms look better using the system default styles, or customized styles designed to match your content. this decision is yours to make, as the designer of your site, or web application. box sizing all text fields have complete support for every property related to the css box model, such as width, height, padding, margin, and border. as before, however, browsers rely on the system default styles when displaying these widgets. it's up to you to define how you wish to blend them into your content. if you want to keep the native look and feel of the widgets, you'll face a little difficulty if you want to give them a consistent size. this is because each widget has their own rules for border...
... if you want to keep the native look and feel of the widgets, you'll face a little difficulty if you want to give them a consistent size. this is because each widget has their own rules for border, padding and margin. to give the same size to several different widgets, you can use the box-sizing property along with some consistent values for other properties: input, textarea, select, button { width : 150px; padding: 0; margin: 0; box-sizing: border-box; } in the screenshot below, the left column shows the default rendering of an <input type="radio">, <input type="checkbox">, <input type="range">, <input type="text">, <input type="date"> input, <select>, <textarea>,<input type="submit">, and <button>. the right column on the other hand shows the same elements with our above rule appli...
...And 4 more matches
Video and Audio APIs - Learn web development
that gets longer as the time elapses. to get an idea of what the finished product will look like, check out our finished version. exploring the css now open the css file and have a look inside. the css for the example is not too complicated, but we'll highlight the most interesting bits here. first of all, notice the .controls styling: .controls { visibility: hidden; opacity: 0.5; width: 400px; border-radius: 10px; position: absolute; bottom: 20px; left: 50%; margin-left: -200px; background-color: black; box-shadow: 3px 3px 5px black; transition: 1s all; display: flex; } .player:hover .controls, player:focus .controls { opacity: 1; } we start off with the visibility of the custom controls set to hidden. in our javascript later on, we will set the control...
...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; } .timer span { position: absolute; z-index: 3; left: 19px; } we set the outer .timer <div> to have flex: 5, so it takes up most of the width of the controls bar. we also give it position: relative, so that we can position elements inside it conveniently according to it's boundaries, and not the boundaries of the <body> element. the inner <div> is abso...
... the <span> is also absolutely positioned to sit near the left hand side of the timer bar. ...
...And 4 more matches
Mozilla Quirks Mode Behavior
s 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. 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). residual style tags' size info does not take precedence over heading tags' size (bug 77352). use box-sizing:border-box for most input types and textarea. give form a margin-bottom:1em ...
...or the background attribute sets the background url to empty only in quirks mode. the topmargin, bottommargin, leftmargin, and rightmargin attributes on body are supported only in quirks mode (bug 9258). obsolete since gecko 35 (firefox 35.0 / thunderbird 35.0 / seamonkey 2.32) (bug 95530) this quirk is now html5 conform and has been adopted in standards mode. the scrollleft, scrolltop, scrollwidth, and scrollheight properties are relative to body in quirks mode (instead of html) (bug 211030). html (1-7) and css (xx-small - xx-large) font sizes are calculated slightly differently (see bug 18136). the :hover and :active pseudo-classes will only be applied to links, and only if there is no other pseudo-class in the selector. to match other elements, the selector must include a tag name, id...
...ment changes the color of text decorations specified on ancestor elements. proposed to apply in all modes: bug 747517. in quirks mode, text-decoration is propagated into floating and absolutely positioned elements. (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in quirks mode, text-decoration is not propagated into tables (bug 572713). maybe (firefox 3) when computing the minimum intrinsic width of an inline flow directly in a table cell (no blocks in between), it is assumed that it is not possible to break before and after an image (when otherwise it would be). obsolete since gecko 8.0 prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) text-decoration in quirks mode had line thickness and position adjusted on descendant text to match the descendant. tables td, th, ...
...And 4 more matches
imgIEncoder
modules/libpr0n/public/imgiencoder.idlscriptable please add a summary to this article. ...
...n pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 frameformat, in astring frameoptions); void encodeclipboardimage(in nsiclipboardimage aclipboardimage, out nsifile aimagefile); obsolete since gecko 1.9 void endimageencode(); void initfromdata([array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring outputoptions); void startimageencode(in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring outputoptions); constants possible values for input format (note that not all image formats support saving alpha channels): constant value description input_format_rgb 0 input is rgb each pixel is ...
.... xoffset=# -- default: "0" yoffset=# -- default: "0" where to draw the frame, relative to the canvas. jpeg: ----- quality=# -- default: "92" quality of compression, 0-100 (worst-best). quality >= 90 prevents down-sampling of the color channels. ...
...And 4 more matches
CDATASection - Web APIs
a cdata section: <![cdata[ < > & ]]> with all kinds of unescaped text.</foo> the only sequence which is not allowed within a cdata section is the closing sequence of a cdata section itself, ]]>: <![cdata[ ]]> will cause an error ]]> note that cdata sections should not be used within html; they only work in xml. ...
...thin html; they only work in xml. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
CanvasRenderingContext2D - Web APIs
for the drawing surface of a <canvas> element. it is used for drawing shapes, text, images, and other objects. see the interface's properties and methods in the sidebar and below. the canvas tutorial has more explanation, examples, and resources, as well. ...
... html <canvas> element to work with: <canvas id="my-house" width="300" height="300"></canvas> to get the canvas' 2d rendering context, call getcontext() on the <canvas> element, supplying '2d' as the argument: const canvas = document.getelementbyid('my-house'); const ctx = canvas.getcontext('2d'); with the context in hand, you can draw anything you like. this code draws a house: // set line width ctx.linewidth = 10; // wall ctx.strokerect(75, 140, 150, 110); // door ctx.fillrect(130, 190, 40, 60); // roof ctx.beginpath(); ctx.moveto(50, 140); ctx.lineto(150, 60); ctx.lineto(250, 140); ctx.closepath(); ctx.stroke(); the resulting drawing looks like this: reference drawing rectangles there are three methods that immediately draw rectangles to the canvas. canvasrenderingcontext2...
... 190, 40, 60); // roof ctx.beginpath(); ctx.moveto(50, 140); ctx.lineto(150, 60); ctx.lineto(250, 140); ctx.closepath(); ctx.stroke(); the resulting drawing looks like this: reference drawing rectangles there are three methods that immediately draw rectangles to the canvas. canvasrenderingcontext2d.clearrect() sets all pixels in the rectangle defined by starting 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. drawing text the fol...
...And 4 more matches
Manipulating video using canvas - Web APIs
canvas c1 is used to display the current frame of the original video, while c2 is used to display the vide...
... canvas c1 is used to display the current frame of the original video, while c2 is used to display the video after performing the chroma-keying effect; c2 is prelo...
...r starts playing the video. var processor; processor.doload = function doload() { this.video = document.getelementbyid('video'); this.c1 = document.getelementbyid('c1'); this.ctx1 = this.c1.getcontext('2d'); this.c2 = document.getelementbyid('c2'); this.ctx2 = this.c2.getcontext('2d'); let self = this; this.video.addeventlistener('play', function() { self.width = self.video.videowidth / 2; self.height = self.video.videoheight / 2; self.timercallback(); }, false); }, this code grabs references to the elements in the xhtml document that are of particular interest, namely the video element and the two canvas elements. it also fetches references to the graphics contexts for each of the two canvases. these will be used when we're ...
...And 4 more matches
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. ...
...th 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 fillstyle. 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 strokestyle. ...
...context('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 strokestyle. 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 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 pro...
...And 4 more matches
Optimizing canvas - Web APIs
vas if you find yourself repeating some of the same drawing operations on each animation frame, consider offloading them to an offscreen canvas. you can then render the offscreen image to your primary canvas as often as needed, without unnecessarily repeating the steps needed to generate it in the first place. mycanvas.offscreencanvas = document.createelement('canvas'); mycanvas.offscreencanvas.width = mycanvas.width; mycanvas.offscreencanvas.height = mycanvas.height; mycanvas.getcontext('2d').drawimage(mycanvas.offscreencanvas, 0, 0); avoid floating-point coordinates and use integers instead sub-pixel rendering occurs when you render objects on a canvas without whole values. ctx.drawimage(myimage, 0.3, 0.5); this forces the browser to do extra calculations to create the anti-aliasing ...
...lements. for example, let's say you have a game with a ui on top, the gameplay action in the middle, and a static background on the bottom. in this case, you could split your game into three <canvas> layers. the ui would change only upon user input, the gameplay layer would change with every new frame, and the background would remain generally unchanged. ...
... top, the gameplay action in the middle, and a static background on the bottom. in this case, you could split your game into three <canvas> layers. the ui would change only upon user input, the gameplay layer would change with every new frame, and the background would remain generally unchanged. ...
...And 4 more matches
Transformations - Web APIs
tore() 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: strokestyle, fillstyle, 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 last saved state is popped off the...
...next we save this state and make changes to the fill color. we then draw the second and smaller blue rectangle and save the state. again we change some drawing settings and draw the third semi-transparent white rectangle. so far this is pretty similar to what we've done in previous sect...
...e drawing position. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); for (var i = 0; i < 3; i++) { for (var j = 0; j < 3; j++) { ctx.save(); ctx.fillstyle = 'rgb(' + (51 * i) + ', ' + (255 - 51 * i) + ', 255)'; ctx.translate(10 + j * 50, 10 + i * 50); ctx.fillrect(0, 0, 25, 25); ctx.restore(); } } } <canvas id="canvas" width="150" height="150"></canvas> draw(); screenshotlive sample rotating the second transformation method is rotate(). we use it to rotate the canvas around the current origin. rotate(angle) rotates the canvas clockwise around the current origin by the angle number of radians. the rotation center point is always the canvas origin. to change the center point, we will need to move the canvas ...
...And 4 more matches
DOMRect - Web APIs
Web › API › DOMRect
of box represented by the domrect is specified by the method or property that returned it. for example, vreyeparameters.renderrect from the defunct webvr api specified the viewport of a canvas into which visuals for one eye of a head mounted display should be rendered. it inherits from its parent, domrectreadonly. ...
...mrectreadonly. ...
...y: 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/domrectreadonly" target="_top"><rect x="1" y="1" width="150" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">domrectreadonly</text></a><polyline points="151,25 161,20 161,30 151,25" stroke="#d4dde4" fill="none"/><line x1="161" y1="25" x2="191" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/domrect" target="_top"><rect x="191" y="1" w...
...And 4 more matches
Element.getBoundingClientRect() - Web APIs
the element.getboundingclientrect() method returns the size of an element and its position relative to the viewport. the element's size is equal to its width/height + padding + border-width in the case that the standard box model is being used, or width/height only if box-sizing: border-box has been set on it. syntax domrect = element.getboundingclientrect(); value the returned value is a domrect object which is the union of the rectangles returned by getclientrects() for the element, i.e., the css border-boxes associated with the element. ...
...box-sizing: border-box has been set on it. syntax domrect = element.getboundingclientrect(); value the returned value is a domrect object which is the union of the rectangles returned by getclientrects() for the element, i.e., the css border-boxes associated with the element. ...
...value the returned value is a domrect object which is the union of the rectangles returned by getclientrects() for the element, i.e., the css border-boxes associated with the element. the result is the smallest rectangle which contains the entire element, with read-only left, top, right, bottom, x, y, width, and height properties describing the overall border-box in pixels. properties other than width and height are relative to the top-left of the viewport. empty border-boxes are completely ignored. if all the element's border-boxes are empty, then a rectangle is returned with a width and height of zero and where the top and left are the top-left of the border-box for the first css box (in content order) for the element. the amount of scrolling that has been done of the viewport area (or a...
...And 4 more matches
GlobalEventHandlers.onanimationcancel - Web APIs
document (document), or window (window). the function receives as input a single parameter: an animationevent object describing the event which occurred. ...
...ndow (window). the function receives as input a single parameter: an animationevent object describing the event which occurred. ...
...escribing the event which occurred. ...
...And 4 more matches
HTMLAreaElement - Web APIs
the htmlareaelement interface provides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <area> elements. ...
... presentation of <area> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLBodyElement - Web APIs
the htmlbodyelement interface provides special properties (beyond those inherited from the regular htmlelement interface) for manipulating <body> elements. ...
...for manipulating <body> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLDataListElement - Web APIs
the htmldatalistelement interface provides special properties (beyond the htmlelement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content. ...
...list> elements and their content. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLElement.offsetLeft - Web APIs
the htmlelement.offsetleft read-only property returns the number of pixels that the upper left corner of the current element is offset to the left within the htmlelement.offsetparent node. for block-level elements, offsettop, offsetleft, offsetwidth, and offsetheight describe the border box of an element relative to the offsetparent. ...
...left within the htmlelement.offsetparent node. for block-level elements, offsettop, offsetleft, offsetwidth, and offsetheight describe the border box of an element relative to the offsetparent. however, for inline-level elements (such as span) that can wrap from one line to the next, offsettop and offsetleft describe the positions of the first border box (use element.getclientrects() to get its width and height), while offsetwidth and offsetheight describe the dimensions of the bounding border box (use element.getboundingclientrect() to get its position). therefore, a box with the left, top, width and height of offsetleft, offsettop, offsetwidth and offsetheight will not be a bounding box for a span with wrapped text. syntax left = element.offsetleft; left is an integer representing the o...
... 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. ...
...And 4 more matches
HTMLFormElement - Web APIs
the htmlformelement interface represents a <form> element in the dom. it allows access to—and, in some cases, modification of—aspects of the form, as well as access to its component elements. ...
...access to its component elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLLinkElement - Web APIs
ce 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. ...
...ods of the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLMediaElement.onwaitingforkey - Web APIs
the onwaitingforkey property of the htmlmediaelement is an event handler, fired when a waitingforkey event occurs, when playback is blocked while waiting for an encryption key. this interface inherits from the extendableevent interface. ...
...bleevent interface. ...
...isplay: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 60" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLMediaElement - Web APIs
the htmlmediaelement interface adds to htmlelement the properties and methods needed to support basic media-related capabilities that are common to audio and video. the htmlvideoelement and htmlaudioelement elements both inherit this interface. ...
...ents both inherit this interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 30%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 180" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLMenuElement - Web APIs
the htmlmenuelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menu> elements. ...
...for manipulating <menu> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLMenuItemElement - Web APIs
the htmlmenuitemelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menuitem> elements. ...
...manipulating <menuitem> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLOutputElement - Web APIs
the htmloutputelement interface provides properties and methods (beyond those inherited from htmlelement) for manipulating the layout and presentation of <output> elements. ...
...resentation of <output> elements. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLPictureElement - Web APIs
the htmlpictureelement interface represents a <picture> html element. it doesn't implement specific properties or methods. ...
...t specific properties or methods. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLSelectElement - Web APIs
the htmlselectelement interface represents a <select> html element. these elements also share all of the properties and methods of other html elements via the htmlelement interface. ...
...ts via the htmlelement interface. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLSpanElement - Web APIs
the htmlspanelement interface represents a <span> element and derives from the htmlelement interface, but without implementing any additional properties or methods. ...
...additional properties or methods. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLStyleElement - Web APIs
ment. it inherits properties and methods from its parent, htmlelement, and from linkstyle. 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. ...
...ied css properties using the dom. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
HTMLUnknownElement - Web APIs
the htmlunknownelement interface represents an invalid html element and derives from the htmlelement interface, but without implementing any additional properties or methods. ...
...additional properties or methods. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
MediaDevices.getUserMedia() - Web APIs
cannot be included for any reason, the call to getusermedia() will result in an error. while information about a user's cameras and microphones are inaccessible for privacy reasons, an application can request the camera and microphone capabilities it needs and wants, using additional constraints. ...
... the reason for the difference in behaviour is that the keywords min, max, and exact are inherently mandatory. ...
...n: 720 } } } if no camera exists with this resolution or higher, then the returned promise will be rejected with overconstrainederror, and the user will not be prompted. the reason for the difference in behaviour is that the keywords min, max, and exact are inherently mandatory. whereas plain values and a keyword called ideal are not. here's a full example: { audio: true, video: { width: { min: 1024, ideal: 1280, max: 1920 }, height: { min: 576, ideal: 720, max: 1080 } } } an ideal value, when used, has gravity, which means that the browser will try to find the setting (and camera, if you have more than one), with the smallest fitness distance from the ideal values given. plain values are inherently ideal, which means that the first of our resolution examples above cou...
...And 4 more matches
SVGAnimationElement - Web APIs
the svganimationelement interface is the base interface for all of the animation element interfaces: svganimateelement, svgsetelement, svganimatecolorelement, svganimatemotionelement and svganimatetransformelement. ...
...transformelement. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGClipPathElement - Web APIs
the svgclippathelement interface provides access to the properties of <clippath> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGComponentTransferFunctionElement - Web APIs
the svgcomponenttransferfunctionelement interface defines a base interface used by the component transfer function interfaces. ...
...ction interfaces. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGCursorElement - Web APIs
the svgcursorelement interface provides access to the properties of <cursor> elements, as well as methods to manipulate them. ...
... manipulate them. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGDescElement - Web APIs
the svgdescelement interface corresponds to the <desc> element. ...
...e <desc> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEBlendElement - Web APIs
the svgfeblendelement interface corresponds to the <feblend> element. ...
...feblend> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEColorMatrixElement - Web APIs
the svgfecolormatrixelement interface corresponds to the <fecolormatrix> element. ...
...rmatrix> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEComponentTransferElement - Web APIs
the svgfecomponenttransferelement interface corresponds to the <fecomponenttransfer> element. ...
...ransfer> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFECompositeElement - Web APIs
the svgfecompositeelement interface corresponds to the <fecomposite> element. ...
...mposite> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEConvolveMatrixElement - Web APIs
the svgfeconvolvematrixelement interface corresponds to the <feconvolvematrix> element. ...
...ematrix> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEDiffuseLightingElement - Web APIs
the svgfediffuselightingelement interface corresponds to the <fediffuselighting> element. ...
...ighting> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEDisplacementMapElement - Web APIs
the svgfedisplacementmapelement interface corresponds to the <fedisplacementmap> element. ...
...mentmap> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEDistantLightElement - Web APIs
the svgfedistantlightelement interface corresponds to the <fedistantlight> element. ...
...ntlight> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEDropShadowElement - Web APIs
the svgfedropshadowelement interface corresponds to the <fedropshadow> element. ...
...pshadow> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEFloodElement - Web APIs
the svgfefloodelement interface corresponds to the <feflood> element. ...
...feflood> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEGaussianBlurElement - Web APIs
the svgfegaussianblurelement interface corresponds to the <fegaussianblur> element. ...
...ianblur> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEImageElement - Web APIs
the svgfeimageelement interface corresponds to the <feimage> element. ...
...feimage> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEMergeElement - Web APIs
the svgfemergeelement interface corresponds to the <femerge> element. ...
...femerge> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEMergeNodeElement - Web APIs
the svgfemergenodeelement interface corresponds to the <femergenode> element. ...
...rgenode> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEMorphologyElement - Web APIs
the svgfemorphologyelement interface corresponds to the <femorphology> element. ...
...phology> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEOffsetElement - Web APIs
the svgfeoffsetelement interface corresponds to the <feoffset> element. ...
...eoffset> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFEPointLightElement - Web APIs
the svgfepointlightelement interface corresponds to the <fepointlight> element. ...
...ntlight> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFESpecularLightingElement - Web APIs
the svgfespecularlightingelement interface corresponds to the <fespecularlighting> element. ...
...ighting> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFESpotLightElement - Web APIs
the svgfespotlightelement interface corresponds to the <fespotlight> element. ...
...otlight> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFETileElement - Web APIs
the svgfetileelement interface corresponds to the <fetile> element. ...
...<fetile> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGFETurbulenceElement - Web APIs
the svgfeturbulenceelement interface corresponds to the <feturbulence> element. ...
...bulence> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGGradientElement - Web APIs
the svggradient interface is a base interface used by svglineargradientelement and svgradialgradientelement. ...
...lgradientelement. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGGraphicsElement - Web APIs
the svggraphicselement interface represents svg elements whose primary purpose is to directly render graphics into a group. ...
...tly render graphics into a group. ...
...gram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGMPathElement - Web APIs
the svgmpathelement interface corresponds to the <mpath> element. ...
... <mpath> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGMetadataElement - Web APIs
the svgmetadataelement interface corresponds to the <metadata> element. ...
...etadata> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGScriptElement - Web APIs
the svgscriptelement interface corresponds to the svg <script> element. ...
...<script> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGStopElement - Web APIs
the svgstopelement interface corresponds to the <stop> element. ...
...e <stop> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGStyleElement - Web APIs
svg style interface the svgstyleelement interface corresponds to the svg <style> element. ...
... <style> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGSymbolElement - Web APIs
the svgsymbolelement interface corresponds to the <symbol> element. ...
...<symbol> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
SVGTitleElement - Web APIs
the svgtitleelement interface corresponds to the <title> element. ...
... <title> element. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 4 more matches
WEBGL_compressed_texture_astc - Web APIs
ods. ext.getsupportedprofiles() returns an array of strings containing the names of the astc profiles supported by the implementation. constants the compressed texture formats are exposed by 28 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ...
...mplementation. constants the compressed texture formats are exposed by 28 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ...
...ge2d(). ...
...And 4 more matches
WebGL2RenderingContext.texImage3D() - Web APIs
the webglrenderingcontext.teximage3d() method of the webgl api specifies a three-dimensional texture image. ...
... the webglrenderingcontext.teximage3d() method of the webgl api specifies a three-dimensional texture image. ...
...he webglrenderingcontext.teximage3d() method of the webgl api specifies a three-dimensional texture image. ...
...And 4 more matches
WebGL2RenderingContext.texSubImage3D() - Web APIs
the webgl2renderingcontext.texsubimage3d() method of the webgl api specifies a sub-rectangle of the current texture. ...
... the webgl2renderingcontext.texsubimage3d() method of the webgl api specifies a sub-rectangle of the current texture. ...
...l api specifies a sub-rectangle of the current texture. ...
...And 4 more matches
WebGLRenderingContext.texImage2D() - Web APIs
the webglrenderingcontext.teximage2d() method of the webgl api specifies a two-dimensional texture image. ...
...get, level, internalformat, format, type, htmlimageelement? pixels); void gl.teximage2d(target, level, internalformat, format, type, htmlcanvaselement? pixels); void gl.teximage2d(target, level, internalformat, format, type, htmlvideoelement? pixels); void gl.teximage2d(target, level, internalformat, format, type, imagebitmap? ...
...ternalformat, format, type, htmlcanvaselement? pixels); void gl.teximage2d(target, level, internalformat, format, type, htmlvideoelement? pixels); void gl.teximage2d(target, level, internalformat, format, type, imagebitmap? ...
...And 4 more matches
WebGLRenderingContext - Web APIs
information and functionality to deal with the webgl context: webglrenderingcontext.canvas a read-only back-reference to the htmlcanvaselement. might be null if it is not associated with a <canvas> element. webglrenderingcontext.commit() pushes frames back to the original htmlcanvaselement, if the context is not directly fixed to a specific canvas. webglrenderingcontext.drawingbufferwidth the read-only width of the current drawing buffer. should match the width of the canvas element associated with this context. webglrenderingcontext.drawingbufferheight the read-only height of the current drawing buffer. should match the height of the canvas element associated with this context. webglrenderingcontext.getcontextattributes() returns a webglcontextattributes object that contains...
...getparameter() returns a value for the passed parameter name. webglrenderingcontext.geterror() returns error information. webglrenderingcontext.hint() specifies hints for certain behaviors. the interpretation of these hints depend on the implementation. webglrenderingcontext.isenabled() tests whether a specific webgl capability is enabled or not for this context. webglrenderingcontext.linewidth() sets the line width of rasterized lines. webglrenderingcontext.pixelstorei() specifies the pixel storage modes webglrenderingcontext.polygonoffset() specifies the scale factors and units to calculate depth values. webglrenderingcontext.samplecoverage() specifies multi-sample coverage parameters for anti-aliasing effects. webglrenderingcontext.stencilfunc() sets the both front and back ...
...}, such as the canvas 2d rendering context. however, the properties and variables you can tweak are different for each api. effect of canvas size on rendering with webgl with scissor() and clear() we can demonstrate how the webgl drawing buffer is affected by the size of the canvas. the size of the first canvas is set to the styled element size, determined by css. this is done by assigning the width and height properties of the canvas to the values of the clientwidth and clientheight properties, respectively. in contrast, no such assignment is done for the second canvas. the internal width and height properties of the canvas remain at default values, which are different than the actual size of the canvas element in the browser window. the effect is clearly visible when using scissor() and ...
...And 4 more matches
-webkit-text-stroke - CSS: Cascading Style Sheets
<color> the color of the stroke. ...
... <color> the color of the stroke. ...
... <color> the color of the stroke. ...
...And 4 more matches
@media - CSS: Cascading Style Sheets
Web › CSS › @media
cument if and only if the media query matches the device on which the content is being used. note: in javascript, the rules created using @media can be accessed with the cssmediarule css object model interface. syntax the @media at-rule may be placed at the top level of your code or nested inside any other conditional group at-rule. /* at the top level of your code */ @media screen and (min-width: 900px) { article { padding: 1rem 3rem; } } /* nested within another conditional at-rule */ @supports (display: flex) { @media screen and (min-width: 900px) { article { display: flex; } } } for a discussion of media query syntax, please see using media queries. description media types media types describe the general category of a device. except when using the not ...
...ch media feature expression must be surrounded by parentheses. name summary notes any-hover does any available input mechanism allow the user to hover over elements? added in media queries level 4. any-pointer is any available input mechanism a pointing device, and if so, how accurate is it? added in media queries level 4. aspect-ratio width-to-height aspect ratio of the viewport color number of bits per color component of the output device, or zero if the device isn't color color-gamut approximate range of colors that are supported by the user agent and output device added in media queries level 4. color-index number of entries in the output device's color lookup table, or zero if the d...
...f bits per color component of the output device, or zero if the device isn't color color-gamut approximate range of colors that are supported by the user agent and output device added in media queries level 4. color-index number of entries in the output device's color lookup table, or zero if the device does not use such a table device-aspect-ratio width-to-height aspect ratio of the output device deprecated in media queries level 4. device-height height of the rendering surface of the output device deprecated in media queries level 4. device-width width of the rendering surface of the output device deprecated in media queries level 4. display-mode the display mode of the application, as specified ...
...And 4 more matches
Using multi-column layouts - CSS: Cascading Style Sheets
e css multi-column layout module extends the block layout mode to allow the easy definition of multiple columns of text. people have trouble reading text if lines are too long; if it takes too long for the eyes to move from the end of the one line to the beginning of the next, they lose track of which line they were on. ...
... the column-count property sets the number of columns to a particular number. e.g., example 1 html <div id="col"> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ...
... the column-count property sets the number of columns to a particular number. ...
...And 4 more matches
aspect-ratio - CSS: Cascading Style Sheets
1; /* global values */ aspect-ratio: inherit; aspect-ratio: initial; aspect-ratio: unset; values <auto> replaced elements with an intrinsic aspect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio. size calculations involving intrinsic aspect ratio always work with the content box dimensions. ...
...this appears in the browser's internal ua stylesheet. chrome is also shipping this feature. ...
...al definition initial valueautoapplies toall elements except inline boxes and internal ruby or table boxesinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <ratio> examples mapping width and height to aspect-ratio firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements and other related elements that accept width and height attributes. this appears in the browser's internal ua stylesheet. chrome is also shipping this feature. ...
...And 4 more matches
border-block - CSS: Cascading Style Sheets
the border-block css property is a shorthand property for setting the individual logical block border property values in a single place in the style sheet. border-block: 1px; border-block: 2px dotted; border-block: medium dashed blue; border-block can be used to set the values for one or more of border-block-width, border-block-style, and border-block-color setting both the start and end in the block dimension at once. the physical borders to which it 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. the borders in the other dimension can be set with border-inline, which se...
...tom 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-inline, which sets border-inline-start, and border-inline-end. ...
...xt-orientation. the borders in the other dimension can be set with border-inline, which sets border-inline-start, and border-inline-end. constituent properties this property is a shorthand for the following css properties: border-block-color border-block-style border-block-width syntax values the border-block is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. ...
...And 4 more matches
border-inline - CSS: Cascading Style Sheets
ctionality, 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. the borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end. ...
...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. ...
...plies 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. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...And 4 more matches
border-left - CSS: Cascading Style Sheets
e 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 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:borde...
...ax 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. ...
... <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. ...
...And 4 more matches
border-right - CSS: Cascading Style Sheets
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 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...
...der-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. ...
...idth> 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. ...
...And 4 more matches
border-top - CSS: Cascading Style Sheets
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: 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-...
... 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. ...
...alues <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 4 more matches
columns - CSS: Cascading Style Sheets
Web › CSS › columns
the columns css shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. 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. ...
...ing an element's contents, as well as those columns' widths. 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 well as those columns' widths. 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: column-count column-width syntax /* column width */ columns: 18em; /* column count */ columns: auto; columns: 2; /* both column width and count */ columns: 2 auto; columns: auto 12em; columns: auto auto; /* global values */ columns: inherit; columns: initial; columns: unset; the columns property may be specified as one or two of the values listed below, in any order. ...
...And 4 more matches
<length> - CSS: Cascading Style Sheets
Web › CSS › length
note: although <percentage> values are also css dimensions, and are usable in some of the same properties that accept <length> values, they are not themselves <length> values. see <length-percentage>. syntax the <length> data type consists of a <number> followed by one of the units listed below. as with all css dimensions, there is no space between the unit literal and the number. the length unit is optional after the number 0. ...
...f a particular character or font attribute in the font currently in effect in an element or its parent. note: these units, especially em and rem, are often used to create scalable layouts, which maintain the vertical rhythm of the page even when the user changes the font size. cap represents the "cap height" (nominal height of capital letters) of the element’s font. ch represents the width, or more precisely the advance measure, of the glyph "0" (zero, the unicode character u+0030) in the element's font. in the cases where it is impossible or impractical to determine the measure of the “0” glyph, it must be assumed to be 0.5em wide by 1em tall. em represents the calculated font-size of the element. if used on the font-size property itself, it represents the inherited font-...
...roperties of the root element, it refers to the properties' initial value. viewport-percentage lengths viewport-percentage lengths define the <length> value relative to the size of the viewport, i.e., the visible portion of the document. viewport lengths are invalid in @page declaration blocks. vh equal to 1% of the height of the viewport's initial containing block. vw equal to 1% of the width of the viewport's initial containing block. vi equal to 1% of the size of the initial containing block, in the direction of the root element’s inline axis. vb equal to 1% of the size of the initial containing block, in the direction of the root element’s block axis. vmin equal to the smaller of vw and vh. vmax equal to the larger of vw and vh. absolute length units absolute len...
...And 4 more matches
<percentage> - CSS: Cascading Style Sheets
syntax the <percentage> data type consists of a <number> followed by the percentage sign (%). ...
... syntax the <percentage> data type consists of a <number> followed by the percentage sign (%). ...
...ceded by a single + or - sign, 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. ...
...And 4 more matches
Web video codec guide - Web media technologies
xel) is 8,294,400 bytes. at a typical 30 frames per second, each second of hd video would occupy 248,832,000 bytes (~249 mb). a minute of hd video would need 14.93 gb of storage. a fairly typical 30 minute video conference would need about 447.9 gb of storage, and a 2-hour movie would take almost 1.79 tb (that is, 1790 gb). not only is the required storage space enormous, but the network bandwidth needed to transmit an uncompressed video like that would be enormous, at 249 mb/sec—not including audio and overhead. this is where video codecs come in. just as audio codecs do for the sound data, video codecs compress the video data and encode it into a format that can later be decoded and played back or edited. most video codecs are lossy, in that the decoded video does not precisely match ...
...achieve the same level of compression. the more variability—such as noise—there is in the image, the more complex the compression process and the less success the algorithm is likely to have compressing the image to the same degree. unless you configure the encoder in a way that ignores some or all of the variations caused by noise, the compressed video will be larger. resolution (width and height) higher resolution video, presented in the same screen size, will typically be able to more accurately portray the original scene, barring effects introduced during compression. the higher the resolution of a video, the larger it gets. this plays a key role in the final size of the video. the degree to which these affect the resulting encoded video will vary depending on t...
...and chroma subsampling. in addition, a series of levels are specified, each defining limits on a range of attributes of the video. these attributes include frame dimensions, image area in pixels, display and decode rates, average and maximum bit rates, and limits on the number of tiles and tile columns used in the encoding/decoding process. for example, level av1 level 2.0 offers a maximum frame width of 2048 pixels and a maximum height of 1152 pixels, but its maximum frame size in pixels is 147,456, so you can't actually have a 2048x1152 video at level 2.0. it's worth noting, however, that at least for firefox and chrome, the levels are actually ignored at this time when performing software decoding, and the decoder just does the best it can to play the video given the settings provided. for ...
...And 4 more matches
Mobile first - Progressive web apps (PWAs)
look at what subset of features will be available on mobile, desktop, etc. in tandem and how they will be implemented. then at implementation stage, we present the mobile layout and functionality as the default configuration provided, before additional information is loaded on top of that, whenever appropriate. this means that mobiles (often the target devices with the least available memory, bandwidth or processing power available) can be given an experience suitable for them as quickly as possible, and as free as possible of extraneous information. for example: if you are serving different styling and layout information for different viewport sizes, etc., it makes more sense to include the narrow screen/mobile styling as the default styling before any media queries are encountered, rather ...
...etty much all browsers will need first, then progressively enhance browsers higher up the food chain. note: starting with very little and working up as the need arises usually makes more sense than starting with everything and then covering up things if they aren't needed! mobile constraints we have already mentioned the fact that mobiles generally have less memory, processing power and bandwidth than other devices (although bear in mind that smart tvs are also generally pretty low powered.) they also have less viewport size available. therefore, as well as splitting content into different views, and simplifying the interface and content on each view of your application for mobile as much as possible, it is also a good idea to not include visual effects such as shadows, animations, and gr...
..., so they would become the positioning contexts of the absolutely positioned elements (you don't want them to be positioned relative to the <body> element.) adding a mobile first layout the above layout is fine for narrower layouts, but it doesn't work very well when you get wider than about 480px. ...
...And 4 more matches
Example - SVG: Scalable Vector Graphics
behavior. this is done completely in w3c standards–xhtml, svg, and javascript–no flash or any vendor-specific extensions. this example should work in firefox 1.5 and above. ...
... extensions. this example should work in firefox 1.5 and above. view the example <?xml version='1.0'?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <title>a swarm of motes</title> <style type='text/css'> <![cdata[ label, input { width: 150px; display: block; float: left; margin-bottom: 10px; } label { text-align: right; width: 75px; padding-right: 20px; } br { clear: left; } ]]> </style> </head> <body onload='update()'> <svg:svg id='display' width='400' height='300'> <svg:circle id='cursor' cx='200' cy='150' r='7' fill='#0000ff' fill-opacity='0.5'/> </svg:svg> <p>a swarm of motes, governed by two simple principles. first, each mote tries to move towards the cursor, and second each mote ...
... <br/> </p> </form> <script type='text/javascript'> <![cdata[ // array of motes var motes; // get the display element. function display() { return document.getelementbyid('display'); } // determine dimensions of the display element. ...
...And 4 more matches
Basic Transformations - SVG: Scalable Vector Graphics
« previousnext » now we're ready to start distorting our beautiful images. but first, let's formally introduce the <g> element. with this helper, you can assign properties to a complete set of elements. actually, that's its only purpose. an example: <svg width="30" height="10"> <g fill="red"> <rect x="0" y="0" width="10" height="10" /> <rect x="20" y="0" width="10" height="10" /> </g> </svg> all following transformations are summed up in an element's transform attribute. transformations can be chained simply by concatenating them, separated by whitespace. translation it may be necessary to move an element around, even though you can position it with the according attributes. for this purpose, the translate() transformation stands ready. <svg w...
...med up in an element's transform attribute. transformations can be chained simply by concatenating them, separated by whitespace. translation it may be necessary to move an element around, even though you can position it with the according attributes. for this purpose, the translate() transformation stands ready. ...
...y. <svg width="40" height="50" style="background-color:#bff;"> <rect x="0" y="0" width="10" height="10" transform="translate(30,40)" /> </svg> the example will render a rectangle, translated to the point (30,40) instead of (0,0). if the second value is not given, it is assumed to be 0. rotation rotating an element is quite a common task. use the rotate() transformation for this: <svg width="31" height="31"> <rect x="12" y="-10" width="20" height="20" transform="rotate(45)" /> </svg> this example shows a square that is rotated by 45 degrees. the value for rotate() is given in degrees. multiple transformations transformations can be concatenated easily just by separating them with spaces. for example, translate() and rotate() are common used transformations. ...
...And 4 more matches
New Skin Notes - Archive of obsolete content
devmo has a new skin that is ready for testing. if you go to your user preferences, you can change the skin to "devmo". this is currently just a preview, but we would appreciate help with testing. please add any feedback to this page. thanks! ...
... page. --dria css classes for feature and subfeature boxes, including required graphics. -- dria when will these fixes be on the live site? --nickolay 10:38, 31 aug 2005 (pdt) existing fixes should be on test/docs/ now. --dria stuff that's been fixed note that while i've made these fixes, they haven't necessarily been checked in yet. edit page textarea needs to 'scale' better with page width (so large whitespace area's are non-existant), suggest min-width:some-em-size; width: 88%; and max-width set to 95% or something like that. --callek i tried this, but it gets totally screwed up in ie for some reason. i'll try again, but can't guarantee this will be fixed for the initial upgrades. --dria took two days, but i finally got this sorted out. when the skin is updated on test/docs, edi...
... --dria the menu column seems larger than before in the current test theme, so as to cause some reference pages to look ugly when browser set in 800x* resolution, using the default firefox 1.0.6 fonts settings on xfree86. a few examples: , .these work fine with the old theme, and i expect that this affects a lot of reference articles. that our screen resolutions are now wider than 800 pixels width does not mean that we always want to enlarge the window that large and as a result get extra-wide unreadable text lines :) and some people really are restricted to 800 (we can ignore 640, this will most likely require fonts settings changes as well). but it should work by default with 800 pixels width, imo. --mmondor 11:54, 26 aug 2005 (pdt) for all that it is worth, i am against setting the 'ba...
...And 3 more matches
Space Manager Detailed Design - Archive of obsolete content
ata * indicates which parts of the band are available, and which parts * are unavailable * * the band data that is returned is in the coordinate space of the * local coordinate system. * * the local coordinate space origin, the y-offset, and the max size * describe a rectangle that's used to clip the underlying band of * available space, i.e. * {0, ayoffset, amaxsize.width, amaxsize.height} in the local * coordinate space * * @param ayoffset the y-offset of where the band begins. the coordinate is * relative to the upper-left corner of the local coordinate space * @param amaxsize the size to use to constrain the band data * @param abanddata [in,out] used to return the list of trapezoids that * describe the available ...
...successful * ns_error_failure if there is already a region tagged with aframe */ nsresult addrectregion(nsiframe* aframe, const nsrect& aunavailablespace); /** * resize the rectangular region associated with aframe by the specified * deltas. the height change always applies to the bottom edge or the existing * rect. ...
...he height change always applies to the bottom edge or the existing * rect. you specify whether the width change applies to the left or right edge * * returns ns_ok if successful, ns_error_invalid_arg if there is no region * tagged with aframe */ enum affectededge {leftedge, rightedge}; nsresult resizerectregion(nsiframe* aframe, nscoord adeltawidth, nscoord adeltaheight, affectededge aedge = rightedge); /** * offset the region associated with aframe by the specified amount. * * returns ns_ok if successful, ns_error_invalid_arg if there is no region * tagged with aframe */ nsresult offsetregion(nsiframe* aframe, nscoord dx, nscoord dy); /** * remove the re...
...And 3 more matches
Adding more elements - Archive of obsolete content
ing 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 been giv...
...you will notice that if the window is resized, the textbox 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. ...
...re 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 3 more matches
Box Objects - Archive of obsolete content
are quite useful for xul development. the base box object has two useful features. first, you can retrieve the position and size of the xul element as displayed, and second, you can determine the order of the elements in the box as displayed, instead of their order as they are stored in the dom. retrieving position and size the box object provides six read only properties, x, y, screenx, screeny, width and height, for determining the currently displayed position and size of an element. all values returned are in pixels. x, y the x and y coordinates are referenced from the top left corner of the document in the window (that portion which excludes the window border and title bar) and refer to the top left corner of the element, including css padding. css margins and borders* are excluded. the ...
...rgins and borders* are excluded. the top left corner of the document is that which is obtained from screen.mozinnerscreenx, screen.mozinnerscreeny screenx, screeny the screenx and screeny coordinates are referenced from the absolute top left corner of the screen (screen.top,screen.left) and refer to the top left corner of the element, including css padding and borders. css margins are excluded. width, height the width and height properties are also measured in pixels and return the width and height of the element, including css padding and borders. css margins are excluded. *note that x, y refers to the portion of the element that is just inside any borders, which is inconsistent with the other four boxobject position and size references, which include borders as part of the element. the ...
...ch include borders as part of the element. the values are always the position and sizes as currently displayed, so the values will be different if the element is moved or resized. for example, a flexible element will change in size and the box object dimensions will update accordingly. the following example shows this. example 1 : source view <button label="click me" oncommand="alert('the width is ' + this.boxobject.width);"/> you can use the width and height attributes of the element to specify the element's width and height, respectively. note that retrieving these values will return the size only if it was explicitly specified. these properties will return an empty string if the width or height attributes or properties were not set already. that is, you cannot get the current size ...
...And 3 more matches
More Tree Features - Archive of obsolete content
ed like a container. for example, a directory with no files in it should still be treated like a container whereas a file should not. more about tree columns one additional attribute you can add to the tree is enablecolumndrag. (note the mixed case.) if set to true, the user may drag the column headers around to rearrange the order of the columns. a user will also likely want to change the column widths. you can do this by placing a splitter element in between each treecol element. a small notch will appear in between each column header which the user may drag to change the width of a column. you can use the style class tree-splitter to hide the notch, although the column may still be resized. you can set a minimum or maximum width of a column using the minwidth or maxwidth attributes. you can ...
...e columns in-between sessions. (that feature will see in the later section). thus, once the user has decided on a column layout they like, it will automatically be saved for next time. ...
...yout they like, it will automatically be saved for next time. ...
...And 3 more matches
Splitters - Archive of obsolete content
size. (the last element in the box). this attribute can also be set to grow, in which case the elements to the right of the splitter do not change size when the splitter is dragged, but instead the entire box changes size. the default value is closest. if you set the collapse attribute, you should also add a grippy element inside the splitter which the user can use to collapse the element. ...
...d also add a grippy element inside the splitter which the user can use to collapse the element. the width and height attributes of the elements next the splitter are adjusted when the splitter is dragged. the exact element depends on the resizebefore and resizeafter attributes. ...
...ext the splitter are adjusted when the splitter is dragged. the exact element depends on the resizebefore and resizeafter attributes. splitter example an example would be helpful here: example 1 : source view <hbox flex="1"> <iframe id="content-1" width="60" height="20" src="w1.html"/> <splitter collapse="before" resizeafter="farthest"> <grippy/> </splitter> <iframe id="content-2" width="60" height="20" src="w2.html"/> <iframe id="content-3" width="60" height="20" src="w3.html"/> <iframe id="content-4" width="60" height="20" src="w4.html"/> </hbox> here, four iframes have been created and a splitter has been placed in-between the first and second one. the collapse has been set to a value of before, meaning that if the splitter grippy is clicked on, the first frame would ...
...And 3 more matches
keyset - Archive of obsolete content
if this attribute is set, the element...
...if this attribute is set, the element is disabled. disabled elem...
...if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. ...
...And 3 more matches
member - Archive of obsolete content
information is available in the xul tutorial. ...
...n the xul tutorial. ...
... container type: ? a variable reference to a node that is expected to be a container. ...
...And 3 more matches
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the eleme...
...emactive event will be sent to the item when the item is hovered over, and a dommenuiteminactive event will be sent to the item when the selection moves away. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. ...
...And 3 more matches
Browser Feature Detection - Archive of obsolete content
true true true backgroundrepeat true true true border true true true borderspacing true false true borderstyle 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 borderwidth true true true clear true true true color true true true display true true true cssfloat true false true font t...
...t true true true paddingbottom true true true paddingleft true true true textalign true true true textdecoration true true true textindent true true true texttransform true true true verticalalign true true true whitespace true true true width true true true wordspacing true true true dom css 2 support for properties/methods in document.body.style</caption> name firefox 1.5 ie 6 & 7 opera 8.54 - 9.01 azimuth true false false backgroundposition true true true bordercollapse true true true borderspacing true false ...
...ection true true true elevation true false false emptycells true false true fontsizeadjust true false true fontstretch true false true left true true true markeroffset true false true marks true false true maxheight true ie7 only true maxwidth true ie7 only true minheight true true true minwidth true ie7 only true orphans true false true outline true false true outlinecolor true false true outlinestyle true false true outlinewidth true false true overflow true true true page ...
...And 3 more matches
-ms-filter - Archive of obsolete content
following example shows how to use an inline style sheet to set the filter on an image. ...
...author/dhtml/graphics/cone.jpg" height="80px" width="80px" alt="cone"> the following example shows how to use scripting to set the filter on an image. code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/filter_s.htm <body> <p>click the image to start the filter.</p> // call the function. ...
...position: absolute; width: 200px; height: 250px; background-color: white; filter: revealtrans()"> <img id="imagefrom" style="position: absolute; top: 20px; left: 20px;" src="sphere.jpg" alt="sphere"> <div id="filterto" style="position: absolute; width: 200px; height: 250px; top: 20px; left: 20px; background: white; visibility: hidden;"> </div> </div> <script type="text/javascript"> let filterimg = document.queryselector('#filterfrom'); filterimg.addeventlistener('click', dofilter); function dofilter () { filterfrom.filters.item(0).apply(); // 12 ...
...And 3 more matches
Building up a basic demo with Three.js - Game development
tory to store your experiments in. save a copy of the latest minimized three.js library inside your directory. open the three.js documentation in a separate tab — it is useful to refer to. ...
...ctory. open the three.js documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: three.js demo</title> <style> body { margin: 0; padding: 0; } canvas { width: 100%; height: 100%; } </style> </head> <body> <script src="three.min.js"></script> <script> var width = window.innerwidth; var height = window.innerheight; /* all our javascript code goes here */ </script> </body> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element, that three.js will insert on the page to 100% to fill the entire available viewport space. the first <script> element includes the three.js library...
... before reading further, copy this code to a new text file, and save it in your working directory as index.html. renderer a renderer is a tool which displays scenes right in your browser. there are a few different renderers: webgl is the default, and others you can use are canvas, svg, css, and dom. ...
...And 3 more matches
Build the brick field - Game development
the paddle. what a breakout game really needs is some bricks to destroy with the ball, and this is what we'll create now! setting up the brick variables the overall aim of this lesson is to render a few lines of code for the bricks, using a nested loop that works through a two-dimensional array. ...
...s of code for the bricks, using a nested loop that works through a two-dimensional array. first however we need to set up some variables to define information about the bricks such as their width and height, rows and columns, etc. add the following lines to your code below the variables which you have previously declared in your program. var brickrowcount = 3; var brickcolumncount = 5; var brickwidth = 75; var brickheight = 20; var brickpadding = 10; var brickoffsettop = 30; var brickoffsetleft = 30; here we've defined the number of rows and columns of bricks , their width and height, the padding between the bricks so they won't touch each other and a top and left offset so they won't start being drawn right from the edge of the canvas. we will hold all our bricks in a two-dimensional array...
...later. brick drawing logic now let's create a function to loop through all the bricks in the array and draw them on the screen. our code might look like this: function drawbricks() { for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { bricks[c][r].x = 0; bricks[c][r].y = 0; ctx.beginpath(); ctx.rect(0, 0, brickwidth, brickheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } } } again, we're looping through the rows and columns to set the x and y position of each brick, and we're also painting a brick on the canvas — size brickwidth x brickheight — with each loop iteration. the problem is that we're painting them all in one place, at coordinat...
...And 3 more matches
Extra lives - Game development
of lives, the text label that displays the number of lives that remain, and a text label that will be shown on screen when the player loses one of their lives. defining the new text labels defining the texts look like something we already did in the score lesson. ...
...es one of their lives. defining the new text labels defining the texts look like something we already did in the score lesson. add the following lines below the existing scoretext definition inside your create() function: livestext = game.add.text(game.world.width-5, 5, 'lives: '+lives, { font: '18px arial', fill: '#0095dd' }); livestext.anchor.set(1,0); lifelosttext = game.add.text(game.world.width*0.5, game.world.height*0.5, 'life lost, click to continue', { font: '18px arial', fill: '#0095dd' }); lifelosttext.anchor.set(0.5); lifelosttext.visible = false; the livestext and lifelosttext objects look very similar to the scoretext one — they define a position on the screen, the actual text to display, and the font styling. the former is anchored on its top right edge to align properly wi...
... the lives handling code to implement lives in our game, let's ...
...And 3 more matches
Advanced styling effects - Learn web development
legible without them. you can find the examples in this section at box-shadow.html (see the source code too). a simple box shadow let's look at a simple example to get things started. ...
... any length and color units that would make sense to do so to define these values. ...
...ook with shadows based on multiple light sources. other box shadow features unlike text-shadow, box-shadow has an inset keyword available — putting this at the start of a shadow declaration causes it to become an inner shadow, rather than an outer shadow. let's have a look and see what we mean. ...
...And 3 more matches
How much does it cost to do something on the Web? - Learn web development
t is better to check the license of the file before you use it. sites like pixabay provide images under cc0 license, so you can use, edit and publish them even with modification for commercial use. media editors if you want to include video or audio into your website, you can either embed online services (for example youtube, vimeo, or dailymotion), or include your own videos (see below for bandwidth costs). for audio files, you can find free software (audacity, wavosaur), or paying up to a few hundred dollars (sony sound forge, adobe audition). likewise, video-editing software can be free (pitivi, openshot for linux, imovie for mac), less than $100 (adobe premiere elements), or several hundred dollars (adobe premiere pro, avid media composer, final cut pro). the software you received with y...
...need a more serious computer if you want to produce complicated designs, touch up photos, or produce audio and video files. you need to upload content to a remote server (see hosting below), so you need a modem. your isp can rent internet connectivity to you for a few dollars per month, though your budget might vary, depending on your location. ...
...s computer if you want to produce complicated designs, touch up photos, or produce audio and video files. you need to upload content to a remote server (see hosting below), so you need a modem. your isp can rent internet connectivity to you for a few dollars per month, though your budget might vary, depending on your location. ...
...And 3 more matches
Advanced form styling - Learn web development
and radio buttons styling a checkbox or a radio button is tricky by default. the sizes of check boxes and radio buttons are not meant to be changed with their default designs, and browsers react very differently when you try. ...
... </label> </p> </fieldset> </form> now, let's style these with a custom checkbox design. ...
...can get away with some simple styling to make sizing consistent, uniform styling of things like background-colors, and usage of appearence to get rid of some system-level styling. ...
...And 3 more matches
Advanced text formatting - Learn web development
n 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 color.</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px;...
...nds the cake together. coffee the drink that gets the world running in the morning. ...
...always reset it using the reset button. if you get really stuck, press the show solution button to see the answer. playable code 2 <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: 150px; width: 95%"> <p>hello and welcome to my motivation page. as confucius' quotes site says:</p> <p>it does not matter how slowly you go as long as you do not stop.</p> <p>i also love the concept of positive thinking, and the need to eliminate negative self talk (as mentioned in affirmations for positive thinking.)</p> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="res...
...And 3 more matches
Getting started with HTML - Learn web development
r your work using the reset button. if you get really stuck, press the show solution button to see the answer. ...
..."playable-code" style="min-height: 100px;width: 95%"> this is my text. ...
...n always reset it using the reset button. if you get really stuck, press the show solution button to see the answer. ...
...And 3 more matches
Video and audio content - Learn web development
with files, familiarity with html fundamentals (as covered in getting started with html) and images in html. objective: to learn how to embed video and audio content into a webpage, and add captions/subtitles to video. video and audio on the web web developers have wanted to use video and audio on the web for a long time, ever since the early 2000s when we started to have bandwidth fast enough to support any kind of video (video files are much larger than text or even images.) in the early days, native web technologies such as html didn't have the ability to embed video and audio on the web, so proprietary (or plugin-based) technologies like flash (and later, silverlight) became popular for handling such content. this kind of technology worked ok, but it had a number of pro...
...ple code for your own experimentation, in case you are unable to get hold of your own. note: before you begin here, you should also know that there are quite a few ovps (online video providers) like youtube, dailymotion, and vimeo, and online audio providers like soundcloud. such companies offer a convenient, easy way to host and consume videos, so you don't have to worry about the enormous bandwidth consumption. ovps even usually offer ready-made code for embedding video/audio in your webpages; if you use that route, you can avoid some of the difficulties we discuss in this article. we'll be discussing this kind of service a bit more in the next article. the <video> element the <video> element allows you to embed a video very easily. a really simple example looks like this: <video src="r...
...ch obviously takes time and is an unnecessary use of resources. refer to our guide to media types and formats for help selecting the best containers and codecs for your needs, as well as to look up the right mime types to specify for each. other <video> features there are a number of other features you can include when displaying an html video. ...
...And 3 more matches
Useful string methods - Learn web development
case it is probably more useful to test whether the method call isn't equal to a certain result. ...
... document.createelement('li'); listitem.textcontent = input; list.appendchild(listitem); } } </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; useren...
...g literals; they can also be variables, or even variables with a method being invoked on them. ...
...And 3 more matches
Implementing feature detection - Learn web development
llback properties, as described in css fallback behavior and handling css prefixes. @supports in recent times, css has had its own native feature detection mechanism introduced — the @supports at-rule. this works in a similar manner to media queries (see also responsive design problems) — except that instead of selectively applying css depending on a media feature like a resolution, screen width or aspect ratio, it selectively applies css depending on whether a css feature is supported. for example, we could rewrite our previous example to use @supports — see supports-feature-detect.html and supports-styling.css. if you look at the latter, you'll see a couple of @supports blocks, for example: @supports (flex-flow: row) and (flex: 1) { main { display: flex; } main div { ...
... your-feature-here" in your favorite search engine. bear in mind though that some features, however, are known to be undetectable — see modernizr's list of undetectables. matchmedia we also wanted to mention the window.matchmedia javascript feature at this point too. this is a property that allows you to run media query tests inside javascript. ...
... javascript. it looks like this: if (window.matchmedia("(max-width: 480px)").matches) { // run javascript in here. } as an example, our snapshot demo makes use of it to selectively apply the brick javascript library and use it to handle the ui layout, but only for the small screen layout (480px wide or less). ...
...And 3 more matches
nsIAccessibleText
anged in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void addselection(in long startoffset, in long endoffset); nsiaccessible getattributerange(in long offset, out long rangestartoffset, out long rangeendoffset); obsolete since gecko 1.9.1 wchar getcharacteratoffset(in long offset); void getcharacterextents(in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype); long getoffsetatpoint(in long x, in long y, in unsigned long coordtype); void getrangeextents(in long startoffset, in long endoffset, out long x, out long y, out long width, out long height, in unsigned long coordtype); void getselectionbounds(in long selectionnum, out long startoffset, out long endoffset); astring gettext(in long startoffse...
...e queried by at more often than other positions. because it does not represent an existing character its bounding box is defined in relation to preceding characters. it should be roughly equivalent to the bounding box of some character when inserted at the end of the text. its height typically being the maximal height of all the characters in the text or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate. void getcharacterextents( in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype ); parameters offset index of the character for which to return its bounding box. the valid range is 0..length. x x coordinate of the bounding box of the referenced character. y y coordinate...
...height height of the bounding box of the referenced character. coordtype specifies if the coordinates are relative to the screen or to the parent window (see constants declared in nsiaccessiblecoordinatetype.constants). ...
...And 3 more matches
AnalyserNode - Web APIs
the output is not connected. ...
...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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/d...
...dth="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/audionode" target="_top"><rect x="151" y="1" width="90" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">audionode</text></a><polyline points="241,25 251,20 251,30 241,25" stroke="#d4dde4" fill="none"/><line x1="251" y1="25" x2="281" y2="25" stroke="#d4dde4"/><a xlink:href="/doc...
...And 3 more matches
AudioBufferSourceNode - Web APIs
ent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. to play sounds which require accurate timing but must be streamed from the network or played from disk, use a audioworkletnode to implement its playback. ...
...ent its playback. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/audionode" target="_top"><rect x="151" y="1" wid...
...And 3 more matches
CSSMathValue.operator - Web APIs
will return the string "sum". syntax var astring = cssmathvalue.operator; value a string. ...
... a string. interface value cssmathsum "sum" cssmathproduct "product" cssmathmin "min" cssmathmax "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. ...
...um "sum" cssmathproduct "product" cssmathmin "min" cssmathmax "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. ...
...And 3 more matches
Determining the dimensions of elements - Web APIs
there are several properties you can look at in order to determine the width and height of elements, and it can be tricky to determine which is the right one for your needs. this article is designed to help you make that decision. note that all these properties are read-only. if you want to set the width and height of an element, use width and height or the overriding min-width and max-width, and min-height and max-height properties. how much room does it use up? ...
...ht one for your needs. this article is designed to help you make that decision. note that all these properties are read-only. if you want to set the width and height of an element, use width and height or the overriding min-width and max-width, and min-height and max-height properties. how much room does it use up? ...
... are read-only. if you want to set the width and height of an element, use width and height or the overriding min-width and max-width, and min-height and max-height properties. how much room does it use up? if you need to know the total amount of space an element occupies, including the width of the visible content, scrollbars (if any), padding, and border, you want to use the htmlelement.offsetwidth and htmlelement.offsetheight properties. most of the time these are the same as width and height of element.getboundingclientrect(), when there aren't any transforms applied to the element. in case of transforms, the offsetwidth and offsetheight returns the element's layout width and height, while getboundingclientrect() returns the rendering width and height. as an example, if the element has wi...
...And 3 more matches
CanvasRenderingContext2D.fillText() - Web APIs
the canvasrenderingcontext2d method filltext(), part of the canvas 2d api, draws a text string at the specified coordinates, filling the string's characters with the current fillstyle. an optional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. ...
...hout modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. the text is rendered using the font and text layout configuration as defined by the font, textalign, textbaseline, and direction properties. to draw the outlines of the characters in a string, call the context's stroketext() method. ...
....filltext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context. the text is rendered using the settings specified by font, textalign, textbaseline, and direction. x the x-axis coordinate of the point at which to begin drawing the text, in pixels. y the y-axis coordinate of the point at which to begin drawing the text, in pixels. maxwidth optional the maximum number of pixels wide the text may be once rendered. if not specified, there is no limit to the width of the text. however, if this value is provided, the user agent will adjust the kerning, select a more horizontally condensed font (if one is available or can be generated without loss of quality), or scale down to a smaller font size in order to fit the text in the specifie...
...And 3 more matches
CanvasRenderingContext2D.lineCap - Web APIs
rmines the shape used to draw the end points of lines. note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods. syntax ctx.linecap = "butt" || "round" || "square"; options "butt" the ends of lines are squared off at the endpoints. default value. "round" the ends of lines are rounded. ...
...two guides to see the exact differences between the three are added. each of these lines starts and ends exactly on these guides. ...
...are drawn, each with a different value for the linecap property. two guides to see the exact differences between the three are added. each of these lines starts and ends exactly on these guides. the line on the left uses the default "butt" option. it's drawn completely flush with the guides. the second is set to use the "round" option. ...
...And 3 more matches
Comment - Web APIs
Web › API › Comment
the comment interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. comments are represented in html and xml as content between '<!--' and '-->'. in xml, the character sequence '--' cannot be used within a comment. ...
... within a comment. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 3 more matches
Document - Web APIs
Web › API › Document
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. ...
...s in the document. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 3 more matches
GlobalEventHandlers.onanimationend - Web APIs
an html element (htmlelement), document (document), or window (window). the function receives as input a single parameter: an animationevent object describing the event which occurred. ...
...ent), document (document), or window (window). the function receives as input a single parameter: an animationevent object describing the event which occurred. ...
...meter: an animationevent object describing the event which occurred. ...
...And 3 more matches
GlobalEventHandlers.onanimationstart - Web APIs
an html element (htmlelement), document (document), or window (window). the function receives as input a single parameter: an animationevent object describing the event which occurred. ...
...ent), document (document), or window (window). the function receives as input a single parameter: an animationevent object describing the event which occurred. ...
...meter: an animationevent object describing the event which occurred. ...
...And 3 more matches
HTMLAnchorElement - Web APIs
ink elements and provides special properties and methods (beyond those of the regular htmlelement object interface that they inherit from) for manipulating the layout and presentation of such elements. ...
...s represented by htmllinkelement) <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/d...
...ke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#d4dde4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/w...
...And 3 more matches
HTMLDocument - Web APIs
the htmldocument interface, which may be accessed through the window.htmldocument property, extends the window.htmldocument property to include methods and properties that are specific to html documents. ...
...to html documents. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 3 more matches
KeyboardEvent - Web APIs
had with a key on the keyboard at a low level, providing no contextual meaning to that interaction. when you need to handle text input, use the input event instead. keyboard events may not be fired if the user is using an alternate means of entering text, such as a handwriting system on a tablet or graphics tablet. ...
...blet or graphics tablet. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/uievent" target="_top"><rect x="116" y="1" width="75" hei...
...And 3 more matches
ProcessingInstruction - Web APIs
eclaration. user-defined processing instructions cannot begin with "xml", as xml-prefixed processing-instruction target names are reserved by the xml specification for particular, standard uses (see, for example, <?xml-stylesheet ?>). the processinginstruction interface inherits methods and properties from node. ...
... methods and properties from node. ...
...agram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 10%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 700 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 3 more matches
SVGElement - Web APIs
all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface. ...
...element interface. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 3 more matches
SyncEvent - Web APIs
Web › API › SyncEvent
the syncevent interface represents a sync action that is dispatched on the serviceworkerglobalscope of a serviceworker. this interface inherits from the extendableevent interface. ...
...xtendableevent interface. ...
...tyle="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/extendableevent" target="_top"><rect x="116" y="1" width=...
...And 3 more matches
Text - Web APIs
Web › API › Text
is parsed into information items and text nodes that form its children. new documents have a single text node for each block of text. over time, more text nodes may be created as the document's content changes. the node.normalize() method merges adjacent text objects back into a single node for each block of text. ...
...ach block of text. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 3 more matches
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
the webglrenderingcontext.compressedteximage2d() and webgl2renderingcontext.compressedteximage3d() methods of the webgl api specify a two- or three-dimensional texture image in a compressed format. compressed image formats must be enabled by webgl extensions before using these methods. ...
...mage in a compressed format. compressed image formats must be enabled by webgl extensions before using these methods. ...
...syntax // webgl 1: void gl.compressedteximage2d(target, level, internalformat, width, height, border, arraybufferview? ...
...And 3 more matches
Using IIR filters - Web APIs
nseoutput); we can use this data to draw a filter frequency plot. we'll do so on a 2d canvas context. ...
...data to draw a filter frequency plot. we'll do so on a 2d canvas context. ...
...vas context. ...
...And 3 more matches
WheelEvent - Web APIs
nt. even when it does, that doesn't mean that the delta* values in the wheel event necessarily reflect the content's scrolling direction. therefore, do not rely on delta* properties to get the content's scrolling direction. instead, detect value changes to scrollleft and scrolltop of the target in the scroll event. ...
...et in the scroll event. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/uievent" target="_top"><rect x="116" y="1" width="75" hei...
...And 3 more matches
Window: resize event - Web APIs
the on-going discussions. examples window size logger the following example reports the window size each time it is resized. bear in mind that since the example is running in an <iframe>, you'll need to actually get the <iframe> to resize before you see an effect. ...
...cussions. examples window size logger the following example reports the window size each time it is resized. bear in mind that since the example is running in an <iframe>, you'll need to actually get the <iframe> to resize before you see an effect. ...
...size each time it is resized. bear in mind that since the example is running in an <iframe>, you'll need to actually get the <iframe> to resize before you see an effect. ...
...And 3 more matches
Window - Web APIs
Web › API › Window
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. ...
... to the window instead. <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/window" target="_top"><rect x="1" y="1" width="75" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">window</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructors see also the dom interfaces. domparser domparser can parse xml ...
....frames read only returns an array of the subframes in the current window. window.fullscreen this property indicates whether the window is displayed in full screen or not. window.history read only returns a reference to the history object. window.innerheight read only gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar. window.innerwidth read only gets the width of the content area of the browser window including, if rendered, the vertical scrollbar. window.issecurecontext read only indicates whether a context is capable of using features that require secure contexts. window.length read only returns the number of frames in the window. see also window.frames. window.location gets/sets the location, or current url, of t...
...And 3 more matches
XMLDocument - Web APIs
the xmldocument interface represents an xml document. it inherits from the generic document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents. ...
...ypes of documents. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 3 more matches
Logical properties for sizing - CSS: Cascading Style Sheets
he default for many of us, in a design you may well use both physical and logical sizing. you might want some features to always relate to the physical dimensions whatever the writing mode. mappings for dimensions the table below provides mappings between logical and physical properties. ...
...s for dimensions the table below provides mappings between logical and physical properties. these mappings assume that you are in a horizontal-tb writing mode, such as english or arabic, in which case width would be mapped to inline-size. if you were in a vertical writing mode then inline-size would be mapped to height. logical property physical property inline-size width block-size height min-inline-size min-width min-block-size min-height max-inline-size max-width max-block-size max-height width and height example the logical mappings for width and height are inline-size, which sets the length in the inline dimension and block-size, which sets the length in the block dimension. when working in e...
...ze height min-inline-size min-width min-block-size min-height max-inline-size max-width max-block-size max-height width and height example the logical mappings for width and height are inline-size, which sets the length in the inline dimension and block-size, which sets the length in the block dimension. when working in english, replacing width with inline-size and height with block-size will give the same layout. in the live example below i have set the writing mode to horizontal-tb. change it to vertical-rl and you will see that the first example — which uses width and height — remains the same size in each dimension, despite the text becoming vertical. the second example — which uses inline-size and block-size — will follow ...
...And 3 more matches
CSS Scrollbars - CSS: Cascading Style Sheets
css scrollbars standardizes the obsolete scrollbar color properties introduced in 2000 by windows ie 5.5. basic example in this example we have chosen to use a thin scrollbar, with a green track and purple thumb. .scroller { width: 300px; height: 100px; overflow-y: scroll; scrollbar-color: rebeccapurple green; scrollbar-width: thin; } html <div class="scroller"> veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic. ...
...r"> veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic. gumbo beet greens corn soko endive gumbo gourd. parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. dandelion cucumber earthnut pea peanut soko zucchini. </div> result reference css properties scrollbar-width scrollbar-color specifications specification status comment css scrollbars level 1 working draft initial definition. accessibility concerns when you customize scrollbars, consider they have enough contrast and that their hit area is large enough for people who use touch input. baseline rules for scrollbar usability | adrian roselli browser compa...
...sider they have enough contrast and that their hit area is large enough for people who use touch input. baseline rules for scrollbar usability | adrian roselli browser compatibility the compatibility table in 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. ...
...And 3 more matches
Grid wrapper - CSS: Cascading Style Sheets
the grid wrapper pattern is useful for aligning grid content within a central wrapper, while also allowing items to break out and align to the edge of the containing element or page when desired. requirements items placed on the grid should be able to align to a horizontally-centered max-width wrapper and/or the outer edges of the grid. recipe download this example choices made this recipe uses the css grid minmax() function to define the grid track sizes in the grid-template-columns property. for the central columns with a maximum width we can set a minimum value of 0 or greater and a maximum value that specifies the maximum size the column tracks will grow to. using a numeric unit (pixels, ems, rems) will create a fixed maximum size for the central wrapper, whereas using percentage...
... for the central wrapper, whereas using percentage values or viewport units will mean this wrapper grows or shrinks in response to its context. the outer two columns have a maximum size of 1fr, meaning that they will each expand to fill the remaining available space in the grid container. ...
...er grows or shrinks in response to its context. the outer two columns have a maximum size of 1fr, meaning that they will each expand to fill the remaining available space in the grid container. ...
...And 3 more matches
Shorthand properties - CSS: Cascading Style Sheets
pes, as the order has no importance, but this does not work as easily when several properties can have identical values. ...
...e identical values. ...
...-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. ...
...And 3 more matches
background-size - CSS: Cascading Style Sheets
es project, please clone https://github.com/mdn/interactive-examples and send us a pull request. spaces not covered by a background image are filled with the background-color property, and the background color will be visible behind background images that have transparency/translucency. ...
...operty, and the background color will be visible behind background images that have transparency/translucency. ...
...auto; /* multiple backgrounds */ background-size: auto, auto; /* not to be confused with `auto auto` */ background-size: 50%, 25%, 25%; background-size: 6px, auto, contain; /* global values */ background-size: inherit; background-size: initial; background-size: unset; the background-size property is specified in one of the following ways: using the keyword values contain or cover. using a width value only, in which case the height defaults to auto. using both a width and a height value, in which case the first sets the width and the second sets the height. each value can be a <length>, a <percentage>, or auto. to specify the size of multiple background images, separate the value for each one with a comma. values contain scales the image as large as possible without cropping or s...
...And 3 more matches
block-size - 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. ...
... syntax /* <length> values */ block-size: 300px; block-size: 25em; /* <percentage> values */ block-size: 75%; /* keyword values */ block-size: max-content; block-size: min-content; block-size: fit-content(20em); block-size: auto; /* global values */ block-size: inherit; block-size: initial; block-size: unset; if the writing mode is vertically oriented, the value of block-size relates to the width of the element; otherwise, it relates to the height of the element. a related property is inline-size, which defines the other dimension of the element. initial valueautoapplies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc(); syntax values the block-size property takes the same va...
...ent; otherwise, it relates to the height of the element. a related property is inline-size, which defines the other dimension of the element. initial valueautoapplies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc(); syntax values the block-size property takes the same values as the width and height properties. ...
...And 3 more matches
calc() - CSS: Cascading Style Sheets
Web › CSS › calc
roperty values. it can be used anywhere a <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> is allowed. 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 /* property: calc(expression) */ width: calc(100% - 80px); the calc() function takes a single expression as its parameter, with the expression's result used as the value. the expression can be any simple expression combining the following operators, using standard operator precedence rules: + addition. - subtraction. * multiplication. at least one of the arguments must be a <number>. / division. the right-hand side must be ...
...ercentage followed by a subtraction operator and a length. likewise, calc(8px + -50%) is treated as a length followed by an addition operator and a negative percentage. the * and / operators do not require whitespace, but adding it for consistency is both allowed and recommended. division by zero results in an error being generated by the html parser. math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified. it is permitted to nest calc() functions, in which case the inner ones are treated as simple parentheses. formal syntax calc( <calc-sum> )where <calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*where <ca...
... results in an integer. ie. z-index: calc(4 / 2); will not be accepted. examples positioning an object on screen with a margin calc() makes it easy to position an object with a set margin. ...
...And 3 more matches
fit-content() - CSS: Cascading Style Sheets
-examples and send us a pull request. the function can be used as a track size in css grid properties, where the maximum size is defined by max-content and the minimum size by auto, which is calculated similar to auto (i.e., minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. the function can also be used as laid out box size for width, height, min-width, min-height, max-width and max-height, where the maximum and minimum sizes refer to the content size. syntax the fit-content() function accepts a <length> or a <percentage> as an argument. /* <length> values */ fit-content(200px) fit-content(5cm) fit-content(30vw) fit-content(100ch) /* <percentage> value */ fit-content(40%) values <length> an absolute length. <percen...
...acks and to the block size of the grid container for row tracks. otherwise it is relative to the available inline size or block size of the laid out box depending on the writing mode. examples sizing grid columns with fit-content html <div id="container"> <div>item as wide as the content.</div> <div> item with more text in it. ...
...id="container"> <div>item as wide as the content.</div> <div> item with more text in it. because the contents of it are wider than the maximum width, it is clamped at 300 pixels. ...
...And 3 more matches
left - CSS: Cascading Style Sheets
Web › CSS › left
he horizontal position of a positioned element. it has no effect on non-positioned elements. 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 /* <length> values */ left: 3px; left: 2.4em; /* <percentage>s of the width of the containing block */ left: 10%; /* keyword value */ left: auto; /* global values */ left: inherit; left: initial; left: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the left edge of the containing block. for relatively positioned elements, the distance that the element is moved to the right o...
...values */ left: inherit; left: initial; left: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the left edge of the containing block. for relatively positioned elements, the distance that the element is moved to the right of its normal position. <percentage> a <percentage> of the containing block's width. auto specifies that: for absolutely positioned elements, the position of the element is based on the right property, while width: auto is treated as a width based on the content; or if right is also auto, the element is positioned where it should horizontally be positioned if it were a static element. for relatively positioned elements, the distance of the element from its normal positio...
...the element is relatively positioned.) when position is set to relative, the left property specifies the distance the element's left edge is moved to the right from its normal position. when position is set to sticky, the left property is used to compute the sticky-constraint rectangle. when position is set to static, the left property has no effect. when both left and right are defined, and width constraints don't prevent it, the element will stretch to satisfy both. if the element cannot stretch to satisfy both, the position of the element is overspecified. when this is the case, the left value has precedence when the container is left-to-right; the right value has precedence when the container is right-to-left. formal definition initial valueautoapplies topositioned elementsinherited...
...And 3 more matches
outline - CSS: Cascading Style Sheets
Web › CSS › outline
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. note: the o...
...or 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 of the outline. defaults to medium if absent. see outline-width. description borders and outlines are very similar. however, outlines differ from borders 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...
...e a visible focus indicator. provide obvious focus styling if the default focus style is removed. ...
...And 3 more matches
position - CSS: Cascading Style Sheets
Web › CSS › position
ted position value is sticky. it's treated as relatively positioned until its containing block crosses a specified threshold (such as setting top to value other than auto) within its flow root (or the container it scrolls within), at which point it is treated as "stuck" until meeting the opposite edge of its containing block. most of the time, absolutely positioned elements that have height and width set to auto are sized so as to fit their contents. however, non-replaced, absolutely positioned elements can be made to fill the available vertical space by specifying both top and bottom and leaving height unspecified (that is, auto). they can likewise be made to fill the available horizontal space by specifying both left and right and leaving width as auto. except for the case just described (...
... position within the document, but without the offset affecting other elements. in the example below, note how the other elements are placed as if "two" were taking up the space of its normal location. html <div class="box" id="one">one</div> <div class="box" id="two">two</div> <div class="box" id="three">three</div> <div class="box" id="four">four</div> css .box { display: inline-block; width: 100px; height: 100px; background: red; color: white; } #two { position: relative; top: 20px; left: 20px; background: blue; } absolute positioning elements that are relatively positioned remain in the normal flow of the document. in contrast, an element that is absolutely positioned is taken out of the flow; thus, other elements are positioned as if it did not exist. the absol...
...tatic). if a positioned ancestor doesn't exist, it is positioned relative to the icb (initial containing block — see also the w3c definition), which is the containing block of the document's root element. html <h1>absolute positioning</h1> <p>i am a basic block level element. ...
...And 3 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
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 above example shows simple usage of the <video> element. in a similar manner to the <img> element, we include a path to the media we want to display inside the src attribute; we can include other attributes to specify information such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's default video controls, etc. the content inside the opening and closing <video></video> tags is shown as a fallback in browsers that don't support the element. attributes like all other html elements, this element supports the global attributes. autoplay a boolean attribute; if specified, the video a...
...dio, media incoming from webrtc, and so forth), this value is +infinity. height the height of the video's display area, in css pixels (absolute values only; no percentages.) intrinsicsize this attribute tells the browser to ignore the actual intrinsic size of the image and pretend it’s the size specified in the attribute. specifically, the image would raster at these dimensions and naturalwidth/naturalheight on images would return the values specified in this attribute. explainer, examples loop a boolean attribute; if specified, the browser will automatically seek back to the start upon reaching the end of the video. muted a boolean attribute that indicates the default setting of the audio contained in the video. if set, the audio will be initially silenced. its default value is fal...
...bute has precedence over preload. if autoplay is specified, the browser would obviously need to start downloading the video for playback. the specification does not force the browser to follow the value of this attribute; it is a mere hint. src the url of the video to embed. this is optional; you may instead use the <source> element within the video block to specify the video to embed. width the width of the video's display area, in css pixels (absolute values only; no percentages). events event name fired when audioprocess the input buffer of a scriptprocessornode is ready to be processed. canplay the browser can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for f...
...And 3 more matches
Browser detection using the user agent - HTTP
if the users' device is touch-friendly and has a small screen so they can optimize their website accordingly. while user agent sniffing can sometimes detect these, not all devices are the same: some mobile devices have big screen sizes, some desktops have a small touchscreen, some people use smart tv's which are an entirely different ballgame altogether, and some people can dynamically change the width and height of their screen by flipping their tablet on its side! so, user agent sniffing is definitely not the way to go. thankfully, there are much better alternatives. use navigator.maxtouchpoints to detect if the user's device has a touchscreen. then, default back to checking the user agent screen only if (!("maxtouchpoints" in navigator)) { /*code here*/}. using this information of whether th...
...what you want to do for screen size is not slash off information on smaller screens. that will only annoy people because it will force them to use the desktop version. rather, try to have fewer columns of information in a longer page on smaller screens while having more columns with a shorter page on la...
... also consider the following. if more people visit the webpage to see the cats, then it might be a good idea to put all the cats higher in the source code than the dogs so that more people can find what they are looking for faster on smaller screens where the content collapses down to one column. next, always make your code dynamic. the user can flip their mobile device on its side, changing the width and height of the page. or, there might be some weird flip-phone-like device thing in the future where flipping it out extends the screen. do not be the developer having a headache over how to deal with the flip-phone-like device thing. never be satisfied with your webpage until you can open up the dev tools side panel and resize the screen while the webpage looks smooth, fluid, and dynamically r...
...And 3 more matches
Image file type and format guide - Web media technologies
gorithms that still leave fairly large files after compression. tiff supports a variety of compression methods, but the most commonly used are the ccitt group 4 (and, for older fax systems, group 3) compression systems used for by fax software, as well as lzw and lossy jpeg compression. every value in a tiff file is specified using its tag (indicating what kind of information it is, such as the width of the image) and its type (indicating the format the data is stored in), followed by the length of the array of values to assign to that tag (all properties are stored in arrays, even for single values). this allows different data types to be used for the same properties. for example, the width of an image, imagewidth, is stored using tag 0x0100, and is a one-entry array. by specifying type 3 (s...
...pe (indicating the format the data is stored in), followed by the length of the array of values to assign to that tag (all properties are stored in arrays, even for single values). this allows different data types to be used for the same properties. for example, the width of an image, imagewidth, is stored using tag 0x0100, and is a one-entry array. ...
...n to that tag (all properties are stored in arrays, even for single values). this allows different data types to be used for the same properties. for example, the width of an image, imagewidth, is stored using tag 0x0100, and is a one-entry array. ...
...And 3 more matches
stroke-linecap - SVG: Scalable Vector Graphics
on a zero length subpath, the path will not be rendered at all. example html,body,svg { height:100% } <svg viewbox="0 0 6 4" xmlns="http://www.w3.o...
...on a zero length subpath, the stroke consists of a full circle centered at the s...
...on a zero length subpath, the stroke consists of a full circle centered at the subpath's point. ...
...And 3 more matches
SVG and CSS - SVG: Scalable Vector Graphics
below you'll create a simple demonstration that runs in your svg-enabled browser. note: elements referenced by <use> elements inherit the styles from that element. so to apply different styles to them you should use css custom properties. example make a new svg document as a plain text file, doc8.svg. ...
...tion ***/ /* 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; } /* petals */ .segment-fill { fill: var(--segment-fill-fill); stroke: var(--segment-fill-stroke); stroke-width: var(--segment-fill-stroke-width); } .segment-fill:hover { fill: var(--segment-fill-fill-hover); stroke: var(--segment-fill-stroke-hover); } .segment-edge { fill: var(--segment-edge-fill); stroke: var(--segment-edge-stroke); stroke-width: var(--segment-edge-stroke-width); } .segment-edge:hover { stroke: var(--segment-edge-stroke-hover); } /* outer petals */ #outer-petals { opacit...
...stroke: var(--segment-fill-stroke-hover); } .segment-edge { fill: var(--segment-edge-fill); stroke: var(--segment-edge-stroke); stroke-width: var(--segment-edge-stroke-width); } .segment-edge:hover { stroke: var(--segment-edge-stroke-hover); } /* outer petals */ #outer-petals { opacity: .75; --segment-fill-fill: azure; --segment-fill-stroke: lightsteelblue; --segment-fill-stroke-width: 1; --segment-edge-fill: none; --segment-edge-stroke: deepskyblue; --segment-edge-stroke-width: 3; --segment-fill-fill-hover: plum; --segment-fill-stroke-hover: none; --segment-edge-stroke-hover: slateblue; } /* non-standard way of styling elements referenced via <use> elements, supported by some older browsers */ #outer-petals .segment-fill { fill: azure; stroke: lightsteelblu...
...And 3 more matches
Layout System Overview - Archive of obsolete content
ator 4.x). the decision about when to apply css-specified formatting and when to apply legacy formatting is controlled by the document's doctype specification. these layout modes are referred to as 'standards' and 'navquirks' modes. (doctype and modes are explained in more detail in article mozilla's doctype sniffing. ...
...article mozilla's doctype sniffing. galley and page presentations: the presentation generally is constrained by the width of the window in which the presentation is to be displayed, and a height that extends as far as necessary. this is referred to as the galley mode presentation, and is what one expects from a typical browser. additionally, layout must support a paginated presentation, where the width of the presentation is constrained by the dimensions of the printed output (paper) and the height of each page is fixed. this paged presentation presents several challenges not present in the galley presentation, namely how to break up elements that are larger than a single page, and how to handle changes to page dimensions. the original design of the layout system allowed for multiple, possibly ...
...he most essential frame types are block and inline, and these correspond to the most important layout concepts, the block and line. a block is a rectangular region that is composed of one or more lines. a line is a single row of text or other presentational elements. all layout happens in the context of a block, and all of the contents of a block are formatted into lines within that block. as the width of a block is changed, the contents of the lines must be reformatted. consider for example a large paragraph of text sitting in paragraph: <p> we need documentation for users, web developers, and developers working on mozilla. if you write your own code, document it. much of the existing code <b>isn’t very well documented</b>. in the process of figuring things out, try and document your dis...
...And 2 more matches
crop - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › crop
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. ...
...e cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. ...
...And 2 more matches
Property - Archive of obsolete content
« xul reference accessible accessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi customtoo...
... height hidden hideseconds highlightnonmatches homepage hour hourleadingzero id ignoreblurwhilesearching image increment inputfield inverted is24hourclock ispm issearching iswaiting itemcount label labelelement lastpermanentchild lastselected left linkedpanel listboxobject locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageincrement pageindex pagestep parentcontainer palette persist persistence placeholder...
... pack pagecount pageid pageincrement pageindex pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src ...
...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...
...avior 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 box model m...
...ng 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 horizontal box...
...And 2 more matches
column - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single column in a columns element. each child of the column element is placed in each successive cell of the grid. the column with the most child elements determines the number of rows in each column. it is common to use columns only to define width and flexibility for the grid column and not place elements directly inside the column. more information is available in the xul tutorial. example see grid for an example. attributes 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...
...y inside the column. more information is available in the xul tutorial. example see grid for an example. ...
...information is available in the xul tutorial. example see grid for an example. ...
...And 2 more matches
dialogheader - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } description type: string descriptive text to appear in addition to the dialog title. title type: stri...
... description type: string descriptive text to appear in addition to the dialog title. title type: string the text to appear in the title bar of the window. ...
...And 2 more matches
dropmarker - Archive of obsolete content
use a dropmarker, that when pressed, will reveal a popup menu. ...
... pressed, will reveal a popup menu. examples properties accessibletype attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. inhe...
... tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...And 2 more matches
image - Archive of obsolete content
Archive › Mozilla › XUL › image
xamples | attributes | properties | methods | related ] summary an element that displays an image, much like the html img element. the src attribute can be used to specify the url of the image. more information 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. ...
...t displays an image, much like the html img element. the src attribute can be used to specify the url of the image. more information 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.on...
... accessibletype type: integer a value indicating the type of accessibility object for the element. src type: url gets and sets the value of the src attribute. ...
...And 2 more matches
listcell - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the elem...
...te is reserved for use by anonymous children of listitem; do not use. properties disabled type: boolean gets and sets the value of the disabled attribute. ...
...And 2 more matches
listhead - Archive of obsolete content
t for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. ...
...is normally preferred to use of the attribute, as it may need to update additional state. 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...nteger a value indicating the type of accessibility object for the element. disabled type: boolean gets and sets the value of the disabled attribute. ...
...And 2 more matches
listheader - Archive of obsolete content
em element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. ...
...s attribute is copied to the menulist.value property upon user selection of the menuitem. 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. inhe...
... tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...And 2 more matches
menuitem - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } description type: string descriptive text to appear in addition to the dialog title. disabled type: b...
...ue of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
...And 2 more matches
progressmeter - Archive of obsolete content
ing the value to "0" shows an empty bar, "100" shows a bar at full length and "25" shows the first quarter of the bar. ...
...an empty bar, "100" shows a bar at full length and "25" shows the first quarter of the bar. 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...e of the value attribute. for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax. ...
...And 2 more matches
rows - Archive of obsolete content
Archive › Mozilla › XUL › rows
ement. the rows element may be nested inside another rows element. the children of these nested rows are counted as normal rows as if they were part of the parent. however, nesting rows elements allows groups of rows to have a separate appearance such as a different border, or separate scrolling may be defined for these rows. non-row related elements placed inside a rows element occupy the full width of the grid and are placed in their corresponding positions between the rows. more information is available in the xul tutorial. example see grid for an example. attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, h...
...ns between the rows. more information is available in the xul tutorial. example see grid for an example. ...
...information is available in the xul tutorial. example see grid for an example. ...
...And 2 more matches
scrollbox - Archive of obsolete content
all men are created equal."/> </vbox> the next bunch of labels is similar, but if the container doesn't give enough room for it, scroll bars will sprout out of nowhere and allow the user 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. <vbox flex="1" style="overflow:auto"> <label value="01 four score and seven years ago "/> <label value="02 our fathers brought forth on "/> <label value="03 this continent, a new nation, "/> <label value="04 conceived in libe...
...isible(child_element_to_make_visible); see the nsiscrollboxobject api for other scroll-related methods. ...
...e_visible); see the nsiscrollboxobject api for other scroll-related methods. ...
...And 2 more matches
<statusbarpanel> - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no ...
... image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. ...
...And 2 more matches
toolbarspacer - Archive of obsolete content
] firefox only a space between toolbar items. ...
...etween toolbar items. properties accessibletype examples (example needed) attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. inhe...
... tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...And 2 more matches
toolbarspring - Archive of obsolete content
y a flexible space between toolbar items. ...
...toolbar items. properties accessibletype examples (example needed) attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. inheri...
...p, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...And 2 more matches
tooltip - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. ...
... 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 copied to the menulist.value property upon user selection of the menuitem. ...
...And 2 more matches
treecols - Archive of obsolete content
ed) attributes pickertooltiptext type: string the text for the tooltip on the column picker. ...
...pickertooltiptext type: string the text for the tooltip on the column picker. 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. inhe...
... tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...And 2 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
netscape 7.01 examples if you are like me, you learn best from examples. studying how other authors use browser detection and cross browser coding techniques is the best way to learn. example 1 - object based feature detection this example illustrates the use of feature detection. ...
... use browser detection and cross browser coding techniques is the best way to learn. example 1 - object based feature detection this example illustrates the use of feature detection. note that gecko 1.0 (netscape 7) and later implement the proprietary internet explorer feature clientwidth while netscape 6 did not. in this example, netscape 7 and internet explorer 5+ will automatically use clientwidth while netscape navigator 4, netscape 6, compuserve 7 and opera will use innerwidth. ...
... internet explorer feature clientwidth while netscape 6 did not. in this example, netscape 7 and internet explorer 5+ will automatically use clientwidth while netscape navigator 4, netscape 6, compuserve 7 and opera will use innerwidth. compare how you would have had to code this using vendor/version based detection approaches. ...
...And 2 more matches
::-ms-fill-lower - Archive of obsolete content
tion 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. ...
... the following css properties can be used in a rule with ::-ms-fill-lower in its selector. other properties are ignored. ...
...s-fill-lower in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-fill-upper - Archive of obsolete content
tion 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. ...
... the following css properties can be used in a rule with ::-ms-fill-upper in its selector. other properties are ignored. ...
...s-fill-upper in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-reveal - Archive of obsolete content
o 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. ...
...only the following css properties can be used in a rule with ::-ms-reveal in its selector. other properties are ignored. ...
...::-ms-reveal in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-thumb - Archive of obsolete content
sentation 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. ...
... only the following css properties can be used in a rule with ::-ms-thumb in its selector. other properties are ignored. ...
... ::-ms-thumb in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-ticks-after - Archive of obsolete content
lor 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. ...
...the following css properties can be used in a rule with ::-ms-ticks-after in its selector. other properties are ignored. ...
...-ticks-after in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-ticks-before - Archive of obsolete content
or 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. ...
...he following css properties can be used in a rule with ::-ms-ticks-before in its selector. other properties are ignored. ...
...ticks-before in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-track - Archive of obsolete content
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. ...
... only the following css properties can be used in a rule with ::-ms-track in its selector. other properties are ignored. ...
... ::-ms-track in its selector. other properties are ignored. ...
...And 2 more matches
::-ms-value - Archive of obsolete content
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. ...
... only the following css properties can be used in a rule with ::-ms-value in its selector. other properties are ignored. ...
... ::-ms-value in its selector. other properties are ignored. ...
...And 2 more matches
Collision detection - Game development
ulations } } } if the center of the ball is inside the coordinates of one of our bricks, we'll change the direction of the ball. for the center of the ball to be inside the brick, all four of the following statements need to be true: the x position of the ball is greater than the x position of the brick. the x position of the ball is less than the x position of the brick plus its width. ...
... making the bricks disappear after they are hit the above code will work as desired and the ball changes its direction. the problem is that the bricks are staying where they are. ...
...awbricks() function before drawing it — if status is 1, then draw it, but if it's 0, then it was hit by the ball and we don't want it on the screen anymore. ...
...And 2 more matches
Build the brick field - Game development
dd a call to initbricks at the end of the create() function: function create(){ // ... initbricks(); } now onto the function itself. add the initbricks() function at the end of our games code, just before the closing </script> tag, as shown below. ...
...in with we've included the brickinfo object, as this will come in handy very soon: function initbricks() { brickinfo = { width: 50, height: 20, count: { row: 3, col: 7 }, offset: { top: 50, left: 60 }, padding: 10 }; } this brickinfo object will hold all the information we need: the width and height of a single brick, the number of rows and columns of bricks we will see on screen, the top and left offset (the location on the canvas where we shall start to draw the bricks) and the padding between each row and column of bricks. now, let's start creating the bricks themselves — add an empty group first to contain the bricks, by adding the following line at the bottom of the initbr...
...'s body is set to be immovable (so it won't move when hit by the ball), and we're also setting the anchor to be in the middle and adding the brick to the group. the problem currently is that we're painting all the bricks in one place, at coordinates (0,0). what we need to do is draw each brick at its own x and y position. update the brickx and bricky lines as follows: var brickx = (c*(brickinfo.width+brickinfo.padding))+brickinfo.offset.left; var bricky = (r*(brickinfo.height+brickinfo.padding))+brickinfo.offset.top; each brickx position is worked out as brickinfo.width plus brickinfo.padding, multiplied by the column number, c, plus the brickinfo.offset.left; the logic for the bricky is identical except that it uses the values for row number, r, brickinfo.height, and brickinfo.offset.top. ...
...And 2 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
ariable that can store only one value. 24 asynchronous glossary, web, webmechanics, asynchronous the term asynchronous refers to or multiple related things happening without waiting for the previous one to complete). 25 attribute codingscripting, glossary, html an attribute extends an element, changing its behavior or providing metadata. 26 bandwidth glossary, infrastructure bandwidth is the measure of how much information can pass through a data connection in a given amount of time. it is usually measured in multiples of bits-per-second (bps), for example megabits-per-second (mbps) or gigabits-per-second (gbps). 27 base64 advanced, base64, javascript, typed arrays, uri, url, unicode problem, atob(), btoa() base...
...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 the document object model (dom). both of them are part of the critical rendering path which is a series of steps that must happen to properly render a website. 57 css pixel css, css pixel, glossary, height, length, pixel, size, unit, width the css pixel—denoted in css with the suffix px—is a unit of length which roughly corresponds to the width or height of a single dot that can be comfortably seen by the human eye without strain, but is otherwise as small as possible. by definition, this is the physical size of a single pixel at a pixel density of 96 dpi, located an arm's length away from the viewer's eyes. 58 ...
... the internet is a worldwide network of networks that uses the internet protocol suite (also named tcp/ip from its two most important protocols). 237 intrinsic size css, glossary, intrinsic size in css, the intrinsic size of an element is the size it would be based on its content, if no external factors were applied to it. for example, inline elements are sized intrinsically: width, height, and vertical margin and padding have no impact, though horizontal margin and padding do. 238 jpeg beginner, composing, glossary, images, jpeg jpeg (joint photographic experts group) is a commonly used method of lossy compression for digital images. 239 json codingscripting, glossary, intro, json, l10n:priority javascript object notation (json) is...
...And 2 more matches
HTML: A good basis for accessibility - Learn web development
old days, people used to create page layouts using html tables — using different table cells to contain the header, footer, sidebar, main content column, etc. this is not a good idea because a screen reader will likely give out confusing readouts, especially if the layout is complex and has many nested tables. ...
...adouts, especially if the layout is complex and has many nested tables. ...
...ple table-layout.html example, which looks something like this: <table width="1200"> <!-- main heading row --> <tr id="heading"> <td colspan="6"> <h1 align="center">header</h1> </td> </tr> <!-- nav menu row --> <tr id="nav" bgcolor="#ffffff"> <td width="200"> <a href="#" align="center">home</a> </td> <td width="200"> <a href="#" align="center">our team</a> </td> <td width="200"> <a href="#" align="center">projects</a> </td> <td width="200"> <a href="#" align="center">contact</a> </td> <td width="300"> <form width="300"> <input type="search" name="q" placeholder="search query" width="300"> </for...
...And 2 more matches
HTML: A good basis for accessibility - Learn web development
old days, people used to create page layouts using html tables — using different table cells to contain the header, footer, sidebar, main content column, etc. this is not a good idea because a screen reader will likely give out confusing readouts, especially if the layout is complex and has many nested tables. ...
...adouts, especially if the layout is complex and has many nested tables. ...
...ple table-layout.html example, which looks something like this: <table width="1200"> <!-- main heading row --> <tr id="heading"> <td colspan="6"> <h1 align="center">header</h1> </td> </tr> <!-- nav menu row --> <tr id="nav" bgcolor="#ffffff"> <td width="200"> <a href="#" align="center">home</a> </td> <td width="200"> <a href="#" align="center">our team</a> </td> <td width="200"> <a href="#" align="center">projects</a> </td> <td width="200"> <a href="#" align="center">contact</a> </td> <td width="300"> <form width="300"> <input type="search" name="q" placeholder="search query" width="300"> </for...
...And 2 more matches
Flexbox - Learn web development
and positioning. these are fine and they work, but in some ways they are also rather limiting and frustrating. the following simple layout requirements are either difficult or impossible to achieve with such tools, in any kind of convenient, flexible way: vertically centering a block of content inside its parent. making all the children of a container take up an equal amount of the available width/height, regardless of how much width/height is available. making all columns in a multiple column layout adopt the same height even if they contain a different amount of content. as you'll see in subsequent sections, flexbox makes a lot of layout tasks much easier. let's dig in! introducing a simple example in this article we are going to get you to work through a series of exercises to help...
...irection: column; you'll see that this puts the items back in a column layout, much like they were before we added any css. before you move on, delete this declaration from your example. note: you can also lay out flex items in a reverse direction using the row-reverse and column-reverse values. experiment with these values too! wrapping one issue that arises when you have a fixed amount of width or height in your layout is that eventually your flexbox children will overflow their container, breaking the layout. have a look at our flexbox-wrap0.html example, and try viewing it live (take a local copy of this file now if you want to follow along with this example): here we see that the children are indeed breaking out of their container. one way in which you can fix this is to add the f...
...l amount of the spare space left after things like padding and margin have been set. it is relative to other flex items, meaning that giving each flex item a value of 400000 would have exactly the same effect. now add the following rule below the previous one: article:nth-of-type(3) { flex: 2; } now when you refresh, you'll see that the third <article> takes up twice as much of the available width as the other two — there are now four proportion units available in total (since 1 + 1 + 2 = 4). the first two flex items have one unit each so they take 1/4 of the available space each. the third one has two units, so it takes up 2/4 of the available space (or one-half). you can also specify a minimum size value inside the flex value. try updating your existing article rules like so: article...
...And 2 more matches
Normal Flow - Learn web development
f the things you will have studied in previous modules with regard to normal document flow. how are elements laid out by default? first of all, individual element boxes are laid out by taking the elements' content, then adding any padding, border and margin around them — it's that box model thing again, which we've looked at earlier. by default, a block level element's content is 100% of the width of its parent element, and as tall as its content. inline elements are as tall as their content, and as wide as their content. you can't set width or height on inline elements — they just sit inside the content of block level elements. if you want to control the size of an inline element in this manner, you need to set it to behave like a block level element with display: block; (or even,displa...
...they will be separated by any margin that is set on them. in english therefore, or any other horizontal, top to bottom writing mode, block-level elements are laid out vertically. inline elements behave differently — they don't appear on new lines; instead, they sit on the same line as one another and any adjacent (or wrapped) text content, as long as there is space for them to do so inside the width of the parent block level element. if there isn't space, then the overflowing text or elements will move down to a new line. if two adjacent elements both have the margin set on them and the two margins touch, the larger of the two remains, and the smaller one disappears — this is called margin collapsing, and we have met this before too. let's look at a simple example that explains all of th...
... set on them and the two margins touch, the larger of the two remains, and the smaller one disappears — this is called margin collapsing, and we have met this before too. let's look at a simple example that explains all of this: <h1>basic document flow</h1> <p>i am a basic block level element. ...
...And 2 more matches
Practical positioning examples - Learn web development
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 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 a...
...f the chain throughout this example — this is so that we can insert this feature into a page with other content already on it, without fear of interfering with the styles applied to other parts of the page. ...
...e-type is set to none to get rid of the bullets, and their width is set to 150px so they will comfortably fit across the info-box. the <a> elements are set to display inline-block so they will sit in a line but still be stylable, and they are styled appropriately for tab buttons, using a variety of other properties. add the following css: .info-box li { float: left; list-style-type: none; width: 150px; } .info-box li a { display: inline-block; text-decoration: none; width: 100%; line-height: 3; background-color: red; color: black; text-align: center; } finally for this section we'll set some styles on the link states. first, we'll set the :focus and :hover states of the tabs to look different when they are focused/hovered, providing users with some visual feedback. secon...
...And 2 more matches
UI pseudo-classes - Learn web development
n. 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. ...
...puts work more like replaced elements and therefore don't have one), we will add an empty <span> to hang the generated content on: <div> <label for="fname">first name: </label> <input id="fname" name="fname" type="text" required> <span></span> </div> the immediate problem with this was that the span was dropping onto a new line below the input because the input and label are both set with width: 100%. to fix this we style the parent <div> to become a flex container, but also tell it to wrap its contents onto new lines if the content becomes too long: fieldset > div { margin-bottom: 20px; display: flex; flex-flow: row wrap; } the effect this has is that the label and input sit on separate lines because they are both width: 100%, but the <span> has a width of 0 so can sit on the s...
...you can try it here: it is possible fo...
...And 2 more matches
CSS basics - Learn web development
apart from the selector, each ruleset must be wrapped in curly braces. ({}) within each declaration, you must use a colon (:) to separate the property from its value or values. within each ruleset, you must use a semicolon (;) to separate each declaration from the next one. to modify multiple property values in one ruleset, write them separated by semicolons, like this: p { color: red; width: 500px; border: 1px solid black; } selecting multiple elements you can also select multiple elements and apply a single ruleset to all of them. separate multiple selectors by commas. for example: p, li, h1 { color: red; } different types of selectors there are many different types of selectors. the examples above use element selectors, which select all elements of a given type. but we ca...
...s boxes sitting on top of other boxes. css layout is mostly based on the box model. each box taking up space on your page has properties like: padding, the space around the content. in the example below, it is the space around the paragraph text. border, the solid line that is just outside the padding. margin, the space around the outside of the border. in this section we also use: width (of an element). background-color, the color behind an element's content and padding. color, the color of an element's content (usually text). text-shadow sets a drop shadow on the text inside an element. display sets the display mode of an element. (keep reading to learn more) to continue, let's add more css. keep adding these new rules at the bottom of style.css. experiment with changing ...
...eep reading to learn more) to continue, let's add more css. keep adding these new rules at the bottom of style.css. experiment with changing values to see what happens. changing the page color html { background-color: #00539f; } this rule sets a background color for the entire page. change the color code to the color you chose in what will my website look like?. styling the body body { width: 600px; margin: 0 auto; background-color: #ff9500; padding: 0 20px 20px 20px; border: 5px solid black; } there are several declarations for the <body> element. let's go through these line-by-line: width: 600px; this forces the body to always be 600 pixels wide. margin: 0 auto; when you set two values on a property like margin or padding, the first value affects the element's top and ...
...And 2 more matches
Multimedia: video - Learn web development
literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to learn about the various video formats, their impact on performance, and how to reduce video impact on overall page load time while serving the smallest video file size based on each browsers file type support. why optimize your multimedia? for the average website, 25% of bandwidth comes from video. optimizing video has the potential for very large bandwidth savings that translate into better website performance. optimizing video delivery it's best to compress all video, optimize <source> order, set autoplay, remove audio from muted video, optimize video preload, and consider streaming the video. the sections below describe each of these optimization techniques. compress...
... a feature to reduce file size. if not, there are online tools, such as ffmpeg (discussed in section below), that encode, decode, convert, and perform other optimization functions. optimize <source> order order video source from smallest to largest. for example, given video compressions in three different formats at 10mb, 12mb, and 13mb, declare the smallest first and the largest last: <video width="400" height="300" controls="controls"> <!-- webm: 10 mb --> <source src="video.webm" type="video/webm" /> <!-- mpeg-4/h.264: 12 mb --> <source src="video.mp4" type="video/mp4" /> <!-- ogg/theora: 13 mb --> <source src="video.ogv" type="video/ogv" /> </video> the browser downloads the first format it understands. the goal is to offer smaller versions ahead of larger versions. with th...
...anner_video.webm" type='video/webm; codecs="vp8, vorbis"'> <source src="web_banner.mp4" type="video/mp4"> </video> this hero-video code (above) is common to conference websites and corporate home pages. it includes a video that is auto-playing, looping, and muted. there are no controls, so there is no way to hear audio. the audio is often empty, but still present, and still using bandwidth. there is no reason to serve audio with video that is always muted. removing audio can save 20% of the bandwidth. depending on your choice of software, you might be able to remove audio during export and compression. if not, a free utility called ffmpeg can do it for you. this is the ffmpeg command string to remove audio: ffmpeg -i original.mp4 -an -c:v copy audiofreeversion.mp4 video preloa...
...And 2 more matches
Examples
the error = ' + uneval(e)); } myi...
...the error = ' + uneval(e)); } myimage.onabort = function(e) { loadt...
...the error = ' + uneval(e)); } myimage.onabort = function(e) { loadthisimagepromise.reject('image load was a...
...And 2 more matches
Extras
le="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>x</mi> </mrow> <mrow> <mi title="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>a</mi> </mrow> </mfrac> </mrow> </math> </p> css content math.cue *[title] { color: blue; } mixing with other markups html content <math display="block"> <mrow> <mi>a</mi> <mo>=</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext> <img width="16" height="16" src="https://udn.realityripple.com/samples/3f/9341cbddc0.png" alt="mozilla-16" /> </mtext> </mtd> </mtr> <mtr> <mtd> <mtext><input value="type" size="4"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math> <math display="block"> <msqrt> <mpadded width="30px" height="15px" depth="15px" voffset="-15px"> <mtext> <svg width="30px" height="30px"> <defs> ...
... dur="15s" repeatcount="indefinite"/> <g transform="translate(-15, -15)"> <path fill="url(#radgrad1)" d="m 15 0 l 20 10 l 30 15 l 20 20 l 15 30 l 10 20 l 0 15 l 10 10"/> </g> </g> </g> </svg> </mtext> </mpadded> </msqrt> <mo>=</mo> <msubsup> <mo>∫</mo> <mn>0</mn> <mfrac> <mi>π</mi> <mn>2</mn> </mfrac> </msubsup> <msup> <mi>θ</mi> <mtext> <svg width="15px" height="15px"> <defs> <radialgradient id="radgrad2" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:.9;"/> </radialgradient> </defs> <g> <animatemotion path="m0,0 l3,0 l2,5 l5,5 l0,4 l5,2 z" ...
..."/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:.9;"/> </radialgradient> </defs> <g> <animatemotion path="m0,0 l3,0 l2,5 l5,5 l0,4 l5,2 z" begin="0s" dur="0.5s" repeatcount="indefinite"/> <circle fill="url(#radgrad2)" r="5px" cx="5px" cy="5px"/> </g> </svg> </mtext> </msup> <mrow> <mo>ⅆ</mo> <mi>θ</mi> </mrow> </math> <div style="width: 300px; margin-left: auto; margin-right: auto;"> <svg width="300px" height="250px"> <defs> <lineargradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" style="stop-color:rgb(0,0,255);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(0,255,0);stop-opacity:1"/> </lineargradient> <lineargradient id="grad2" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop...
...And 2 more matches
nsIAppShellService
ice: var appshellservice = components.classes["@mozilla.org/appshell/appshellservice;1"] .getservice(components.interfaces.nsiappshellservice); method overview void closetoplevelwindow(in nsixulwindow awindow); obsolete since gecko 1.8 void createhiddenwindow(in nsiappshell aappshell); native code only! ...
...iew void closetoplevelwindow(in nsixulwindow awindow); obsolete since gecko 1.8 void createhiddenwindow(in nsiappshell aappshell); native code only! ...
...dow( in nsiappshell aappshell ); parameters aappshell a widget "appshell" (event processor) to associate with the new window. createstartupstate() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) creates the initial state of the application by launching tasks specfied by "general.startup.*" prefs. note: size_to_content may be used for width or height. boolean createstartupstate( in long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the initial window(s) opened. awindowheight the height to make the initial window(s) opened. return value true if a window was opened. createtoplevelwindow() this method creates a window, which will be initially invisible. nsixulwindow createtoplevelwi...
...And 2 more matches
nsITaskbarPreviewController
ts should provide their own implementation of this interface. depending on whether the controller is connected to an nsitaskbartabpreview or nsitaskbarwindowpreview, only certain methods and attributes need to be implemented. method overview boolean drawpreview(in nsidomcanvasrenderingcontext2d ctx); boolean drawthumbnail(in nsidomcanvasrenderingcontext2d ctx, in unsigned long width, in unsigned long height); boolean onactivate(); void onclick(in nsitaskbarpreviewbutton button); void onclose(); attributes attribute type description height unsigned long the height in pixels of the preview image. this value may change at any time. see drawpreview() for more information. read only. thumbnailaspectratio ...
...ion height unsigned long the height in pixels of the preview image. this value may change at any time. see drawpreview() for more information. read only. thumbnailaspectratio float the thumbnail's aspect ratio. this doesn't need to match the preview's aspect ratio, and is allowed to be changed at any time. see drawthumbnail() for more information. read only. width unsigned long the width in pixels of the preview image. this value may change at any time. see drawpreview() for more information. read only. note: although these attributes are read only, that indicates that the previews controlled by an nsitaskbarpreviewcontroller cannot alter these values. the controller and its supporting code, however, may change this values at any time. method...
... note: although these attributes are read only, that indicates that the previews controlled by an nsitaskbarpreviewcontroller cannot alter these values. the controller and its supporting code, however, may change this values at any time. methods drawpreview() invoked by nsitaskbarpreview when it needs to render the preview. the specified context is attached to a surface with the controller's width and height, the values of which are obtained immediately prior to calling this method. boolean drawpreview( in nsidomcanvasrenderingcontext2d ctx ); parameters ctx an nsidomcanvasrenderingcontext2d object representing the drawing context into which the preview is to be rendered. note that this context is not actually attached to a canvas element. return value true if you want a frame ...
...And 2 more matches
Attr - Web APIs
Web › API › Attr
the attr interface represents one of a dom element's attributes as an object. in most dom methods, you will directly retrieve the attribute as a string (e.g., element.getattribute()), but certain functions (e.g., element.getattributenode()) or means of iterating return attr types. ...
...return attr types. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 2 more matches
CSSMathValue - Web APIs
representing complex numeric values. interfaces based on cssmathvalue below is a list of interfaces based on the cssmathvalue interface. cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum properties cssmathvalue.operator indicates the operator that the current subtype represents. event handlers no methods none. ...
...st of interfaces based on the cssmathvalue interface. cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum properties cssmathvalue.operator indicates the operator that the current subtype represents. event handlers no methods none. examples we create an element with a width determined using a calc() function, then console.log() the operator. ...
...the cssmathvalue interface. cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum properties cssmathvalue.operator indicates the operator that the current subtype represents. event handlers no methods none. examples we create an element with a width determined using a calc() function, then console.log() the operator. ...
...And 2 more matches
CanvasRenderingContext2D.createPattern() - Web APIs
ill 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. ...
...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. ...
...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. ...
...And 2 more matches
CanvasRenderingContext2D.strokeText() - Web APIs
the canvasrenderingcontext2d method stroketext(), part of the canvas 2d api, strokes — that is, draws the outlines of — the characters of a text string at the specified coordinates. an optional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. use the filltext() method to fill the text characters rather than having just their outlines drawn. syntax canvasrenderingcontext2d.stroketext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context. the text is rendered using the settings ...
...asrenderingcontext2d.stroketext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context. the text is rendered using the settings specified by font, textalign, textbaseline, and direction. x the x-axis coordinate of the point at which to begin drawing the text. y the y-axis coordinate of the point at which to begin drawing the text. maxwidth optional the maximum width the text may be once rendered. if not specified, there is no limit to the width of the text. however, if this value is provided, the user agent will adjust the kerning, select a more horizontally condensed font (if one is available or can be generated without loss of quality), or scale down to a smaller font size in order to fit the text in the specified width. retur...
...r can be generated without loss of quality), or scale down to a smaller font size in order to fit the text in the specified width. return value undefined. examples drawing text outlines this example writes the words "hello world" using the stroketext() method. html first, we need a canvas to draw into. this code creates a context 400 pixels wide and 150 pixels high. <canvas id="canvas" width="400" height="150"></canvas> javascript the javascript code for this example follows. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '50px serif'; ctx.stroketext('hello world', 50, 90); this code obtains a reference to the <canvas>, then gets a reference to its 2d graphics context. with that in hand, we set the font to 50-pixel-tall "seri...
...And 2 more matches
Basic usage of canvas - Web APIs
« previousnext » let's start this tutorial by looking at the <canvas> html element itself. at the end of this page, you will know how to set up a canvas 2d context and have drawn a first example in your browser. the <canvas> element <canvas id="tutorial" width="150" height="150"></canvas> at first sight a <canvas> looks like the <img> element, with the only clear difference being that it doesn't have the src and alt attributes. indeed, the <canvas> element has only two attributes, width and height. these are both optional and can also be set using dom properties. when no width and height attributes are specified, the canvas will initially be 300 pixels wide and 150 pixels high. the element can be sized arbitrarily by css, but during rendering the image is scaled to fit ...
... 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. ...
...t support <canvas> will ignore the container and render the fallback content inside it. browsers that do support <canvas> will ignore the content inside the container, and just render the canvas normally. for example, we could provide a text description of the canvas content or provide a static image of the dynamically rendered content. this can look something like this: <canvas id="stockgraph" width="150" height="150"> current stock price: $3.15 + 0.15 </canvas> <canvas id="clock" width="150" height="150"> <img src="images/clock.png" width="150" height="150" alt=""/> </canvas> telling the user to use a different browser that supports canvas does not help users who can't read the canvas at all, for example. providing a useful fallback text or sub dom helps to make the canvas more acces...
...And 2 more matches
CharacterData - Web APIs
the characterdata abstract interface represents a node object that contains characters. this is an abstract interface, meaning there aren't any object of type characterdata: it is implemented by other interfaces, like text, comment, or processinginstruction which aren't abstract. ...
...h aren't abstract. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 2 more matches
CompositionEvent - Web APIs
the dom compositionevent represents events that occur due to the user indirectly entering text. ...
...ndirectly entering text. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/uievent" target="_top"><rect x="116" y="1" width="75" hei...
...And 2 more matches
DocumentFragment - Web APIs
ent of a document structure comprised of nodes just like a standard document. the key difference is due to the fact that the document fragment isn't part of the active document tree structure. changes made to the fragment don't affect the document (even on reflow) or incur any performance impact when changes are made. ...
...en changes are made. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 2 more matches
DocumentType - Web APIs
the documenttype interface represents a node containing a doctype. ...
...taining a doctype. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
...And 2 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
dy> <div> hello </div> <div> world! </div> </body> we can summarize how the whitespace here is handled as follows (the may be some slight differences in exact behavior between browsers, but this basically works): because we’re inside a block formatting context, everything must be a block, so our 3 text nodes also become blocks, just like the 2 <div>s. ...
...ch, but really they don’t. if there is formatting whitespace between adjacent inline elements, this will result in space in the layout, just like the spaces between words in text. ...
...eople-list li { display: inline-block; width: 2em; height: 2em; background: #f06; border: 1px solid; } <ul class="people-list">⏎ ◦◦<li></li>⏎ ◦◦<li></li>⏎ ◦◦<li></li>⏎ ◦◦<li></li>⏎ ◦◦<li></li>⏎ </ul> this renders as follows: hidden example 3 .people-list { list-style-type: none; margin: 0; padding: 0; } .people-list li { display: inline-block; width: 2em; height: 2em; background: #f06; border: 1px solid; } <ul class="people-list"> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> you probably don't want the gaps in between the blocks — depending on the use case (is this a list of avatars, or horizontal nav buttons?), you probably want the element sides flush with each other, and to be able to control any spacing...
...And 2 more matches
FocusEvent - Web APIs
the focusevent interface represents focus-related events, including focus, blur, focusin, and focusout. ...
..., focusin, and focusout. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/uievent" target="_top"><rect x="116" y="1" width="75" hei...
...And 2 more matches
Image() - Web APIs
the image() constructor creates a new htmlimageelement instance. it is functionally equivalent to document.createelement('img'). disambiguation: image(), the css function notation. syntax var htmlimageelement = new image(width, height); parameters width the width of the image (i.e., the value for the width attribute). height the height of the image (i.e., the value for the height attribute). usage note the entire bitmap is loaded regardless of the sizes specified in the constructor. ...
...if no size is specified in the constructor both pairs of properties have the same values. ...
...if no size is specified in the constructor both pairs of properties have the same values. ...
...And 2 more matches
HTMLImageElement.alt - Web APIs
read the css used. view the css editors: if you change the css below, please be sure to close the details box using the toggle at the top of the css view before saving. otherwise, readers will find it open by default, which is not the intent here. ...
... top of the css view before saving. otherwise, readers will find it open by default, which is not the intent here. ...
...in other wor...
...And 2 more matches
HTMLImageElement.srcset - Web APIs
the htmlimageelement property srcset is a string which identifies one or more image candidate strings, separated using commas (,) each specifying image resources to use under given circumstances. each image candidate string contains an image url and an optional width or pixel density descriptor that indicates the conditions under which that candidate should be used instead of the image specified by the src property. the srcset property, along with the sizes property, are a crucial component in designing responsive web sites, as they can be used together to make pages that use appropriate images for the rendering situation. syntax htmlimageelement.srcset = imagecandidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a comma-separated list of one or more image ...
...ach comma. if the condition descriptor is not provided (in other words, the image candidate provides only a url), the candidate is used as the fallback if none of the other candidates match. otherwise, the condition descriptor may take one of two forms: to indicate that the image resource specified by the image candidate string should be used when the image is being rendered with a particular width in pixels, provide a width descriptor comprised the number giving that width in pixels followed by the lower case letter "w". for example, to provide an image resource to be used when the renderer needs a 450 pixel wide image, use the width descriptor string 450w. the specified width must be a positive, non-zero, integer, and must match the intrinsic width of the referenced image. alternatively,...
...multiple image candidate strings that specify the same descriptor. all of the following are valid image candidate strings: "images/team-photo.jpg 1x, images/team-photo-retina.jpg 2x, images/team-photo-full 2048w" this string provides versions of an image to be used at the standard pixel density (1x) as well as double that pixel density (2x). also available is a version of the image for use at a width of 2048 pixels (2048w). "header640.png 640w, header960.png 960w, header1024.png 1024w, header.png" this string provides versions of a header image to use when the user agent's renderer needs an image of width 640px, 960px, or 1024px. an additional, fallback image candidate is provided without any condition at all, to be used for any other width. "icon32px.png 32w, icon64px.png 64w, icon-retina...
...And 2 more matches
IDBCursorWithValue - Web APIs
synchronously process all the records in the cursor's range. you can have an unlimited number of cursors at the same time. you always get the same idbcursorwithvalue object representing a given cursor. operations are performed on the underlying index or object store. note: this feature is available in web workers. ...
...able in web workers. ...
..."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/idbcursor" target="_top"><rect x="1" y="1" width="90" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="46" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbcursor</text></a><polyline points="91,25 101,20 101,30 91,25" stroke="#d4dde4" fill="none"/><line x1="101" y1="25" x2="131" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/idbcursorwithvalue" target="_top"><rect x="131" y="1...
...And 2 more matches
IDBOpenDBRequest - Web APIs
the idbopendbrequest interface of the indexeddb api provides access to the results of requests to open or delete databases (performed using idbfactory.open and idbfactory.deletedatabase), using specific event handler attributes. note: this feature is available in web workers. ...
...le in web workers. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/idbrequest" target="_top"><rect x="151" y="1" wi...
...And 2 more matches
InputEvent - Web APIs
the inputevent interface represents an event notifying of editable content change. ...
...editable content change. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/uievent" target="_top"><rect x="116" y="1" width="75" hei...
...And 2 more matches
InstallEvent - Web APIs
ler, the installevent interface represents an install action that is dispatched on the serviceworkerglobalscope of a serviceworker. as a child of extendableevent, it ensures that functional events such as fetchevent are not dispatched during installation. this interface inherits from the extendableevent interface. ...
...xtendableevent interface. ...
...tyle="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/extendableevent" target="_top"><rect x="116" y="1" width=...
...And 2 more matches
Intersection Observer API - Web APIs
resholds each 25%. ...
...<div class="label topright"></div> <div class="label bottomleft"></div> <div class="label bottomright"></div> </div> </template> <main> <div class="contents"> <div class="wrapper"> </div> </div> </main> .contents { position: absolute; width: 700px; height: 1725px; } .wrapper { position: relative; top: 600px; } .samplebox { position: relative; left: 175px; width: 150px; background-color: rgb(245, 170, 140); border: 2px solid rgb(201, 126, 17); padding: 4px; margin-bottom: 6px; } #box1 { height: 200px; } #box2 { height: 75px; } #box3 { height: 150px; } #box4 { height: 100px; } .label { font: 14px "open sans", "arial", sans-serif; position: absolute; margin: 0; background-color: rgba(255, 255, 255, 0.7); border: 1px solid rgb...
...nd-color: rgb(245, 170, 140); border: 2px solid rgb(201, 126, 17); padding: 4px; margin-bottom: 6px; } #box1 { height: 200px; } #box2 { height: 75px; } #box3 { height: 150px; } #box4 { height: 100px; } .label { font: 14px "open sans", "arial", sans-serif; position: absolute; margin: 0; background-color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(0, 0, 0, 0.7); width: 3em; height: 18px; padding: 2px; text-align: center; } .topleft { left: 2px; top: 2px; } .topright { right: 2px; top: 2px; } .bottomleft { bottom: 2px; left: 2px; } .bottomright { bottom: 2px; right: 2px; } let observers = []; startup = () => { let wrapper = document.queryselector(".wrapper"); // options for the observers let observeroptions = { root: nul...
...And 2 more matches
MediaStreamConstraints.video - Web APIs
these constraints is required. examples using a boolean value in this example, we provide a simple value of true for the video property. this tells getusermedia() that we require a video track, but we don't care about any specifics beyond that. ...
...ecifics beyond that. ...
... then attaches the resulting stream to a <video> element once the stream is returned. ...
...And 2 more matches
Recording a media element - Web APIs
l download the received data (although it's in a raw, unwrapped form that isn't very useful). </p> <br> let's start by looking at the key bits of the html. there's a little more than this, but it's just informational rather than being part of the core operation of the app. <div class="left"> <div id="startbutton" class="button"> start </div> <h2>preview</h2> <video id="preview" width="160" height="120" autoplay muted></video> </div> we present our main interface in two columns. on the left is a start button and a <video> element which displays the video preview; this is the video the user's camera sees. note that the autoplay attribute is used so that as soon as the stream starts to arrive from the camera, it immediately gets displayed, and the muted attribute is specified ...
...he autoplay attribute is used so that as soon as the stream starts to arrive from the camera, it immediately gets displayed, and the muted attribute is specified to ensure that the sound from the user's microphone isn't output to their speakers, causing an ugly feedback loop. <div class="right"> <div id="stopbutton" class="button"> stop </div> <h2>recording</h2> <video id="recording" width="160" height="120" controls></video> <a id="downloadbutton" class="button"> download </a> </div> on the right we see a stop button and the <video> element which will be used to play back the recorded video. notice that the playback panel doesn't have autoplay set (so the playback doesn't start as soon as media arrives), and it has controls set, which tells it to show the user controls t...
...nd it has controls set, which tells it to show the user controls to play, pause, and so forth. below the playback element is a button for downloading the recorded video. ...
...And 2 more matches
MouseEvent - Web APIs
event derives from uievent, which in turn derives from event. though the mouseevent.initmouseevent() method is kept for backward compatibility, creating of a mouseevent object should be done using the mouseevent() constructor. several more specific events are based on mouseevent, including wheelevent and dragevent. ...
...heelevent and dragevent. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/uievent" target="_top"><rect x="116" y="1" width="75" hei...
...And 2 more matches
OfflineAudioContext - Web APIs
interface is an audiocontext interface representing an audio-processing graph built from linked together audionodes. in contrast with a standard audiocontext, an offlineaudiocontext doesn't render the audio to the device hardware; instead, it generates it, as fast as it can, and outputs the result to an audiobuffer. ...
...to an audiobuffer. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/audiocontext" target="_top"><rect x="151" y="1" ...
...And 2 more matches
PerformanceResourceTiming - Web APIs
events such as redirect start and end times, fetch start, dns lookup start and end times, response start and end times, etc.. additionally, the interface extends performanceentry with other properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch. ...
...ed the fetch. ...
...: 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/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performanceresourcetiming" target="_top"><r...
...And 2 more matches
ResizeObserver - Web APIs
the border box encompasses the content, padding, and border. see the box model for further explanation. resizeobserver avoids infinite callback loops and cyclic dependencies that are often created when resizing via a callback function. ...
...nt targets of a particular observer. resizeobserver.observe() initiates the observing of a specified element. resizeobserver.unobserve() ends the observing of a specified element. examples in the resize-observer-text.html (see source) example, we use the resize observer to change the font-size of a header and paragraph as a slider’s value is changed causing the containing <div> to change width. this shows that you can respond to changes in an element’s size, even if they have nothing to do with the viewport. we also provide a checkbox to turn the observer off and on. if it is turned off, the text will not change in response to the <div>'s width changing. the javascript looks like so: const h1elem = document.queryselector('h1'); const pelem = document.queryselector('p'); const dive...
...s turned off, the text will not change in response to the <div>'s width changing. ...
...And 2 more matches
SVGRect - Web APIs
Web › API › SVGRect
the svgrect represents a rectangle. rectangles consist of an x and y coordinate pair identifying a minimum x value, a minimum y value, and a width and height, which are constrained to be non-negative. an svgrect object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...a rectangle. rectangles consist of an x and y coordinate pair identifying a minimum x value, a minimum y value, and a width and height, which are constrained to be non-negative. an svgrect object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...ception being thrown. ...
...And 2 more matches
ServiceWorkerGlobalScope - Web APIs
e not allowed from within a service worker — only asynchronous requests, like those initiated via the fetch() method, can be used. this interface inherits from the workerglobalscope interface, and its parent eventtarget, and therefore implements properties from windowtimers, windowbase64, and windoweventhandlers. ...
...ndoweventhandlers. ...
...splay: inline-block; position: relative; width: 100%; padding-bottom: 12.142857142857142%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 85" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/workerglobalscope" target="_top"><rect x="151" y...
...And 2 more matches
TextMetrics - Web APIs
it takes into account the current font of the context. ...
...it takes into account the current font of the context. ...
... distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the ideographic baseline of the line box, in css pixels. examples baselines illustrated this example demonstrates the baselines the textmetrics object holds. the default baseline is the alphabeticbaseline. see also the canvasrenderingcontext2d.textbaseline property. ...
...And 2 more matches
TouchEvent - Web APIs
ontact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. touches are represented by the touch object; each touch is described by a position, size and shape, amount of pressure, and target element. lists of touches are represented by touchlist objects. ...
...ed by touchlist objects. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/uievent" target="_top"><rect x="116" y="1" width="75" hei...
...And 2 more matches
Canvas size and WebGL - Web APIs
ct of setting (or not setting) the canvas size to its element size in css pixels, as it appears in the browser window. effect of canvas size on rendering with webgl with scissor() and clear() we can demonstrate how the webgl drawing buffer is affected by the size of the canvas. the size of the first canvas is set to the styled element size, determined by css. this is done by assigning the width and height properties of the canvas to the values of the clientwidth and clientheight properties, respectively. in contrast, no such assignment is done for the second canvas. the internal width and height properties of the canvas remain at default values, which are different than the actual size of the canvas element in the browser window. the effect is clearly visible when using scissor() and ...
...ts position and size in pixels. in the first canvas, we get the desired result. in the second, the square has the wrong shape, size, and position. ...
..." + "your browser or device may not support webgl."; return; ...
...And 2 more matches
WebGL best practices - Web APIs
ble. still, applications must be conscious of vram usage and not just allocate as much as possible. one technique pioneered by the google maps team is the notion of a per-pixel vram budget: 1) for one system (e.g. a particular desktop / laptop), decide the maximum amount of vram your application should use. 2) compute the number of pixels covered by a maximized browser window. e.g. (window.innerwidth * devicepixelratio) * (window.innerheight * window.devicepixelratio) 3) the per-pixel vram budget is (1) divided by (2), and is a constant. this constant should generally be portable among systems. mobile devices typically have smaller screens than powerful desktop machines with large monitors. re-compute this constant on a few target systems to get a reliable estimate. now adjust all internal ...
...as the browser window resizes, and older resources above the limit must be purged. keeping the application's vram usage under this cap will help to avoid out-of-memory errors and associated instability. consider rendering to a smaller backbuffer size a common (and easy) way to trade off quality for speed is rendering into a smaller backbuffer, and upscaling the result. consider reducing canvas.width and height and keeping canvas.style.width and height at a constant size. batch draw calls (prefer fewer-but-larger draw calls) fewer, larger draw operations will generally improve performance. if you have 1000 sprites to paint, try to do it as a single drawarrays() or drawelements() call. it's common to use "degenerate triangles" if you need to draw discontinuous objects as a single drawarrays...
...rprisingly slow, as masking out the alpha channel and/or patching blend functions has fairly high overhead. prefer to use rgba8 and ignore the alpha yourself for better performance. consider compressed texture formats while jpg and png are generally smaller over-the-wire, gpu compressed texture formats are smaller on in gpu memory, and are faster to sample from. (this reduces texture memory bandwidth, which is precious on mobile) however, compressed texture formats have worse quality than jpg, and are generally only acceptable for colors (not e.g. normals or coordinates). unfortunately, there's no single universally supported format. every system has at least one of the following though: webgl_compressed_texture_s3tc (desktop) webgl_compressed_texture_etc1 (android) webgl_compressed_tex...
...And 2 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
ge. must be an integer (no decimals) between 0 and 100 inclusive. must be followed by a percent sign (%). ...
...text is aligned within the space given by the size cue setting if it is set. ...
... height of the text area. value is a percentage. must be an integer (i.e., no decimals) between 0 and 100 inclusive. must be followed by a percent sign (%). table 4 - size examples vertical omitted vertical:rl vertical:lr size:100% full width full height full height size:50% half width half height half height align specifies the alignment of the text. text is aligned within the space given by the size cue setting if it is set. table 5 - align values vertical omitted vertical:rl vertical:lr align:start left top top align:middle centred hori...
...And 2 more matches
XMLHttpRequest - Web APIs
xmlhttprequest (xhr) objects are used to interact with servers. you can retrieve data from a url without having to do a full page refresh. this enables a web page to update just part of a page without disrupting what the user is doing. xmlhttprequest is used heavily in ajax programming. ...
...ajax programming. ...
...play: inline-block; position: relative; width: 100%; padding-bottom: 23.076923076923077%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 650 150" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/xmlhttprequesteventtarget" target="_top"><rect x...
...And 2 more matches
-moz-image-rect - CSS: Cascading Style Sheets
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. ...
...his: #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: -moz-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 0%, 50%, 50%, 0%); width:133px; height:136px; position:absolute; } this is the top-left corner of the image. it defines a rectangle containing the top-left quarter of the image in the file firefox.jpg. ...
...ect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 0%, 50%, 50%, 0%); width:133px; height:136px; position:absolute; } this is the top-left corner of the image. it defines a rectangle containing the top-left quarter of the image in the file firefox.jpg. #box2 { background-image: -moz-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 0%, 100%, 50%, 50%); width:133px; height:136px; position:absolute; } this defines the top-right corner of the image. ...
...And 2 more matches
Resizing background images with background-size - CSS: Cascading Style Sheets
the background-size css property lets you resize the background image of an element, overriding the default behavior of tiling the image at its full size by specifying the width and/or height of the image. by doing so, you can scale the image upward or downward as desired. tiling a large image let's consider a large image, a 2982x2808 firefox logo image. we want (for some reason likely involving horrifyingly bad site design) to tile four copies of this image into a 300x300-pixel element. to do this, we can use a fixed background-size value of 150 pixels. ...
...nt (for some reason likely involving horrifyingly bad site design) to tile four copies of this image into a 300x300-pixel element. to do this, we can use a fixed background-size value of 150 pixels. html <div class="tiledbackground"> </div> css .tiledbackground { background-image: url(https://www.mozilla.org/media/img/logos/firefox/logo-quantum.9c5e96634f92.png); background-size: 150px; width: 300px; height: 300px; border: 2px solid; color: pink; } result stretching an image you can also specify both the horizontal and vertical sizes of the image, like this: background-size: 300px 150px; the result looks like this: scaling an image up on the other end of the spectrum, you can scale an image up in the background. here we scale a 32x32 pixel favicon to 300x300 pixels:...
...ching an image you can also specify both the horizontal and vertical sizes of the image, like this: background-size: 300px 150px; the result looks like this: scaling an image up on the other end of the spectrum, you can scale an image up in the background. here we scale a 32x32 pixel favicon to 300x300 pixels: .square2 { background-image: url(favicon.png); background-size: 300px; width: 300px; height: 300px; border: 2px solid; text-shadow: white 0px 0px 2px; font-size: 16px; } as you can see, the css is actually essentially identical, save the name of the image file. special values: "contain" and "cover" besides <length> values, the background-size css property offers two special size values, contain and cover. let's take a look at these. contain the contain value...
...And 2 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
x-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 100px); grid-template-rows: repeat(3, 100px); height: 500px; width: 500px; grid-gap: 10px; grid-template-areas: "a a b" "a a b" "c d d"; } .item1 { grid-area: a; } .item2 { grid-area: b; } .item3 { grid-area: c; } .item4 { grid-area: d; } <div class="wrapper"> <div class="item1">item 1</div> <div class="item2">item 2</div> <div class="item3">item 3</div> <div class="item4">item 4</div> </div> if i add align-content to my con...
...x-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 100px); grid-template-rows: repeat(3, 100px); height: 500px; width: 500px; grid-gap: 10px; grid-template-areas: "a a b" "a a b" "c d d"; align-content: end; } .item1 { grid-area: a; } .item2 { grid-area: b; } .item3 { grid-area: c; } .item4 { grid-area: d; } <div class="wrapper"> <div class="item1">item 1</div> <div class="item2">item 2</div> <div class="item3">item 3</div> <div class="item4">item 4</div> </div> we can al...
...x-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 100px); grid-template-rows: repeat(3, 100px); height: 500px; width: 500px; grid-gap: 10px; grid-template-areas: "a a b" "a a b" "c d d"; align-content: space-between; } .item1 { grid-area: a; } .item2 { grid-area: b; } .item3 { grid-area: c; } .item4 { grid-area: d; } <div class="wrapper"> <div class="item1">item 1</div> <div class="item2">item 2</div> <div class="item3">item 3</div> <div class="item4">item 4</div> </div> ...
...And 2 more matches
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
the logical properties and values specification introduces flow-relative mappings for many of the properties and values in css. this article introduces the specification, and explains flow relative properties and values. why do we need logical properties? css traditionally has sized things according to the physical dimensions of the screen. therefore we describe boxes as having a width and height, position items from the top and left, float things left, assign borders, margin, and padding to the top, right, bottom, left, etc. the logical properties and values specification defines mappings for these physical values to their logical, or flow relative, counterparts — e.g. start and end as opposed to left and right/top and bottom. an example of why these mappings might be needed is as follow...
...gn borders, margin, and padding to the top, right, bottom, left, etc. the logical properties and values specification defines mappings for these physical values to their logical, or flow relative, counterparts — e.g. start and end as opposed to left and right/top and bottom. an example of why these mappings might be needed is as follows. i have a layout using css grid, the grid container has a width applied and i am using the align-self and justify-self properties to align the items. these properties are flow relative — justify-self: start aligns the item to the start on the inline dimension, align-self: start does the same on the block dimension. if i now change the writing mode of this component to vertical-rl using the writing-mode property, the alignment continues to work in the sam...
... start aligns the item to the start on the inline dimension, align-self: start does the same on the block dimension. if i now change the writing mode of this component to vertical-rl using the writing-mode property, the alignment continues to work in the same way. the inline dimension is now running vertically and the block dimension horizontally. the grid doesn't look the same however, as the width assigned to the container is a horizontal measure, a measure tied to the physical and not the logical or flow relative running of the text. if instead of the width property we use the logical property inline-size, the component now works the same way no matter which writing mode it is displayed using. you can try this out in the live example below. change writing-mode from vertical-rl to ho...
...And 2 more matches
Animatable CSS properties - CSS: Cascading Style Sheets
ttomright -moz-outline-radius-topleft -moz-outline-radius-topright -webkit-line-clamp -webkit-text-fill-color -webkit-text-stroke -webkit-text-stroke-color all backdrop-filter background background-color background-position background-size block-size border border-block-end border-block-end-color border-block-end-width border-block-start border-block-start-color border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-width border-color border-end-end-radius border-end-start-radius border-image-outset border-image-slice border-image-width border-inline-end border-i...
...ock-start-color border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-width border-color border-end-end-radius border-end-start-radius border-image-outset border-image-slice border-image-width border-inline-end border-inline-end-color border-inline-end-width border-inline-start border-inline-start-color border-inline-start-width border-left border-left-color border-left-width border-radius border-right border-right-color border-right-width border-start-end-radius border-start-start-radius border-top border-top-color border-top-left-radius border-top-right-radius bord...
...order-inline-start border-inline-start-color border-inline-start-width border-left border-left-color border-left-width border-radius border-right border-right-color border-right-width border-start-end-radius border-start-start-radius border-top border-top-color border-top-left-radius border-top-right-radius border-top-width border-width bottom box-shadow caret-color clip clip-path color column-count column-gap column-rule column-rule-color column-rule-width column-width columns filter flex flex-basis flex-grow flex-shrink font font-size font-size-adjust font-stretch font-variation-settings fon...
...And 2 more matches
border-style - CSS: Cascading Style Sheets
pecified, the styles apply to the top, right, bottom, and left in that order (clockwise). each value is a keyword chosen from the list below. values <line-style> describes the style of the border. it can have the following values: none like the hidden keyword, displays no border. ...
...in the case of table cell and border collapsing, the hidden value has the highest priority: if any other conflicting border is set, it won't be displayed. dotted displays a series of rounded dots. ...
...e. in the case of table cell and border collapsing, the hidden value has the highest priority: if any other conflicting border is set, it won't be displayed. dotted displays a series of rounded dots. the spacing of the dots is not defined by the specification and is implementation-specific. the radius of the dots is half the computed value of the same side's border-width. dashed displays a series of short square-ended dashes or line segments. the exact size and length of the segments are not defined by the specification and are implementation-specific. solid displays a single, straight, solid line. double displays two straight lines that add up to the pixel size define...
...And 2 more matches
<image> - CSS: Cascading Style Sheets
Web › CSS › image
tural size), like a jpeg, png, or other raster format. images with multiple intrinsic dimensions, existing in multiple versions inside a single file, like some .ico formats. ...
... similar to the containing box.) images with no intrinsic dimensions but with an intrinsic aspect ratio between its width and height, like an svg or other vector format. images with neither intrinsic dimensions, nor an intrinsic aspect ratio, like a css gradient. ...
...utside ? mask-border-source ? symbols for @counter-style at risk feature. ...
...And 2 more matches
margin-left - CSS: Cascading Style Sheets
rom its neighbors, while a negative value places it closer. 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 vertical margins of two adjacent boxes may fuse. this is called margin collapsing. in the rare cases where width is overconstrained (i.e., when all of width, margin-left, border, padding, the content area, and margin-right are defined), margin-left is ignored, and will have the same calculated value as if the auto value was specified. syntax /* <length> values */ margin-left: 10px; /* an absolute length */ margin-left: 1em; /* relative to the text size */ margin-left: 5%; /* relative to the nearest ...
...its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. ...
... /* keyword values */ margin-left: auto; /* global values */ margin-left: inherit; margin-left: initial; margin-left: unset; the margin-left property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the left margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. if the values of margin-left and margin-right are both auto, the calculated space is evenly distributed. this table summarizes the different cases: value of display value of float value of position computed value of auto ...
...And 2 more matches
mask-size - CSS: Cascading Style Sheets
Web › CSS › mask-size
the mask-size css property specifies the sizes of the mask images. the size of the image can be fully or partially constrained in order to preserve its intrinsic ratio. ...
...e css property specifies the sizes of the mask images. the size of the image can be fully or partially constrained in order to preserve its intrinsic ratio. ...
...e: if the value of this property is not set in a mask shorthand property that is applied to the element after the mask-size css property, the value of this property is then reset to its initial value by the shorthand property. syntax one or more <bg-size> values, separated by commas. a <bg-size> can be specified in one of three ways: using the keyword contain using the keyword cover using width and height values to specify a size using width and height, you can supply one or two values: if only one value is given it sets the width, with the height set to auto. if two values are given, the first sets width and the second sets height. each value can be a <length>, a <percentage>, or auto. values <length> a <length> value scales the mask image to the specified length in the co...
...And 2 more matches
min() - CSS: Cascading Style Sheets
Web › CSS › min
y value. the min() function can be used anywhere a <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> is allowed. 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 the first above example, the width will be at most 200px, but will be smaller if the viewport is less than 400px wide (in which case 1vw would be 4px, so 50vw would be 200px). in other words, the maximum width is 200px. think of the min() value as providing the maximum value a property can have. syntax the min() function takes one or more comma-separated expressions as its parameter, with the smallest (most negative) expression ...
...d as the value. the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>). you can use different units for each value in your expression, if you wish. you may also use parentheses to establish computation order when needed. notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified. it is permitted to nest max() and other min() functions as expression values. the expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc(...
... that the font can still be scaled at least 200% for readability (without assistive technology like a zoom function). ...
...And 2 more matches
transform-origin - CSS: Cascading Style Sheets
, or calc formal syntax [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> = <length> | <percentage> examples code sample transform: none; <div class="box1">&nbsp;</div> .box1 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform: none; -webkit-transform: none; } transform: rotate(30deg); <div class="box2">&nbsp;</div> .box2 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform: rotate(30deg); -webkit-transform: rotate(30deg); } ...
...nsform: rotate(30deg); <div class="box2">&nbsp;</div> .box2 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform: rotate(30deg); -webkit-transform: rotate(30deg); } transform: rotate(30deg); transform-origin: 0 0; <div class="box3">&nbsp;</div> .box3 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform-origin: 0 0; -webkit-transform-origin: 0 0; transform: rotate(30deg); -webkit-transform: rotate(30deg); } transform: rotate(30deg); transform-origin: 100% 100%; <div class="box4">&nbsp;</div> .box4 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; bac...
... .box4 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform-origin: 100% 100%; -webkit-transform-origin: 100% 100%; transform: rotate(30deg); -webkit-transform: rotate(30deg); } transform: rotate(30deg); transform-origin: -1em -3em; <div class="box5">&nbsp;</div> .box5 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen; transform-origin: -1em -3em; -webkit-transform-origin: -1em -3em; transform: rotate(30deg); -webkit-transform: rotate(30deg); } transform: scale(1.7); <div class="box6">&nbsp;</div> .box6 { margin: 0.5em; width: 3em; height: 3em; border: solid 1px; background-color: palegreen;...
...And 2 more matches
Creating a cross-browser video player - Developer guides
<source src="video/tears-of-steel-battle-clip-medium.mp4" type="video/mp4"> <source src="video/tears-of-steel-battle-clip-medium.webm" type="video/webm"> <source src="video/tears-of-steel-battle-clip-medium.ogg" type="video/ogg"> <!-- flash fallback --> <object type="application/x-shockwave-flash" data="flash-player.swf?videourl=video/tears-of-steel-battle-clip-medium.mp4" width="1024" height="576"> <param name="movie" value="flash-player.swf?videourl=video/tears-of-steel-battle-clip-medium.mp4" /> <param name="allowfullscreen" value="true" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="controlbar=over&amp;image=img/poster.jpg&amp;file=flash-player.swf?videourl=video/tears-of-steel-battle-clip-medium.mp4" ...
...wf?videourl=video/tears-of-steel-battle-clip-medium.mp4" /> <param name="allowfullscreen" value="true" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="controlbar=over&amp;image=img/poster.jpg&amp;file=flash-player.swf?videourl=video/tears-of-steel-battle-clip-medium.mp4" /> <img alt="tears of steel poster image" src="img/poster.jpg" width="1024" height="428" title="no video playback possible, please download the video from the link below" /> </object> <!-- offer download --> <a href="video/tears-of-steel-battle-clip-medium.mp4">download mp4</a> </video> <figcaption>&copy; blender foundation | <a href="http://mango.blender.org">mango.blender.org</a></figcaption> </figure> even though this player will define...
...that below. another event, timeupdate, is raised periodically as the video is being played through. this event is ideal for updating the progress bar's value, setting it to the value of the video's currenttime attribute, which indicates how far through the video the current playback is. video.addeventlistener('timeupdate', function() { progress.value = video.currenttime; progressbar.style.width = math.floor((video.currenttime / video.duration) * 100) + '%'; }); as the timeupdate event is raised, the progress element's value attribute is set to the video's currenttime. the <span> element mentioned earlier, for browsers that do not support the <progress> element (e.g. internet explorer 9), is also updated at this time, setting its width to be a percentage of the total time played. this ...
...And 2 more matches
Audio and Video Delivery - Developer guides
- fallback for browsers that don't support audio tag --> <a href="audiofile.mp3">download audio</a> </audio> the code above will create an audio player that attempts to preload as much audio as possible for smooth playback. note: the preload attribute may be ignored by some mobile browsers. ...
...ent and creating a cross-browser video player. audio and video fallback you can create a more comprehensive fallback using flash. using flashmediaelement.swf is one way. <audio controls> <source src="audiofile.mp3" type="audio/mpeg"> <source src="audiofile.ogg" type="audio/ogg"> <!-- fallback for non supporting browsers goes here --> <a href="audiofile.mp3">download audio</a> <object width="320" height="30" type="application/x-shockwave-flash" data="flashmediaelement.swf"> <param name="movie" value="flashmediaelement.swf" /> <param name="flashvars" value="controls=true&isvideo=false&file=audiofile.mp3" /> </object> </audio> the process is very similar with video — just remember to set isvideo=true in the flashvars value parameters. more options for fallbacks. javas...
...te audio on the fly: <audio id="player" src="data:audio/x-wav;base64,uklgrvc..."></audio> speak.js employs this technique. try the demo. javascript video var myvideo = document.createelement('video'); if (myvideo.canplaytype('video/mp4')) { myvideo.setattribute('src','videofile.mp4'); } else if (myvideo.canplaytype('video/webm')) { myvideo.setattribute('src','videofile.webm'); } myvideo.width = 480; myvideo.height = 320; we set the source of the video depending on the type of video file the browser supports we then set the width and height of the video. web audio api var context; var request; var source; try { context = new audiocontext(); request = new xmlhttprequest(); request.open("get","http://jplayer.org/audio/mp3/riomez-01-sleep_together.mp3",true); r...
...And 2 more matches
Block formatting context - Developer guides
ements with contain: layout, content, or paint. flex items (direct children of the element with display: flex or inline-flex) if they are neither flex nor grid nor table containers themselves. grid items (direct children of the element with display: grid or inline-grid) if they are neither flex nor grid nor table containers themselves. multicol containers (elements where column-count or column-width isn't auto, including elements with column-count: 1). column-span: all should always create a new formatting context, even when the column-span: all element isn't contained by a multicol container (spec change, chrome bug). formatting contexts affect layout, but typically, we create a new block formatting context for the positioning and clearing floats rather than changing the layout, because ...
...oot"> <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 { float: left; width: 200px; height: 100px; background-color: rgba(255, 255, 255, .5); border:1px solid black; padding: 10px; } exclude external floats in the following example, we are using display:flow-root and floats to implement double 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 co...
... note that flexbox is a more efficient way to implement muti columns layout in morden css. margin collapsing creating a new bfc to avoid the m...
...And 2 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
e feature of <link> elements is their ability to accept media attributes. ...
...cept media types or full-blown media queries, allowing you to do responsive preloading! ...
... charset="utf-8"> <title>responsive preload example</title> <link rel="preload" href="bg-image-narrow.png" as="image" media="(max-width: 600px)"> <link rel="preload" href="bg-image-wide.png" as="image" media="(min-width: 601px)"> <link rel="stylesheet" href="main.css"> </head> <body> <header> <h1>my site</h1> </header> <script> var mediaquerylist = window.matchmedia("(max-width: 600px)"); var header = document.queryselector('header'); if (mediaquerylist.matches) { header.style.backgroundimage = 'url(bg-image-narrow.png)'; } else { header.style.backgroundimage = 'url(bg-image-wide.png)'; } </script> </body> we include media attributes on our <link> elements so that a narrow image is preloaded if the user has a narrow viewport, and a wider ...
...And 2 more matches
super - JavaScript
r keyword appears alone and must be used before the this keyword is used. the super keyword can also be used to call functions on a parent object. examples using super in classes this code snippet is taken from the classes sample (live demo). here super() is called to avoid duplicating the constructor parts' that are common between rectangle and square. ...
... the super keyword can also be used to call functions on a parent object. examples using super in classes this code snippet is taken from the classes sample (live demo). here super() is called to avoid duplicating the constructor parts' that are common between rectangle and square. ...
...er keyword can also be used to call functions on a parent object. examples using super in classes this code snippet is taken from the classes sample (live demo). here super() is called to avoid duplicating the constructor parts' that are common between rectangle and square. ...
...And 2 more matches
maskUnits - SVG: Scalable Vector Graphics
the maskunits attribute indicates which coordinate system to use for the geometry properties of the <mask> element. ...
... the maskunits attribute indicates which coordinate system to use for the geometry properties of the <mask> element. ...
... html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <mask id="mymask1" maskunits="userspaceonuse" x="20%" y="20%" width="60%" height="60%"> <rect fill="black" x="0" y="0" width="100%" height="100%" /> <circle fill="white" cx="50" cy="50" r="35" /> </mask> <mask id="mymask2" maskunits="objectboundingbox" x="20%" y="20%" width="60%" height="60%"> <rect fill="black" x="0" y="0" width="100%" height="100%" /> <circle fill="white" cx="50" cy="50" r="35" /> </mask> <!-- some reference rect to materialized the mask --> <rect id="r1" x="0" y="0" width="45" height="45" /> <rect id="r2" x="0" y="55" width="45" height="45" /> <rect id="r3" x="55" y="55" width="45" height="45" /> <rect id="r4" x="55" y="...
...And 2 more matches
stitchTiles - SVG: Scalable Vector Graphics
the stitchtiles attribute defines how the perlin noise tiles behave at the border. ...
...ribute defines how the perlin noise tiles behave at the border. ...
...html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" stitchtiles="nostitch" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" stitchtiles="stitch" /> </filter> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); transform: translate(100px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); transform: translate(0, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); transform: translate(100px, 100px);" /> <rect x="0...
...And 2 more matches
viewBox - SVG: Scalable Vector Graphics
Web › SVG › Attribute › viewBox
the viewbox attribute defines the position and dimension, in user space, of an svg viewport. the value of the viewbox attribute is a list of four numbers: min-x, min-y, width and height. the numbers separated by whitespace and/or a comma, which specify a rectangle in user space which is mapped to the bounds of the viewport established for the associated svg element (not the browser viewport). ...
... is mapped to the bounds of the viewport established for the associated svg element (not the browser viewport). ...
...viewbox the circle looks small as it is using user units for the r attribute: 4 resolved against 100 as set in the viewbox --> <circle cx="50%" cy="50%" r="4" fill="white"/> </svg> <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <!-- with relative unit such as percentage, the visual size of the square looks unchanged regardless of the viewbox` --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with a small viewbox the circle looks large as it is using user units for the r attribute: 4 resolved against 10 as set in the viewbox --> <circle cx="50%" cy="50%" r="4" fill="white"/> </svg> <svg viewbox="-5 -5 10 10" xmlns="http://www.w3.org/2000/svg"> <!-- the point of coordinate 0,0 is now in the center of the viewport, and 100% is still resolv...
...And 2 more matches
x - SVG: Scalable Vector Graphics
Web › SVG › Attribute › x
for <altglyph>, x defines the x-axis coordinate of the alternate glyph. value list of <length> default value none animatable yes feblend for <febl...
... for <altglyph>, x defines the x-axis coordinate of the alternate glyph. value list of <length> default value none animatable yes feblend for <feblend>, x defines the minimum x coordinate for the ...
... for <altglyph>, x defines the x-axis coordinate of the alternate glyph. value list of <length> default value none animatable yes feblend for <feblend>, x defines the minimum x coordinate for the rendering area of the primitive. value ...
...And 2 more matches
y - SVG: Scalable Vector Graphics
Web › SVG › Attribute › y
for <altglyph>, y defines the y-axis coordinate of the alternate glyph. value list of <length> default value none animatable yes feblend for <febl...
... for <altglyph>, y defines the y-axis coordinate of the alternate glyph. value list of <length> default value none animatable yes feblend for <feblend>, y defines the minimum y coordinate for the ...
... for <altglyph>, y defines the y-axis coordinate of the alternate glyph. value list of <length> default value none animatable yes feblend for <feblend>, y defines the minimum y coordinate for the rendering area of the primitive. value ...
...And 2 more matches
<feComponentTransfer> - SVG: Scalable Vector Graphics
" x2="100%" y2="0"> <stop offset="0" stop-color="#ff0000"></stop> <stop offset="0.2" stop-color="#ffff00"></stop> <stop offset="0.4" stop-color="#00ff00"></stop> <stop offset="0.6" stop-color="#00ffff"></stop> <stop offset="0.8" stop-color="#0000ff"></stop> <stop offset="1" stop-color="#800080"></stop> </lineargradient> <filter id="identity" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="identity"></fefuncr> <fefuncg type="identity"></fefuncg> <fefuncb type="identity"></fefuncb> <fefunca type="identity"></fefunca> </fecomponenttransfer> </filter> <filter id="table" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalu...
... </fecomponenttransfer> </filter> <filter id="table" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="0 0 1 1"></fefuncr> <fefuncg type="table" tablevalues="1 1 0 0"></fefuncg> <fefuncb type="table" tablevalues="0 1 1 0"></fefuncb> </fecomponenttransfer> </filter> <filter id="discrete" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="discrete" tablevalues="0 0 1 1"></fefuncr> <fefuncg type="discrete" tablevalues="1 1 0 0"></fefuncg> <fefuncb type="discrete" tablevalues="0 1 1 0"></fefuncb> </fecomponenttransfer> </filter> <filter id="linear" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr...
...nsfer> </filter> <filter id="linear" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" slope="0.5" intercept="0"></fefuncr> <fefuncg type="linear" slope="0.5" intercept="0.25"></fefuncg> <fefuncb type="linear" slope="0.5" intercept="0.5"></fefuncb> </fecomponenttransfer> </filter> <filter id="gamma" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" amplitude="4" exponent="7" offset="0"></fefuncr> <fefuncg type="gamma" amplitude="4" exponent="4" offset="0"></fefuncg> <fefuncb type="gamma" amplitude="4" exponent="1" offset="0"></fefuncb> </fecomponenttransfer> </filter> </defs> <g font-weight="bold"> <text x="0" y="20">default</te...
...And 2 more matches
<foreignObject> - SVG: Scalable Vector Graphics
t of a browser, it is most likely (x)html. html,body,svg { height:100% } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <style> div { color: white; font: 18px serif; height: 100%; overflow: auto; } </style> <polygon points="5,5 195,10 185,185 10,195" /> <!-- common use case: embed html text into svg --> <foreignobject x="20" y="20" width="160" height="160"> <!-- in the context of svg embedded in an html document, the xhtml namespace could be omitted, but it is mandatory in the context of an svg document --> <div xmlns="http://www.w3.org/1999/xhtml"> lorem ipsum dolor sit amet, consectetur adipiscing elit. sed mollis mollis mi ut ultricies. nullam magna ipsum, porta vel dui convallis...
...w.w3.org/1999/xhtml"> lorem ipsum dolor sit amet, consectetur adipiscing elit. sed mollis mollis mi ut ultricies. nullam magna ipsum, porta vel dui convallis, rutrum imperdiet eros. aliquam erat volutpat. </div> </foreignobject> </svg> attributes height the height of the foreignobject. ...
...99/xhtml"> lorem ipsum dolor sit amet, consectetur adipiscing elit. sed mollis mollis mi ut ultricies. nullam magna ipsum, porta vel dui convallis, rutrum imperdiet eros. aliquam erat volutpat. </div> </foreignobject> </svg> attributes height the height of the foreignobject. ...
...And 2 more matches
<metadata> - SVG: Scalable Vector Graphics
Web › SVG › Element › metadata
mation about data. the contents of <metadata> should be elements from other xml namespaces such as rdf, foaf, etc. usage context categoriesdescriptive elementpermitted contentany elements or character data attributes global attributes core attributes global event attributes specific attributes none dom interface this element implements the svgmetadataelement interface. ...
...e svg --> <defs> <!-- hubplug symbol. ...
...bol. ...
...And 2 more matches
<use> - SVG: Scalable Vector Graphics
Web › SVG › Element › use
tes them somewhere else. html,body,svg { height:100% } <svg viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <circle id="mycircle" cx="5" cy="5" r="4" stroke="blue"/> <use href="#mycircle" x="10" fill="blue"/> <use href="#mycircle" x="20" fill="white" stroke="red"/> <!-- stroke="red" will be ignored here, as stroke was already set on mycircle. most attributes (except for x, y, width, height and (xlink:)href) do not override those set in the ancestor. that's why the circles have different x positions, but the same stroke value. --> </svg> the effect is the same as if the nodes were deeply cloned into a non-exposed dom, then pasted where the use element is, much like cloned template elements in html5. most attributes on use do not override those already on the element...
...roke value. --> </svg> the effect is the same as if the nodes were deeply cloned into a non-exposed dom, then pasted where the use element is, much like cloned template elements in html5. most attributes on use do not override those already on the element referenced by use. (this differs from how css style attributes override those set 'earlier' in the cascade). only the attributes x, y, width, height and href on the use element will override those set on the referenced element. however, any other attributes not set on the referenced element will be applied to the use element. since the cloned nodes are not exposed, care must be taken when using css to style a use element and its cloned descendants. css properties are not guaranteed to be inherited by the cloned dom unless you expli...
...ype: <url> ; default value: none; animatable: yes xlink:href an <iri> reference to an element/fragment that needs to be duplicated. value type: <iri> ; default value: none; animatable: yes x the x coordinate of the use element. value type: <coordinate> ; default value: 0; animatable: yes y the y coordinate of the use element. value type: <coordinate> ; default value: 0; animatable: yes width the width of the use element. value type: <length> ; default value: 0; animatable: yes height the height of the use element. value type: <length> ; default value: 0; animatable: yes note: width, and height have no effect on use elements, unless the element referenced has a viewbox - i.e. they only have an effect when use refers to a svg or symbol element. note: starting with svg2, x, ...
...And 2 more matches
Clipping and masking - SVG: Scalable Vector Graphics
ble, it's an all-or-nothing approach. masking on the other hand allows soft edges by taking transparency and grey values of the mask into account. creating clips we create the above mentioned semicircle based on a circle element: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <clippath id="cut-off-bottom"> <rect x="0" y="0" width="200" height="100" /> </clippath> </defs> <circle cx="100" cy="100" r="100" clip-path="url(#cut-off-bottom)" /> </svg> centered at (100,100) a circle with radius 100 is painted. the attribute clip-path references a <clippath> element with a single rect element. this rectangular on its own would paint the upper half of the canvas black. note, that the clippath element is usually placed ...
...d transformation. then every part of the target lying in a transparent area of the resulting clippath's content will not be rendered. color, opacity and such have no effect as long as they don't let parts vanish completely. masking the effect of masking is most impressively presented with a gradient. if you want an element to fade out, you can achieve this effect quite quickly with masks. ...
...element to fade out, you can achieve this effect quite quickly with masks. <svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <lineargradient id="gradient"> <stop offset="0" stop-color="black" /> <stop offset="1" stop-color="white" /> </lineargradient> <mask id="mask"> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" /> </mask> </defs> <rect x="0" y="0" width="200" height="200" fill="green" /> <rect x="0" y="0" width="200" height="200" fill="red" mask="url(#mask)" /> </svg> you see a green-filled rect at the lowest layer and on top a red-filled rect. the latter has the mask attribute pointing to the mask element. the content of the mask is a single rect e...
...And 2 more matches
Sidebar - Archive of obsolete content
indow; if (sidebarwindow.location.href == "chrome://browser/content/web-panels.xul") { // act on the sidebar content only if it is the web panels } accessing the browser.xul window from a sidebar script see accessing the elements of the top-level document from a child window section of working with windows in chrome code. ...
...t/web-panels.xul") { // act on the sidebar content only if it is the web panels } accessing the browser.xul window from a sidebar script see accessing the elements of the top-level document from a child window section of working with windows in chrome code. ...
...els.xul") { // act on the sidebar content only if it is the web panels } accessing the browser.xul window from a sidebar script see accessing the elements of the top-level document from a child window section of working with windows in chrome code. ...
...arwidth(newwidth) { var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.getelementbyid("sidebar-box").width=newwidth; } or function setsidebarwidth(newwidth) { window.top.document.getelementbyid("sidebar-box").width=newwidth; } you can also disable the ability to resize it manually, using the mouse, by hiding the sidebar's splitter element. for this snippet to work, you have to declare mainwindow as in the previous code block then write: mainwindow.document.getelementbyid("sidebar-splitter").hi...
JavaScript Daemons Management - Archive of obsolete content
"orecompose.reversals = 2;alert('changed');">two reversals</button> <button onclick="orecompose.makeloop();alert('changed');">makeloop</button> <button onclick="orecompose.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="orecompose.close();">close</button> <button onclick="orecompose.reclose();">reclose</button><br /> frame rate: <input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){orecompose.setrate(this.value);}" /></p> </body> </html> example #2: a practical instantiation – daemon.buildaround() <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>daemon.buildaro...
...button onclick="ounhide.reversals = 2;alert('changed');">two reversals</button> <button onclick="ounhide.makeloop();alert('changed');">makeloop</button> <button onclick="ounhide.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="ounhide.close();">close</button> <button onclick="ounhide.reclose();">reclose</button><br /> frame rate: <input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){ounhide.setrate(this.value);}" /></p> </body> </html> example #3: a safe (without setinterval) instantiation – new daemon.safe() <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>new ...
..."orecompose.reversals = 2;alert('changed');">two reversals</button> <button onclick="orecompose.makeloop();alert('changed');">makeloop</button> <button onclick="orecompose.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="orecompose.close();">close</button> <button onclick="orecompose.reclose();">reclose</button><br /> frame rate: <input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){orecompose.setrate(this.value);}" /></p> </body> </html> example #4: a practical and safe (without setinterval) instantiation – daemon.safe.buildaround() <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; char...
...button onclick="ounhide.reversals = 2;alert('changed');">two reversals</button> <button onclick="ounhide.makeloop();alert('changed');">makeloop</button> <button onclick="ounhide.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="ounhide.close();">close</button> <button onclick="ounhide.reclose();">reclose</button><br /> frame rate: <input type="text" id="vello" value="33" style="width: 40px;" onkeypress="return event.charcode===0||/\d/.test(string.fromcharcode(event.charcode));" onkeyup="if(isfinite(this.value)&&number(this.value)>0){ounhide.setrate(this.value);}" /></p> </body> </html> ...
Drag and Drop Example - Archive of obsolete content
f 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. ...
... 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. it will...
...t drags from the palette. ...
...nal code is shown below: <window title="widget dragger" id="test-window" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <script src="chrome://global/content/nsdraganddrop.js"/> <script src="chrome://global/content/nstransferable.js"/> <script src="dragboard.js"/> <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> <vbox> <button label="button" elem="button" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> <button label="check box" elem="checkbox" ondraggesture="nsdraga...
slideBar - Archive of obsolete content
nvention of the old sidebar features of browsers. they allow quick access to a wide range of both temporary and permanent information at the side of your browser window. when a slidebar feature is selected its contents will be revealed from behind the current webpage. it currently under development and lives in the future. ...
...er development and lives in the future. jetpack.future.import("slidebar"); methods append(iconurihtmlhtml/xmlurluriwidthintpersistboolautoreloadboolonclickfunctiononselectfunctiononreadyfunction)this is a list of options to specify modifications to your slidebar instance. ...
...velopment and lives in the future. jetpack.future.import("slidebar"); methods append(iconurihtmlhtml/xmlurluriwidthintpersistboolautoreloadboolonclickfunctiononselectfunctiononreadyfunction)this is a list of options to specify modifications to your slidebar instance. ...
...ureuri widthwidth of the content area and the selected slide sizeint persistdefault slide behavior when being selectedbool autoreloadautomatically reload content on selectbool onclickcallback when the icon is clickedfunction onselectcallback when the feature is selectedfunction onreadycallback when featured is loadedfunction an example: jetpack.slidebar.append({ url: "http://mozilla.com", width: 150, onclick: function(slide){ slide.icon.src = "chrome://branding/content/icon48.png"; }}); ...
Example Sticky Notes - Archive of obsolete content
lass="sticker"><p>acme,&nbsp;inc. fax - respond today.</p></div> <div class="sticker"><p>don't forget the eggs!</p></div> <div class="sticker"><p>the new project - who's on charge?</p></div> <div class="sticker"><p>learn more about xbl.</p></div> <p style="clear: left"><a href="http://validator.w3.org/check?uri=referer"><img src="https://udn.realityripple.com/samples/e2/dd625ef1cd.png" width="88" height="31" alt="valid html 4.01" style="border: 1px none"></a></p> </body> </html> notes.xml <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- in above only xbl namespace declaration is mandatory. t...
...d is local within the binding file (not visible in the target document dom tree). --> <resources> <!-- obtaining the stylesheet we'll use to (re)style the bound element. --> <stylesheet src="notes.css"/> </resources> <content> <!-- this svg graphics will be added automatically around each bound element. the position of the original content is indicated by <children/> tag. ...
...). --> <resources> <!-- obtaining the stylesheet we'll use to (re)style the bound element. --> <stylesheet src="notes.css"/> </resources> <content> <!-- this svg graphics will be added automatically around each bound element. the position of the original content is indicated by <children/> tag. ...
...tr); ]]></handler> <handler event="mouseover"><![cdata[ this.$bg = this.style.backgroundcolor || '#ffff00'; this.style.backgroundcolor = '#ffcc00'; ]]></handler> <handler event="mouseout"><![cdata[ this.style.backgroundcolor = this.$bg; ]]></handler> </handlers> </binding> </bindings> notes.css .sticker { position: relative; left: 0px; right: 0px; float: left; clear: none; width: 10em; height: 10em; overflow: visible; margin: 1em 1em; padding: 0.5em 0.5em; border: 2px solid blue; background-color: yellow; font: 1em normal "times new roman",serif; font-style: italic; cursor: default; } view this example ...
Features of a Window - Archive of obsolete content
rl of the file you wish to open. the second is an internal name of the window. the third is a list of display flags. the flag 'chrome' is important to open the window as a chrome file. if you do not add the 'chrome' flag, the file will open up as the content in a browser window. for example: var mywin = window.open("chrome://findfile/content/findfile.xul", "findfile", "chrome"); specifying the width and height you should have noticed that whenever elements were added to a window, the window's width expanded to fit the new elements. the window is really just a box which is flexible and defaults to vertical orientation. you can also specify the width and height directly on the window tag. this, of course, causes the window to be displayed in a specific size. if you leave it out, the size is d...
... out, the size is determined by the elements that are in it. gecko 1.9.2 note starting in gecko 1.9.2 (firefox 3.6), overriding the position of a window using window features will not change the persisted values saved by the session store feature. that means the next time the window is opened, it will still open in the saved location. <window id="findfile-window" title="find files" width="400" height="450" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> in this example, the window will open with a width of 400 pixels and a height of 450 pixels. even if there aren't enough elements to fit this size, the window will still open at this size and there will be blank space in the remaining area. if there are too many elements, the window will not be large en...
...ple, the window will open with a width of 400 pixels and a height of 450 pixels. even if there aren't enough elements to fit this size, the window will still open at this size and there will be blank space in the remaining area. if there are too many elements, the window will not be large enough to fit the elements. the user will have to resize the dialog. you have to be careful when specifying a width and height that the window is not too small or too big. you should also consider that a user might be using a different theme or locale. note that you must specify both the width and the height. if you only specify one, the other will be set to 0. to have the window set its size automatically, leave both the width and height out. ...
...the user may still resize the window to another size, assuming that the window is resizable. other window features the flags below can be passed as part of the third argument to the window.open function. your operating system may not support all of them. ...
action - Archive of obsolete content
mes, it will have the same value in each place. for more information, see actions. ...
...value in each place. for more information, see actions. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, t...
... 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(), getelementsbytagname(), getelementsbytagnamens()...
assign - Archive of obsolete content
ibute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name". ...
... to assign the value to; otherwise it's a reference to a template variable such as "?name". ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
bbox - Archive of obsolete content
Archive › Mozilla › XUL › bbox
is equivalent to using an hbox element with an align attribute set to baseline. ...
...box element with an align attribute set to baseline. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
binding - Archive of obsolete content
the action of a rule. properties object, predicate, subject examples fixme: (example needed) attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties object type: string the object of the element. it can be a variable reference, an rdf resource 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 resource uri. ...
...o 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 resource uri. ...
...esource uri. ...
bindings - Archive of obsolete content
inside the rule element. more information is available in the template guide. examples (example needed) attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width object type: string the object of the element. it can be a variable reference, an rdf resource uri, or an rdf ...
...r 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 resource uri. ...
...ust be a uri of the property. subject type: string the subject of the element. it can be a variable reference or an rdf resource uri. ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
broadcaster - Archive of obsolete content
more information is available in the broadcasters and observers xul tutorial. ...
...able in the broadcasters and observers xul tutorial. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
broadcasterset - Archive of obsolete content
cendants are not displayed. more information is available in the xul tutorial. ...
... more information is available in the xul tutorial. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
columns - Archive of obsolete content
mns. more information about columns is available in the xul tutorial. example see grid for an example. ...
...out columns is available in the xul tutorial. example see grid for an example. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
conditions - Archive of obsolete content
stead of the query element. more information is available in the xul tutorial. ...
... more information is available in the xul tutorial. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
deck - Archive of obsolete content
Archive › Mozilla › XUL › deck
selectedindex type: integer gets and sets the index of the currently selected panel. the first item is at index 0. 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties selectedindex type: integer returns the index of the currently selected item. you...
... selectedpanel type: element holds a reference to the currently selected panel within a deck element. assigning a value to this property will modify the selected panel. ...
... element holds a reference to the currently selected panel within a deck element. assigning a value to this property will modify the selected panel. ...
...ected panel. ...
grippy - Archive of obsolete content
ng element of the splitter. more information is available in the xul tutorial. ...
... more information is available in the xul tutorial. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
groupbox - Archive of obsolete content
="black and white"/> <radio label="colour"/> </radiogroup> <checkbox label="enabled"/> </groupbox> attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object ...
... tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...t-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...he element. ...
observes - Archive of obsolete content
tributes are not observed. element type: id the id of the broadcaster element that the observer is observing. ...
... element type: id the id of the broadcaster element that the observer is observing. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
page - Archive of obsolete content
Archive › Mozilla › XUL › page
w, except it should be used for xul files that are to be loaded into an iframe. ...
... for xul files that are to be loaded into an iframe. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
preferences - Archive of obsolete content
the tree with default values. attribute nsiprefbranch2 rootbranchinternal; the root prefs branch (nsiprefbranch2). ...
...es. attribute nsiprefbranch2 rootbranchinternal; the root prefs branch (nsiprefbranch2). ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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 void firechangedevent(in domelement preference); creates and dispatches a changed (non-bubbling) event to the specified preference element. 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); nsiobserver method used internally to...
query - Archive of obsolete content
Archive › Mozilla › XUL › query
th expression which returns results. any namespace prefixes declared on the element may be used within the expression. ...
... results. any namespace prefixes declared on the element may be used within the expression. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
queryset - Archive of obsolete content
container for query elements when more than one query is used. for more information, see multiple queries. ...
...s when more than one query is used. for more information, see multiple queries. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
row - Archive of obsolete content
Archive › Mozilla › XUL › row
defined in the grid. more information is available in the xul tutorial. example see grid for an example. ...
...information is available in the xul tutorial. example see grid for an example. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
script - Archive of obsolete content
t version is used (like you get when including a javascript file from web content without specifying a version number). ...
... get when including a javascript file from web content without specifying a version number). ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
scrollcorner - Archive of obsolete content
nt is used for the small box where the horizontal and vertical scrollbars meet. ...
...x where the horizontal and vertical scrollbars meet. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
separator - Archive of obsolete content
parator separates vertically placed elements. vertical the separator separates horizontally placed elements. ...
...y placed elements. vertical the separator separates horizontally placed elements. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
spinbuttons - Archive of obsolete content
d. for instance, spinbuttons are used for the number type textbox, and with the timepicker and datepicker. ...
...ns are used for the number type textbox, and with the timepicker and datepicker. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
statusbar - Archive of obsolete content
="1"/> <progressmeter mode="determined" value="82"/> <statusbarpanel label="right panel"/> </statusbar> attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object fo...
...p, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...ait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...he element. ...
stringbundleset - Archive of obsolete content
| properties | methods | related ] a container for stringbundle elements. ...
... related ] a container for stringbundle elements. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
tabpanel - Archive of obsolete content
r container in place of it. more information is available in the xul tutorial. ...
... more information is available in the xul tutorial. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
template - Archive of obsolete content
if not specified, the variable specified in the uri attribute in the action body of the template's first rule is used. ...
...ble specified in the uri attribute in the action body of the template's first rule is used. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
textnode - Archive of obsolete content
ed) attributes value type: uri the text value to display. this value should be an rdf property (predicate). ...
... type: uri the text value to display. this value should be an rdf property (predicate). ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
toolbargrippy - Archive of obsolete content
more information is available in the xul tutorial. properties accessible examples (example needed) attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element. ...
...template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element. ...
...ext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element. ...
...the element. ...
toolbarseparator - Archive of obsolete content
label="button 1"/> <toolbarseparator /> <toolbarbutton label="button 2"/> </toolbar> </toolbox> attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object fo...
...ip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
...the element. ...
toolbarset - Archive of obsolete content
d as a container for custom toolbars, which are added in the custom toolbar dialog. ...
... toolbars, which are added in the custom toolbar dialog. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, to...
... 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(), getelementsbytagname(), getelementsbytagnamens(),...
treechildren - Archive of obsolete content
und of the tree's rows will alternate between two colors. you can use the :-moz-tree-row css style to do this instead. ...
... alternate between two colors. you can use the :-moz-tree-row css style to do this instead. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
treerow - Archive of obsolete content
sets the properties of the element, which can be used to style the element. for more information, see styling a tree. ...
... element, which can be used to style the element. for more information, see styling a tree. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
treeseparator - Archive of obsolete content
sets the properties of the element, which can be used to style the element. for more information, see styling a tree. ...
... element, which can be used to style the element. for more information, see styling a tree. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
triple - Archive of obsolete content
erty. subject type: string the subject of the element. it can be a variable reference or an rdf resource uri. ...
... string the subject of the element. it can be a variable reference or an rdf resource uri. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
where - Archive of obsolete content
Archive › Mozilla › XUL › where
subject type: string the variable or string to compare. value type: string the value to compare. ...
...tring the variable or string to compare. value type: string the value to compare. ...
...tmenu, 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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
window - Archive of obsolete content
detect when a window is activated or deactivated by watching for the "activate" and "deactivate" events. see window activation events. more information is available in the xul tutorial. ...
...ain four numbers, separated by commas, indicating the margin in pixels for the top, right, bottom, and left edges of the window, respectively. this value may be -1 to use the default margin for that side on the current platform, 0 to have no system border (that is, to extend the client area to the edge of the window), or a value greater than zero to indicate how much less than the default default width you wish the margin on that side to be. if this value turns out to be less than 0, 0 is used. disablechrome type: boolean set this attribute to true to disable chrome in the window. this is used to hide chrome when showing in-browser ui such as the about:addons page, and causes the toolbars to be hidden, with only the tab strip (and, if currently displayed, the add-on bar) left showing. note...
...ttribute does not change the window state. use window.maximize(), window.restore(), or window.minimize() to change the window state. to get the window state from javascript code, use window.windowstate. listen to the sizemodechange event dispatched to the dom window to get notified when the window state changes. title type: string the text to appear in the title bar of the window. width type: string (representing an integer) the preferred width of the element. the value should not include a unit as all values are in pixels. the actual displayed 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. windowtype type: string...
...vigator:browser - looks like if window has gbrowser it has this window type devtools:scratchpad - scratchpad windows navigator:view-source - the view source windows 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...
-ms-hyphenate-limit-zone - Archive of obsolete content
for more information about supported length units, see css basic data types. ...
...for more information about supported length units, see css basic data types. ...
...for more information about supported length units, see css basic data types. ...
...for more information about supported length units, see css basic data types. negative values are not allowed. formal syntax <percentage> | <length> specifications not part of any specification. remarks the -ms-hyphenate-limit-zone property enables you to control the amount of trailing whitespace permitted during hyphenation. ...
::-ms-browse - Archive of obsolete content
roperties can be used in a rule with ::-ms-browse in its selector. other properties are ignored. ...
...selector. other properties are ignored. ...
...sition-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-left padding-right pa...
...op-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-browse example html <label>select image: <input type="file"></label> css input[type="file"]::-ms-browse { color: red; background-color: yellow; } result output example specifications not part of any specification. browser compatibility historically supported in internet explorer and edge before version 79. ...
::-ms-check - Archive of obsolete content
properties can be used in a rule with ::-ms-check in its selector. other properties are ignored. ...
...selector. other properties are ignored. ...
...sition-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-left padding-right pa...
...*/ color: red; /* th...
::-ms-clear - Archive of obsolete content
ing css properties can be used in a rule with ::-ms-clear in its selector. other properties are ignored. ...
... in its selector. other properties are ignored. ...
...contrast-adjust background-clip background-color background-image background-origin 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 pa...
...op-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 example html <form> <label for="firstname">first name:</label> <input type="text" id="firstname" name="firstname" placeholder="first name"> <br> <label for="lastname">last name:</label> <input type="text" id="lastname" name="lastname" placeholder="second name"> </form> css input, label { display: block; } input[type=text]::-ms-clear { color: red; /* thi...
::-ms-expand - Archive of obsolete content
ng css properties can be used in a rule with ::-ms-expand in its selector. other properties are ignored. ...
... in its selector. other properties are ignored. ...
...contrast-adjust background-clip background-color background-image background-origin 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 pa...
... ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
btn_comments = new ext.button({ text: "submit", fieldlabel: "", ...
... btn_comments = new ext.button({ text: "submit", fieldlabel: "", handler: formhandler }); // create the form panel, attach the inputs form_comments = new ext.form.formpanel({ labelalign: "ri...
...xt.onready( function() { // create the name text field txt_name = new ext.form.textfield({ name: "name", fieldlabel: "name", width: 200 }); // create the e-mail text field txt_email = new ext.form.textfield({ name: "email", fieldlabel: "e-mail", width: 200 }); // create the message text field txt_message = new ext.form.textarea({ name: "message", fieldlabel: "message", width: 200 }); // create a button used to send the form details. ...
...); // create the message text field txt_message = new ext.form.textarea({ name: "message", fieldlabel: "message", width: 200 }); // create a button used to send the form details. btn_comments = new ext.button({ text: "submit", fieldlabel: "", handler: formhandler }); // create the form panel, attach the inputs form_comments = new ext.form.formpanel({ labelalign: "right", width: 400, title: "comments", items: [ txt_name, txt_email, txt_message, btn_comments ], renderto: "form-comments" }); }); </script> the code in listing 6 starts by hooking in the ext js library which is used to produce the ui elements of the form. next a script named validatecomments.js is hooked in with the runat attribute set to both. the function ...
Displaying a graphic with audio samples - Archive of obsolete content
ollowing 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. ...
...o stream and display them behind an image (in this case, the mozilla logo), giving the impression that the image is built from the samples. ...
...ls), 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.fillstyle = "rgb(0,0,0)"; ctx.fillrect (0,0, canvas.width, canvas.height); ctx.fillstyle = "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); } ctx.drawimage(document.getelementbyid('mozlogo'),0,0,...
....height); ctx.fillstyle = "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); } ctx.drawimage(document.getelementbyid('mozlogo'),0,0, canvas.width, canvas.height); } var audio = document.getelementbyid('audio-element'); audio.addeventlistener('mozaudioavailable', audioavailable, false); audio.addeventlistener('loadedmetadata', loadedmetadata, false); </script> </body> </html> ...
GLSL Shaders - Game development
webgl support, such as the latest firefox or chrome. create a directory to store your experiments in. save a copy of the latest minimized three.js library inside your directory. html structure here's the html structure we will use. ...
...the <script> element in the <head> includes the three.js library in the page; we will write our code into three script tags in the <body> tag: the first one will contain the vertex shader. the second one will contain the fragment shader. the third one will contain the actual javascri...
.../shaders/js/three.min.js"></script> <script id="vertexshader" type="x-shader/x-vertex"> void main() { gl_position = projectionmatrix * modelviewmatrix * vec4(position.x+10.0, position.y, position.z+5.0, 1.0); } </script> <script id="fragmentshader" type="x-shader/x-fragment"> void main() { gl_fragcolor = vec4(0.0, 0.58, 0.86, 1.0); } </script> javascript var width = window.innerwidth; var height = window.innerheight; var renderer = new three.webglrenderer({antialias:true}); renderer.setsize(width, height); renderer.setclearcolor(0xdddddd, 1); document.body.appendchild(renderer.domelement); var scene = new three.scene(); var camera = new three.perspectivecamera(70, width/height); camera.position.z = 50; scene.add(camer...
...our example doesn't do much but there are many more cool things you can do with shaders — check out some really cool ones on shadertoy for inspiration and to learn from their sources. ...
Finishing up - Game development
we can also reset the ball and the paddle positions when the player begins with their next life. so, in the draw() function replace the following three lines: alert("game over"); document.location.reload(); clearinterval(interval); // needed for chrome to end game wi...
...if there are no lives left, the game is lost; if there are still some lives left, then the position of the ball and the paddle are reset, along with the movement of the ball. rendering the l...
...if there are no lives left, the game is lost; if there are still some lives left, then the position of the ball and the paddle are reset, along with the movement of the ball. rendering the lives display now you need to add a call to drawlives() inside the draw() function...
...if there are no lives left, the game is lost; if there are still some lives left, then the position of the ball and the paddle are reset, along with the movement of the ball. rendering the lives display now you need to add a call to drawlives() inside the draw() function and add it ...
Animations and tweens - Game development
the spritesheet — put the following line at the bottom of your preload() function: game.load.spritesheet('ball', 'img/wobble.png', 20, 20); instead of loading a single image of the ball we can load the whole spritesheet — a collection of different images. we will show the sprites sequentially to create the illusion of animation. the spritesheet() method's two extra paremeters determine the width and height of each single frame in the given spritesheet file, indicating to the program how to chop it up to get the individual frames. loading the animation next up, go into your create() function, find the line that loads the ball sprite, and below it put the call to animations.add() seen below: ball = game.add.sprite(50, 250, 'ball'); ball.animations.add('wobble', [0,1,0,2,0,1,0,2,0], 24);...
...w) we can add an extra parameter that specifies a function to be executed every time the collision happens, in the same fashion as the ballhitbrick() function. update the first line inside update() as shown below: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.input.x || game.world.width*0.5; } then we can create the ballhitpaddle() function (having ball and paddle as default parameters), playing the wobble animation when it is called. add the following function just before your closing </script> tag: function ballhitpaddle(ball, paddle) { ball.animations.play('wobble'); } the animation is played every time the ball hits the paddle. you can add the animations.play() call...
...ion ballhitpaddle(ball, paddle) { ball.animations.play('wobble'); } the animation is played every time the ball hits the paddle. you can add the animations.play() call inside the ballhitbrick() function too, if you feel it would make the game look better. tweens whereas animations play external sprites sequentially, tweens smoothly animate properties of an object in the gameworld, such as width or opacity. let's add a tween to our game to make the bricks smoothly disappear when they are hit by the ball. go to your ballhitbrick() function, find your brick.kill(); line, and replace it with the following: var killtween = game.add.tween(brick.scale); killtween.to({x:0,y:0}, 200, phaser.easing.linear.none); killtween.oncomplete.addonce(function(){ brick.kill(); }, this); killtween.star...
...to the end, we use the add.tween() method, specifying brick.scale as the argument as this is what we want to tween. the to() method defines the state of the object at the end of the tween. it takes an object containing the chosen parameter's desired ending values (scale takes a scale value, 1 being 100% of size, 0 being 0% of size, etc.), ...
Player paddle and controls - Game development
oad.image('paddle', 'img/paddle.png'); } adding the paddle graphic just so we don't forget, at this point you should grab the paddle graphic from github, and save it in your /img folder. rendering the paddle, with physics next up, we will init our paddle by adding the following add.sprite() call inside the create() function — add it right at the bottom: paddle = game.add.sprite(game.world.width*0.5, game.world.height-5, 'paddle'); we can use the world.width and world.height values to position the paddle exactly where we want it: game.world.width*0.5 will be right in the middle of the screen. in our case the world is the same as the canvas, but for other types of games, like side-scrollers for example, the world will be bigger, and you can tinker with it to create interesting effects. ...
...ollers for example, the world will be bigger, and you can tinker with it to create interesting effects. as you'll notice if you reload your index.html at this point, the paddle is currently not exactly in the middle. why? because the anchor from which the position is calculated always starts from the top left edge of the object. we can change that to have the anchor in the middle of the paddle's width and at the bottom of it's height, so it's easier to position it against the bottom edge. add the following line below the previous new one: paddle.anchor.set(0.5,1); the paddle is now positioned right where we want it to be. now, to make it collide with the ball we have to enable physics for the paddle. continue by adding the following new line, again at the bottom of the create() function: g...
...e paddle's x position will adjust accordingly to the input's x position, however when we start the game, the position of the paddle is not in the middle. it's because the input position is not yet defined. to fix that we can set the default position (if an input position is not yet defined) to be the middle of the screen. update the previous line as follows: paddle.x = game.input.x || game.world.width*0.5; if you haven't already done so, reload your index.html and try it out! position the ball we have the paddle working as expected, so let's position the ball on it. it's very similar to positioning the paddle — we need to have it placed in the middle of the screen horizontally and at the bottom vertically with a little offset from the bottom. to place it exactly as we want it we will set...
...ery similar to positioning the paddle — we need to have it placed in the middle of the screen horizontally and at the bottom vertically with a little offset from the bottom. to place it exactly as we want it we will set the anchor to the exact middle of the ball. find the existing ball = game.add.sprite( ... ) line, and replace it with the following two lines: ball = game.add.sprite(game.world.width*0.5, game.world.height-25, 'ball'); ball.anchor.set(0.5); the velocity stays almost the same — we're just changing the second parameter's value from 150 to -150, so the ball will start the game by moving up instead of down. find the existing ball.body.velocity.set( ... ) line and update it to the following: ball.body.velocity.set(150, -150); now the ball will start right from the middle of ...
Client hints - MDN Web Docs Glossary: Definitions of Web-related terms
ferences. client hints enable automated delivery of optimized assets like the automatic negotiation of image dpr resolution. use of client hints isn't automatic: rather, servers must announce that they support client hints. servers announce support for client hints using the accept-ch (accept client hints) header or an equivalent html meta element with the http-equiv attribute. accept-ch: dpr, width, viewport-width, downlink and / or <meta http-equiv="accept-ch" content="dpr, width, viewport-width, downlink"> when a client receives the accept-ch header, if supported, it appends client hint headers that match the advertised field-values. for example, based on accept-ch example above, the client could append dpr, width, viewport-width, and downlink headers to all subsequent requests. in the...
...mple above, the client could append dpr, width, viewport-width, and downlink headers to all subsequent requests. in the second example, the server gives the browser the hints by setting the accept-ch meta tag. basically, with the client hints header, the developer or application can tell the browser to advertise information about itself to the server, such as the device pixel ratio, the viewport width, and the display width. the client can then give the server information about the client's environment, and the server can determine which resources to send based on that information. varying client hints to convey to caches that different client hints may affect the response, the vary http header must be used. ...
...evice pixel ratio, the viewport width, and the display width. the client can then give the server information about the client's environment, and the server can determine which resources to send based on that information. varying client hints to convey to caches that different client hints may affect the response, the vary http header must be used. ...
...o, the viewport width, and the display width. the client can then give the server information about the client's environment, and the server can determine which resources to send based on that information. varying client hints to convey to caches that different client hints may affect the response, the vary http header must be used. ...
How CSS works - Learn web development
the fact that browsers will use the last css they come across in a stylesheet when you have two rules with the same specificity you can also offer alternatives for browsers that don't support new css. this works particularly well when you want to use a value that is quite new and not supported everywhere. for example, some older browsers do not support calc() as a value. ...
...ey come across in a stylesheet when you have two rules with the same specificity you can also offer alternatives for browsers that don't support new css. this works particularly well when you want to use a value that is quite new and not supported everywhere. for example, some older browsers do not support calc() as a value. i might give a fallback width for a box in pixels, then go on to give a width with a calc() value of 100% - 50px. ...
... and finally you've nearly finished this module; we only have one more thing to do. in the next article you'll use your new knowledge to restyle an example, testing out some css in the process. ...
... and finally you've nearly finished this module; we only have one more thing to do. in the next article you'll use your new knowledge to restyle an example, testing out some css in the process. ...
HTML table basics - Learn web development
Learn › HTML › Tables › Basics
readers' output will be confusing to their users. tables produce tag soup: as mentioned above, table layouts generally involve more complex markup structures than proper layout techniques. this can result in the code being harder to write, maintain, and debug. tables are not automatically responsive: when you use proper layout containers (such as <header>, <section>, <article>, or <div>), their width defaults to 100% of their parent element. tables on the other hand are sized according to their content by default, so extra measures are needed to get table layout styling to effectively work across a variety of devices. active learning: creating your first table we've talked table theory enough, so, let's dive into a practical example and build up a simple table. first of all, make a loca...
... column of data all in one place — the <col> and <colgroup> elements. 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. 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(). take the following simple example: <table> <tr> <th>data 1</th> <th style="background-color: yellow">data 2</th> </tr> <tr> <td>calcutta</td> <td style="background-color: yellow">orange</td> </tr> <tr> <td>robots</t...
...the same table you saw above, minus the column styling information. add a <colgroup> element at the top of the table, just underneath the <table> tag, in which you can add your <col> elements (see the remaining steps below). the first two columns need to be left unstyled. add a background color to the third column. the value for your style attribute is background-color:#97db9a; set a separate width on the fourth column. the value for your style attribute is width: 42px; add a background color to the fifth column. the value for your style attribute is background-color: #97db9a; add a different background color plus a border to the sixth column, to signify that this is a special day and she's teaching a new class. the values for your style attribute are background-color:#dcc48e; border:4px ...
...o the fifth column. the value for your style attribute is background-color: #97db9a; add a different background color plus a border to the sixth column, to signify that this is a special day and she's teaching a new class. the values for your style attribute are background-color:#dcc48e; border:4px solid #c1437a; the last two days are free days, so just set them to no background color but a set width; the value for the style attribute is width: 42px; see how you get on with the example. if you get stuck, or want to check your work, you can find our version on github as timetable-fixed.html (see it live also). summary that just about wraps up the basics of html tables. in the next article we will look at some slightly more advanced table features, and start to think how accessible they are...
Making decisions in your code — conditionals - Learn web development
er">september</option> <option value="october">october</option> <option value="november">november</option> <option value="december">december</option> </select> <h1></h1> <ul></ul> </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="height: 400px;width: 95%"> const select = document.queryselector('select'); const list = document.queryselector('ul'); const h1 = document.queryselector('h1'); select.onchange = function() { const choice = select.value; // add conditional here createcalendar(days, choice); } function createcalendar(days, choice) { list.innerhtml = ''; h1.textcontent = choice; for (let i = 1; i <= days; i++) { con...
...element('li'); listitem.textcontent = i; list.appendchild(listitem); } } createcalendar(31,'january'); </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> .output * { box-sizing: border-box; } .output ul { padding-left: 0; } .output li { display: block; float: left; width: 25%; border: 2px solid white; padding: 5px; height: 40px; background-color: #4a2db6; color: white; } html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid...
...k">black</option> <option value="purple">purple</option> <option value="yellow">yellow</option> <option value="psychedelic">psychedelic</option> </select> <h1>this is my website</h1> </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="height: 450px;width: 95%"> const select = document.queryselector('select'); const html = document.queryselector('.output'); select.onchange = function() { const choice = select.value; // add switch statement } function update(bgcolor, textcolor) { html.style.backgroundcolor = bgcolor; html.style.color = textcolor; }</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"...
... update(bgcolor, textcolor) { html.style.backgroundcolor = bgcolor; html.style.color = textcolor; }</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; useren...
Arrays - Learn web development
the invoice. this is just simple string concatenation, which should be familiar to you. ...
...in an animated scene for example, you might have an array of objects representing the background graphics currently displayed, and you might only want 50 displayed at once...
...oves the value currently at the end of the array. ...
...us it, ready for the next term to be entered searchinput.value = ''; searchinput.focus(); } } </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; useren...
Multimedia: Images - Learn web development
to learn about the various image formats, their impact on performance, and how to reduce the impact of images on overall page load time. this is a high-level introduction to optimizing multimedia delivery on the web, covering general principles and techniques. for a more in-depth guide, see https://images.guide. why optimize your multimedia? for the average website, 51% of its bandwidth comes from imagery, followed by video at 25%, so it's safe to say it's important to address and optimize your multi-media content. you need to be considerate of data usage. many people are on capped data plans or even pay-as-you-go where they are literally paying by the megabyte. this isn't an emerging market problem either. as of 2018, 24% of the united kingdom still use pay-as-you-go. you als...
...they are literally paying by the megabyte. this isn't an emerging market problem either. as of 2018, 24% of the united kingdom still use pay-as-you-go. you also need to be considerate of memory as many mobile devices have limited ram. it's important to remember that when images are downloaded, they need to be stored in memory. optimizing image delivery despite being the largest consumer of bandwidth, images load asynchronously so the visitor can see the page as they download and therefore, their impact on perceived performance is far lower than many expect. however, images are mostly used for content, so it's important that a visitor can see them as soon as possible for a good experience. loading strategy one of the biggest improvements to most websites is lazy-loading images beneath-the-f...
...on images are carousels where the first image is a higher priority than the subsequent images. rendering strategy as images are loaded asynchronously and continue to load after the first paint, if their dimensions aren't defined before load, they can cause reflows to the page content. for example, when text gets pushed down the page by images loading. for this reason, it's critical that you set width and height attributes so that the browser can reserve space for them in the layout. for any background images, it's important you set a background-color value so any content overlaid is still readable before the image has downloaded. conclusion in this section we took a look at image optimization. you now have a general understanding of how to optimize half of the average web sites average ban...
...and height attributes so that the browser can reserve space for them in the layout. for any background images, it's important you set a background-color value so any content overlaid is still readable before the image has downloaded. conclusion in this section we took a look at image optimization. you now have a general understanding of how to optimize half of the average web sites average bandwidth total. this is just one of the types of media consuming users bandwidth and slowing down page load. let's take a look at video optimization, tackling the next 20% of bandwidth consumption. previous overview: performance next in this module the "why" of web performance what is web performance? how do users perceive performance? measuring performance multimedia: images multimedia:...
Getting started with Svelte - Learn web development
his in mind, let's have a look at the src/app.svelte file that came with the starter template. you should see something like the following: <script> export let name; </script> <main> <h1>hello {name}!</h1> <p>visit the <a href="https://svelte.dev/tutorial">svelte tutorial</a> to learn how to build svelte apps.</p> </main> <style> main { text-align: center; padding: 1em; max-width: 240px; margin: 0 auto; } h1 { color: #ff3e00; text-transform: uppercase; font-size: 4em; font-weight: 100; } @media (min-width: 640px) { main { max-width: none; } } </style> the <script> section the <script> block contains javascript that runs when a component instance is created. variables declared (or imported) at the top level are 'visible' from...
...> svelte also supports tags like {#if...}, {#each...}, and {#await...} — these examples allow you to conditionally render a portion of the markup, iterate through a list of elements, and work with async values, respectively. the <style> section if you have experience working with css, the following snippet should make sense: <style> main { text-align: center; padding: 1em; max-width: 240px; margin: 0 auto; } h1 { color: #ff3e00; text-transform: uppercase; font-size: 4em; font-weight: 100; } @media (min-width: 640px) { main { max-width: none; } } </style> we are applying a style to our <h1> element. what will happen other components with <h1> elements in them? in svelte, css inside a component's <style> block will be scoped only...
...css file. it also compiles the markup and <script> section of every component and stores the result in public/build/bundle.js. it also adds the code in src/main.js to reference the features of each component. ...
... also compiles the markup and <script> section of every component and stores the result in public/build/bundle.js. it also adds the code in src/main.js to reference the features of each component. ...
Handling common HTML and CSS problems - Learn web development
, such as a calendar widget for entering dates. ...
...nputs: <form> <div> <label for="date">enter a date:</label> <input id="date" type="date"> </div> <div> <label for="time">enter a time:</label> <input id="time" type="time"> </div> </form> the output of this code is as follows: hidden example label { float: left; width: 30%; text-align: right; } input { float: right; width: 65%; } label, input { margin-bottom: 20px; } div { clear: both; margin: 10px; } body { width: 400px; margin: 0 auto; } <form> <div> <label for="date">enter a date:</label> <input id="date" type="date"> </div> <div> <label for="time">enter a time:</label> <input ...
... to modern browsers, then instead apply a floated layout to older browsers that don't support flexbox. note: there is a fairly new feature in css called @supports, which allows you to implement native feature detection tests. responsive design problems responsive design is the practice of creating web layouts that change to suit different device form factors — for example, different screen widths, orientations (portrait or landscape), or resolutions. a desktop layout for example will look terrible when viewed on a mobile device, so you need to provide a suitable mobile layout using media queries, and make sure it is applied correctly using viewport. you can find a detailed account of such practices in the building blocks of responsive design. resolution is a big issue too — for exampl...
...eries, and make sure it is applied correctly using viewport. you can find a detailed account of such practices in the building blocks of responsive design. resolution is a big issue too — for example, mobile devices are less likely to need big heavy images than desktop computers, and are more likely to have slower internet connections and possibly even expensive data plans that make wasted bandwidth more of a problem. in addition, different devices can have a range of different resolutions, meaning that smaller images could appear pixellated. there are a number of techniques that allow you to work around such problems, from simple mobile first media queries, to more complex responsive image techniques. another difficulty that can present problems is browser support for the features that mak...
Debugging Frame Reflow
general overview the frame reflow can be logged with the debug capabilities implemented in nsframe.cpp. it provides the following information for each frame at the start of its reflow reflow reason available width, available height computed width, computed height the previous and the next frame in flow and a count number. when the frame's reflow is finished the following information is displayed : reflow metric (desired) width, height max. element width maximum width frame status overflow area getting the log make sure that your build is a debug build (in short you need ac_add_options --enable-debug in your .mozconfig file). create a text file (for instance reflow_rules.txt). enter this line in the text file * 1 this should look like: point th...
...-dbg/dist/nightlydebug.app/contents/macos/firefox-bin > logfile.txt after loading your testcase, the log file will contain the promised information. ...
...d7b210 d=8940,390 area 02d7afe4 d=9180,630 canvas 00b97c6c d=9180,4470 scroll 00b97ee0 d=9180,4470 scroll 00b97ee0 d=9180,4470 vp 00b97c30 d=9180,4470 the first line shows the reflow of the viewport (vp). this viewport has the address 00b97c30. it is the initial reflow: r=0. other reflow reasons are: incremental reflow resize reflow style change reflow dirty reflow the available width is 9180 twips. the available height is 4470 twips (a=9180,4470). the computed width is 9180 twips. the computed height is 4470 twips (c=9180,4470). the line count is 856 (cnt=856). below this is a line that reads: tblo 02d7b5f0 r=0 a=8940,uc c=0,0 cnt=870 here the uc shows that on initial reflow the available height for the outer table frame is unconstrained. the table cell requires its children ...
...s been required to compute the max. element size only once and it reports now: block 02d7bcf8 d=1410,300 the block shows the same address as the previous one. frames with children that overflow the parent have the ns_frame_outside_children flag set. for these frames the overflow area is displayed as block 025ed8f0 d=8940,1020 o=(0,0) 9180 x 1020. the overflow area is specified as (x,y) origin and width x height. the reflow finishes at the same level where it started. advanced reflow debugging the previously described technique dumps the data for every frame. sometimes the log is clearer if only the main frames are shown. the entries in the reflow log can be controlled on a frame level. for instance adding text 0 to the rules in reflow_rules.txt would hide the text entries from the reflow. the d...
JSAPI User Guide
, nullptr, jsprop_enumerate); /* * define a bunch of properties with a jspropertyspec array statically * initialized and terminated with a null-name entry. besides its name, * each property has a "tiny" identifier (my_color, e.g.) that can be used * in switch statements (in a common my_getproperty function, for example). ...
...name, * each property has a "tiny" identifier (my_color, e.g.) that can be used * in switch statements (in a common my_getproperty function, for example). ...
...perty has a "tiny" identifier (my_color, e.g.) that can be used * in switch statements (in a common my_getproperty function, for example). */ enum my_tinyid { my_color, my_height, my_width, my_funny, my_array, my_rdonly }; static jspropertyspec my_props[] = { {"color", my_color, jsprop_enumerate}, {"height", my_height, jsprop_enumerate}, {"width", my_width, jsprop_enumerate}, {"funny", my_funny, jsprop_enumerate}, {"array", my_array, jsprop_enumerate}, {"rdonly", my_rdonly, jsprop_readonly}, {0} }; js_defineproperties(cx, obj, my_props); /* * given the above definitions and call to js_defineproperties, obj will * need this sort of "getter" method in its class (my_class, above). see * the...
...neproperties, obj will * need this sort of "getter" method in its class (my_class, above). see * the example for the "it" class in js.c. */ static jsbool my_getproperty(jscontext *cx, jsobject *obj, jsval id, jsval *vp) { if (jsval_is_int(id)) { switch (jsval_to_int(id)) { case my_color: *vp = . . .; break; case my_height: *vp = . . .; break; case my_width: *vp = . . .; break; case my_funny: *vp = . . .; break; case my_array: *vp = . . .; break; case my_rdonly: *vp = . . .; break; } } return true; } defining classes this pulls together the above api elements by defining a constructor function, a prototype object, and properties of the prototype and of the constructor, all with one api call. initi...
nsIDOMWindowUtils
t32 aidentifiers, [array, size_is(count)] in print32 axs, [array, size_is(count)] in print32 ays, [array, size_is(count)] in pruint32 arxs, [array, size_is(count)] in pruint32 arys, [array, size_is(count)] in float arotationangles, [array, size_is(count)] in float aforces, in pruint32 count, in long amodifiers, [optional] in boolean aignorerootscrollframe); void setcssviewport(in float awidthpx, in float aheightpx); void setdisplayport(in float axpx, in float aypx, in float awidthpx, in float aheightpx); void setresolution(in float axresolution, in float ayresolution); void startpccountprofiling(); void stoppccountprofiling(); void suppresseventhandling(in boolean asuppress); void suspendtimeouts(); nsidomfile w...
...e if the page called event.preventdefault(), indicating that default processing of the event should not occur. setcssviewport() sets the dimensions of the css viewport to the specified size in css pixels, regardless of the size of the enclosing widget/view. this triggers reflow. the caller of this method must have universalxpconnect privileges. ...
...ort to the specified size in css pixels, regardless of the size of the enclosing widget/view. this triggers reflow. the caller of this method must have universalxpconnect privileges. note: after calling this method, the window.innerwidth and window.innerheight properties return the size of the viewport you've specified instead of the size of the browser widget. void setcssviewport( in float awidthpx, in float aheightpx ); parameters awidthpx the width of the viewport in css pixels. aheightpx the height of the viewport in css pixels. setdisplayport() set the "displayport" to be <xpx, ypx, widthpx, heightpx> in units of css pixels, regardless of the size of the enclosing widget/view. this will *not* trigger reflow. <x, y> is relative to the top-left of the css viewport. this me...
...l to set a displayport that extends beyond the css viewport in any direction (left/right/top/bottom). it's also legal to set a displayport that extends beyond the document's bounds. the value of the pixels rendered outside the document bounds is not yet defined. the caller of this method must have universalxpconnect privileges. void setdisplayport( in float axpx, in float aypx, in float awidthpx, in float aheightpx ); parameters axpx aypx awidthpx aheightpx setresolution() get/set the resolution at which rescalable web content is drawn. currently this is only (some) thebes content. setting a new resolution does *not* trigger reflow. this api is entirely separate from textzoom and fullzoom; a resolution scale can be applied together with both textzoom and fullz...
nsITreeBoxObject
view ...
...ically settable, either using a view attribute on the tree tag or by setting this attribute to a new value. focused boolean whether or not we are currently focused. treebody nsidomelement readonly: obtain the treebody content node. this is a node that corresponds to the treechildren tag. rowheight long readonly: obtain the height of a row. rowwidth long readonly: obtain the width of a row. horizontalposition long readonly: get the pixel position of the horizontal scrollbar. selectionregion nsiscriptableregion readonly: return the region for the visible parts of the selection, in device pixels. methods getfirstvisiblerow() get the index of the first visible row. long getfirstvisiblerow(); getlastvi...
... the row index at the coordinates col the nsitreecolumn hit. childelt the pseudoelement hit: this can have values of "cell", "twisty", "image", and "text". getcoordsforcellitem() find the coordinates of an element within a specific cell. ...
...sforcellitem(in long row, in nsitreecolumn col, in acstring element, out long x, out long y, out long width, out long height); parameters row the index of the row col the nsitreecolumn element the pseudoelement. this can have values of "cell", "twisty", "image", and "text". returns x the x coordinate col the y coordinate. width the width of the element height the height of the element iscellcropped() determine if the text of a cell is being cropped or not. boolean iscellcropped(in long row, in nsitreecolumn col); parameters row the index of the row col the nsitreecolumn rowcountchanged() notify the tree that the number of rows changed. the view is responsible for calling this notificatio...
Working with ArrayBuffers
imagedata2 = context.createimagedata(w, h); imagedata2.data.set(incomingbuffer); further, if you have a byte array pixelbuffer, and you need to create imagedata from it. the data property holds an array of bytes. we start with the following: // pixelbuffer is a pointer to a rgba pixel buffer of 400x400 image. pixelbuffer.tostring(); // "ctypes.uint8_t.ptr(ctypes.uint64("0x352e0000"))" var imgwidth = 400; var imgheight = 400; var myimgdat = new imagedata(imgwidth, imgheight); method 1: passing arraytype cdata to uint8clampedarray.prototype.set one method is to get into a js-ctypes array, and then set it into the imagedata, as illustrated by the following code example. // cast pointer to array, to pass to uint8clampedarray.prototype.set. var casted = ctypes.cast(pixelbuffer.address(), ct...
...d 1: passing arraytype cdata to uint8clampedarray.prototype.set one method is to get into a js-ctypes array, and then set it into the imagedata, as illustrated by the following code example. // cast pointer to array, to pass to uint8clampedarray.prototype.set. var casted = ctypes.cast(pixelbuffer.address(), ctypes.uint8_t.array(myimgdata.data.length).ptr).contents; // myimgdat.data.length is imgwidth * imgheight * 4 because per pixel there is r, g, b, a numbers casted.tostring(); // "ctypes.uint8_t.array(640000)([45, 66, 135, 255, 99, 86, 55, 255, .......... ])" myimgdat.data.set(casted); the ctypes.cast takes a couple of milliseconds, however, the myimgdat.data.set takes up to 800ms for a size of 52,428,800 (which is image size of 1280 x 1024 pixels). so, for the size of 640,000 it takes a...
...ta.set takes up to 800ms for a size of 52,428,800 (which is image size of 1280 x 1024 pixels). so, for the size of 640,000 it takes about 98ms. ...
...s.default_abi, ctypes.void_t, // return ctypes.void_t.ptr, // *dest ctypes.void_t.ptr, // *src ctypes.size_t // count ); } catch (ex) { throw new error('i dont know where to memcpy is defined on your operating system, "' + os.constants.sys.name + '"'); lib.close() } memcpy(myimgdat.data, pixelbuffer, myimgdat.data.length); // myimgdat.data.length is imgwidth * imgheight *4 because per pixel there is r, g, b, a numbers lib.close(); see also type conversion ...
AnalyserNode.frequencyBinCount - Web APIs
(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.maxdecibels = -10; ... ...
...0; ... ...
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5 - 1; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-barheight/2,barwidth,barheight/2); x += barwidth; } }; draw(); specifications specification status comment web audio apithe definition of ...
AnalyserNode.getFloatTimeDomainData() - Web APIs
ete 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(); ... ...
...= audioctx.createanalyser(); ... ...
...... ...
...h); var dataarray = new float32array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getfloattimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = '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.stroke(); }; draw(); parameters array the float32array tha...
AnalyserNode.maxDecibels - Web APIs
(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.maxdecibels = -10; ... ...
...0; ... ...
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = '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.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-barheight/2,barwidth,barheight/2); x += barwidth + 1; } }; draw(); specifications specification status comment web audio apithe definition of ...
AnalyserNode.minDecibels - Web APIs
(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.maxdecibels = -10; ... ...
...0; ... ...
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = '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.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-barheight/2,barwidth,barheight/2); x += barwidth + 1; } }; draw(); specifications specification status comment web audio apithe definition of ...
AnalyserNode.smoothingTimeConstant - Web APIs
jarring. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); analyser.mindecibels = -90; analyser.maxdecibels = -10; analyser.smoothingtimeconstant = 0.85; ... ...
...moothingtimeconstant = 0.85; ... ...
...5; ... ...
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = '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.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-barheight/2,barwidth,barheight/2); x += barwidth + 1; } }; draw(); specifications specification status comment web audio apithe definition of ...
AnimationEvent - Web APIs
the animationevent interface represents events providing information related to animations. ...
...n related to animations. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/animationevent" target="_top"><rect x="116" y="1" width="...
... properties also inherits properties from ...
AudioContext - Web APIs
ecoding. you need to create an audiocontext before you do anything else, as everything happens inside a context. it's recommended to create one audiocontext and reuse it instead of initializing a new one each time, and it's ok to use a single audiocontext for several different audio source and pipeline concurrently. ...
...line concurrently. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/audiocontext" target="_top"><rect x="151" y="1" ...
...="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/audiocontext" target="_top"><rect x="151" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">audiocontext</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor audiocontext() creates and returns a new audiocontext objec...
AudioListener.dopplerFactor - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.forwardX - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.forwardY - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.forwardZ - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.positionX - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.positionY - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.positionZ - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.setOrientation() - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.setPosition() - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.speedOfSound - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.upX - Web APIs
Web › API › AudioListener › upX
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.upY - Web APIs
Web › API › AudioListener › upY
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener.upZ - Web APIs
Web › API › AudioListener › upZ
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
AudioListener - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
BaseAudioContext.createPanner() - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
BaseAudioContext - Web APIs
and offline audio-processing graphs, as represented by audiocontext and offlineaudiocontext respectively. you wouldn't use baseaudiocontext directly — you'd use its features via one of these two inheriting interfaces. a baseaudiocontext can be a target of events, therefore it implements the eventtarget interface. ...
...ttarget interface. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/baseaudiocontext" target="_top"><rect x="151" y=...
...x" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/baseaudiocontext" target="_top"><rect x="151" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="231" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">baseaudiocontext</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties baseaudiocontext.audioworklet read only secure context...
BeforeInstallPromptEvent - Web APIs
the beforeinstallpromptevent is fired at the window.onbeforeinstallprompt handler before a user is prompted to "install" a web site to a home screen on mobile. this interface inherits from the event interface. ...
...from the event interface. ...
...tyle="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/beforeinstallpromptevent" target="_top"><rect x="116" y="...
...px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/beforeinstallpromptevent" target="_top"><rect x="116" y="1" width="240" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="236" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">beforeinstallpromptevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor beforeinstallpromptevent() creates a new before...
BeforeUnloadEvent - Web APIs
x appears, asking the users for confirmation to leave the page (see example below). when no value is provided, the event is processed silently. some implementations only show the dialog box if the frame or any embedded frame receives a user gesture or user interaction. see browser compatibility for more information. ...
...ser compatibility for more information. ...
...facediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/beforeunloadevent" target="_top"><rect x="116" y="1" widt...
...y="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/beforeunloadevent" target="_top"><rect x="116" y="1" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">beforeunloadevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} bubbles no cancelable yes target objects defaultview interface event examples ...
BiquadFilterNode() - Web APIs
onse more peaked. please note that for this filter type, this value is not a traditional q, but is a resonance value in decibels. frequency: the cutoff frequency. gain: not used. bandpass: a bandpass filter allows a range of frequencies to pass through and attenuates the frequencies below and above this frequency range. it implements a second-order bandpass filter. q: controls the width of the band. the width becomes narrower as the q value increases. frequency: the center of the frequency band. gain: not used. lowshelf: the lowshelf filter allows all frequencies through, but adds a boost (or attenuation) to the lower frequencies. it implements a second-order lowshelf filter. q: not used. frequency: the upper limit of the frequences where the boost, or attenuat...
...cies. it implements a second-order highshelf filter. q: not used. frequency: the lower limit of the frequences where the boost, or attenuation, is applied. gain: the boost, in db, to be applied. if the value is negative, the frequencies are attenuated. peaking: the peaking filter allows all frequencies through, adding a boost, or attenuation, to a range of frequencies. q: the width of the band of frequencies that are boosted. a large value implies a narrow width. frequency: the center frequency of the boost range. gain: the boost, in db, to be applied. if the value is negative, the frequencies are attenuated. notch: the notch filter (also known as a band-stop, or band-rejection filter) is the opposite of a bandpass filter. it allows all frequencies through, excep...
... frequency: the center frequency of the attenuation range. gain: not used. allpass: an allpass filter allows all frequencies through, but changes the phase relationship between the various frequencies. it implements a second-order allpass filter. ...
... frequency: the center frequency of the attenuation range. gain: not used. ...
BluetoothDevice - Web APIs
the bluetoothdevice interface of the web bluetooth api represents a bluetooth device inside a particular script execution environment. ...
...ution environment. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/bluetoothdevice" target="_top"><rect x="151" y="...
...px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/bluetoothdevice" target="_top"><rect x="151" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">bluetoothdevice</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} interface interface bluetoothdevice { readonly attribute domstring id...
BroadcastChannel - Web APIs
ext of a given origin can subscribe to. it allows communication between different documents (in different windows, tabs, frames or iframes) of the same origin. messages are broadcasted via a message event fired at all broadcastchannel objects listening to the channel. note: this feature is available in web workers. ...
...le in web workers. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/broadcastchannel" target="_top"><rect x="151" y=...
...x" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/broadcastchannel" target="_top"><rect x="151" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="231" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">broadcastchannel</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor broadcastchannel() creates an object linking to the nam...
CSSPrimitiveValue - Web APIs
e.) percentage values can't be converted since they are relative to the parent value (or another property value). there is one exception for color percentage values: since a color percentage value is relative to the range 0-255, a color percentage value can be converted to a number (see also the rgbcolor interface). ...
... rgbcolor interface). ...
...="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/cssvalue" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssvalue</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#d4dde4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/cssprimitivevalue" target="_top"><rect x="121" y="1" wid...
... cssprimitivevalue.primitivetype read only an unsigned short represent...
CSSValueList - Web APIs
es the abstraction of an ordered collection of css values. some properties allow an empty list in their syntax. in that case, these properties take the none identifier. so, an empty list means that the property has the value none. the items in the cssvaluelist are accessible via an integral index, starting from 0. ...
...dex, starting from 0. ...
...="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/cssvalue" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssvalue</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#d4dde4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/cssvaluelist" target="_top"><rect x="121" y="1" width="1...
... cssvaluelist.lengthread only an unsigned long representing the number of c...
CSS Painting API - Web APIs
tes an image where a css property expects a file. access this interface through css.paintworklet. paintworkletglobalscope the global execution context of the paintworklet. paintrenderingcontext2d implements a subset of the canvasrenderingcontext2d api. it has an output bitmap that is the size of the object it is rendering to. paintsize returns the read-only values of the output bitmap's width and height. dictionaries paintrenderingcontext2dsettings a dictionary providing a subset of canvasrenderingcontext2d settings. examples to draw directly into an element's background using javascript in our css, we define a paint worklet using the registerpaint() function, tell the document to include the worklet using the paintworklet addmodule() method, then include the image we created...
... create our paintworklet called 'hollowhighlights' using the registerpaint() function: registerpaint('hollowhighlights', class { static get inputproperties() { return ['--boxcolor']; } static get inputarguments() { return ['*','<length>']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props, args) { const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; const thecolor = props.get( '--boxcolor' ); const stroketype = args[0].tostring(); const strokewidth = parseint(args[1]); console.log(thecolor); if ( strokewidth ) { ctx.linewidth = strokewidth; } else { ctx.linewidth = 1.0; } if ( stroketype === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.strokes...
...inewidth = strokewidth; } else { ctx.linewidth = 1.0; } if ( stroketype === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.strokestyle = thecolor; } else if ( stroketype === 'filled' ) { ctx.fillstyle = thecolor; ctx.strokestyle = thecolor; } else { ctx.fillstyle = 'none'; ctx.strokestyle = 'none'; } ctx.beginpath(); ctx.moveto( x, y ); ctx.lineto( blockwidth, y ); ctx.lineto( blockwidth + blockheight, blockheight ); ctx.lineto( x, blockheight ); ctx.lineto( x, y ); ctx.closepath(); ctx.fill(); ctx.stroke(); for (let i = 0; i < 4; i++) { let start = i * 2; ctx.beginpath(); ctx.moveto( blockwidth + (start * 10) + 10, y); ctx.lineto( blockwidth + (start * 10) + 20, y); ctx.lineto( blockwidth + (start * 10) + 20 + blockhei...
...height, blockheight ); ctx.lineto( x, blockheight ); ctx.lineto( x, y ); ctx.closepath(); ctx.fill(); ctx.stroke(); for (let i = 0; i < 4; i++) { let start = i * 2; ctx.beginpath(); ctx.moveto( blockwidth + (start * 10) + 10, y); ctx.lineto( blockwidth + (start * 10) + 20, y); ctx.lineto( blockwidth + (start * 10) + 20 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10, y); ctx.closepath(); ctx.fill(); ctx.stroke(); } } }); we then include the paintworklet: <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item ...
CanvasRenderingContext2D.addHitRegion() - Web APIs
ing the addhitregion method this example demonstrates the addhitregion() method. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); canvas.addeventlistener('mousemove', function(event) { if(event.region) { alert('ouch, my eye :('); } }); ctx.beginpath(); ctx.arc(100, 100, 75, 0, 2 * math.pi); ctx.linewidth = 5; ctx.stroke(); // eyes ctx.beginpath(); ctx.arc(70, 80, 10, 0, 2 * math.pi); ctx.arc(130, 80, 10, 0, 2 * math.pi); ctx.fill(); ctx.addhitregion({id: "eyes"}); // mouth ctx.beginpath(); ctx.arc(100, 110, 50, 0, math.pi); ctx.stroke(); edit the code below to see your changes update live in the canvas. (if you don't see the full smiley, check the browser compatibility table to see if your cu...
...x.fill(); ctx.addhitregion({id: "eyes"}); // mouth ctx.beginpath(); ctx.arc(100, 110, 50, 0, math.pi); ctx.stroke(); edit the code below to see your changes update live in the canvas. ...
...eed to activate a preference.) playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <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:250px"> ctx.beginpath(); ctx.arc(100, 100, 75, 0, 2 * math.pi, false); ctx.linewidth = 5; ctx.stroke(); // eyes ctx.beginpath(); ctx.arc(70, 80, 10, 0, 2 * math.pi, false); ctx.arc(130, 80, 10, 0, 2 * math.pi, false); ctx.fill(); ctx.addhitregion({id: "eyes"}); // mouth ctx.beginpath(); ctx.arc(100, 110, 50, 0, math.pi, false); ctx.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("co...
...; // mouth ctx.beginpath(); ctx.arc(100, 110, 50, 0, math.pi, false); ctx.stroke();</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; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }); canvas.addeventlistener("mousemove", function(event){ if(event.region) { alert("ouch, my eye :("); } }); textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", d...
CanvasRenderingContext2D.clearRect() - Web APIs
the canvasrenderingcontext2d.clearrect() method of the canvas 2d api erases the pixels in a rectangular area by setting them to transparent black. note: be aware that clearrect() may cause unintended side effects if you're not using paths properly. make sure to call beginpath() before starting to draw new items after calling clearrect(). syntax void ctx.clearrect(x, y, width, height); the clearrect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)). the rectangle's corner is at (x, y), and its size is specified by width and 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.
...the clearrect() method then erases part of the canvas. ...
...e down, and negative are up. examples erasing the whole canvas this code snippet erases the entire canvas. this is commonly required at the start of each frame in an animation. the dimensions of the cleared area are set to equal the <canvas> element's width and height attributes. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.clearrect(0, 0, canvas.width, canvas.height); erasing part of a canvas this example draws a blue triangle on top of a yellowish background. the clearrect() method then erases part of the canvas. html <canvas id="canvas"></canvas> javascript the cleared area is rectangular in shape, with its top-left corner at (10, 10). the cleared area has a width of 120 and a height of 100. const canvas = document.getelementbyid('ca...
...en erases part of the canvas. html <canvas id="canvas"></canvas> javascript the cleared area is rectangular in shape, with its top-left corner at (10, 10). the cleared area has a width of 120 and a height of 100. ...
CanvasRenderingContext2D.lineJoin - Web APIs
and stroketext() methods. syntax ctx.linejoin = "bevel" || "round" || "miter"; options there are three possible values for this property: "round", "bevel", and "miter". the default is "miter". "round" rounds off the corners of a shape by filling an additional sector of disc centered at the common endpoint of connected segments. the radius for these rounded corners is equal to the line width. "bevel" fills an additional triangular area between the common endpoint of connected segments, and the separate outside rectangular corners of each segment. "miter" connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additional lozenge-shaped area. this setting is affected by the miterlimit property. default value. exam...
...to connect at a single point, with the effect of filling an additional lozenge-shaped area. this setting is affected by the miterlimit property. default value. examples changing the joins in a path this example applies rounded line joins to a path. ...
... canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.linewidth = 20; ctx.linejoin = 'round'; ctx.beginpath(); ctx.moveto(20, 20); ctx.lineto(190, 100); ctx.lineto(280, 20); ctx.lineto(280, 150); ctx.stroke(); result comparison of line joins the example below draws three different paths, demonstrating each of the three linejoin options. ...
...eto(20, 20); ctx.lineto(190, 100); ctx.lineto(280, 20); ctx.lineto(280, 150); ctx.stroke(); result comparison of line joins the example below draws three different paths, demonstrating each of the three linejoin options. ...
CanvasRenderingContext2D.textAlign - Web APIs
syntax ctx.textalign = "left" || "right" || "center" || "start" || "end"; options possible values: "left" the text is left-aligned. "right" the text is right-aligned. "center" the text is centered. ...
...at the normal end of the line (right-aligned for left-to-right locales, left-aligned for right-to-left locales). the default value is "start". examples general text alignment this example demonstrates the three "physical" values of the textalign property: "left", "center", and "right". ...
...les, left-aligned for right-to-left locales). the default value is "start". examples general text alignment this example demonstrates the three "physical" values of the textalign property: "left", "center", and "right". ...
...manually specified as "ltr", although this is also the default for english-language text. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '30px serif'; ctx.direction = 'ltr'; ctx.textalign = 'start'; ctx.filltext('start-aligned', 0, 50); ctx.textalign = 'end'; ctx.filltext('end-aligned', canvas.width, 120); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.textalign' in that specification. living standard ...
Detecting device orientation - Web APIs
y, web-enabled devices are capable of determining their orientation; that is, they can report data indicating changes to their orientation with relation to the pull of gravity. in particular, hand-held devices such as mobile phones can use this information to automatically rotate the display to remain upright, presenting a wide-screen view of the web content when the device is rotated so that its width is greater than its height. there are two javascript events that handle orientation information. the first one is the deviceorientationevent, which is sent when the accelerometer detects a change to the orientation of the device. by receiving and processing the data reported by these orientation events, it's possible to interactively respond to rotation and elevation changes caused by the user m...
... orientation example this example will work on any browser supporting the deviceorientation event and running on a device able to detect its orientation. ...
...tation. ...
...cc; border-radius: 10px; } .ball { position: absolute; top : 90px; left : 90px; width : 20px; height: 20px; background: green; border-radius: 100%; } now, if we move our device, the ball will move accordingly: var ball = document.queryselector('.ball'); var garden = document.queryselector('.garden'); var output = document.queryselector('.output'); var maxx = garden.clientwidth - ball.clientwidth; var maxy = garden.clientheight - ball.clientheight; function handleorientation(event) { var x = event.beta; // in degree in the range [-180,180] var y = event.gamma; // in degree in the range [-90,90] output.innerhtml = "beta : " + x + "\n"; output.innerhtml += "gamma: " + y + "\n"; // because we don't want to have the device upside down // we constrain the x...
EffectTiming.fill - Web APIs
Web › API › EffectTiming › fill
pretty simple. we have a <div> named "main" which is a container for the element we'll be animating, which is a <div> with the id "box". below that, another <div> serves as a button that will trigger the animation to begin. ...
...animating, which is a <div> with the id "box". below that, another <div> serves as a button that will trigger the animation to begin. ...
...imatebutton"> animate! ...
... sans-serif; } #text { width: 160px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 2em "lucida grande", "open sans", sans-serif; } while there's other css involved in this example, the part that really matters for our purposes is the css that styles the "box" element that we'll be animating. 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 both vertically and horizontally inside its container. note that there's no rotation appl...
Element.getAttributeNS() - Web APIs
n empty string for non-existent attributes, but it was not typically implemented this way since null makes more sense. the dom4 specification now says this method should return null for non-existent attributes. examples the following svg document reads the value of the foo attribute in a custom namespace. ...
...ull makes more sense. the dom4 specification now says this method should return null for non-existent attributes. examples the following svg document reads the value of the foo attribute in a custom namespace. ...
...014/test'; var circle = document.getelementbyid( 'target' ); console.log( 'attribute test:foo: "' + circle.getattributens( ns, 'foo' ) + '"' ); </script> </svg> in an html5 document the attribute has to be accessed with test:foo since namespaces are not supported. ...
...ute test:foo: "' + circle.getattributens( ns, 'foo' ) + '"' ); </script> </svg> in an html5 document the attribute has to be accessed with test:foo since namespaces are not supported. <!doctype html> <html> <body> <svg xmlns="http://www.w3.org/2000/svg" xmlns:test="http://www.example.com/2014/test" width="40" height="40"> <circle id="target" cx="12" cy="12" r="10" stroke="#444" stroke-width="2" fill="none" test:foo="foo value"/> </svg> <script type="text/javascript"> var ns = 'http://www.example.com/2014/test'; var circle = document.getelementbyid( 'target' ); console.log('attribute value: ' + circle.getattribute('test:foo')); </script> </body> </html> notes namespaces are only supported in xml documents. html5 documents have to use getattribute() instead. getattrib...
Element: overflow event - Web APIs
s for elements styled with overflow != visible). it is a proprietary event specific to gecko (firefox). ...
... bubbles yes cancelable yes interface uievent event 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(...
... ...
... ...
Element: underflow event - Web APIs
for which overflow is not set to visible. the counterpart overflow event is fired when overflow occurs. ...
... bubbles yes cancelable yes interface uievent event 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(...
... ...
... ...
ErrorEvent - Web APIs
the errorevent interface represents events providing information related to errors in scripts or in files. ...
...lated to errors in scripts or in files. ...
...facediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/errorevent" target="_top"><rect x="116" y="1" width="100"...
... errorevent.message read only is a domstring containing a human-readable err...
ExtendableEvent - Web APIs
owser should throw an invalidstateerror; note also that multiple calls will stack up, and the resulting promises will be added to the list of extend lifetime promises. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274.) this interface inherits from the event interface. ...
...from the event interface. ...
...tyle="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/extendableevent" target="_top"><rect x="116" y="1" width=...
...it is not available when it is a window, o...
File - Web APIs
Web › API › File
on an htmlcanvaselement. a file object is a specific kind of a blob, and can be used in any context that a blob can. in particular, filereader, url.createobjecturl(), createimagebitmap(), and xmlhttprequest.send() accept both blobs and files. see using files from web applications for more information and examples. ...
...information and examples. ...
...tyle="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/blob" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">blob</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/file" target="_top"><rect x="116" y="1" width="75" height=...
... instance properties file.prototype.lastmodified read only returns the last modif...
FileReader.readAsBinaryString() - Web APIs
e raw binary data from the file. note that this method was once removed from the file api specification, but re-introduced for backward compatibility. using filereader.readasarraybuffer() is recommended. syntax instanceoffilereader.readasbinarystring(blob); parameters blob the blob or file from which to read. ...
... the file. note that this method was once removed from the file api specification, but re-introduced for backward compatibility. using filereader.readasarraybuffer() is recommended. syntax instanceoffilereader.readasbinarystring(blob); parameters blob the blob or file from which to read. ...
.... note that this method was once removed from the file api specification, but re-introduced for backward compatibility. using filereader.readasarraybuffer() is recommended. syntax instanceoffilereader.readasbinarystring(blob); parameters blob the blob or file from which to read. ...
.... using filereader.readasarraybuffer() is recommended. syntax instanceoffilereader.readasbinarystring(blob); parameters blob the blob or file from which to read. example var canvas = document.createelement('canvas'); var height = 200; var width = 200; canvas.width = width; canvas.height = height; var ctx = canvas.getcontext('2d'); ctx.strokestyle = '#090'; ctx.beginpath(); ctx.arc(width/2, height/2, width/2 - width/10, 0, math.pi*2); ctx.stroke(); canvas.toblob(function (blob) { var reader = new filereader(); reader.onload = function () { console.log(reader.result); } reader.readasbinarystring(blob); }); specifications specification status comment file apithe definition of 'readasbinarystring' in that specification. working draft ...
GlobalEventHandlers.ontransitioncancel - Web APIs
ly 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. ...
...tyle 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. ...
...ct which makes the box's color and size change, and causes the box to rotate, while the mouse cursor hovers over it. ...
...mouse cursor hovers over it. .box { margin-left: 70px; margin-top: 30px; border-style: solid; border-width: 1px; display: block; width: 100px; height: 100px; background-color: #0000ff; color: #ffffff; padding: 20px; font: bold 1.6em "helvetica", "arial", sans-serif; -webkit-transition: width 2s, height 2s, background-color 2s, -webkit-transform 2s, color 2s; transition: width 2s, height 2s, background-color 2s, transform 2s, color 2s; } .box:hover { background-color: #ffcccc; color: #000000; width: 200px; height: 200px; -webkit-transform: rotate(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"...
HTMLCanvasElement.toDataURL() - Web APIs
if the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported. chrome also supports the image/webp type. ...
...ality is used. the default value is 0.92. other arguments are ignored. return value a domstring containing the requested data uri. exceptions securityerror the canvas's bitmap is not origin clean; at least some of its contents have or may have been loaded from a site other than the one from which the document itself was loaded. ...
...yle.display = 'none'; this.nextsibling.style.display = 'inline'; } function showgrayimg() { this.previoussibling.style.display = 'inline'; this.style.display = 'none'; } function removecolors() { var aimages = document.getelementsbyclassname('grayscale'), nimgslen = aimages.length, ocanvas = document.createelement('canvas'), octx = ocanvas.getcontext('2d'); for (var nwidth, nheight, oimgdata, ograyimg, npixel, apix, npixlen, nimgid = 0; nimgid < nimgslen; nimgid++) { ocolorimg = aimages[nimgid]; nwidth = ocolorimg.offsetwidth; nheight = ocolorimg.offsetheight; ocanvas.width = nwidth; ocanvas.height = nheight; octx.drawimage(ocolorimg, 0, 0); oimgdata = octx.getimagedata(0, 0, nwidth, nheight); apix = oimgdata.data; npixlen = apix...
... living standard no change since the latest snapshot, html5 html 5.1the definition of 'htmlcanvaselement.toda...
HTMLFormControlsCollection - Web APIs
e htmlformcontrolscollection interface represents a collection of html form control elements. it represents the lists returned by the htmlformelement interface's elements property and the htmlfieldsetelement interface's elements property. this interface replaces one method from htmlcollection, on which it is based. ...
...ch it is based. ...
...ay: 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/htmlcollection" target="_top"><rect x="1" y="1" width="140" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlcollection</text></a><polyline points="141,25 151,20 151,30 141,25" stroke="#d4dde4" fill="none"/><line x1="151" y1="25" x2="181" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmlformcontrolscollection" target="_top"><re...
...="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlcollection</text></a><polyline points="141,25 151,20 151,30 141,25" stroke="#d4dde4" fill="none"/><line x1="151" y1="25" x2="181" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmlformcontrolscollection" target="_top"><rect x="181" y="1" width="260" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="311" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlformcontrolscollection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface inherits the properties of its par...
HTMLMarqueeElement - Web APIs
the htmlmarqueeelement interface provides methods to manipulate <marquee> elements. it inherits properties and methods from the htmlelement interface. ...
... interface. <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/htmlmarqueeelement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmarqueeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlm...
...l between each scroll movement in milliseconds. the default value is 85. note that any value smaller than 60 is ignored and the value 60 is used instead, unless truespeed is true. htmlmarqueeelement.truespeed by default, scrolldelay values lower than 60 are ignored. if truespeed is true, then those values are not ignored. htmlmarqueeelement.vspace sets the vertical margin. htmlmarqueeelement.width sets the width in pixels or percentage value. event handlers htmlmarqueeelement.onbounce fires when the marquee has reached the end of its scroll position. it can only fire when the behavior attribute is set to alternate. htmlmarqueeelement.onfinish fires when the marquee has finished the amount of scrolling that is set by the loop attribute. it can only fire when the loop attribute is s...
... fires when the marquee starts scrolling. methods inherits methods from its parent, htmlelement. htmlmarqueeelement.start() starts scrolling of the marquee. htmlmarqueeelement.stop() stops scrolling of the marquee. examples <marquee>this text will scroll from right to left</marquee> <marquee direction="up">this text will scroll from bottom to top</marquee> <marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid"> <marquee behavior="alternate"> this text will bounce </marquee> </marquee> specifications specification status comment html living standardthe definition of 'htmlmarqueeelement' in that specification. living standard made obsolete in favor of css but define its expected behavior for backward co...
HTMLOptionsCollection - Web APIs
the htmloptionscollection interface represents a collection of <option> html elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items. this object is returned only by the options property of select. ...
...rty of select. ...
...ay: 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/htmlcollection" target="_top"><rect x="1" y="1" width="140" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlcollection</text></a><polyline points="141,25 151,20 151,30 141,25" stroke="#d4dde4" fill="none"/><line x1="151" y1="25" x2="181" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmloptionscollection" target="_top"><rect x=...
...xt x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlcollection</text></a><polyline points="141,25 151,20 151,30 141,25" stroke="#d4dde4" fill="none"/><line x1="151" y1="25" x2="181" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmloptionscollection" target="_top"><rect x="181" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="286" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmloptionscollection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties name type description leng...
HTMLVideoElement.videoHeight - Web APIs
the htmlvideoelement interface's read-only videoheight property indicates the intrinsic height of the video, expressed in css pixels. in simple terms, this is the height of the media in its natural size. see about intrinsic width and height for more details. syntax height = htmlvideoelement.videoheight; value an integer value specifying the intrinsic height of the video in css pixels. if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available. ...
... the media's clean aperture (the sub-rectangle centered within the media that matches the target aspect ratio). ...
...t for more details. syntax height = htmlvideoelement.videoheight; value an integer value specifying the intrinsic height of the video in css pixels. if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size information is yet available. about intrinsic width and height a user agent calculates the intrinsic width and height of the element's media by starting with the media's raw pixel width and height, then taking into account factors including: the media's aspect ratio. the media's clean aperture (the sub-rectangle centered within the media that matches the target aspect ratio). the target device's resolution. any other factors required by the media format. if the element is currently displaying ...
...eo> element. this can happen when the element switches from displaying the poster frame to displaying video content, or when the displayed video track changes. example this example creates a handler for the resize event that resizes the <video> element to match the intrinsic size of its contents. let v = document.getelementbyid("myvideo"); v.addeventlistener("resize", ev => { let w = v.videowidth; let h = v.videoheight; if (w && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero. this avoids applying invalid changes when there's no true information available yet for dimensions. specifications specification status comment html living standardthe de...
HashChangeEvent - Web APIs
the hashchangeevent interface represents events that fire when the fragment identifier of the url has changed. the fragment identifier is the part of the url that follows (and includes) the # symbol. ...
... includes) the # symbol. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/hashchangeevent" target="_top"><rect x="116" y="1" width=...
... hashchangeevent.newurl read only the new url to whi...
IDBDatabase - Web APIs
dexeddb always happens in the context of a transaction, representing interactions with data in the database. all objects in indexeddb — including object stores, indexes, and cursors — are tied to a particular transaction. thus, you cannot execute commands, access data, or open anything outside of a transaction. ...
...of a transaction. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/idbdatabase" target="_top"><rect x="151" y="1" w...
... idbdatabase.version read only ...
IDBRequest - Web APIs
is fired at the request (idbrequest.onsuccess). if an error occurs while performing the operation, the exception is made available through the result property and an error event is fired (idbrequest.onerror). the interface idbopendbrequest is derived from idbrequest. note: this feature is available in web workers. ...
...le in web workers. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/idbrequest" target="_top"><rect x="151" y="1" wi...
... idbrequest.error read only returns a domexception in the event of an unsuccessfu...
IDBTransaction - Web APIs
e within transactions. you use idbdatabase to start transactions, idbtransaction to set the mode of the transaction (e.g. is it readonly or readwrite), and you access an idbobjectstore to make a request. you can also use an idbtransaction object to abort transactions. note: this feature is available in web workers. ...
...le in web workers. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/idbtransaction" target="_top"><rect x="151" y="1...
...2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/idbtransaction" target="_top"><rect x="151" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbtransaction</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} transactions are started when the transaction is created, not when the fi...
ImageData() - Web APIs
the imagedata() constructor returns a newly instantiated imagedata object built from the typed array given and having the specified width and height. this constructor is the preferred way of creating such an object in a worker. syntax new imagedata(array, width [, height]); new imagedata(width, height); parameters array optional a uint8clampedarray containing the underlying pixel representation of the image. if no such array is given, an image with a transparent black rectangle of the specified width and height will be created. width an unsigned long representing the width of the image. height an unsigned long representing the height of the image. this value is optional if an array is given: the height will be inferred from the array's size and the given width. return value a n...
... be created. width an unsigned long representing the width of the image. height an unsigned long representing the height of the image. this value is optional if an array is given: the height will be inferred from the array's size and the given width. return value a new imagedata object. errors thrown indexsizeerror thrown if array is specified, but its length is not a multiple of (4 * width) or (4 * width * height). examples creating a blank imagedata object this example creates an imagedata object that is 200 pixels wide and 100 pixels tall, containing a total of 20,000 pixels. ...
...turn value a new imagedata object. errors thrown indexsizeerror thrown if array is specified, but its length is not a multiple of (4 * width) or (4 * width * height). examples creating a blank imagedata object this example creates an imagedata object that is 200 pixels wide and 100 pixels tall, containing a total of 20,000 pixels. let imagedata = new imagedata(200, 100); // imagedata { width: 200, height: 100, data: uint8clampedarray[80000] } initializing imagedata with an array this example instantiates an imagedata object with pixel colors defined by an array. ...
... 100); // imagedata { width: 200, height: 100, data: uint8clampedarray[80000] } initializing imagedata with an array this example instantiates an imagedata object with pixel colors defined by an array. html <canvas id="canvas"></canvas> javascript the array (arr) has a length of 40000: it consists of 10,000 pixels, each of which is defined by 4 values. the imagedata constructor specifies a width of 200 for the new object, so its height defaults to 10,000 divided by 200, which is 50. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const arr = new uint8clampedarray(40000); // iterate through every pixel for (let i = 0; i < arr.length; i += 4) { arr[i + 0] = 0; // r value arr[i + 1] = 190; // g value arr[i + 2] = 0; // b value arr[i + ...
Timing element visibility with the Intersection Observer API - Web APIs
e 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); grid-template-rows: auto minmax(min-content, 1fr); max-width: 700px; margin: 0 auto; background-color: aliceblue; } the site's <body> is configured here to use one of a number of common sans-serif fonts, and to use "aliceblue" as the background color. then the "wrapper" class is defined; it wraps the entire blog, including the header, sidebar, and body content (articles and ads). the wrapper establishes a css grid with two columns and two rows. the f...
...lue" as the background color. then the "wrapper" class is defined; it wraps the entire blog, including the header, sidebar, and body content (articles and ads). the wrapper establishes a css grid with two columns and two rows. ...
... the header the header is fairly simple, since for this example all it contains is some text. ...
...h float atop the blue background, with a small margin around the article. every article which isn't the last item in the container has an 8px bottom margin to space things apart. ads finally, the ads have the following initial styling. individual ads may customize the style somewhat, as we'll see later. .ad { height: 96px; padding: 6px; border-color: #555; border-style: solid; border-width: 1px; } .ad:not(:last-child) { margin-bottom: 8px; } .ad h2 { margin-top: 0; } .ad div { position: relative; float: right; padding: 0 4px; height: 20px; width: 120px; font-size: 14px; bottom: 30px; border: 1px solid black; background-color: rgba(255, 255, 255, 0.5); } there's nothing magic in here. it's fairly basic css. tying it together with javascript that brings us...
MediaKeyMessageEvent - Web APIs
the mediakeymessageevent interface of the encryptedmediaextensions api contains the content and related data when the content decryption module generates a message for the session. ...
...message for the session. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediakeymessageevent" target="_top"><rect x="116" y="1" w...
... properties inherits properties from its ...
MediaKeySession.onkeystatuseschange - Web APIs
the onkeystatuseschange property of the mediakeysession is an event handler, fired whenever a keystatuschange event ocurrs, denoting there has been a change in the keys or their statuses within a session. this interface inherits from the extendableevent interface. ...
...bleevent interface. ...
...isplay: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 60" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediakeysession" target="_top"><rect x="151" y="...
...px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediakeysession" target="_top"><rect x="151" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">mediakeysession</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} syntax mediakeysession.onkeystatuseschange = function(keystatuschange) ...
MediaKeySession.onmessage - Web APIs
the onmessage property of the mediakeysession is an event handler, fired whenever a mediakeymessageevent occurs, denoting a message is generated by the content decryption module. this interface inherits from the extendableevent interface. ...
...bleevent interface. ...
...isplay: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-20 0 700 60" 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediakeysession" target="_top"><rect x="151" y="...
...px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediakeysession" target="_top"><rect x="151" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">mediakeysession</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} syntax mediakeysession.onmessage = function(mediakeymessageevent) { ...
MediaSource - Web APIs
the mediasource interface of the media source extensions api represents a source of media data for an htmlmediaelement object. a mediasource object can be attached to a htmlmediaelement to be played in the user agent. ...
...in the user agent. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediasource" target="_top"><rect x="151" y="1" w...
... properties mediasourc...
MediaStreamConstraints.audio - Web APIs
e an audio track, but we don't care about any specifics beyond that. ...
...ecifics beyond that. ...
... a set of constraints based on the mediatrackconstraints dictionary: html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <audio id="audio" autoplay controls></audio><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } audio { margin-top: 20px; border: 1px solid black; width: 160px; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; ...
...as long as an audio input device is available and the user allows it to be used, an audio track will be included in the resulting stream, and it will match the specified constraints as well as possible. result specifications specification status comment media capture and streamsthe definition of 'mediastreamconstraints.audio' in that specification...
MediaStreamTrackEvent - Web APIs
the mediastreamtrackevent interface represents events which indicate that a mediastream has had tracks added to or removed from the stream through calls to media stream api methods. these events are sent to the stream when these changes occur. ...
...hen these changes occur. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediastreamtrackevent" target="_top"><rect x="116" y="1" ...
...="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediastreamtrackevent" target="_top"><rect x="116" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">mediastreamtrackevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} the events based on this interface are addtrack and removetrack p...
Using the Media Capabilities API - Web APIs
a media decoding configuration. there are very specific ways to go about creating the configuration defined by the mediadecodingconfiguration dictionary. in our example, we are testing the decoding capabilities of a video configuration. the configuration requires the type of media being tested — e.g. a plain file or mediasource — and a videoconfiguration including values for the contenttype, width, height, bitrate, and framerate: the contenttype must be a string specifying a valid video mime type. the width and height are the horizontal and vertical dimensions of the video; these are also used to determine the aspect ratio. the bitrate is the number of bits used to encode one second of video. the framerate is the number of frames which are played per second of time when playing the v...
... and height are the horizontal and vertical dimensions of the video; these are also used to determine the aspect ratio. the bitrate is the number of bits used to encode one second of video. the framerate is the number of frames which are played per second of time when playing the video. ...
...rm> <ul id="results"></ul> javascript let mc = { videoconfiguration : new object(), tryit: function () { mc.createconfiguration(); mc.testit(); }, createconfiguration: function () { var size = document.getelementbyid('size').value.split('x'); mc.videoconfiguration = { type: 'file', video: { contenttype: document.getelementbyid('codec').value, width: size[0], height: size[1], bitrate: document.getelementbyid('bitrate').value, framerate: document.getelementbyid('framerate').value, } } }, testit: function () { let content = ''; navigator.mediacapabilities.decodinginfo(mc.videoconfiguration).then(result => { var li = document.createelement('li'), mcv = mc.videoconfiguration.video; ...
...' is ' : 'is not ') + ' supported, ' + (result.smooth ? ' is ' : ' is not ') + ' smooth, and' + (result.powerefficient ? ' is ' : ' is not ') + 'power efficient.'; var ul = document.getelementbyid("results") li.innerhtm...
MessageEvent - Web APIs
stmessage()) and broadcastchannel.onmessage). webrtc data channels (see rtcdatachannel.onmessage). the action triggered by this event is defined in a function set as the event handler for the relevant message event (e.g. using an onmessage handler as listed above). note: this feature is available in web workers. ...
...vailable in web workers. ...
...yle="display: inline-block; position: relative; width: 100%; padding-bottom: 13.333333333333334%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 80" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/messageevent" target="_top"><rect x="116" y="1" width="12...
... properties this interface also inherits properties from its parent, event. ...
Node - Web APIs
Web › API › Node
in some cases, a particular feature of the base node interface may not apply to one of its child interfaces; in that case, the inheriting node may return null or throw an exception, depending on circumstances. for example, attempting to add children to a node type that cannot have children will throw an exception. ...
...hrow an exception. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top"><rect x="151" y="1" width="7...
... node.baseuriread only returns a dom...
PageTransitionEvent - Web APIs
the pagetransitionevent event object is available inside handler functions for the pageshow and pagehide events, fired when a document is being loaded or unloaded. ...
...a document is being loaded or unloaded. ...
...facediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/pagetransitionevent" target="_top"><rect x="116" y="1" wi...
... pagetransitionevent.persisted read only indicates ...
PannerNode.distanceModel - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
PannerNode.maxDistance - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
PannerNode.panningModel - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
PannerNode.setOrientation() - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
PannerNode.setPosition() - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
PannerNode.setVelocity() - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
PannerNode - Web APIs
walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...m box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
... feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
...renttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.currenttime); listener.positiony.setvalueattime(ypos, audioctx.currenttime); listener.positionz.setvalueattime(300, audioctx.currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + y...
PerformanceLongTaskTiming - Web APIs
the performancelongtasktiming interface of the the long tasks api reports instances of long tasks. ...
...f long tasks. ...
...: 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/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancelongtasktiming" target="_top"><r...
..."81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancelongtasktiming" target="_top"><rect x="201" y="1" width="250" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="326" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancelongtasktiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties performancelongtasktiming.attribution read only ...
PerformanceMark - Web APIs
performancemark is an abstract interface for performanceentry objects with an entrytype of "mark". entries of this type are created by calling performance.mark() to add a named domhighrestimestamp (the mark) to the browser's performance timeline. ...
...nce timeline. ...
...: 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/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancemark" target="_top"><rect x="201...
...><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancemark" target="_top"><rect x="201" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="276" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancemark</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but it extends the followin...
PerformanceMeasure - Web APIs
performancemeasure is an abstract interface for performanceentry objects with an entrytype of "measure". entries of this type are created by calling performance.measure() to add a named domhighrestimestamp (the measure) between two marks to the browser's performance timeline. ...
...nce timeline. ...
...: 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/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancemeasure" target="_top"><rect x="...
...ext x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancemeasure" target="_top"><rect x="201" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="291" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancemeasure</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but it extends the follo...
PerformanceNavigationTiming - Web APIs
the performancenavigationtiming interface provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. for example, this interface can be used to determine how much time it takes to load or unload a document. ...
...d a document. ...
...: 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/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancenavigationtiming" target="_top">...
...1" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancenavigationtiming" target="_top"><rect x="201" y="1" width="270" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="336" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancenavigationtiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface extends the following performance...
PerformancePaintTiming - Web APIs
paint" refers to conversion of the render tree to on-screen pixels. an application can register a performanceobserver for "paint" performance entry types and the observer can retrieve the times that paint events occur. use this information to help identify areas that take too long to provide a good user experience. ...
...r experience. ...
...: 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/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancepainttiming" target="_top"><rect...
... x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancepainttiming" target="_top"><rect x="201" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="311" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancepainttiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but it extends the f...
ProgressEvent - Web APIs
the progressevent interface represents events measuring progress of an underlying process, like an http request (for an xmlhttprequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). ...
...eo>, <style> or <link>). ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/progressevent" target="_top"><rect x="116" y="1" width="1...
... properties also inherits properties from its ...
PromiseRejectionEvent - Web APIs
the promiserejectionevent interface represents events which are sent to the global script context when javascript promises are rejected. these events are particularly useful for telemetry and debugging purposes. for details on promise rejection events, see promise rejection events in using promises. ...
...ise rejection events in using promises. ...
...facediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/promiserejectionevent" target="_top"><rect x="116" y="1" ...
...="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/promiserejectionevent" target="_top"><rect x="116" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">promiserejectionevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor promiserejectionevent() creates a promiserejection...
RTCDTMFSender - Web APIs
based communication clients to be connected to a public-switched telephone network (pstn) or other legacy telephone service, including extant voice over ip (voip) services. for that reason, dtmf can't be used between two webrtc-based devices, because there is no mechanism provided by webrtc for receiving dtmf codes. ...
...eiving dtmf codes. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/rtcdtmfsender" target="_top"><rect x="151" y="1"...
..."2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/rtcdtmfsender" target="_top"><rect x="151" y="1" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="216" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcdtmfsender</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties rtcdtmfsender.tonebuffer read only a domstring which cont...
RTCPeerConnection - Web APIs
the rtcpeerconnection interface represents a webrtc connection between the local computer and a remote peer. it provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. ...
... no longer needed. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/rtcpeerconnection" target="_top"><rect x="151" y...
..." /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/rtcpeerconnection" target="_top"><rect x="151" y="1" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="236" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcpeerconnection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructorrtcpeerconnection() the rtcpeerconnection() constructor re...
RadioNodeList - Web APIs
the radionodelist interface represents a collection of radio elements in a <form> or a <fieldset> element. ...
...a <fieldset> element. ...
...="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/nodelist" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">nodelist</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#d4dde4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/radionodelist" target="_top"><rect x="121" y="1" width="...
... radionodelist.value if the underlying element collection...
SVGMarkerElement - Web APIs
plement none methods void setorienttoangle(in svgangle angle) void setorienttoauto() properties svganimatedlength refx svganimatedlength refy svganimatedenumeration markerunits svganimatedlength markerwidth svganimatedlength markerheight svganimatedenumeration orienttype svganimatedangle orientangle constants svg_marker_orient_unknown = 0 svg_marker_orient_auto = 1 svg_marker_orient_angle = 2 svg_markerunits_unknown = ...
...nttype svganimatedangle orientangle constants svg_marker_orient_unknown = 0 svg_marker_orient_auto = 1 svg_marker_orient_angle = 2 svg_markerunits_unknown = 0 svg_markerunits_userspaceonuse = 1 svg_markerunits_strokewidth = 2 normative document svg 1.1 (2nd edition) constants orientation name value description svg_marker_orient_unknown 0 the marker orientation is not one of predefined ty...
... svg_markerunits_unknown 0 the marker unit type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_markerunits_userspaceonuse 1 attribute markerunits is 'userspaceonuse'. svg_markerunits_strokewidth 2 attribute markerunits is 'strokewidth'. properties this interface also inherits properties from its parent interface, svgelement, and implements properties from svgexternalresourcesrequired, svganimatedpreserveaspectratio, and svgstylable. name type description ...
...he given marker element. refy svganimatedlength corresponds to attribute refy on the given marker element. markerunits svganimatedenumeration corresponds to attribute markerunits on the given marker element. one of the marker unit types defined on this interface. markerwidth svganimatedlength corresponds to attribute markerwidth on the given marker element. markerheight svganimatedlength corresponds to attribute markerheight on the given marker element. orienttype svganimatedenumeration corresponds to attribute orient on the given marker element. on...
SourceBuffer - Web APIs
the sourcebuffer interface represents a chunk of media to be passed into an htmlmediaelement and played, via a mediasource object. this can be made up of one or several media segments. ...
...al media segments. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/sourcebuffer" target="_top"><rect x="151" y="1" ...
...="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/sourcebuffer" target="_top"><rect x="151" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">sourcebuffer</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties sourcebuffer.appendwindowend controls the timestamp for the ...
SourceBufferList - Web APIs
ner list for multiple sourcebuffer objects. the source buffer list containing the sourcebuffers appended to a particular mediasource can be retrieved using the mediasource.sourcebuffers property. the individual source buffers can be accessed using array operator (i.e. []) or functions such as foreach() for example. ...
...ach() for example. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/sourcebufferlist" target="_top"><rect x="151" y=...
...x" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/sourcebufferlist" target="_top"><rect x="151" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="231" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">sourcebufferlist</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties sourcebufferlist.length read only returns the number of...
StaticRange - Web APIs
taticrange interface extends abstractrange to provide a method to specify a range of content in the dom whose contents don't update to reflect changes which occur within the dom tree. it offers the same set of properties and methods as abstractrange. abstractrange and staticrange are not available from web workers. ...
...rom web workers. ...
...lay: 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/abstractrange" target="_top"><rect x="1" y="1" width="130" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">abstractrange</text></a><polyline points="131,25 141,20 141,30 131,25" stroke="#d4dde4" fill="none"/><line x1="141" y1="25" x2="171" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/staticrange" target="_top"><rect x="171" y="1"...
..."2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">abstractrange</text></a><polyline points="131,25 141,20 141,30 131,25" stroke="#d4dde4" fill="none"/><line x1="141" y1="25" x2="171" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/staticrange" target="_top"><rect x="171" y="1" width="110" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">staticrange</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor staticrange() creates a new staticrange object given the sta...
StorageEvent - Web APIs
a storageevent is sent to a window when a storage area it has access to is changed within the context of another document. ...
...ext of another document. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/storageevent" target="_top"><rect x="116" y="1" width="12...
...family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/storageevent" target="_top"><rect x="116" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="176" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">storageevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} method overview void initstorageevent( in domstring type, in boolean canbubble, in boolean cancelable, in domstring key, in dom...
TaskAttributionTiming - Web APIs
the taskattributiontiming interface of the long tasks api returns information about the work involved in a long task and its associate frame context. the frame context, also called the container, is the iframe, embed or object that is being implicated, on the whole, for a long task. ...
... a long task. ...
...: 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/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/taskattributiontiming" target="_top"><rect ...
... x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/taskattributiontiming" target="_top"><rect x="201" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="306" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">taskattributiontiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties taskattributiontiming.containertype read only retu...
TimeEvent - Web APIs
Web › API › TimeEvent
the timeevent interface, a part of svg smil animation, provides specific contextual information associated with time events. ...
...ciated with time events. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/timeevent" target="_top"><rect x="116" y="1" width="90" h...
...ont-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/timeevent" target="_top"><rect x="116" y="1" width="90" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="161" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">timeevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties timeevent.detail read only is a long that specifies some detail information about the event, depending on the type of the eve...
UIEvent - Web APIs
Web › API › UIEvent
event. although the uievent.inituievent() method is kept for backward compatibility, you should create a uievent object using the uievent() constructor. several interfaces are direct or indirect descendants of this one: mouseevent, touchevent, focusevent, keyboardevent, wheelevent, inputevent, and compositionevent. ...
...t, and compositionevent. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/uievent" target="_top"><rect x="116" y="1" width="75" hei...
... properties this interface also inherits properties of its parent, event. uievent.c...
WebGLContextEvent - Web APIs
the webcontextevent interface is part of the webgl api and is an interface for an event that is generated in response to a status change to the webgl rendering context. inheritance this interface inherits properties and methods from its parent interface, event. ...
...arent interface, event. ...
...yle="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/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/webglcontextevent" target="_top"><rect x="116" y="1" widt...
... webglcontextevent.statusmessage a read-only prop...
WebGLRenderingContext.viewport() - Web APIs
the webglrenderingcontext.viewport() method of the webgl api sets the viewport, which specifies the affine transformation of x and y from normalized device coordinates to window coordinates. syntax void gl.viewport(x, y, width, height); parameters x a glint specifying the horizontal coordinate for the lower left corner of the viewport origin. default value: 0. y a glint specifying the vertical coordinate for the lower left corner of the viewport origin. default value: 0. width a non-negative glsizei specifying the width of the viewport. ...
... window coordinates. syntax void gl.viewport(x, y, width, height); parameters x a glint specifying the horizontal coordinate for the lower left corner of the viewport origin. default value: 0. y a glint specifying the vertical coordinate for the lower left corner of the viewport origin. default value: 0. width a non-negative glsizei specifying the width of the viewport. default value: width of the canvas. height a non-negative glsizei specifying the height of the viewport. default value: height of the canvas. return value none. errors thrown if either width or height is a negative value, a gl.invalid_value error is thrown. examples when you first create a webgl context, the size of the viewport will match the size of the canvas. however, if you resize the canvas, you will n...
...to get this range, you can use the max_viewport_dims constant, which returns an int32array. gl.getparameter(gl.max_viewport_dims); // e.g. int32array[16384, 16384] to get the current viewport, query the viewport constant. ...
...to get this range, you can use the max_viewport_dims constant, which returns an int32array. gl.getparameter(gl.max_viewport_dims); // e.g. int32array[16384, 16384] to get the current viewport, query the viewport constant. gl.getparameter(gl.viewport); // e.g. ...
A basic 2D WebGL animation example - Web APIs
oid main() { gl_fragcolor = uglobalcolor; } </script> this starts by specifying the precision of the float type, as required. then we set the global gl_fragcolor to the value of the uniform uglobalcolor, which is set by the javascript code to the color being used to draw the square. html the html consists solely of the <canvas> that we'll obtain a webgl context on. <canvas id="glcanvas" width="600" height="460"> oh no! your browser doesn't support canvas! </canvas> javascript globals and initialization first, the global variables. we won't discuss these here; instead, we'll talk about them as they're used in the code to come. let gl = null; let glcanvas = null; // aspect ratio and coordinate system // details let aspectratio; let currentrotation = [0, 1]; let currentscale = [1...
...dow.addeventlistener("load", startup, false); function startup() { glcanvas = document.getelementbyid("glcanvas"); gl = glcanvas.getcontext("webgl"); const shaderset = [ { type: gl.vertex_shader, id: "vertex-shader" }, { type: gl.fragment_shader, id: "fragment-shader" } ]; shaderprogram = buildshaderprogram(shaderset); aspectratio = glcanvas.width/glcanvas.height; currentrotation = [0, 1]; currentscale = [1.0, aspectratio]; vertexarray = new float32array([ -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5 ]); vertexbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, vertexbuffer); gl.bufferdata(gl.array_buffer, vertexarray, gl.static_draw); vertexnumcomponents = 2; vertexcount = vertex...
...am. each function has a type (one of gl.vertex_shader or gl.fragment_shader) and an id (the id of the <script> element containing the shader's code). the shader set is passed into the function buildshaderprogram(), which returns the compiled and linked shader program. we'll look at how this works next. once the shader program is built, we compute the aspect ratio of our context by dividing its width by its height. then we set the current rotation vector for the animation to [0, 1], and the scaling vector to [1.0, aspectratio]. the scaling vector, as we saw in the vertex shader, is used to scale the coordinates to fit the -1.0 to 1.0 range. the array of vertices is created next, as a float32array with six coordinates (three 2d vertices) per triangle to be drawn, for a total of 12 values. as...
...e correct shader type string into the message that gets generated. the actual error details are obtained by calling gl.getshaderinfolog(). finally, the compiled shader is returned to the caller (which is the buildshaderprogram() function. drawing and animating the scene the animatescene() function is called to render each animation frame. ...
Basic scissoring - Web APIs
sor test and establishing a rectangular mask. only when the webgl state has been satisfactorily tweaked, we execute the drawing command (in this case, clear()) that starts the processing of fragments down the graphics pipeline. ...
...ddeventlistener("load", function setupwebgl (evt) { "use strict" window.removeeventlistener(evt.type, setupwebgl, false); var paragraph = document.queryselector("p"); var canvas = document.queryselector("canvas"); // the following two lines set the size (in css pixels) of // the drawing buffer to be identical to the size of the // canvas html element, as determined by css. ...
...", function setupwebgl (evt) { "use strict" window.removeeventlistener(evt.type, setupwebgl, false); var paragraph = document.queryselector("p"); var canvas = document.queryselector("canvas"); // the following two lines set the size (in css pixels) of // the drawing buffer to be identical to the size of the // canvas html element, as determined by css. ...
... gl.enable(gl.scissor_test); gl.scissor(40, 20, 60, 130); // clear the drawing buffer solid yellow. ...
Hello vertex attributes - Web APIs
t to the shader using vertex attributes. hello world program in glsl how to send input to a shader program by saving data in gpu memory. <p>first encounter with attributes and sending data to gpu. ...
...ssfully. ...
...nkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl.points, 0, 1); document.queryselector("canvas").addeventlistener("click", function (evt) { var clickxrelativtocanvas = evt.pagex - evt.target.offsetleft; var clickxinwebglcoords = 2.0 * (clickxrelativtocanvas- gl.drawingbufferwidth/2) / gl.drawingbufferwidth; gl.bufferdata(gl.array_buffer, new float32array([clickxinwebglcoords]), gl.static_draw); gl.drawarrays(gl.points, 0, 1); }, false); } var buffer; function initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array([0.0]), gl.static_draw); gl.vertexat...
....array_buffer, new float32array([0.0]), gl.static_draw); gl.vertexattribpointer(0, 1, gl.float, false, 0, 0); } window.addeventlistener("beforeunload", cleanup, true); function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawi...
WebGL constants - Web APIs
the webgl api provides several constants that are passed into or returned by functions. all constants are of type glenum. standard webgl constants are installed on the webglrenderingcontext and webgl2renderingcontext objects, so that you use them as gl.constant_name: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl'); gl.getparameter(gl.line_width); some constants are also provided by webgl extensions. a list is provided below. var debuginfo = gl.getextension('webgl_debug_renderer_info'); var vendor = gl.getparameter(debuginfo.unmasked_vendor_webgl); the webgl tutorial has more information, examples, and resources on how to get started with webgl. table of contents standard webgl 1 constants standard webgl 2 constants webgl extension constants ...
...0cb passed to getparameter to get the current source alpha blend function. blend_color 0x8005 passed to getparameter to return a the current blend color. array_buffer_binding 0x8894 passed to getparameter to get the array buffer binding. element_array_buffer_binding 0x8895 passed to getparameter to get the current element array buffer. line_width 0x0b21 passed to getparameter to get the current linewidth (set by the linewidth method). aliased_point_size_range 0x846d passed to getparameter to get the current size of a point drawn with gl.points aliased_line_width_range 0x846e passed to getparameter to get the range of available widths for a line. returns a length-2 array with the lo value at 0, and hight...
... framebuffers and renderbuffers constant name value description framebuffer 0x8d40 renderbuffer 0x8d41 rgba4 0x8056 rgb5_a1 0x8057 rgb565 0x8d62 depth_component16 0x81a5 stencil_index8 0x8d48 depth_stencil 0x84f9 renderbuffer_width 0x8d42 renderbuffer_height 0x8d43 renderbuffer_internal_format 0x8d44 renderbuffer_red_size 0x8d50 renderbuffer_green_size 0x8d51 renderbuffer_blue_size 0x8d52 renderbuffer_alpha_size 0x8d53 renderbuffer_depth_size 0x8d54 renderbuffer_stencil_size 0x8d55 ...
... 0x8c43 sized (8-bit) srgb and alpha formats. framebuffer_attachment_color_encoding_ext 0x8210 returns the framebuffer color encoding. oes_standard_derivatives constant name value description fragment_shader_derivative_hint_oes 0x8b8b indicates the accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth. webgl_draw_buffers constant name value description color_attachment0_webgl 0x8ce0 framebuffer color attachment point color_attachment1_webgl 0x8ce1 framebuffer color attachment point color_attachment2_webgl 0x8ce2 framebuffer color attachment point color_attachment3_webgl 0x8ce3 framebuffer color attachment po...
WebGL model view projection - Web APIs
ct that will draw a 2d box on the screen. note: the code for each webglbox example is available in this github repo and is organized by section. in addition there is a jsfiddle link at the bottom of each section. ...
...2d box on the screen. note: the code for each webglbox example is available in this github repo and is organized by section. in addition there is a jsfiddle link at the bottom of each section. ...
...try at the edges becomes more and more distorted, equivalent to a wide angle lens. when the field of view is larger, the objects typically get smaller. when the field of view is smaller, then the camera can see less and less in the scene. the objects are distorted much less by perspective and objects seem much closer to the camera aspectratio the scene's aspect ratio, which is equivalent to its width divided by its height. in these examples, that's the window's width divided by the window height. the introduction of this parameter finally solves the problem wherein the model gets warped as the canvas is resized and reshaped. nearclippingplanedistance a positive number indicating the distance into the screen to a plane which is perpendicular to the floor, nearer than which everything gets cl...
...kept reasonably close to the distance of the geometry in order to avoid precision errors creeping in while rendering. in the latest version of the box demo, the computesimpleprojectionmatrix() method has been replaced with the computeperspectivematrix() method. ...
Movement, orientation, and motion: A WebXR example - Web APIs
then...
...then we pass the object's reference space into the applyviewercontrols() function, which returns a revis...
...then we pass the object's reference space into the applyviewercontrols() function, which returns a revised xrreferencespa...
... scenario in which the views for each eye are each rendered onto half of the webgl frame. the xr hardware then handles ensuring that each eye only sees the portion of that image that is intended for that eye. note: in this example, we're visually presenting the frame both on the xr device and on the screen. to ensure that the on-screen canvas is the right size to allow us to do this, we set its width to be equal to the individual xrview width multiplied by the number of views; the canvas height is always the same as the viewport's height. the two lines of code that adjust the canvas size are not needed in regular webxr rendering loops. applying the user inputs the applyviewercontrols() function, which is called by drawframe() before beginning to render anything, takes the offsets in each ...
Window.getComputedStyle() - Web APIs
nt 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 getcomputedstyle(), and print them into the text content of the <p>. ...
...::after { content: ' rocks!'; } </style> <h3>generated content</h3> <script> var h3 = document.queryselector('h3'); var result = getcomputedstyle(h3, ':after').content; console.log('the generated content is: ', result); // returns ' rocks!' </script> notes the returned cssstyledeclaration object contains active values for css property longhand names. for example, border-bottom-width instead of the border-width and border shorthand property names. it is safest to query values with only longhand names like font-size. shorthand names like font will not work with most browsers. css property values may be accessed using the getpropertyvalue(propname) api or by indexing directly into the object such as obj['z-index'] or obj.zindex. the values returned by getcomputedstyle are res...
...ghand names like font-size. shorthand names like font will not work with most browsers. css property values may be accessed using the getpropertyvalue(propname) api or by indexing directly into the object such as obj['z-index'] or obj.zindex. the values returned by getcomputedstyle are resolved values. these are usually the same as css 2.1’s computed values, but for some older properties like width, height, or padding, they are instead the same as used values. originally, css 2.0 defined the computed values as the "ready to be used" final values of properties after cascading and inheritance, but css 2.1 redefined them as pre-layout, and used values as post-layout. for css 2.0 properties, getcomputedstyle returns the old meaning of computed values, now called used values. an example differen...
...0 defined the computed values as the "ready to be used" final values of properties after cascading and inheritance, but css 2.1 redefined them as pre-layout, and used values as post-layout. for css 2.0 properties, getcomputedstyle returns the old meaning of computed values, now called used values. an example difference between pre- and post-layout values includes the resolution of percentages for width or height, as those will be replaced by their pixel equivalent only for used values. returned values are sometimes deliberately inaccurate. to avoid the “css history leak” security issue, browsers may lie about the computed styles for a visited link, returning values as if the user never visited the linked url. see plugging the css history leak and privacy-related changes coming to css :visi...
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. ...
...an xmlhttprequest. ...
...splay: 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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/xmlhttprequesteventtarget" target="_top"><rect x...
...t x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/xmlhttprequesteventtarget" target="_top"><rect x="151" y="1" width="250" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="276" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">xmlhttprequesteventtarget</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties xmlhttprequesteventtarget.onabort contains the ...
XRViewport - Web APIs
x read only the offset from the origin of the destination graphics surface (typically a xrwebgllayer) to the left edge of the viewport, in pixels. ...
... x read only the offset from the origin of the destination graphics surface (typically a xrwebgllayer) to the left edge of the viewport, in pixels. ...
...om left corner of the surface. usage notes currently, the only type of surface available is the xrwebgllayer. the precise orientation of the coordinate system may vary with other surface types, but in webgl, the origin (0, 0) is located at the bottom-left corner of the surface. thus the values specified in an xrviewport define a rectangle whose bottom-left corner is at (x, y) and which extends width pixels toward the left and height pixels upward. these values may be passed directly into the webglrenderingcontext.viewport() method: let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); example this example sets up an animation frame callback using requestanimationframe(). after initial setup, it iterates over each ...
...iews within the viewer's pose, configuring the viewport as dictated by the xrwebgllayer. xrsession.requestanimationframe((time, xrframe) => { let viewerpose = xrframe.getviewerpose(xrreferencespace); gl.bindframebuffer(xrwebgllayer.framebuffer); for (xrview of viewerpose.views) { let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); // now we can use webgl to draw into a viewport matching // the viewer's needs } }); specifications specification status comment webxr device apithe definition of 'xrviewport' in that specification. working draft initial definition. ...
Introduction to the CSS basic box model - CSS: Cascading Style Sheets
size, position, and properties (color, background, border size, etc.) of these boxes. every box is composed of four parts (or areas), defined by their respective edges: the content edge, padding edge, border edge, and margin edge. the content area, bounded by the content edge, contains the "real" content of the element, such as text, an image, or a video player. its dimensions are the content width (or content-box width) and the content height (or content-box height). it often has a background color or background image. if the box-sizing property is set to content-box (default) and if the element is a block element, the content area's size can be explicitly defined with the width, min-width, max-width, height, min-height, and max-height properties. the padding area, bounded by the padding...
...or or background image. if the box-sizing property is set to content-box (default) and if the element is a block element, the content area's size can be explicitly defined with the width, min-width, max-width, height, min-height, and max-height properties. the padding area, bounded by the padding edge, extends the content area to include the element's padding. its dimensions are the padding-box width and the padding-box height. the thickness of the padding is determined by the padding-top, padding-right, padding-bottom, padding-left, and shorthand padding properties. the border area, bounded by the border edge, extends the padding area to include the element's borders. its dimensions are the border-box width and the border-box height. the thickness of the borders are determined by the bord...
...d the padding-box height. the thickness of the padding is determined by the padding-top, padding-right, padding-bottom, padding-left, and shorthand padding properties. the border area, bounded by the border edge, extends the padding area to include the element's borders. its dimensions are the border-box width and the border-box height. the thickness of the borders are determined by the border-width and shorthand border properties. if the box-sizing property is set to border-box, the border area's size can be explicitly defined with the width, min-width, max-width, height, min-height, and max-height properties. when there is a background (background-color or background-image) set on a box, it extends to the outer edge of the border (i.e. extends underneath the border in z-ordering). this def...
...ackground-color or background-image) set on a box, it extends to the outer edge of the border (i.e. extends underneath the border in z-ordering). this default behavior can be altered with the background-clip css property. the margin area, bounded by the margin edge, extends the border area to include an empty area used to separate the element from its neighbors. its dimensions are the margin-box width and the margin-box height. the size of the margin area is determined by the margin-top, margin-right, margin-bottom, margin-left, and shorthand margin properties. when margin collapsing occurs, the margin area is not clearly defined since margins are shared between boxes. finally, note that for non-replaced inline elements, the amount of space taken up (the contribution to the height of the lin...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
ed within the items a different pattern for navigation would be to distribute the available space within the items themselves, rather than create space between them. in this case we would use the flex properties to allow items to grow and shrink in proportion to one another as described in controlling ratios of flex items along the main axis. ...
... split navigation another way to align items on the main axis is to use auto margins. this enables the design pattern of a navigation bar where one group of items are aligned left and another group aligned right. ...
... align the items on the cross axis to flex-start, and then set the .content flex item to flex: 1. as with our column layout card pattern above, using flex: 1 means this part of the card can grow. some things that you might want to try in this live example relate to the different ways you might want to constrain the media object in your design. to prevent the image growing too large, add a max-width to the image. as that side of the media object is using the initial values of flexbox it can shrink but not grow, and uses a flex-basis of auto. any width or max-width applied to the image will become the flex-basis. .image img { max-width: 100px; } you could also allow both sides to grow and shrink in proportion. if you set both sides to flex: 1, they will grow and shrink from a flex-basis ...
... you could also allow both sides to grow and shrink in proportion. if you set both sides to flex: 1, they will grow and shrink from a flex-basis of 0, so you will end up with two equal-sized columns. you could either take the content as a guide and set both to flex: auto, in which case they would grow and shrink from the size of the content or any size applied directly to the flex items such as a width on the image. .media .content { flex: 1; padding: 10px; } .image { flex: 1; } you could also give each side different flex-grow factors, for example setting the side with the image to flex: 1 and the content side to flex: 3. this will mean they use a flex-basis of 0 but distribute that space at different rates according to the flex-grow factor you have assigned. the flex properties we us...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
, or create a new column track in the implicit grid. as with implicit row tracks, these column tracks will be auto sized. you can control the size of implicit column tracks with grid-auto-columns, this works in the same way as grid-auto-rows. in this next example i have created a grid with three row tracks of 200 pixels height. i am auto-placing by column and the columns created will be a column width of 300 pixels, then a column width of 100 pixels until there are enough column tracks to hold all of the items. .wrapper { display: grid; grid-template-rows: repeat(3, 200px); grid-gap: 10px; grid-auto-flow: column; grid-auto-columns: 300px 100px; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6...
...landscape and some portrait images. i have set landscape images – with a class of landscape to span two column tracks. i then use grid-auto-flow: dense to create a densely packed grid. ...
...ked grid. ...
...currently we can’t do things like target every other cell of the grid with our items. a related issue may have already come to mind if you followed the last guide ab...
CSS Logical Properties and Values - CSS: Cascading Style Sheets
rtical dimension in vertical writing modes. for standard english text, it is the horizontal dimension. ...
...ion. ...
... 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-radius border-end-en...
...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 inline-start keywords) float (in...
Using CSS transforms - CSS: Cascading Style Sheets
ifferent distances. it also includes classes for the container box and the cube itself, as well as each of its faces. ...
...f, as well as each of its faces. ...
...spective: 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; transform: rotatey(180deg) translatez(50px); } .right { background:...
...pomr { perspective-origin: right; } .pobl { perspective-origin: bottom left; } .pobm { perspective-origin: bottom; } .pobr { perspective-origin: bottom right; } .po200200neg { 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; } /* de...
Mozilla CSS extensions - CSS: Cascading Style Sheets
line-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 version border-inline-start-style] -moz-border-start-width [superseded by the standard ve...
...dard 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 accepted] -moz-column-rule [prefixed version still accepted] -moz-column-rule-width ...
...d by the standard version margin-inline-end] -moz-margin-start [superseded by the standard version margin-inline-start] mask [applying to more than svg] o -moz-opacityobsolete since gecko 1.9.1 -moz-outlineobsolete since gecko 1.9.2 -moz-outline-colorobsolete since gecko 1.9.2 -moz-outline-offsetobsolete since gecko 1.9.2 -moz-outline-styleobsolete since gecko 1.9.2 -moz-outline-widthobsolete since gecko 1.9.2 p -moz-padding-end [superseded by the standard version padding-inline-start] -moz-padding-start [superseded by the standard version padding-inline-end] -moz-perspective [prefixed version still accepted] -moz-perspective-origin [prefixed version still accepted] pointer-events [applying to more than svg] t–u -moz-tab-size -moz-text-align-la...
...l -moz-simp-chinese-informal -moz-tamil -moz-telugu -moz-thai -moz-trad-chinese-formal -moz-trad-chinese-informal -moz-urdu overflow -moz-scrollbars-none -moz-scrollbars-horizontal -moz-scrollbars-vertical -moz-hidden-unscrollable text-align -moz-center -moz-left -moz-right text-decoration -moz-anchor-decoration -moz-user-select -moz-all -moz-none width, min-width, and max-width -moz-min-content -moz-fit-content -moz-max-content -moz-available pseudo-elements and pseudo-classes a – d ::-moz-anonymous-block eg@:- bug 331432 ::-moz-anonymous-positioned-block :-moz-any :-moz-any-link [matches :link and :visited] :-moz-broken ::-moz-canvas ::-moz-color-swatch ::-moz-cell-content :-moz-drag-over f – i :-moz-...
Cubic Bezier Generator - CSS: Cascading Style Sheets
<html> <canvas id="bezier" width="336" height="336"> </canvas> <form> <label for="x1">x1 = </label><input onchange="updatecanvas();" type="text" maxlength=6 id="x1" value="0.79" class='field'> <label for="y1">y1 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y1" value="0.33" class='field'> <label for="x2">x2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="x2" value="0.14" class='field'> <label for="y2">y2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y2" value="0.53" class='field'> <br> <output id="output">log</output> </form> </html> .field { width: 40px; } function updatecanvas() { var x1 = ...
...elementbyid('y1').value; var x2 = document.getelementbyid('x2').value; var y2 = document.getelementbyid('y2').value; drawbeziercurve(x1, y1, x2, y2); } const radius = 4; // place needed to draw the rulers const rulers = 30.5; const margin = 10.5; const basic_scale_size = 5; // size of 0.1 tick on the rulers var scaling; //limitation: scaling is computed once: if canvas.height/canvas.width change it won't be recalculated var dragsm = 0; // drag state machine: 0 = nodrag, others = object being dragged function initcanvas() { // get the canvas element using the dom 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 =...
...bject being dragged function initcanvas() { // get the canvas element using the dom 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'); scaling = math.min(canvas.height - rulers - margin, canvas.width - rulers - margin); canvas.onmousedown = mousedown; canvas.onmouseup = mouseup; } else { alert('you need safari or firefox 1.5+ to see this demo.'); } } function cx(x) { return x * scaling + rulers; } function reversex(x) { return (x - rulers) / scaling; } function lx(x) { //used when drawing vertical lines to prevent subpixel blur var result = ...
...t; } function drawbeziercurve(x1, y1, x2, y2) { // get the canvas element using the dom 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.strokestyle = "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)) { ...
animation - CSS: Cascading Style Sheets
Web › CSS › animation
iv> </div> </div> <div class="row"> <div class="cell"> <button class="pause" title="pause"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s slidein;</div> <div class="animation a3"></div> </div> </div> </div> </div> html,body { height: 100%; box-sizing: border-box; } pre { margin-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%3cstyle%3epath%20%7bdisplay%3ano...
...%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%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#restart'); } .grid { width: 100%; height: 100%; display: flex; background: #eee; font: 1em monospace; } .row { display: flex; flex: 1 auto; flex-direction: row; flex-wrap: wrap; justify-content: space-between; } .col { display: flex; flex: 1 auto; flex-direction: column; } .cell { box-sizing: border-box; margin: .5em; padding: 0; background-color: #fff; overflow: hidden; text-align: l...
...und: #fff3d4; padding: 1em; margin: .5em; font: .8em sans-serif; text-align: left; flex: none; } .overlay { padding: .5em; } @keyframes slidein { from { transform: scalex(0); } to { transform: scalex(1); } } .a1 { animation: 3s ease-in 1s 2 reverse both paused slidein; } .a2 { animation: 3s linear 1s slidein; } .a3 { animation: 3s slidein; } .animation { background: #3f87a6; width: 100%; height: calc(100% - 1.5em); transform-origin: left center; } window.addeventlistener('load', function () { var animation = array.from(document.queryselectorall('.animation')); var button = array.from(document.queryselectorall('button')); function togglebutton (btn, type) { btn.classlist.remove('play', 'pause', 'restart'); btn.classlist.add(type); btn.title = type...
...nteger>[, <step-position>]?)where <step-position> = jump-start | jump-end | jump-none | jump-both | start | end examples cylon eye <div class="view_port"> <div class="polling_message"> listening for dispatches </div> <div class="cylon_eye"></div> </div> .polling_message { color: white; float: left; margin-right: 2%; } .view_port { background-color: black; height: 25px; width: 100%; overflow: hidden; } .cylon_eye { background-color: red; background-image: linear-gradient(to right, rgba(0, 0, 0, .9) 25%, rgba(0, 0, 0, .1) 50%, rgba(0, 0, 0, .9) 75%); color: white; height: 100%; width: 20%; -webkit-animation: 4s linear 0s infinite alternate move_eye; animation: 4s linear 0s infinite alternate move_eye; } @-webkit-keyframes mo...
background-position - CSS: Cascading Style Sheets
e that is 25% from the left and 75% from the top will be placed at the spot of the container that is 25% from the container's left and 75% from the container's top. essentially what happens is the background image dimension is subtracted from the corresponding container dimension, and then a percentage of the resulting value is used as the direct offset from the left (or top) edge. ...
...from the left and 75% from the top will be placed at the spot of the container that is 25% from the container's left and 75% from the container's top. essentially what happens is the background image dimension is subtracted from the corresponding container dimension, and then a percentage of the resulting value is used as the direct offset from the left (or top) edge. ...
...a percentage position for that axis will have no effect because the "container-image difference" will be zero. you will need to offset using absolute values. formal definition initial value0% 0%applies toall elements. ...
... example, the star is in a different position. the third example illustrates how to specify positions for two different background images within one element. ...
conic-gradient() - CSS: Cascading Style Sheets
image represented by the conic gradient will not be accessible to screen reader users. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. ...
...overall purpose, it is better to describe it semantically in the document. ...
... background-image: conic-gradient(from 40deg, #fff, #000); } off-centered gradient div { width: 100px; height: 100px; } <div></div> div { background: conic-gradient(from 0deg at 0% 25%, blue, green, yellow 180deg); } gradient pie-chart this example uses multi-position color stops, with adjacent colors having the same color stop value, creating a striped effect. ...
...from 0deg at 0% 25%, blue, green, yellow 180deg); } gradient pie-chart this example uses multi-position color stops, with adjacent colors having the same color stop value, creating a striped effect. div { width: 100px; height: 100px; } <div></div> div { background: conic-gradient( red 36deg, orange 36deg 170deg, yellow 170deg); border-radius: 50% } checkerboard div { width: 100px; height: 100px; } <div></div> div { background: conic-gradient(#fff 0.25turn, #000 0.25turn 0.5turn, #fff 0.5turn 0.75turn, #000 0.75turn) top left / 25% 25% repeat; border: 1px solid; } more conic-gradient examples please see using css gradients for more examples. specifications specification status comment css images module level 4the...
<gradient> - CSS: Cascading Style Sheets
Web › CSS › gradient
ing colors, gradients are calculated in the alpha-premultiplied color space. this prevents unexpected shades of gray from appearing when both the color and the opacity are changing. (be aware that older browsers may not use this behavior when using the transparent keyword.) examples linear gradient example a simple linear gradient. ...
...ord.) examples linear gradient example a simple linear gradient. <div class="linear-gradient">linear gradient</div> div { width: 240px; height: 80px; } .linear-gradient { background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet); } radial gradient example a simple radial gradient. <div class="radial-gradient">radial gradient</div> div { width: 240px; height: 80px; } .radial-gradient { background: radial-gradient(red, yellow, rgb(30, 144, 255)); } repeating gradient examples simple repeating linear and radial gradient examples. ...
...div class="radial-gradient">radial gradient</div> div { width: 240px; height: 80px; } .radial-gradient { background: radial-gradient(red, yellow, rgb(30, 144, 255)); } repeating gradient examples simple repeating linear and radial gradient examples. <div class="linear-repeat">repeating linear gradient</div> <br> <div class="radial-repeat">repeating radial gradient</div> div { width: 240px; height: 80px; } .linear-repeat { background: repeating-linear-gradient(to top left, lightpink, lightpink 5px, white 5px, white 10px); } .radial-repeat { background: repeating-radial-gradient(powderblue, powderblue 8px, white 8px, white 16px); } conic gradient example a simple conic gradient example. note that this isn't supported widely across browser as of yet. <div ...
...ound: repeating-linear-gradient(to top left, lightpink, lightpink 5px, white 5px, white 10px); } .radial-repeat { background: repeating-radial-gradient(powderblue, powderblue 8px, white 8px, white 16px); } conic gradient example a simple conic gradient example. note that this isn't supported widely across browser as of yet. <div class="conic-gradient">conic gradient</div> div { width: 200px; height: 200px; } .conic-gradient { background: conic-gradient(lightpink, white, powderblue); } specifications specification status comment css images module level 4the definition of '<gradient>' in that specification. working draft adds conic-gradient css images module level 3the definition of '<gradient>' in that specification. can...
margin-bottom - CSS: Cascading Style Sheets
ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this property has no effect on non-replaced inline elements, such as <span> or <code>. syntax /* <length> values */ margin-bottom: 10px; /* an absolute length */ margin-bottom: 1em; /* relative to the text size */ margin-bottom: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-bottom: auto; /* global values */ margin-bottom: inherit; margin-bottom: initial; margin-bottom: unset; the margin-bottom property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, re...
...d values */ margin-bottom: auto; /* global values */ margin-bottom: inherit; margin-bottom: initial; margin-bottom: unset; the margin-bottom property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. ...
...percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable value to use. see margin. formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. ...
...g positive and negative bottom margins html <div class="container"> <div class="box0">box 0</div> <div class="box1">box 1</div> <div class="box2">box one's negative margin pulls me up</div> </div> css css for divs to set margin-bottom and height .box0 { margin-bottom:1em; height:3em; } .box1 { margin-bottom:-1.5em; height:4em; } .box2 { border:1px dashed black; border-width:1px 0; margin-bottom:2em; } some definitions for container and divs so margins' effects can be seen more clearly .container { background-color:orange; width:320px; border:1px solid black; } div { width:320px; background-color:gold; } result specifications specification status comment css basic box modelthe definition of 'margin-bottom' ...
margin-right - CSS: Cascading Style Sheets
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the vertical margins of two adjacent boxes may fuse. this is called margin collapsing. syntax /* <length> values */ margin-right: 20px; /* an absolute length */ margin-right: 1em; /* relative to the text size */ margin-right: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-right: auto; /* global values */ margin-right: inherit; margin-right: initial; margin-right: unset; the margin-right property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relativ...
...eyword values */ margin-right: auto; /* global values */ margin-right: inherit; margin-right: initial; margin-right: unset; the margin-right property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the right margin receives a share of the unused horizontal space, as determined mainly by the layout mode that is used. if the values of margin-left and margin-right are both auto, the calculated space is evenly distributed. this table summarizes the different cases: value of display value of float value of position computed value of auto ...
...(floating element) any table-*, except table-caption any any 0 internal table-* elements don't have margins, use border-spacing instead any, except flex, inline-flex, or table-* any fixed or absolute 0, except if both margin-left and margin-right are set to auto. in this case, it is set to the value centering the border area inside the available width, if fixed. absolutely positioned layout mode flex, inline-flex any any 0, except if there is any positive horizontal free space. in this case, it is evenly distributed to all horizontal auto margins. flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and ...
...0, except if there is any positive horizontal free space. in this case, it is evenly distributed to all horizontal auto margins. flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. ...
margin - CSS: Cascading Style Sheets
Web › CSS › margin
o the left and right. when three values are specified, the first margin applies to the top, the second to the right and left, the third to the bottom. when four values are specified, the margins apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable margin to use. for example, in certain cases this value can be used to center an element. formal syntax [ <length> | <percentage> | auto ]{1,4} examples simple example html <div class="center">this element is centered.</div> <div class="outside">this element is positioned outside of its container.</div> css .center { margi...
... the browser selects a suitable margin to use. for example, in certain cases this value can be used to center an element. ...
...ses this value can be used to center an element. ...
...n of 'margin' in that specification. recommendation initial definition. initial valueas each of the properties of the shorthand:margin-bottom: 0margin-left: 0margin-right: 0margin-top: 0applies toall elements, except elements with table display types other than table-caption, table and inline-table. ...
min-block-size - 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. ...
.../ min-block-size: 100px; min-block-size: 5em; /* <percentage> values */ min-block-size: 10%; /* keyword values */ min-block-size: max-content; min-block-size: min-content; min-block-size: fit-content(20em); /* global values */ min-block-size: inherit; min-block-size: initial; min-block-size: unset; if the writing mode is vertically oriented, the value of min-block-size relates to the minimum width of the element; otherwise, it relates to the minimum height of the element. a related property is min-inline-size, which defines the other dimension of the element. values the min-block-size property takes the same values as the min-width and min-height properties. formal definition initial value0applies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed v...
... otherwise, it relates to the minimum height of the element. a related property is min-inline-size, which defines the other dimension of the element. values the min-block-size property takes the same values as the min-width and min-height properties. ...
...nline-size, which defines the other dimension of the element. values the min-block-size property takes the same values as the min-width and min-height properties. formal definition initial value0applies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as min-width and min-heightanimation typea length, percentage or calc(); formal syntax <'min-width'> examples setting minimum block size for vertical text html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; min-block-size: 200px; } result specifications specification status comment css logical properties and values level 1the definition of 'min-block-size' in that specification. ed...
offset-path - CSS: Cascading Style Sheets
motion path that is identical to the <path> element in the svg. the path, as can be seen in the rendering of the svg code, is a line drawing of a house with a chimney. svg the top and bottom halves of the scissors would appear in the top left of the canvas were they not positioned along the starting point of the motion path defined by offset-path. ...
...wing of a house with a chimney. svg the top and bottom halves of the scissors would appear in the top left of the canvas were they not positioned along the starting point of the motion path defined by offset-path. ...
...3" fill="yellow" /> <polygon points="993,245 993,190 1086,190 1086,300" fill="red" /> <path id="house" d="m900,190 l993,245 v201 a11,11 0 0,1 1004,190 h1075 a11,11 0 0,1 1086,201 v300 l1294,423 h1216 a11,11 0 0,0 1205,434 v789 a11,11 0 0,1 1194,800 h606 a11,11 0 0,1 595,789 v434 a11,11 0 0,0 584,423 h506 l900,190" fill="none" stroke="black" stroke-width="13" stroke-linejoin="round" stroke-linecap="round" /> <path id="firstscissorhalf" class="scissorhalf" d="m30,0 h-10 a10,10 0 0,0 -20,10 a20,20 0 1,1 -40,-10 h20 a10,10 0 0,1 30,0 m-40,20 a10,10 1 0,0 -40,0 a10,10 1 0,0 -40,20 m0,0" transform="translate(0,0)" fill="green" stroke="black" stroke-width="5" stroke-linejoin="round" ...
...roke-width="5" stroke-linejoin="round" stroke-linecap="round" fill-rule="evenodd" /> <path id="secondscissorhalf" class="scissorhalf" d="m30,0 h-10 a10,10 0 0,1 -20,-10 a20,20 0 1,0 -40,10 h20 a10,10 0 0,0 30,0 m-40,-20 a10,10 1 0,0 -40,0 a10,10 1 0,0 -40,-20 m0,0" transform="translate(0,0)" fill="forestgreen" stroke="black" stroke-width="5" stroke-linejoin="round" stroke-linecap="round" fill-rule="evenodd" /> </svg> css .scissorhalf { offset-path: path('m900,190 l993,245 v201 a11,11 0 0,1 1004,190 h1075 a11,11 0 0,1 1086,201 v300 l1294,423 h1216 a11,11 0 0,0 1205,434 v789 a11,11 0 0,1 1194,800 h606 a11,11 0 0,1 595,789 v434 a11,11 0 0,0 584,423 h506 l900,190'); animation: followpath 4...
outline-style - CSS: Cascading Style Sheets
e-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 permits the user agent to render a custom outline style. 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. groove the outline looks as though it were carved into the page. ridge the opposite of groove: the outline looks...
...tyle [that] is either a user interface default for the platform, or perhaps a style that is richer than can be described in detail in css, e.g. a rounded edge outline with semi-translucent outer pixels that appears to glow. ...
...ine: auto" */ } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result setting outline style to dashed and dotted html <div> <div class="dotted"> <p class="dashed">outline demo</p> </div> </div> css .dotted { outline-style: dotted; /* same result as "outline: dotted" */ } .dashed { outline-style: dashed; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result setting outline style to solid and double html <div> <div class="solid"> <p class="double">outline demo</p> </div> </div> css .solid { outline-style: solid; } .double { outline-style: double; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result setting outline style to groove and ridge html <div> <div clas...
...utline-style: solid; } .double { outline-style: double; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result setting outline style to groove and ridge html <div> <div class="groove"> <p class="ridge">outline demo</p> </div> </div> css .groove { outline-style: groove; } .ridge { outline-style: ridge; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result setting outline style to inset and outset html <div> <div class="inset"> <p class="outset">outline demo</p> </div> </div> css .inset { outline-style: inset; } .outset { outline-style: outset; } /* to make the demo clearer */ * { outline-width: 10px; padding: 15px; } result specifications specification status comment ...
repeat() - CSS: Cascading Style Sheets
Web › CSS › repeat
es a share of the remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. auto-fill if the grid container has a definite or maximal size in the relevant axis, then the number of repetitions is the largest possible positive integer that does not cause the grid to overflow its grid container. treating each track as its maximal track sizing function (each independant value used to define grid-template-rows or grid-...
...function of 0px, and the gutters on either side of it collapse. for the purpose of finding the number of auto-repeated tracks, the user agent floors the track size to a user agent specified value (e.g., 1px), to avoid division by zero. examples specifying grid columns using repeat() html <div id="container"> <div> this item is 50 pixels wide. </div> <div> item with flexible width. ...
...number of auto-repeated tracks, the user agent floors the track size to a user agent specified value (e.g., 1px), to avoid division by zero. examples specifying grid columns using repeat() html <div id="container"> <div> this item is 50 pixels wide. </div> <div> item with flexible width. </div> <div> this item is 50 pixels wide. </div> <div> item with flexible width. </div> <div> inflexible item of 100 pixels width. ...
... this item is 50 pixels wide. </div> <div> item with flexible width. </div> <div> this item is 50 pixels wide. </div> <div> item with flexible width. </div> <div> inflexible item of 100 pixels width. </div> </div> css #container { display: grid; grid-template-columns: repeat(2, 50px 1fr) 100px; grid-gap: 5px; box-sizing: border-box; height: 200px; width: 100%; background-color: #8cffa0; padding: 10px; } #container > div { background-color: #8ca0ff; padding: 5px; } result specifications specification status comment css grid layoutthe definition of 'repeat()' in that specification. candidate recommendation initial definition ...
shape-margin - CSS: Cascading Style Sheets
tance between the edges of the shape (the float element) and the surrounding content. ...
...in: 10px; shape-margin: 20mm; /* <percentage> value */ shape-margin: 60%; /* global values */ shape-margin: inherit; shape-margin: initial; shape-margin: unset; values <length-percentage> sets the margin of the shape to a <length> value or to a <percentage> of the width of the element's containing block. ...
... candidate...
... candidate recommendation initial definition ...
tab-size - CSS: Cascading Style Sheets
Web › CSS › tab-size
must be nonnegative. ...
...must be nonnegative. ...
...must be nonnegative. ...
...must be nonnegative. ...
table-layout - CSS: Cascading Style Sheets
. 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 /* keyword values */ table-layout: auto; table-layout: fixed; /* global values */ table-layout: inherit; table-layout: initial; table-layout: unset; values auto by default, most browsers use an automatic table layout algorithm. the widths of the table and its cells are adjusted to fit the content. fixed table and column widths are set by the widths of table and col elements or by the width of the first row of cells. cells in subsequent rows do not affect column widths. under the "fixed" layout method, the entire table can be rendered once the first table row has been downloaded and analyzed. this can speed up rendering time ov...
...ths are set by the widths of table and col elements or by the width of the first row of cells. cells in subsequent rows do not affect column widths. under the "fixed" layout method, the entire table can be rendered once the first table row has been downloaded and analyzed. this can speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths provided. cells use the overflow property to determine whether to clip any overflowing content, but only if the table has a known width; otherwise, they won't overflow the cells. ...
... might not fit in the column widths provided. cells use the overflow property to determine whether to clip any overflowing content, but only if the table has a known width; otherwise, they won't overflow the cells. formal definition initial valueautoapplies totable and inline-table elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | fixed examples fixed-width tables with text-overflow this example uses a fixed table layout, combined with the width property, to restrict the table's width. the text-overflow property is used to apply an ellipsis to words that are too long to fit. if the table layout were auto, the table would grow to accomodate its contents, despite the specified width. html <table> <tr><td>ed</td><td>wood</td></tr> <tr><td>albert...
...ed to apply an ellipsis to words that are too long to fit. if the table layout were auto, the table would grow to accomodate its contents, despite the specified width. html <table> <tr><td>ed</td><td>wood</td></tr> <tr><td>albert</td><td>schweitzer</td></tr> <tr><td>jane</td><td>fonda</td></tr> <tr><td>william</td><td>shakespeare</td></tr> </table> css table { table-layout: fixed; width: 120px; border: 1px solid red; } td { border: 1px solid blue; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } result specifications specification status comment css level 2 (revision 1)the definition of 'table-layout' in that specification. recommendation initial definition. ...
matrix3d() - CSS: Cascading Style Sheets
reated from dom elements and transforms, which can be hovered/focused to apply a matrix3d() transform to it. ...
... css #example-element { width: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); margin: 50px auto; } #example-element:hover, #example-element:focus { transform: rotate3d(1, 1, 1, 30deg) matrix3d(1,0,0,0,0,1,6,0,0,0,1,0,50,100,0,1.1); } .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,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background:...
...lt matrix translation and scale example another transform3d() example, which implements an animated combined translate and scale. html <div class="foo"> lorem ipsum dolor sit amet, consectetur adipisicing elit. ...
...dolor sit amet, consectetur adipisicing elit. quos quaerat sit soluta, quisquam exercitationem delectus qui unde in facere necessitatibus aut quia porro dolorem nesciunt enim, at consequuntur aliquam esse? </div> css html { width: 100%; } body { height: 100vh; /* centering content */ display: flex; flex-flow: row wrap; justify-content: center; align-content: center; } .foo { width: 50%; padding: 1em; color: white; background: #ff8c66; border: 2px dashed black; text-align: center; font-family: system-ui, sans-serif; font-size: 14px; /* setting up animation for better demonstration */ animation: motionscale 2s alternate linear infinite; } @keyframes motionscale { from { /* identity matrix is used as basis here. the matrix below describes...
url() - CSS: Cascading Style Sheets
Web › CSS › url()
editor's draft c...
... editor's draft css values and units module level 3the definition of 'url()' in that sp...
... editor's draft css values and units module level 3the definition of 'url()' in that specification. candidate recommendation no significant...
... result data-uri html <div class="background"></div> css .background { height: 100vh; } .background { background: yellow; background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='90' height='45'%3e%3cpath d='m10 10h60' stroke='%2300f' stroke-width='5'/%3e%3cpath d='m10 20h60' stroke='%230f0' stroke-width='5'/%3e%3cpath d='m10 30h60' stroke='red' stroke-width='5'/%3e%3c/svg%3e"); } 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 (revision 1). css lev...
vertical-align - CSS: Cascading Style Sheets
ign:20%" src="https://udn.realityripple.com/samples/16/ed9c61c3b6.png"/> -100%:<img style="vertical-align:-100%" src="https://udn.realityripple.com/samples/16/ed9c61c3b6.png"/> </p> #* { box-sizing: border-box; } img { margin-right: 0.5em; } p { height: 3em; padding: 0 .5em; font-family: monospace; text-decoration: underline overline; margin-left: auto; margin-right: auto; width: 80%; } to vertically align the content of a cell in a table: <table> <tr> <td style="vertical-align: baseline">baseline</td> <td style="vertical-align: top">top</td> <td style="vertical-align: middle">middle</td> <td style="vertical-align: bottom">bottom</td> <td> <p>there is a theory which states that if ever anyone discovers exactly what the universe is fo...
... syntax /* keyword values */ vertical-align: baseline; vertical-align: sub; vertical-align: super; vertical-align: text-top; vertical-align: ...
...r to the line-height of the element itselfcomputed valuefor percentage and length values, the absolute length, otherwise the keyword as specifiedanimation typea length formal syntax baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length> examples basic example html <div>an <img src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a default alignment.</div> <div>an <img class="top" src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a text-top alignment.</div> <div>an <img class="bottom" src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a text-bottom alignment.</div> <div>an <...
... recommendation adds the <length> value an...
Cross-browser audio basics - Developer guides
ck written in a plugin technology such as adobe flash or microsoft silverlight. ...
...dio/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.onload = function(){ var myaudio = document.getelementbyid('my-audio'); var play = document.getelementbyid('play'); var pause = document.getelementbyid('pause'); var loading...
...fortunately this isn't too difficult to implement. first of all, we apply a quick update to the progress bar css to display the hand p...
... there are a couple of properties we haven't looked at yet, buffered and seekable. buffere...
Media buffering, seeking, and time ranges - Developer guides
ed.length; // returns 2 myaudio.buffered.start(0); // returns 0 myaudio.buffered.end(0); // returns 5 myaudio.buffered.start(1); // returns 15 myaudio.buffered.end(1); // returns 19 to try out and visualize buffered time ranges we can write a little bit of html: <p> <audio 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.fillstyle = 'lightgray'; context.fillrect(0, 0, mycanvas.width, mycanvas.height); context.fillstyle = 'red'; context...
...le bit of javascript: window.onload = function(){ var myaudio = document.getelementbyid('my-audio'); var mycanvas = document.getelementbyid('my-canvas'); var context = mycanvas.getcontext('2d'); context.fillstyle = 'lightgray'; context.fillrect(0, 0, mycanvas.width, mycanvas.height); context.fillstyle = 'red'; context.strokestyle = '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 = myaudio.buffered.end(i) * inc; var width = endx - startx; context.fillrect(startx, 0, width, mycanvas.height); context.rect(startx, 0, width, myca...
...html for our player looks like this: <audio id="my-audio" preload controls> <source src="music.mp3" type="audio/mpeg"> </audio> <div class="buffered"> <span id="buffered-amount"></span> </div> <div class="progress"> <span id="progress-amount"></span> </div> we'll use the following css to style the buffering display: .buffered { height: 20px; position: relative; background: #555; width: 300px; } #buffered-amount { display: block; height: 100%; background-color: #777; width: 0; } .progress { margin-top: -20px; height: 20px; position: relative; width: 300px; } #progress-amount { display: block; height: 100%; background-color: #595; width: 0; } and the following javascript provides our functionality: window.onload = function(){ var myaudio = documen...
...unction(){ 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 progress even...
Audio and video manipulation - Developer guides
and the output greyscale frames. ordinarily, if you were implementing a "play video in greyscale" feature, you'd probably add display: none to the style for the <video> element, to keep the source video from being drawn to the screen while showing only the canvas showing the altered frames. html we can set up our video player and <canvas> element like this: <video id="my-video" controls="true" width="480" height="270" crossorigin="anonymous"> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type="video/webm"> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type="video/mp4"> </video> <canvas id="my-canvas" width="480" height="270"></canvas> javascript this code handles altering the frames. var processor = { timercallback: function() { ...
...omputeframe(); var self = this; settimeout(function () { self.timercallback(); }, 16); // roughly 60 frames per second }, doload: function() { this.video = document.getelementbyid("my-video"); this.c1 = document.getelementbyid("my-canvas"); this.ctx1 = this.c1.getcontext("2d"); var self = this; this.video.addeventlistener("play", function() { self.width = self.video.width; self.height = self.video.height; self.timercallback(); }, false); }, computeframe: function() { this.ctx1.drawimage(this.video, 0, 0, this.width, this.height); var frame = this.ctx1.getimagedata(0, 0, this.width, this.height); var l = frame.data.length / 4; for (var i = 0; i < l; i++) { var grey = (frame.data[i * 4 + 0] + frame.data[...
... but not the pitch. to manipulate the audio's pitch you need to use the web audio api. see the audiobuffersourcenode.playbackrate property. ...
...javascript var context = new audiocontext(), audiosource = context.createmediaelementsource(document.getelementbyid("my-video")), filter = context.createbiquadfilter(); audiosource.connect(filter); filter.connect(context.destination); // configure filter filter.type = "lowshelf"; filter.frequency.value = 1000; filter.gain.value = 25; playable code <video id="my-video" controls="true" width="480" height="270" crossorigin="anonymous"> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type="video/webm"> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type="video/mp4"> </video> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class=...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
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 lets you set the color of the corresponding side of the element's border. border-block-start-color and border-block-end-color with these, you can set the color used to draw the bord...
...ple, using a <div> as a wrapper around the contents, which consists of two more <div>s, each styled differently with a single paragraph (<p>) in each box. the magic happens, as usual, in the css, where we'll apply colors define the layout for the html above. css we'll look at the css to create the above results a piece at a time, so we can review the interesting parts one by one. .wrapper { width: 620px; height: 110px; margin: 0; padding: 10px; border: 6px solid mediumturquoise; } the .wrapper class is used to assign styles to the <div> that encloses all of our other content. this establishes the size of the container using width and height as well as its margin and padding. of more interest to our discussion here is the use of the border property to establish a border around th...
...height as well as its margin and padding. of more interest to our discussion here is the use of the border property to establish a border around the outside edge of the element. this border is a solid line, 6 pixels wide, in the color mediumturquoise. our two colored boxes share a number of properties in common, so next we establish a class, .box, that defines those shared properties: .box { width: 290px; height: 100px; margin: 0; padding: 4px 6px; font: 28px "marker felt", "zapfino", cursive; display: flex; justify-content: center; align-items: center; } in brief, .box establishes the size of each box, as well as the configuration of the font used within. we also take advantage of css flexbox to easily center the contents of each box. we enable flex mode using display: flex...
...abel> element) and an empty paragraph element (<p>) into which we'll output some text from our javascript code. <div id="box"> <label for="colorpicker">border color:</label> <input type="color" value="#8888ff" id="colorpicker"> <p id="output"></p> </div> css the css simply establishes a size for the box and some basic styling for appearances. the border is also established with a 2-pixel width and a border color that won't last, courtesy of the javascript below... #box { width: 500px; height: 200px; border: 2px solid rgb(245, 220, 225); padding: 4px 6px; font: 16px "lucida grande", "helvetica", "arial", "sans-serif" } javascript the script here handles the task of updating the starting color of the border to match the color picker's value. then two event handlers are added...
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
Web › HTML › Element › canvas
include the global attributes. height the height of the coordinate space in css pixels. defaults to 150. moz-opaque lets the canvas know whether or not translucency will be a factor. if the canvas knows there's no translucency, painting performance can be optimized. this is only supported by mozilla-based browsers; use the standardized canvas.getcontext('2d', { alpha: false }) instead. width the width of the coordinate space in css pixels. defaults to 300. usage notes alternative content you may (and should) provide alternate content inside the <canvas> block. that content will be rendered both on older browsers that don't support canvas and in browsers with javascript disabled. providing a useful fallback text or sub dom helps to make the the canvas more accessible. required <...
...g unlike the <img> element, the <canvas> element requires the closing tag (</canvas>). sizing the canvas using css versus html the displayed size of the canvas can be changed using css, but if you do this the image is scaled during rendering to fit the styled size, which can make the final graphics rendering end up being distorted. ...
... by setting the width and height attributes directly on the <canvas> elements, either directly in the html or by using javascript. maximum canvas size the maximum size of a <canvas> element is very large, but the exact size depends on the browser. the following is some data we've collected from various tests and other sources (e.g. ...
...68,435,456 pixels (i.e., 16,384 x 16,384) ie 8,192 pixels 8,192 pixels ? note: exceeding the maximum dimensions or area renders the canvas unusable — drawing commands will not work. examples html this code snippet adds a canvas element to your html document. a fallback text is provided if a browser is unable to render the canvas, or if can't read a canvas. <canvas width="300" height="300"> an alternative text describing what your canvas displays. </canvas> javascript then in the javascript code, call htmlcanvaselement.getcontext() to get a drawing context and start drawing onto the canvas: const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 100, 100); result accessibility c...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
Web › HTML › Element › details
a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. an input device as well as some form of output device is recommended.</p> </details> this results in: customizing the appearance now let's apply some css to customize the appearance of the disclosure box. ...
... have some memory and ideally some kind of long-term storage. an input device as well as some form of output device is recommended.</p> </details> this results in: customizing the appearance now let's apply some css to customize the appearance of the disclosure box. 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; } 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 clicking the tab opens it to reveal its contents. html <details> <summary>system require...
...nge 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 that browser. ...
... 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 that browser. ...
<input type="range"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › range
e slider. values include horizontal, meaing the range is rendered horizontally, and vertical, where the range is rendered vertically. note: the following input attributes do not apply to the input range: accept, alt, checked, dirname, formaction, formenctype, formmethod, formnovalidate, formtarget, height, maxlength, minlength, multiple, pattern, placeholder, readonly, required, size, src, and width. any of these attributes, if included, will be ignored. examples while the number type lets users enter a number with optional constraints forcing their value to be between a minimum and a maximum value, it does require that they enter a specific value. the range input type lets you ask the user for a value in cases where the user may not even care—or know—what the specific numeric value s...
... but the <datalist> tag has to be styled with css as its display property is set to none by default, hiding the labels. change the orientation by default, if a browser renders a range input as a slider, it will render it so that the knob slides left and right. when supported, we will be able to make the range vertical, to slide up and down with css by declaring a height value greater than the width value. this is not actually implemented yet by any of the major browsers. (see firefox bug 981916, chrome bug 341071). it also, perhaps, may still be under discussion. in the meantime, we can make the range vertical by rotating it using using css transforms, or, by targeting each browser engine with their own method, which includes setting the appearance to slider-vertical, by using a non-standa...
...trol: <input type="range" id="volume" min="0" max="11" value="7" step="1"> screenshotlive sample this control is horizontal (at least on most if not all major browers; others might vary). standards according to the specification, making it vertical requires adding css to change the dimensions of the control so that it's taller than it is wide, like this: css #volume { height: 150px; width: 50px; } html <input type="range" id="volume" min="0" max="11" value="7" step="1"> result screenshotlive sample unfortunately, no major browsers currently support vertical range controls directly. transform: rotate(-90deg) you can, however, create a vertical range control by drawing a horizontal range control on its side. the easiest way is to use css: by applying a transform to rotate t...
...ge" min="0" max="11" value="7" step="1"> </div> css now we need some css. first is the css for the wrapper itself; this specifies the display mode and size we want so that the page lays out correctly; in essence, it's reserving an area of the page for the slider so that the rotated slider fits into the reserved space without making a mess of things. .slider-wrapper { display: inline-block; width: 20px; height: 150px; padding: 0; } then comes the style information for the <input> element within the reserved space: .slider-wrapper input { width: 150px; height: 20px; margin: 0; transform-origin: 75px 75px; transform: rotate(-90deg); } the size of the control is set to be 150 pixels long by 20 pixels tall. the margins are set to 0 and the transform-origin is shifted to the ...
<input type="tel"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › tel
de directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. size the size attribute is a numeric value indicating how many characters wide the input field should be. the value must be a number greater than zero, and the default value is 20. since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use). this does not set a limit on how many characters the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit o...
...elno">enter a telephone number (required): </label> <input id="telno" name="telno" type="tel" required> <span class="validity"></span> </div> <div> <button>submit</button> </div> </form> and let's include the following css to highlight valid entries with a checkmark and invalid entries with a cross: 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; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } the output looks like this: pattern validation if you want to further restrict entered numbers so they also have to conform to a ...
... look like this: <form> <div> <label for="telno">enter a telephone number (in the form xxx-xxx-xxxx): </label> <input id="telno" name="telno" type="tel" required pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"> <span class="validity"></span> </div> <div> <button>submit</button> </div> </form> 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; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } notice how the entered value is reported as invalid unless the pattern xxx-xxx-xxxx is matched; for instance, 41-323-421 won't be ...
...tee that the users would enter their numbers correctly. it makes you wonder if it is worth going to all this trouble on the client-side, when you could just let the user enter their number in whatever format they wanted on the client-side and then validate and sanitize it on the server. but this choice is yours to make. ...
Standard metadata names - HTML: Hypertext Markup Language
Web › HTML › Element › meta › name
urrent color scheme using the prefers-color-scheme css media feature. the css device adaptation specification defines the following metadata name: viewport: gives hints about the size of the initial size of the viewport. used by mobile devices only. values for the content of <meta name="viewport"> value possible subvalues description width a positive integer number, or the text device-width defines the pixel width of the viewport that you want the web site to be rendered at. height a positive integer, or the text device-height defines the height of the viewport. not used by any browser. initial-scale a positive number between 0.0 and 10.0 defines the ratio between the devi...
... maximum-scale a positive number between 0.0 and 10.0 defines the maximum amount to zoom in. it must be greater or equal to the minimum-scale or the behaviour is undefined. ...
... maximum-scale a positive number between 0.0 and 10.0 defines the maximum amount to zoom in. it must be greater or equal to the minimum-scale or the behaviour is undefined. browser settings can ignore this rule and ios10+ ignores it by default. ...
...ng noimageindex requests this page not to appear as the referring page of an indexed image. google nocache synonym of noarchive. bing notes: only cooperative robots follow these rules. do not expect to prevent e-mail harvesters with them. the robot still needs to access the page in order to read these rules. to prevent bandwidth consumption, use a robots.txt file. if you want to remove a page, noindex will work, but only after the robot visits the page again. ensure that the robots.txt file is not preventing revisits. some values are mutually exclusive, like index and noindex, or follow and nofollow. in these cases the robot's behaviour is undefined and may vary between them. some crawler robots, like google, ya...
Connection management in HTTP/1.x - HTTP
ed a single model to handle such connections. these connections were short-lived: a new one created each time a request needed sending, and closed once the answer had been received. this simple model held an innate limitation on performance: opening each tcp connection is a resource-consuming operation. several messages must be exchanged between the client and the server. network latency and bandwidth affect performance when a request needs sending. modern web pages require many requests (a dozen or more) to serve the amount of information needed, proving this earlier model inefficient. two newer models were created in http/1.1. the persistent-connection model keeps connections opened between successive requests, reducing the time needed to open new connections. the http pipelining model goes...
...allback to http/1.0). http pipelining http pipelining is not activated by default in modern browsers: buggy proxies are still common and these lead to strange and erratic behaviors that web developers cannot foresee and diagnose easily. pipelining is complex to implement correctly: the size of the resource being transferred, the effective rtt that will be used, as well as the effective bandwidth, have a direct incidence on the improvement provided by the pipeline. without knowing these, important messages may be delayed behind unimportant ones. the notion of important even evolves during page layout! http pipelining therefore brings a marginal improvement in most cases only. pipelining is subject to the hol problem. for these reasons, pipelining has been superseded by a better algorit...
...rings a marginal improvement in most cases only. pipelining is subject to the hol problem. for these reasons, pipelining has been superseded by a better algorithm, multiplexing, that is used by http/2. by default, http requests are issued sequentially. the next request is only issued once the response to the current request has been received. as they are affected by network latencies and bandwidth limitations, this can result in significant delay before the next request is seen by the server. pipelining is the process to send successive requests, over the same persistent connection, without waiting for the answer. this avoids latency of the connection. theoretically, performance could also be improved if two http requests were to be packed into the same tcp message. the typical mss (maxim...
...is no longer useful: the http/2 connection is able to handle parallel unprioritized requests very well. domain sharding is even detrimental to performance. most http/2 implementations use a technique called connection coalescing to revert eventual domain sharding. as an http/1.x connection is serializing requests, even without any ordering, it can't be optimal without large enough available bandwidth. as a solution, browsers open several connections to each domain, sending parallel requests. default was once 2 to 3 connections, but this has now increased to a more common use of 6 parallel connections. there is a risk of triggering dos protection on the server side if attempting more than this number. if the server wishes a faster web site or application response, it is possible for the serve...
Inheritance and the prototype chain - JavaScript
r g = new graph(); console.log(g.vertices); // print [4,4] g.vertices = 25; console.log(g.vertices); // print 25 delete g.vertices; console.log(g.vertices); // print undefined with the class keyword ecmascript 2015 introduced a new set of keywords implementing classes. the new keywords include class, constructor, static, extends, and super. ...
...// print [4,4] g.vertices = 25; console.log(g.vertices); // print 25 delete g.vertices; console.log(g.vertices); // print undefined with the class keyword ecmascript 2015 introduced a new set of keywords implementing classes. the new keywords include class, constructor, static, extends, and super. ...
... [4,4] g.vertices = 25; console.log(g.vertices); // print 25 delete g.vertices; console.log(g.vertices); // print undefined with the class keyword ecmascript 2015 introduced a new set of keywords implementing classes. the new keywords include class, constructor, static, extends, and super. ...
...ipt 2015 introduced a new set of keywords implementing classes. the new keywords include class, constructor, static, extends, and super. 'use strict'; class polygon { constructor(height, width) { this.height = height; this.width = width; } } class square extends polygon { constructor(sidelength) { super(sidelength, sidelength); } get area() { return this.height * this.width; } set sidelength(newlength) { this.height = newlength; this.width = newlength; } } var square = new square(2); performance the lookup time for properties that are high up on the prototype chain can have a negative impact on the performance, and this may be significant in the code where performance is critical. additionally, trying to access nonexistent properties will always tr...
BigInt.asIntN() - JavaScript
examples staying in 64-bit ranges the bigint.asintn() method can be useful to stay in the range of 64-bit arithmetic. ...
... examples staying in 64-bit ranges the bigint.asintn() method can be useful to stay in the range of 64-bit arithmetic. ...
... examples staying in 64-bit ranges the bigint.asintn() method can be useful to stay in the range of 64-bit arithmetic. ...
... examples staying in 64-bit ranges the bigint.asintn() method can be useful to stay in the range of 64-bit arithmetic. ...
BigInt.asUintN() - JavaScript
examples staying in 64-bit ranges the bigint.asuintn() method can be useful to stay in the range of 64-bit arithmetic. ...
... examples staying in 64-bit ranges the bigint.asuintn() method can be useful to stay in the range of 64-bit arithmetic. ...
... examples staying in 64-bit ranges the bigint.asuintn() method can be useful to stay in the range of 64-bit arithmetic. ...
... examples staying in 64-bit ranges the bigint.asuintn() method can be useful to stay in the range of 64-bit arithmetic. ...
MathML attribute reference - MathML
pecifying the action happening for this element. align <mtable> <munder>, <mover>, <munderover> <mstack> specifies different alignments 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...
...align <mtable>, <mtd>, <mtr>, <mlabeledtr> specifies the horizontal alignment of table cells. columnlines <mtable> specifies table column borders. columnspacing <mtable> specifies the space between table columns. columnspan <mtd> a non-negative integer value that indicates over how many table columns the cell extends. unimplemented columnwidth <mtable> specifies the width of table columns. unimplemented crossout <mscarry> specifies what kind of line is drawn to cross out carries. unimplemented decimalpoint <mstyle> if the decimalpoint value is used to specify the alignment, this attribute is specifying the character for the alignment point within <mstack> and <mtable> columns. denomalign ...
...move to sub- and superscript positions. notation <menclose> a list of notations, separated by white space, to apply to the child elements. numalign <mfrac> the alignment of the numerator over the fraction. open <mfenced> a string for the opening delimiter. unimplemented overflow <math> if an expression is too long to fit in the allowed width, this attribute sets the preferred handling. unimplemented position <msgroup>, <msrow>, <mscarries>, <msline> rowalign <mtable>, <mtd>, <mtr> specifies the vertical alignment of table cells. rowlines <mtable> specifies table row borders. rowspacing <mtable> specifies the space between table rows. rowspan <mtd> a non-negat...
...ltiscripts>, <msup>, <msubsup> the minimum space by which to shift the superscript above the baseline of the expression. symmetric <mo> if stretchy is true, this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis (centered fraction line). voffset <mpadded> sets the vertical position of the child content. width <mglyph>, <mpadded>, <mspace>, <mtable> specifies the desired width. see lengths for possible values. xlink:href all can be used to set a hyperlink to a specfied uri. however, authors are encouraged to use the href attribute instead. xmlns <math> specifies the uri for the mathml namespace (http://www.w3.org/1998/math/mathml) ...
Critical rendering path - Web Performance
contain any visible information, and is therefore not included in the render tree. if there's a display: none; set on an element, neither it, nor any of its descendants, are in the render tree. layout once the render tree is built, layout becomes possible. layout is dependent on the size of screen. ...
... a display: none; set on an element, neither it, nor any of its descendants, are in the render tree. layout once the render tree is built, layout becomes possible. layout is dependent on the size of screen. the layout step determines where and how the elements are positioned on the page, determining the width and height of each element, and where they are in relation to each other. ...
...ts, are in the render tree. layout once the render tree is built, layout becomes possible. layout is dependent on the size of screen. the layout step determines where and how the elements are positioned on the page, determining the width and height of each element, and where they are in relation to each other. what is the width of an element? block level elements, by definition, have a default width of 100% of the width of their parent. an element with a width of 50%, will be half of the width of its parent. unless otherwise defined, the body has a width of 100%, meaning it will be 100% of the width of the viewport. this width of the device impacts layout. the viewport meta tag defines the width of the layout viewport, impacting the layout. without it, the browser uses the default viewport ...
... of 100% of the width of their parent. an element with a width of 50%, will be half of the width of its parent. unless otherwise defined, the body has a width of 100%, meaning it will be 100% of the width of the viewport. this width of the device impacts layout. the viewport meta tag defines the width of the layout viewport, impacting the layout. without it, the browser uses the default viewport width, which on by-default full screen browsers is generally 960px. on by-default full screen browsers, like your phone's browser, by setting <meta name="viewport" content="width=device-width">, the width will be the width of the device instead of the default viewport width. the device-width changes when a user rotates their phone between landscape and portrait mode. layout happens every time a device ...
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
everything else specifies details about the gradient mask itself. applying the svg effect to (x)htm...
...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" sty...
...olor 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="toggleradius()">toggle radius</button> <svg height="0"> <clippath id="clipping-path-1" clippathunits="objectboundingbox"> <circle cx="0.25" cy="0.25" r="0.25" id="circle"/> <rect x="0.5" y="0.2" width="0.5" height="0.8"/> </clippath> </svg> .target { clip-path: url(#clipping-path-1); } p { width: 300px; border: 1px solid #000; display: inline-block; } this establishes a clipping area made of a circle and rectangle, assigns it the id #clipping-path-1, then references it in the css. the clip path can be assigned to any element with the target class. you can make changes to the svg ...
...putation heavy, so ensure to use it sparingly, especially in elements that get scrolled or animated. example: text effects svg effects can also be used to add a more dynamic and flexible approach to adding text compared to plain html text. by creating the text using svg elements combined with html you can make a variety of different text effects. you can rotate the text: <svg height="60" width="200"> <text x="0" y="15" fill="blue" transform="rotate(30 20,50)">example text</text> </svg> using external references svg used for clipping, masking, and filtering can be loaded from an external source, as long as that source comes from the same origin as the html document to which it's applied. for example, if your css is in a file named default.css, it can look like this: .target { cli...
baseFrequency - SVG: Scalable Vector Graphics
the basefrequency attribute represents the base frequency parameter for the noise function of the <feturbulence> filter primitive. ...
...ase frequency parameter for the noise function of the <feturbulence> filter primitive. ...
...t is using this attribute: <feturbulence> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.05" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <number-optional-number> default value 0 animatable yes <number-optional-number> if two numbers are provided, the first one represents the base frequency in the h...
... <number-optional-number> default value 0 animatable yes <number-optional-number> if two numbers are provided, the first one represents the base frequency in the horizontal direction and the second one the base frequency in the vertical direction. if one number is provided, then that value is used for both x and y. negative values are forbidden. ...
cx - SVG: Scalable Vector Graphics
Web › SVG › Attribute › cx
value <length-percentage> default value 0 animatable yes note: starting with svg2 cx, is a geometry property, meaning this attribute can also be used as css property for circles. ellipse for <ellipse>, cx defines th...
... c...
... candidate recommendation definition as a geometry property scalable vector g...
... candidate recommendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'cx' in that specification. candidate recommendatio...
cy - SVG: Scalable Vector Graphics
Web › SVG › Attribute › cy
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, cy is a geometry property meaning this attribute can also be used as a css property for circles. ellipse for <ellipse>, cy defin...
... c...
... candidate recommendation definition as a geometry property scalable vector g...
... candidate recommendation definition as a geometry property scalable vector graphics (svg) 2the definition of 'cy' in that specification. candidate recommendatio...
display - SVG: Scalable Vector Graphics
Web › SVG › Attribute › display
ement from contributing to the clipping path. note: as a presentation attribute, display can be used as a css property. see css display for further information. as a presentation attribute, it can be applied to any element. ...
... attribute, display can be used as a css property. see css display for further information. as a presentation attribute, it can be applied to any element. ...
...it can be applied to any element. ...
...} <svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <!-- here the yellow rectangle is displayed --> <rect x="0" y="0" width="100" height="100" fill="skyblue"></rect> <rect x="20" y="20" width="60" height="60" fill="yellow"></rect> <!-- here the yellow rectangle is not displayed --> <rect x="120" y="0" width="100" height="100" fill="skyblue"></rect> <rect x="140" y="20" width="60" height="60" fill="yellow" display="none"></rect> </svg> usage notes default value inline value [ <display-outside> | <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>where <display-outside> = block | inline | run-in<display-inside> = flow | flow-root | table | flex | grid | ruby<display-listitem> = <display-outside>? ...
enable-background - SVG: Scalable Vector Graphics
background image is managed. note: as a presentation attribute, enable-background can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <a>, <defs>, <glyph>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, and <symbol> context notes value accumulate | new [ <x> <y> <width> <height> ]? default value accumulate animatable no accumulate if an ancestor container element has a property value of enable-background: new, then all graphics elements within the current container element are rendered both onto the parent container elementʼs background image canvas and onto the target device. otherwise, there is no current background imag...
...ulate if an ancestor container element has a property value of enable-background: new, then all graphics elements within the current container element are rendered both onto the parent container elementʼs background image canvas and onto the target device. otherwise, there is no current background image canvas, so graphics elements are only rendered onto the target device. new [ <x> <y> <width> <height> ]? this value enables the ability of children of the current container element to access the background image. it also indicates that a new (i.e., initially transparent black) background image canvas is established and that in effect all children of the current container element shall be rendered into the new background image canvas in addition to being rendered onto the target dev...
...bles the ability of children of the current container element to access the background image. it also indicates that a new (i.e., initially transparent black) background image canvas is established and that in effect all children of the current container element shall be rendered into the new background image canvas in addition to being rendered onto the target device. ...
...rendered into the new background image canvas in addition to being rendered onto the target device. the optional <x>, <y>, <width>, and <height> parameters are <number> values that indicate the subregion of the container elementʼs user space where access to the background image is allowed to happen. those values act as a clipping rectangle on the background image canvas. negative values for <width> or <height> are forbidden. if one, two, or three values are specified or if neither <width> nor <height> are specified, the backgroundimage and backgroundalpha of a filter primitive are processed as if background image processing were not enabled. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'ena...
mode - SVG: Scalable Vector Graphics
Web › SVG › Attribute › mode
the mode attribute defines the blending mode on the <feblend> filter primitive. ...
... the mode attribute defines the blending mode on the <feblend> filter primitive. ...
...l, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <filter id="blending1" x="0" y="0" width="100%" height="100%"> <feflood result="floodfill" x="0" y="0" width="100%" height="100%" flood-color="seagreen" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="multiply"/> </filter> <filter id="blending2" x="0" y="0" width="100%" height="100%"> <feflood result="floodfill" x="0" y="0" width="100%" height="100%" flood-color="seagreen" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="color-dodge"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#blending1);"/> <image xlink:href="//deve...
... x="0" y="0" width="100%" height="100%" flood-color="seagreen" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="color-dodge"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#blending1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#blending2); transform:translatex(220px);"/> </svg> usage notes value <blend-mode> default value normal animatable yes for a description of the values, see <blend-mode>. specifications specification status comment filter effects module level 1the definition of 'mode' in that sp...
patternContentUnits - SVG: Scalable Vector Graphics
n> element. only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- a pattern tile that content coordinates and values are computed against the current coordinate user space. ...
... --> <pattern id="p1" width="20%" height="20%" patterncontentunits="userspaceonuse"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- a pattern tile that content coordinates and values are computed against the bounding box of the target element. ...
...tes and values are computed against the bounding box of the target element. note that the size of the tile is also computed against the bounding box of the target element --> <pattern id="p2" width="20%" height="20%" patterncontentunits="objectboundingbox"> <circle cx=".1" cy=".1" r=".1" /> </pattern> <!-- left square with user space tiles --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> <!-- right square with bounding box tiles --> <rect x="110" y="10" width="80" height="80" fill="url(#p2)" /> </svg> pattern for <pattern>, patterncontentunits defines the coordinate system in use for the content of the element. value userspaceonuse | objectboundingbox default value userspaceonuse anim...
...pattern> element refer to the user coordinate system as defined when the pattern tile was created. objectboundingbox this value indicates that all coordinates inside the <pattern> element are relative to the bounding box of the element the pattern is applied to. a bounding box could be considered the same as if the content of the <pattern> were bound to a "0 0 1 1" viewbox for a pattern tile of width and height of 100%. specifications specification status comment scalable vector graphics (svg) 2the definition of 'patterncontentunits' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'patterncontentunits' in that specification. recommendation initial definition ...
spreadMethod - SVG: Scalable Vector Graphics
ibute, you will need to set the size of the gradient smaller than the shape. in the case of a linear gradient, the edges may be defined as a rectangle by the x1, x2, y1 and y2 attributes. in the case of a radial gradient, the edges may be defined as outer and inner circles by the cx, cy and r (outer) and fx, fy and fr (inner) attributes. ...
...the outer thirds show the difference between the three spread methods. examples of spreadmethod with radial gradients svg <...
..."/> </lineargradient> <lineargradient id="repeatgradient" spreadmethod="repeat" x1="33%" x2="67%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> </defs> <rect fill="url(#padgradient)" x="10" y="0" width="200" height="40"/> <rect fill="url(#reflectgradient)" x="10" y="50" width="200" height="40"/> <rect fill="url(#repeatgradient)" x="10" y="100" width="200" height="40"/> </svg> result notice that the middle third of each gradient is the same. the outer thirds show the difference between the three spread methods. examples of spreadmethod with radial gradients svg <svg width="340" height="120" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgra...
..."/> </radialgradient> <radialgradient id="radialrepeatgradient" spreadmethod="repeat" cx="75%" cy="25%" r="33%" fx="64%" fy="18%" fr="17%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </radialgradient> </defs> <rect fill="url(#radialpadgradient)" x="10" y="10" width="100" height="100"/> <rect fill="url(#radialreflectgradient)" x="120" y="10" width="100" height="100"/> <rect fill="url(#radialrepeatgradient)" x="230" y="10" width="100" height="100"/> </svg> result specifications specification status comment scalable vector graphics (svg) 2the definition of 'spreadmethod for <radialgradient>' in that specific...
stroke-miterlimit - SVG: Scalable Vector Graphics
when the limit is exceeded, the join is converted from a miter to a bevel. note: as a presentation attribute stroke-miterlimit can be used as a css property. ...
... <path stroke="black" fill="none" stroke-linejoin="miter" stroke-miterlimit="8" id="p3" d="m1,29 l7 ,-3 l7 ,3 m2, 0 l3.5 ,-3 l3.5 ,3 m2, 0 l2 ,-3 l2 ,3 m2, 0 l0.75,-3 l0.75,3 m2, 0 l0.5 ,-3 l0.5 ,3" /> <!-- the following pink lines highlight the position of the path for each stroke --> <path stroke="pink" fill="none" stroke-width="0.05" d="m1, 9 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3 m1,19 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3 m1,29 l7,-3 l7,3 m2,0 l3.5,-3 l3.5,3 m2,0 l2,-3 l2,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5,-3 l0.5,3" /> </svg> when two line segments meet at a sharp angle and miter join...
...at a sharp angle and miter joins have been specified for stroke-linejoin, it is possible for the miter to extend far beyond the thickness of the line stroking the path. the stroke-miterlimit ratio is used to define when the limit is exceeded, if so the join is converted from a miter to a bevel. ...
... line stroking the path. the stroke-miterlimit ratio is used to define when the limit is exceeded, if so the join is converted from a miter to a bevel. the ratio of miter length (distance between the outer tip and the inner corner of the miter) to stroke-width is directly related to the angle (theta) between the segments in user space by the formula: stroke-miterlimit = miterlength stroke-width = 1 sin ( θ 2 ) for example, a miter limit of 1.414 converts miters to bevels for theta less than 90 degrees, a limit of 4.0 converts them for theta less than approximately 29 degrees, and a limit of 10.0 converts them for theta less than approximately 11.5 degrees. usage context value <number> default value 4 animatable yes the v...
SVG Attribute reference - SVG: Scalable Vector Graphics
Web › SVG › Attribute
dientunits h hanging height href hreflang horiz-adv-x horiz-origin-x i id ideographic image-rendering in in2 intercept k k k1 k2 k3 k4 kernelmatrix kernelunitlength kerning keypoints keysplines keytimes l lang lengthadjust letter-spacing lighting-color limitingconeangle local m marker-end marker-mid marker-start markerheight markerunits markerwidth mask maskcontentunits maskunits mathematical max media method min mode n name numoctaves o offset opacity operator order orient orientation origin overflow overline-position overline-thickness p panose-1 paint-order path pathlength patterncontentunits patterntransform patternunits ping pointer-events points pointsatx pointsaty pointsatz preservealpha...
... restart 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...
...t 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 vert-origin-x vert-origin-y viewbox viewtarget visibility w width widths word-spacing writing-mode x x x-height x1 x2 xchannelselector xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xml:lang xml:space y y y1 y2 ychannelselector z z zoomandpan svg attributes by category generic attributes core attributes id, lang, tabindex, xml:base, xml:lang, xml:space style attributes cla...
...h, font-style, font-variant, font-weight, glyph-orientation-horizontal, glyph-orientation-vertical, image-rendering, kerning, letter-spacing, lighting-color, marker-end, marker-mid, marker-start, mask, opacity, overflow, pointer-events, shape-rendering, stop-color, stop-opacity, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, text-decoration, text-rendering, transform, transform-origin, unicode-bidi, vector-effect, visibility, word-spacing, writing-mode filters attributes filter primitive attributes height, result, width, x, y transfer function attributes type, tablevalues, slope, intercept, amplitude, exponent, offset animation attributes animation attribute target attributes attributetype, attr...
<feMergeNode> - SVG: Scalable Vector Graphics
the femergenode takes the result of another filter to be processed by its parent <femerge>. ...
... the femergenode takes the result of another filter to be processed by its parent <femerge>. ...
... specifications specif...
... specifications specification status comment filter effects module level 1the definition of '<femergenode>' in that specific...
<marker> - SVG: Scalable Vector Graphics
Web › SVG › Element › marker
wheads or polymarkers on a given <path>, <line>, <polyline> or <polygon> element. markers are attached to shapes using the marker-start, marker-mid, and marker-end properties. ...
...00" xmlns="http://www.w3.org/2000/svg"> <defs> <!-- arrowhead marker definition --> <marker id="arrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="auto-start-reverse"> <path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <!-- simple dot marker definition --> <marker id="dot" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="5" markerheight="5"> <circle cx="5" cy="5" r="5" fill="red" /> </marker> </defs> <!-- coordinate axes with a arrowhead in both direction --> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <!-- data line with polymarkers --> <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="g...
... <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="url(#dot)" marker-mid="url(#dot)" marker-end="url(#dot)" /> </svg> attributes markerheight this attribute defines the height of the marker viewport. value type: <length> ; default value: 3; animatable: yes markerunits this attribute defines the coordinate system for the attributes markerwidth, markerheight and the contents of the <marker>. value type: userspaceonuse|strokewidth ; default value: strokewidth; animatable: yes markerwidth this attribute defines the width of the marker viewport. value type: <length> ; default value: 3; animatable: yes orient this attribute defines the orientation of the marker relative to the shape it is attached to. value type: auto|auto-start-reve...
...cessing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<mask> - SVG: Scalable Vector Graphics
Web › SVG › Element › mask
the <mask> element defines an alpha mask for compositing the current object into the background. a mask is used/referenced using the mask property. ...
...eight this attribute defines the height of the masking area. value type: <length> ; default value: 120%; animatable: yes maskcontentunits this attribute defines the coordinate system for the contents of the <mask>. value type: userspaceonuse|objectboundingbox ; default value: userspaceonuse; animatable: yes maskunits this attribute defines defines the coordinate system for attributes x, y, width and height on the <mask>. value type: userspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes x this attribute defines the x-axis coordinate of the top-left corner of the masking area. value type: <coordinate> ; default value: -10%; animatable: yes y this attribute defines the y-axis coordinate of the top-left corner of the masking area. value type: <coordinate...
...erspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes x this attribute defines the x-axis coordinate of the top-left corner of the masking area. value type: <coordinate> ; default value: -10%; animatable: yes y this attribute defines the y-axis coordinate of the top-left corner of the masking area. value type: <coordinate> ; default value: -10%; animatable: yes width this attribute defines the width of the masking area. value type: <length> ; default value: 120%; animatable: yes global attributes core attributes most notably: id styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule...
...notably: id styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer 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>,...
<pattern> - SVG: Scalable Vector Graphics
Web › SVG › Element › pattern
ect which can be redrawn at repeated x- and y-coordinate intervals ("tiled") to cover an area. the <pattern> is referenced by the fill and/or stroke attributes on other graphics elements to fill or stroke those elements with the referenced pattern. html,body,svg { height:100% } <svg viewbox="0 0 230 100" xmlns="http://www.w3.org/2000/svg"> <defs> <pattern id="star" viewbox="0,0,10,10" width="10%" height="10%"> <polygon points="0,0 2,5 0,10 5,8 10,10 8,5 10,0 5,2"/> </pattern> </defs> <circle cx="50" cy="50" r="50" fill="url(#star)"/> <circle cx="180" cy="50" r="40" fill="none" stroke-width="20" stroke="url(#star)"/> </svg> attributes height this attribute determines the height of the pattern tile. value type: <length>|<percentage>; default value: 0; animat...
...ute has no effect if a viewbox attribute is specified on the <pattern> element. patterntransform this attribute contains the definition of an optional additional transformation from the pattern coordinate system onto the target coordinate system. value type: <transform-list>; default value: none; animatable: yes patternunits this attribute defines the coordinate system for attributes x, y, width , and height. value type: userspaceonuse|objectboundingbox; default value: objectboundingbox; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be deformed if it is embedded in a container with a different aspect ratio. value type: (none| xminymin| xmidymin| xmaxymin| xminymid| xmidymid| xmaxymid| xminymax| xmidymax| xmaxymax) (meet|slice)? ; default value: ...
...med if it is embedded in a container with a different aspect ratio. value type: (none| xminymin| xmidymin| xmaxymin| xminymid| xmidymid| xmaxymid| xminymax| xmidymax| xmaxymax) (meet|slice)? ; default value: xmidymid meet; animatable: yes viewbox this attribute defines the bound of the svg viewport for the pattern fragment. value type: <list-of-numbers> ; default value: none; animatable: yes width this attribute determines the width of the pattern tile. value type: <length>|<percentage> ; default value: 0; animatable: yes x this attribute determines the x coordinate shift of the pattern tile. value type: <length>|<percentage> ; default value: 0; animatable: yes xlink:href deprecated since svg 2 this attribute reference a template pattern that provides default values for the <pattern...
...cessing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title usage notes categoriescontainer 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>, <m...
<svg> - SVG: Scalable Vector Graphics
Web › SVG › Element › svg
ocument. note: the xmlns attribute is only required on the outermost svg element of svg documents. it is unnecessary for inner svg elements or inside html documents. html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg" stroke="red" fill="grey"> <circle cx="50" cy="50" r="40" /> <circle cx="150" cy="50" r="4" /> <svg viewbox="0 0 10 10" x="200" width="100"> <circle cx="5" cy="5" r="4" /> </svg> </svg> attributes baseprofile deprecated since svg 2 the minimum svg language profile that the document requires. value type: <string> ; default value: none; animatable: no contentscripttype deprecated since svg 2 the default scripting language used by the svg fragment. value type: <string> ; default value: application/ecmascript; ani...
...axymid| xminymax| xmidymax| xmaxymax) (meet|slice)? ; default value: xmidymid meet; animatable: yes version deprecated since svg 2 which version of svg is used for the inner content of the element. value type: <number> ; default value: none; animatable: no viewbox the svg viewport coordinates for the current svg fragment. value type: <list-of-numbers> ; default value: none; animatable: yes width the displayed width of the rectangular viewport. (not the width of its coordinate system.) value type: <length>|<percentage> ; default value: auto; animatable: yes x the displayed x coordinate of the svg container. no effect on outermost svg elements. value type: <length>|<percentage> ; default value: 0; animatable: yes y the displayed y coordinate of the svg container. no effect on outerm...
...ge> ; default value: auto; animatable: yes x the displayed x coordinate of the svg container. no effect on outermost svg elements. value type: <length>|<percentage> ; default value: 0; animatable: yes y the displayed y coordinate of the svg container. no effect on outermost svg elements. value type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning these attributes can also be used as css properties. global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes, document event attributes, document element...
...ibutes, document event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
hods from svgpathelement to svggeometryelement implemented (bug 1239100) document structure change notes svgsvgelement.suspendredraw(), svgsvgelement.unsuspendredraw(), and svgsvgelement.unsuspendredrawall() deprecated turned into no-ops (bug 734079) externalresourcesrequired attribute removed implementation status unknown auto value for width and height in <image> implementation status unknown referencing entire document with <use> implementation status unknown lang attribute on <desc> and <title> implemented (bug 721920) css transforms on outermost <svg> not affecting svgsvgelement.currentscale or svgsvgelement.currenttranslate implementation status unknown rootelement attribute depreca...
...gsvgelement.currenttranslate implementation status unknown rootelement attribute deprecated implementation status unknown svgelementinstance and svgelementinstancelist and corresponding attributes on svguseelement removed implementation status unknown <use> event flow following shadow dom spec. ...
...1920) svgsvgelement.viewport removed never implemented xml:base attribute removed implementation status unknown reorder descendent elements of <switch> having systemlanguage attribute according to allowreorder smil attribute implementation status unknown made <tspan> and <textpath> graphics elements implementation status unknown allow x, y, width, and height on <symbol> implementation status unknown made <use> element shadow trees consistent with shadow dom spec implementation status unknown role mapping of <a> element depending on whether it is a valid link implementation status unknown aria state and property attributes animatable implementation status unknown styling change not...
...a ua style sheet implementation status unknown !important user agent style rules controlling never-rendered elements implementation status unknown :focus and ::selection styles implementation status unknown geometry change notes x and y attributes removed from <pattern> and <filter> implementation status unknown auto value of width and height computes to 0 but 100% on <svg> not implemented coordinate systems, transformations and units change notes exception for bad values on svgmatrix.skewx() and svgmatrix.skewy() implementation status unknown bounding box for element with no position at (0, 0) implementation status unknown defer keyword removed from preserveaspect...
window/utils - Archive of obsolete content
are accepted. options : object options for the function, with the following properties: name type parent nsidomwindow parent for the new window. optional, defaults to null. name string name that is assigned to the window. optional, defaults to null. ...
... returns nsidomwindow opendialog(options) opens a top level window and returns its nsidomwindow representation. ...
...ions for the function, with the following properties: name type url string uri of the document to be loaded into the window. defaults to "chrome://browser/content/browser.xul". name string optional name that is assigned to the window. defaults to "_blank". features string map of features to set for the window, defined like: { width: 10, height: 15, chrome: true }. for the set of features you can set, see the window.opendialog documentation. optional, defaults to: 'chrome,all,dialog=no'. args object extra argument(s) to be attached to the new window as the window.arguments property. returns nsidomwindow windows() returns an array of all currently opened windows. note that these windows ...
CSS3 - Archive of obsolete content
the css background-origin, background-size, and background-clip properties. support for curved border corners, with the css border-radius, border-top-left-radius, border-top-right-radius, border-bottom-left-radius, and border-bottom-right-radius properties. support for the use of an <image> as the border with the css border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, and border-image-repeat properties. support for shadows of the element with the css box-shadow property. the css4 iteration of the backgrounds and borders specification is already in progress, though it still hasn't reached the first public working draft stage, it plans to add the ability to clip a border (with the css border-clip, border-clip-top, borde...
... 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-count, column-fill, column-gap, column-rule, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, break-after, break-before, and break-inside. css values and units module level 3 candidate recommendation makes initial and inherit keywords usable on any css property. formally defines the css data types of css 2.1, that were implicitely defined by their grammar token and some textual precisions. adds: definition f...
...tion-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, and animation-timing-function properties, as well as the @keyframes at-rule. web animations working draft css text module level 3 working draft extends: the css text-transform property with the value full-width. the css text-align property with the value start, end, start end, and match-parent for a better support of documents with multiple directionalities of text. the css text-align property with a <string> value to align on that character. this is useful to align number on the decimal point. the css word-spacing and letter-spacing properties with range constraints to control flexibilit...
Notes on HTML Reflow - Archive of obsolete content
reflow is the process by which the geometry of the layout engine's formatting objects are computed. the html formatting objects are called frames : a frame corresponds to the geometric information for (roughly) a single element in the content model; the frames are arranged into a hierarchy that parallels the containment hierarchy in the content model. a frame is rectangular, with width, height, and an offset from the parent frame that contains it. more than one frame may be needed to represent a single element from the content model; for example, text that wraps is broken into several frames, one per wrapped line. in this case, the primary frame is the frame containing the first line of text, with continuing frames (or continuations ) created for subs...
.... 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 frames. for example, a <div> with a constrained width (e.g., set via the css width property) would note this in the reflow state object before flowing its children. when reflow begins, the root reflow state is initialized with information about the top-level container for the document's presentation; e.g., the width and height of the application window. this is passed as an argument to the reflow method of the root frame in the frame hierar...
... to simplify geometry computation. incremental, when something in the frame tree changes; for example, when more content is read from the network, or some script manipulates the dom. an incremental reflow is targeted at a single frame in the frame hierarchy. during an incremental reflow, a frame can assume that none of the constraints computed "from above" (for example, available 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. stylechang...
Visualizing an audio spectrum - Archive of obsolete content
es an fft of the samples and displays them in a canvas. note: you can use the audionode called analysernode to perform real-time fft analysis on an audio stream, rather than the code shown below. ...
... note: you can use the audionode called analysernode to perform real-time fft analysis on an audio stream, rather than the code shown below. ...
... / 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; } fft.forward(signal); // clear the canvas before drawing spectrum ctx.clearrect(0,0, canvas.width, canvas.height); for (var i = 0; i < fft.spectrum.length; i++ ) { // multiply spectrum by a zoom value magnitude = fft.spectrum[i] * 4000; // draw rectangle bars for each frequency bin ctx.fillrect(i * 4, canvas.height, 3, -magnitude); } } var audio = document.getelementbyid('audio-element'); audio.addeventlistener('moza...
Using XPInstall to Install Plugins - Archive of obsolete content
the software components to be installed as well as a javascript install.js file (called the install script) as the installer logic. downloads and installs would be initiated with a security dialog box naming the certificate authority and the signer. often, the smartupdate download was triggered via the pluginurl attribute of the embed tag: <embed type="application/x-randomtype" src="myfile.typ" width="50" height="50" pluginurl="http://mytypecompany.xyz/jarpacks/mytypeplugin.jar"></embed> in the example above, the pluginurl attribute points to the signed jar file, which netscape communicator 4.x would then download (subject to the security dialog boxes) if the plugin was not located on the user's machine. smartupdate differs from xpinstall in that: xpinstall uses zip files named xpi files (...
...xpinstall downloads can also be initiated by html tags invoking plugins, notably via the codebase attribute of the object tag. this is analogous to how internet explorer downloads cab files pointed to by the codebase attribute of the object tag. here's an example of a hypothetical object tag used to invoke myplugin (an imaginary application): <object id="theplugin" type="application/x-myplugin" width="100" height="100" codebase="http://location/xpi/myplugin.xpi"> <param .... > in the above case, the codebase attribute points directly to the xpi package, and if the browser can not identify any plugin to handle the (imaginary) application/x-myplugin mime type, it will download the xpi package. note: xpi packages (files with the xpi extension) use the application/x-xpinstall mime type. when s...
...pinstall downloads can also be initiated by html tags invoking plugins, notably via the codebase attribute of the object tag. this is analogous to how internet explorer downloads cab files pointed to by the codebase attribute of the object tag. here's an example of a hypothetical object tag used to invoke myplugin (an imaginary application): <object id="theplugin" type="application/x-xpinstall" width="100" height="100" codebase="http://location/xpi/myplugin.xpi"> <param .... > in the above case, the codebase attribute points directly to the xpi package, and if the browser can not identify any plugin to handle the (imaginary) application/x-myplugin mime type, it will download the xpi package. note: xpi packages (files with the xpi extension) use the application/x-xpinstall mime type. when s...
Grids - Archive of obsolete content
Archive › Mozilla › XUL › Tutorial › Grids
xtbox and a button. you could add additional nested boxes or even another grid inside a single cell. if you resize the window of the last example, you will see that the textboxes resize, but no other elements do. this is because of the flex attributes added to the textboxes and the second column. the first column does not need to be flexible as the labels do not need to change size. the initial width of a column is determined by the largest element in the column. similarly, the height of a row is determined by the size of the elements in a row. you can use the minwidth and maxwidth and related attributes to further define the size. column based organization you can also place the elements inside the column elements instead of the rows. if you do this, the rows are just declared to specify h...
... flexible vertically. the flex attribute has also been added to the grid element so that the entire grid is flexible, otherwise it would only grow in one direction. column spanning there is no means of making a cell span a particular number of multiple columns or rows (see discussion for a way of achieving the same effect). however, it is possible to make a row or column that spans the entire width or height of the grid. to do this, just add an element inside the rows element that isn't inside a row element. you can use a box type for example, and put other elements inside it if you want to use several elements. here is a simple example: example 5 : source view <grid> <columns> <column flex="1"/> <column flex="1"/> </columns> <rows> <row> <label value="northwest"/...
...you can use a similar technique to add an element in-between two columns. it would stretch to fit the height of the grid. you could also do both if that is desired. next, we'll look at adding content panels. « previousnext » ...
command - Archive of obsolete content
urrently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
... receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
commandset - Archive of obsolete content
ute is not specified, or you set it to the value '*', all elements are valid. the command update will only occur when the event occurs to one of the specified elements. ...
...u set it to the value '*', all elements are valid. the command update will only occur when the event occurs to one of the specified elements. ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
description - Archive of obsolete content
ion 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 cropped t...
... the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the elem...
grid - Archive of obsolete content
Archive › Mozilla › XUL › grid
rows element as child to define the rows. the size and attributes defined on columns and rows will affect the size and placement of elements in each cell. elements placed within both the columns and rows will be displayed, although usually only elements will be placed inside one of these. it is most common to place elements within the rows and use the columns only to define their flexibility and width. whichever of the columns and rows is last in the grid is displayed on top; commonly the columns element appears in the grid first. more information is available in the xul tutorial. example <!-- groupbox containing a grid. the second column is twice as big as the first column --> <groupbox> <caption label="details"/> <grid> <columns> <column flex="1"/> <column flex=...
...abel="support"/> </menupopup> </menulist> </row> </rows> </grid> </groupbox> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
key - Archive of obsolete content
Archive › Mozilla › XUL › key
ould be set to the value capturing to indicate during the event capturing phase or target to indicate at the target element or left out entirely for the bubbling phase. ...
...pturing to indicate during the event capturing phase or target to indicate at the target element or left out entirely for the bubbling phase. ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
menubar - Archive of obsolete content
integer a value indicating the type of accessibility object for the element. statusbar type: id of statusbar element gets and sets the value of the statusbar attribute. ...
...icating the type of accessibility object for the element. statusbar type: id of statusbar element gets and sets the value of the statusbar attribute. ...
...ar attribute. ...
rule - Archive of obsolete content
Archive › Mozilla › XUL › rule
ntainer nodes with different tags. parsetype type: string if this attribute is set to integer, the rule will only match rdf nodes with a parse type of integer. ...
...t tags. parsetype type: string if this attribute is set to integer, the rule will only match rdf nodes with a parse type of integer. ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
scrollbar - Archive of obsolete content
s when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. the default value is 10. ...
...ll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. the default value is 10. ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
spacer - Archive of obsolete content
tutorial. ...
... <button label="left"/> <spacer flex="1"/> <button label="right"/> </box> attributes 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, 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,...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
stringbundle - Archive of obsolete content
(example needed) attributes src type: uri the uri of the property file that contains the localized strings. ...
...s src type: uri the uri of the property file that contains the localized strings. ...
...this is an object which implements nsilocale. ...
toolbox - Archive of obsolete content
e toolbar customization events. ...
...nly.xul" title="toolbox example" width="300"> <toolbox> <toolbar> <toolbarbutton label="back"/> <toolbarbutton label="forward"/> <toolbarbutton label="home"/> </toolbar> <toolbar> <toolbarbutton label="stop"/> <toolbarbutton label="reload"/> </toolbar> </toolbox> <textbox multiline="true" value="we have two toolbars inside of one toolbox above." width="20"/> </window> attributes 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,...
... customtoolbarcount firefox only type: integer the number of custom toolbars currently within the toolbox. ...
treecell - Archive of obsolete content
the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. ...
... for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
treeitem - Archive of obsolete content
t to rdf:*. elements that appear inside the element with the attribute will be repeated for each node in the rdf datasource. elements outside will appear only once. ...
...at appear inside the element with the attribute will be repeated for each node in the rdf datasource. elements outside will appear only once. ...
... 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(), getelementsbytagname(), getelementsbytagnamens(...
wizardpage - Archive of obsolete content
es the page's identifer in the wizard. this is used with the next attribute. the wizard always starts with the wizardpage that appears first in the wizard child list. ...
...the wizard. this is used with the next attribute. the wizard always starts with the wizardpage that appears first in the wizard child list. ...
... 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(), getelementsbytagname()...
2006-09-29 - Archive of obsolete content
the invalid elements. details can be located at layout confusion refactoring the nshtmlreflowstate(computeblockboxdata, initconstraints) and nsimageframe::getdesiredsize which uses ns_inrinsicsize, into the following method: /** * compute the size that a frame will occupy. called while * constructing the nshtmlreflowstate to be used to reflow the frame, * in order to fill its mcomputedwidth and mcomputedheight member * variables. * * the |height| member of the return value may be * ns_unconstrainedsize, but the |width| member must not be. * * @param aavailwidth the available width into which the element is * being placed (i.e., the width of its containing * block). * @param amargin the sum of the left and right mar...
... * @param apadding the sum of the left and right margins of the * frame, including actual values resulting from * percentages. ...
...f the * frame, including actual values resulting from * percentages. * @param ashrinkwrap whether the frame is in a context where * non-replaced blocks should shrink-wrap (e.g., * it's floating, absolutely positioned, or * inline-block). */ virtual nssize computesize(nscoord aavailwidth, nscoord amargin, nscoord aborder, nscoord apadding, prbool ashrinkwrap) = 0; details can be located at refactoring some of nshtmlreflowstate. discussion on how to determine whether there is pending layout changes or reflows when using a popup. it was concluded that a frame model change is utilized within a popup, not a layout change. o...
NPWindow - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary contains information about the target into which the plug-in instance can draw. ...
... the following fields: window platform-specific handle to a native window element in the netscape window hierarchy on windows (hwnd) and unix (x window id). mac os: window is a pointer to an np_port. x, y the x and y coordinates for the top left corner of the plug-in relative to the page (and thus relative to the origin of the drawable). should not be modified by the plug-in. height, width the height and width of the plug-in area. should not be modified by the plug-in. cliprect clipping rectangle of the plug-in; the origin is the top left corner of the drawable or window. clipping to the cliprect prevents the plug-in from overwriting the status bar, scroll bars, and other page elements when partially scrolled off the screen. mac os: cliprect is the rectangle in port coordinat...
... the paint is requested.) description the npwindow structure represents the native window or a drawable, and contains information about coordinate position, size, whether the plug-in is windowed or windowless, and some platform-specific information. the plug-in area is a native window element on windows and unix, or a rectangle within a native window on mac os. the x, y, height, and width coordinates of npwindow specify the position and size of this area. the browser calls npp_setvalue whenever the drawable changes. a windowed plug-in is drawn into a native window (or portion of a native window) on a web page. for windowed plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable (a pointer to an npwindow allocated by the browser)...
The Business Benefits of Web Standards - Archive of obsolete content
he 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 conjunction with css. according to various reports, case studies, and andy king, author of speed up your web site: web site optimization, css has made it possible to transform table-based layouts into css-based layouts. typically this reduces page size by 25 to 50%. this translates into bette...
...ge size by 25 to 50%. this translates into better user experience, according to usability guru jakob nielsen, who notes that users tend to close a web page when it takes more than 10 seconds to load. the style sheet only needs to load once and then it is cached. the payload might be slightly higher for the first page. but for accessing multiple pages of a site over many visits the savings in bandwidth are huge. improve search engine optimization without costs being well-placed in search engines is one of the hardest challenges faced by webmasters. in this case, every bit helps. by using semantic markup we greatly assist the search engines in their indexing process. these things come naturally to standards developers without additional effort, time or thought. all their documents are proper...
...nd shareholders alike should be irresistible. benefits of css over javascript specifically, graphics and javascript are often used for special effects on text fragments. as style sheet technology gives designers good typographic control and permits effects such as roll-overs, it greatly reduces the need for javascript programming and creation of graphics. even more importantly, it reduces bandwidth consumption by images. well-formed html code saves time and money one of the major headaches for web developers comes from web pages being displayed differently in various browsers. such rendering differences do exist in older browsers, but most of them are well known and documented. in many cases, rendering differences are caused by ambiguous coding. for developers who are in commercial enviro...
Windows Media in Netscape - Archive of obsolete content
2: use of object element to create control if you are running netscape 7.1 and later or ie, and have installed windows media player 7 or above, the snippet of code below should produce a windows media control and play a song. this is the example: needs to be embedded in wiki page (can it just be put here?) <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full"> <param name="autostart" value="true"> <param name="url" value="media/preludesteel.wma"> your browser does not support the activex windows media player </object> the same markup (used above and shown below) will work in both ie and netscape 7.1. <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" w...
... in ie, and on netscape 7.1 the codebase attribute isn't supported for such retrieval. therefore detecting whether the component was successfully instantiated can help provide users with the right component if a failed instantiation is detected. the code listing below provides a mechanism to to this. ...
...osed to the global namespace, but rather as properties of the document object. accessing properties and controls from the document object works well with ie also, and thus, in order to deploy cross-platform code, avoiding syntax that makes use of global namespace is important. ...
Desktop mouse and keyboard controls - Game development
ue; } } the keyuphandler looks almost exactly the same as the keydownhandler above, but instead of setting the pressed variables to true, we would set them to false. ...
...icle, it will work out of the box on the desktop too: var buttonenclave = this.add.button(10, 10, 'logo-enclave', this.clickenclave, this); the button will be placed ten pixels from the top left corner of the screen, use the logo-enclave image, and will execute the clickenclave() function when clicked. we can assign actions directly to the buttons: this.buttonshoot = this.add.button(this.world.width*0.5, 0, 'button-alpha', null, this); this.buttonshoot.oninputdown.add(this.shootingpressed, this); this.buttonshoot.oninputup.add(this.shootingreleased, this); the button used for shooting works perfectly fine on both the mobile and desktop approach. if you want to use the mouse's cursor position on the screen you can do so with this.game.input.mousepointer. let's assume you'd like to shoot a b...
...s perfectly fine on both the mobile and desktop approach. if you want to use the mouse's cursor position on the screen you can do so with this.game.input.mousepointer. ...
Mobile touch controls - Game development
we can get the first touch (e.touches[0], our example is not multitouch-enabled), extract the pagex...
...ult(); } } if the touch occurs (touches object is not empty), then we will have all the info we need in that object. we can get the first touch (e.touches[0], our example is not multitouch-enabled), extract the pagex and pagey variables and set the player's ship position on the screen by subtracting the canvas offset (distance from the canvas and the edge of the screen) and half the player's width and height. to see if it's working correctly we can output the x and y positions using the output element. the preventdefault() function is needed to prevent the browser from moving — without it you'd have the default behaviour, and the canvas would be dragged around the page, which would show the browser scroll bars and look messy. touch events in phaser we don't have to do this on our ow...
...he small mobile screen with them, we can use something a little bit different: we'll create invisible areas which respond to the given action. from a design point of view, it is better to make the field of activity bigger without covering half of the screen with button images. for example, tapping on the right side of the screen will fire the weapon: this.buttonshoot = this.add.button(this.world.width*0.5, 0, 'button-alpha', null, this); this.buttonshoot.oninputdown.add(this.goshootpressed, this); this.buttonshoot.oninputup.add(this.goshootreleased, this); the code above will create a new button using a transparent image that covers the right half of the screen. you can assign functions on input down and input up separately if you'd like to perform more complicated actions, but in this game t...
Crisp pixel art look with image-rendering - Game development
mages in their original, smaller size, thus saving download time. also, some game techniques require algorithms that analyse images, which also benefit from working with smaller images. the css property to achieve this scaling is image-rendering. it is still experimental, but there is partial support in most browsers. the steps to achieve this effect are: create a <canvas> element and set its width and height attributes to the original, smaller resolution. set its css width and height properties to be 2x or 4x the value of the html width and height. if the canvas was created with a 128 pixel width, for example, we would set the css width to 512px if we wanted a 4x scale. set the <canvas> element's image-rendering css property to some value that does not make the image blurry. either crisp...
...that does not make the image blurry. either crisp-edges or pixelated will work. check out the image-rendering article for more information on the differences between these values, and which prefixes to use depending on the browser. an example let's have a look at an example. ...
...ge-rendering article for more information on the differences between these values, and which prefixes to use depending on the browser. an example let's have a look at an example. ...
Square tilemaps implementation: Scrolling maps - Game development
n character in platform games.) regardless of the type of camera, we would always need information regarding its current position, viewport size, etc. in the demo provided along with this article, these are the parameters the camera has: x and y: the current position of the camera. in this implementation, we are assuming that (x,y) points to the top left corner of visible portion of the map. width and height: the size of the camera's viewport. maxx and maxy: the limit for the camera's position — the lower limit will nearly always be (0,0), and in this case the upper limit is equal to the size of the world minus the size of the camera's viewport. rendering the map there are two main differences between rendering scrolling maps vs. static maps: partial tiles might be shown. in stati...
...es, we need to slightly modify the rendering algorithm. let's imagine that we have the camera pointing at (5,10). that means that the first tile would be 0x0. in the demo code, the starting point is stored at startcol and startrow. it's convenient to also pre-calculate the last tile to be rendered. var startcol = math.floor(this.camera.x / map.tsize); var endcol = startcol + (this.camera.width / map.tsize); var startrow = math.floor(this.camera.y / map.tsize); var endrow = startrow + (this.camera.height / map.tsize); once we have the first tile, we need to calculate how much its rendering (and therefore the rendering of the other tiles) is offset by. since the camera is pointing at (5, 10), we know that the first tile should be shifted by (-5,-10) pixels. in our demo the shif...
... = map.gettile(c, r); var x = (c - startcol) * map.tsize + offsetx; var y = (r - startrow) * map.tsize + offsety; if (tile !== 0) { // 0 => empty tile this.ctx.drawimage( this.tileatlas, // image (tile - 1) * map.tsize, // source x 0, // source y map.tsize, // source width map.tsize, // source height math.round(x), // target x math.round(y), // target y map.tsize, // target width map.tsize // target height ); } } } demo our scrolling tilemap implementation demo pulls the above code together to show what an implementation of ...
Bounce off the walls - Game development
to save on code verbosity: if(y + dy > canvas.height || y + dy < 0) { dy = -dy; } if either of the two statements is true, reverse the movement of the ball. bouncing off the left and right we have the top and bottom edge covered, so let's think about the left and right ones. it is very similar actually, all you have to do is to repeat the statements for x instead of y: if(x + dx > canvas.width || x + dx < 0) { dx = -dx; } if(y + dy > canvas.height || y + dy < 0) { dy = -dy; } at this point you should insert the above code block into the draw() function, just before the closing curly brace. the ball keeps disappearing into the wall! test your code at this point, and you will be impressed — now we have a ball that bounced off all four edges of the canvas! we have another pr...
...it slightly before changing direction: this is because we're calculating the collision point of the wall and the center of the ball, while we should be doing it for its circumference. the ball should bounce right after if touches the wall, not when it's already halfway in the wall, so let's adjust our statements a bit to include that. ...
.... update the last code you added to this: if(x + dx > canvas.width-ballradius || x + dx < ballradius) { dx = -dx; } if(y + dy > canvas.height-ballradius || y + dy < ballradius) { dy = -dy; } when the distance between the center of the ball and the edge of the wall is exactly the same as the radius of the ball, it will change the movement direction. subtracting the radius from one edge's width and adding it onto the other gives us the impression of the proper collision detection — the ball bounces off the walls as it should do. compare your code lets again check the finished code for this part against what you've got, and have a play: exercise: try changing the color of the ball to a random colour every time it hits the wall. next steps we've now got to the stage where our b...
Move the ball - Game development
e 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 use those to define the position the circle is drawn at. ...
...tent: clearrect(). this method takes four parameters: the x and y coordinates of the top left corner of a rectangle, and the x and y coordinates of the bottom right corner of a rectangle. the whole area covered by this rectangle will be cleared of any content previously painted there. add the following highlighted new line to the draw() function: function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); x += dx; y += dy; } save your code and try again, and this time you'll see the ball move without a trail. every 10 milliseconds the canvas is cleared, the blue circle (our ball) will be drawn on a given position and the x and y values will be upd...
..., so it's good to keep it as simple and clean as possible. let's start by moving the ball drawing code to a separate function. replace the existing draw() function with the following two functions: function drawball() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); drawball(); x += dx; y += dy; } compare your code you can check the finished code for this article for yourself in the live demo below, and play with it to understand better how it works: exercise: try changing the speed of the moving ball, or the direction it moves in. next steps we've drawn our ball and gotten it moving, but it keeps disappearing off the ed...
Paddle and keyboard controls - Game development
can watch it indefinitely, but currently there's no interactivity. it's not a game if you cannot control it! so let's add some user interaction: a controllable paddle. defining a paddle to hit the ball so, we need a paddle to hit the ball. let's define a few variables for that. add the following variables near the top of your code, beside your other variables: var paddleheight = 10; var paddlewidth = 75; var paddlex = (canvas.width-paddlewidth) / 2; here we're defining the height and width of the paddle and its starting point on the x axis for use in calculations further on down the code. let's create a function that will draw the paddle on the screen. add the following just below your drawball() function: function drawpaddle() { ctx.beginpath(); ctx.rect(paddlex, canvas.height-pa...
...it's time to implement some keyboard controls. we will need the following: two variables for storing information on whether the left or right control button is pressed. ...
...e seven pixels to the left, and if the right cursor is pressed, the paddle will move seven pixels to the right. this currently works, but the paddle disappears off the edge of the canvas if we hold either key for too long. we could improve that and move the paddle only within the boundaries of the canvas by changing the code like this: if(rightpressed) { paddlex += 7; if (paddlex + paddlewidth > canvas.width){ paddlex = canvas.width - paddlewidth; } } else if(leftpressed) { paddlex -= 7; if (paddlex < 0){ paddlex = 0; } } the paddlex position we're using will move between 0 on the left side of the canvas and canvas.width-paddlewidth on the right hand side, which will work exactly as we want it to. add the above code block into the draw() function at th...
Backgrounds and borders - Learn web development
es, therefore 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. ...
...borders to an element 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 thes...
...gical 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, which covers handling different text directions. there are a variety of styles that you can use for borders. in the example below we have used a different border style for the four sides of my box. play with the border style, width, and color to see how borders work. rounded corners rounding corners on a box is achieved by using the border-radius property and associated longhands which relate to each corner of the box. two lengths or percentages may be used as a value, the first value defining the horizontal radius, and the second the vertical radius. in a lot of cases, you will only pass in one value, which will be use...
Debugging CSS - Learn web development
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. perhaps you have realised that you don't want your box to inherit the <body> element's font size, and want to set its own specific size? you can try this out in devtools before adding it to your css file. you can click the closing curly brace in the rule to start entering a new declaration into it, at wh...
... the properties and values that change how the element is laid out. this includes a description of properties that you may not have explicitly used on the element, but which do have initial values set. in this panel, one of the detailed properties is the box-sizing property, which controls what box model the element uses. compare the two boxes with classes box1 and box2. they both have the same width applied (400px), however box1 is visually wider. you can see in the layout panel that it is using content-box. this is the value that takes the size you give the element and then adds on the padding and border width. the element with a class of box2 is using border-box, so here the padding and border is subtracted from the size that you have given the element. this means that the space taken up ...
... note: find out more in examining and inspecting the box model. ...
Handling different text directions - Learn web development
about writing modes and direction at this point in your learning however, is because of the fact we have already looked at a lot of properties which are tied to the physical dimensions of the screen, and make most sense when in a horizontal writing mode. let's take a look at our two boxes again — one with a horizontal-tb writing mode and one with vertical-rl. i have given both of these boxes a width. you can see that when the box is in the vertical writing mode, it still has a width, and this is causing the text to overflow. what we really want in this scenario, is to essentially swap height and width along with the writing mode. when we're in a vertical writing mode we want the box to expand in the block dimension just like it does in the horizontal mode. to make this easier, css has re...
...the text to overflow. what we really want in this scenario, is to essentially swap height and width along with the writing mode. when we're in a vertical writing mode we want the box to expand in the block dimension just like it does in the horizontal mode. to make this easier, css has recently developed a set of mapped properties. these essentially replace physical properties — things like width and height — with logical, or flow relative versions. the property mapped to width when in a horizontal writing mode is called inline-size — it refers to the size in the inline dimension. the property for height is named block-size and is the size in the block dimension. you can see how this works in the example below where we have replaced width with inline-size. logical margin, border, ...
... the margin-top property is mapped to margin-block-start — this will always refer to the margin at the start of the block dimension. the padding-left property maps to padding-inline-start, the padding that is applied to the start of the inline direction. ...
Images, media, and form elements - Learn web development
ppens with the overflow. in the example below we have two boxes, both 200 pixels in size: one contains an image which is smaller than 200 pixels — it is smaller than the box and doesn't stretch to fill it. the other is larger than 200 pixels and overflows the box. so what can we do about the overflowing issue? as we learned in our previous lesson, a common technique is to make the max-width of an image 100%. this will enable the image to become smaller in size than the box but not larger. this technique will work with other replaced elements such as <video>s, or <iframe>s. try adding max-width: 100% to the <img> element in the example above. you will see that the smaller image remains unchanged, but the larger one becomes smaller to fit into the box. you can make other choices abo...
...h. if you are following these lessons in order then you may not have looked at layout yet. just keep in mind that replaced elements, when they become part of a grid or flex layout, have different default behaviors, essentially to avoid them being stretched strangely by the layout. to force the image to stretch to fill the grid cell it is in, you'd have to do something like following: img { width: 100%; height: 100%; } this would however stretch the image, so probably isn't what you'd want to do. form elements form elements can be a tricky issue when it comes to styling with css, and the web forms module contains detailed guides to the trickier aspects of styling form elements, which i will not fully reproduce here. there are a few key basics worth highlighting in this section of the...
... you should add this rule to your css. button, input, select, textarea { font-family : inherit; font-size : 100%; } form elements and box-sizing across browsers form elements use different box sizing rules for different widgets. you learned about the box-sizing property in our box model lesson and you can use this knowledge when styling forms to ensure a consistent experience when setting widths and heights on form elements. for consistency it is a good idea to set margins and padding to 0 on all elements, then add these back in when styling particular controls button, input, select, textarea { box-sizing: border-box; padding: 0; margin: 0; } other useful settings in addition to the rules mentioned above, you should also set overflow: auto on <textarea>s to stop ie showing a s...
Example 2 - Learn web development
{ 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 1px 2px */ background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : ...
...round : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { 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 ...
.../ 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); -moz-box-sizing : border-box; 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; color: #ffffff; } javascript content window.addeventlistener("load", fun...
Example 3 - Learn web development
{ 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 1px 2px */ background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : ...
...round : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { 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 ...
.../ 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); -moz-box-sizing : border-box; 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; color: #ffffff; } javascript content // ------- // // helpers // // --...
Example 4 - Learn web development
{ 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 1px 2px */ background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : ...
...round : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { 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 ...
.../ 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); -moz-box-sizing : border-box; 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; color: #ffffff; } javascript content // ------- // // helpers // // --...
Example 5 - Learn web development
{ 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 1px 2px */ background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : ...
...round : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { 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 ...
.../ 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); -moz-box-sizing : border-box; 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; color: #ffffff; } javascript content // ------- // // helpers // // --...
HTML Cheatsheet - Learn web development
of a given tag using css so, when using html, take the time to focus on the meaning rather than the appearance. inline elements an "element" is a single part of a webpage. some elements are large and hold smaller elements like containers. some elements are small and are "nested" inside larger ones. by default, "inline elements" appear next to one another in a webpage. they take up only as much width as they need in a page and fit together horizontally like words in a sentence or books shelved side-by-side in a row.all inline elements can be implemented within the <body></body> tags. usage code snippet 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...
...ontally like words in a sentence or books shelved side-by-side in a row.all inline elements can be implemented within the <body></body> tags. ...
..." type="audio/ogg"> your browser does not support audio. </audio> your browser does not support audio. embedded video <video controls src="https://udn.realityripple.com/samples/1f/6cc66528b8.mp4">the <code>video</code> element is unsupported.</video> the video element is unsupported. block elements "block elements," on the other hand, take up the entire width of a webpage. they also take up a full line of a webpage; they do not fit together side-by-side. instead, they stack like paragraphs in an essay or toy blocks in a tower. usage code snippet result a simple paragraph <p>i'm a paragraph</p> <p>i'm another paragraph</p> i'm a paragraph i'm another paragraph an extended quotatio...
Accessible Toolkit Checklist
h as focused, focusable, selected, selectable, visible, protected (for passwords), checked, etc. get_acckeyboardshortcut: what is the keyboard shortcut for this iaccessible (underlined alt+combo mnemonic) get_accfocus: which child is focused? get_accselection: which children of this item are selected? acclocation: get the x,y coordinates, and the height and width of this iaccessible node. accnavigate: navigate to the first/last child, previous/next sibling, up, down, left or right from this iaccessible. [important, but no need to implement up/down/left/right] accdodefaultaction: perform the action described by get_accdefaultaction. supporting the basic msaa states on every item: unavailable, focused, readonly, off...
...this can be supported through spi_getkeyboardcues and spi_getmenuunderlines simple widgets buttons tab, arrow, unmodified letter mnemonics require and support text labels ...
...this can be supported through spi_getkeyboardcues and spi_getmenuunderlines simple widgets buttons tab, arrow, unmodified letter mnemonics require and support text labels for buttons with image...
Performance best practices for Firefox front-end engineers
ts have one or even several properties that do so. if you require size or position information, you have a few options. bug 1434376 has recently landed a helper in the window binding to make it easier for priviledged code to queue up javascript to run when we know that the dom is not dirty, and size, position, and style information is cheap to query for. ...
...perties that do so. if you require size or position information, you have a few options. bug 1434376 has recently landed a helper in the window binding to make it easier for priviledged code to queue up javascript to run when we know that the dom is not dirty, and size, position, and style information is cheap to query for. ...
...easier for priviledged code to queue up javascript to run when we know that the dom is not dirty, and size, position, and style information is cheap to query for. here's an example: async function matchwidth(elem, otherelem) { let width = await window.promisedocumentflushed(() => { // do _not_ under any circumstances write to the dom in one of these // callbacks! return elem.clientwidth; }); requestanimationframe(() => { otherelem.style.width = `${width}px`; }); } please see the section on promisedocumentflushed in detecting and avoiding synchronous style flushes for more information on how to use the api. note that queries for size and position information are only expensive if the dom has been written to. otherwise, we're doing a cheap look-up of cached informatio...
HTMLIFrameElement.getScreenshot()
warning: removed in firefox 65. the getscreenshot() method of the htmliframeelement lets you request a screenshot of a content <iframe>, scaled to fit within a specified maximum width and height. the image will be cropped if necessary but will not be distorted vertically or horizontally. note: getscreenshot() waits for the event loop to go idle before it takes the screenshot. it won't wait more than 2000ms (this delay is defined by the gecko dom.browserelement.maxscreenshotdelayms preference). syntax var instanceofdomrequest = instanceofhtmliframeelement.getscreenshot(maxwidth, maxheight, mimetype); returns a domrequest for handling the screenshot request. its request.onsuccess handler handles the success case (the screenshot is contained in request.result as a blob object...
... maxheight a number representing the maximum height of the screenshot in device pixels. ...
... maxheight a number representing the maximum height of the screenshot in device pixels. mimetype optional a mime type specifying the format of the image to be returned; if not specified, the default used is image/jpeg. ...
mozbrowserasyncscroll
boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: top the scroll top position in css pixels of the document within the browser <iframe>. left the scroll left position in css pixels of the document within the browser <iframe>. width the width in css pixels of the visible part of the document within the browser <iframe>. height the height in css pixels of the visible part of the document within the browser <iframe>. scrollwidth the total content width in css pixels of the document within the browser <iframe>. scrollheight the total content height in css pixels of the document within the browser <iframe>. note: top +...
... note: for performance reasons, this event is asynchronous. that means that the value retrieved through the event object can be different than the real current position of the scroll when the event is processed. ...
...css pixels of the document within the browser <iframe>. scrollheight the total content height in css pixels of the document within the browser <iframe>. note: top + height may be larger than scrollheight. this indicates that the content is over-scrolled, which occurs when the page "rubber-bands" after being scrolled all the way to the bottom. similarly, left + width may be greater than scrollwidth, and both left and top may be negative. note: for performance reasons, this event is asynchronous. that means that the value retrieved through the event object can be different than the real current position of the scroll when the event is processed. examples var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserasyncscroll", function( event ) { console.log(...
mozbrowserresize
type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. ...
...g the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. ...
... object with the following properties: width a number representing the new width of the <iframe> viewport, in device pixels. height a number representing the new height of the <iframe> viewport, in device pixels. ...
mozbrowserscrollareachanged
type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. ...
...e of event. bubbles read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: width a number representing the new scroll area width of the <iframe> viewport, in css pixels. ...
...operties: width a number representing the new scroll area width of the <iframe> viewport, in css pixels. height a number representing the new scroll area height of the <iframe> viewport, in css pixels. ...
MozScrolledAreaChanged
this event, introduced in gecko 1.9.2, is fired whenever either or both of these values change. ...
...t target in the dom tree). typeread only domstring the type of event. bubblesread only boolean whether the event normally bubbles or not. cancelableread only boolean whether the event is cancellable or not. viewread only windowproxy document.defaultview (window of the document) detailread only long (float) 0. widthread only long (int) the width of the visible region of the document. heightread only long (int) the height of the visible region of the document. xread only long (int) the x coordinate of the left edge of the visible region of the document. yread only long (int) the y coordinate of the top edge of the visible region of the document. ex...
... the visible region of the document. ...
Scroll-linked effects
ith 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 javascript on the browser's main thread, it will be asynchronous relative to the user-visible scrolling. therefore, with asynchronous scrolling, the event handler will be delayed relat...
...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 snaps to a particular destination when the user's scrolling stops near that destination. <body s...
...if it is, then it triggers an animation to "snap" the scroll position to the top of the div. as this animation is driven by javascript on the browser's main thread, it can be interrupted by ot...
IAccessibleImage
cally significant information. the user can edit the content that includes an image and therefore the user needs to be able to review the image's position. method overview [propget] hresult description([out] bstr description ); [propget] hresult imageposition([in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods description() returns the localized description of the image. [propget] hresult description( [out] bstr description ); parameters description the localized description of the image. return value s_false if there is nothing to return, [out] value is null. s_ok. imageposition() returns the coordinates of the image. [propget] hresult imageposition( [in] enum ia2coordinatetype co...
... return value s_ok. ...
...y ); parameters coordinatetype specifies whether the returned coordinates should be relative to the screen or the parent object. x the x coordinate. y the y coordinate. return value s_ok. imagesize() returns the size of the image in units specified by parent's coordinate system. [propget] hresult imagesize( [out] long height, [out] long width ); parameters height the height of the image. width the width of the image. return value s_ok. ...
IAccessibleText
(). ...
...eried by at more often than other positions. because it does not represent an existing character its bounding box is defined in relation to preceding characters. it should be roughly equivalent to the bounding box of some character when inserted at the end of the text(). its height typically being the maximal height of all the characters in the text() or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate. [propget] hresult characterextents( [in] long offset, [in] enum ia2coordinatetype coordtype, [out] long x, [out] long y, [out] long width, [out] long height ); parameters offset index of the character for which to return its bounding box. the valid range is 0..length. coordtype specifies if the coordinates are rela...
... [out] long height ); parameters offset index of the character for which to return its bounding box. the valid range is 0..length. coordtype specifies if the coordinates are relative to the screen or to the parent window. x x coordinate of the top left corner of the bounding box of the referenced character. y y coordinate of the top left corner of the bounding box of the referenced character. width width of the bounding box of the referenced character. height height of the bounding box of the referenced character. return value e_invalidarg if bad [in] passed, [out] values are 0s. s_ok. ncharacters() returns total number of characters. [propget] hresult ncharacters( [out] long ncharacters ); parameters ncharacters missing description return value s_ok. newtext() returns any inserted te...
nsIDOMWindowInternal
if the name doesn't exist, then a new window is opened and the specified resource is loaded into its brows...
...if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">open(in domstring url, in domstring name...
...ned this current window. status domstring sets the text in the status bar at the bottom of the browser or returns the previously set text. defaultstatus domstring gets/sets the status bar text for the given window. location nsidomlocation readonly: returns a nsidomlocation object, which contains information about the url of the document. innerwidth long width of the browser window. innerheight long height of the browser window. outerwidth long gets the width of the outside of the browser window. outerheight long gets the height of the outside of the browser window. screenx long the horizontal distance of the left border of the user's browser from the left side of the screen. ...
AbstractRange - Web APIs
oints of a section of content within the document. as an abstract interface, you will not directly instantiate an object of type abstractrange. instead, you will use the range or staticrange interfaces. to understand the difference between those two interfaces, and how to choose which is appropriate for your needs. ...
... for your needs. ...
...: 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/abstractrange" target="_top"><rect x="1" y="1" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">abstractrange</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties collapsed read only a boolean value which is true if the range is collapsed. a collapsed range is one whose start position...
AnalyserNode.fftSize - Web APIs
e = 2048; var bufferlength = analyser.frequencybincount ; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = '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.li...
... working draft ...
... working draft ...
AnalyserNode.getByteFrequencyData() - Web APIs
les/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(); ... ...
...= audioctx.createanalyser(); ... ...
...); ... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = '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.fillstyle = '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. spe...
AudioNode - Web APIs
Web › API › AudioNode
generic interface for representing an audio processing module. examples include: an audio source (e.g. an html <audio> or <video> element, an oscillatornode, etc.), the audio destination, intermediate processing module (e.g. ...
...l (like gainnode) <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" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/d...
...dth="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/audionode" target="_top"><rect x="151" y="1" width="90" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="196" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">audionode</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: an audionode can be target of events, therefore it implements the eventta...
Background Tasks API - Web APIs
t to show the progress, along with a label with sections that are changed to present numeric information about the progress. in addition, there's a "start" button (creatively given the id "startbutton"), which the user will use to start the data processing. ...
... margin-top: 16px; width: 400px; height:500px; border-radius: 6px; border: 1px solid black; box-shadow: 4px 4px 2px black; } .logheader { margin: 0; padding: 0 6px 4px; height: 22px; background-color: lightblue; border-bottom: 1px solid black; border-radius: 6px 6px 0 0; } #log { font: 12px "courier", monospace; padding: 6px; overflow: auto; overflow-y: scroll; width: 388px; height: 460px; } .container { width: 400px; padding: 6px; border-radius: 6px; border: 1px solid black; box-shadow: 4px 4px 2px black; display: block; overflow: auto; } .label { display: inline-block; } .counter { text-align: right; padding-top: 4px; float: right; } .button { padding-top: 2px; padding-bottom: 4px; width: 100px; display: inline-block; f...
...play: block; overflow: auto; } .label { display: inline-block; } .counter { text-align: right; padding-top: 4px; float: right; } .button { padding-top: 2px; padding-bottom: 4px; width: 100px; display: inline-block; float: left; border: 1px solid black; cursor: pointer; text-align: center; margin-top: 0; color: white; background-color: darkgreen; } #progress { width: 100%; padding-top: 6px; } javascript content now that the document structure is defined, construct the javascript code that will do the work. the goal: to be able to add requests to call functions to a queue, with an idle callback that runs those functions whenever the system is idle for long enough a time to make progress. variable declarations let tasklist = []; let totaltaskcount = 0; ...
BaseAudioContext.createAnalyser() - Web APIs
ze = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = '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.li...
... working draft ...
... working draft ...
BiquadFilterNode.type - Web APIs
quencies above it pass through. the cutoff frequency. indicates how peaked the frequency is around the cutoff. the greater the value, the greater the peak. not used bandpass standard second-order bandpass filter. frequencies outside the given range of frequencies are attenuated; the frequencies inside it pass through. the center of the range of frequencies. controls the width of the frequency band. the greater the q value, the larger the frequency band. not used lowshelf standard second-order lowshelf filer. frequencies lower than the frequency get a boost, or an attenuation; frequencies over it are unchanged. the upper limit of the frequencies getting a boost or an attenuation. not used the boost, in db, to be applied; if negative, it will be ...
...ies lower than it are unchanged. the lower limit of the frequencies getting a boost or an attenuation. not used the boost, in db, to be applied; if negative, it will be an attenuation. peaking frequencies inside the range get a boost or an attenuation; frequencies outside it are unchanged. the middle of the frequency range getting a boost or an attenuation. controls the width of the frequency band. the greater the q value, the larger the frequency band. the boost, in db, to be applied; if negative, it will be an attenuation. notch standard notch filter, also called a band-stop or band-rejection filter. it is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated. the cen...
...the larger the frequency band. the boost, in db, to be applied; if negative, it will be an attenuation. notch standard notch filter, also called a band-stop or band-rejection filter. it is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated. the center of the range of frequencies. controls the width of the frequency band. the greater the q value, the larger the frequency band. not used allpass standard second-order allpass filter. it lets all frequencies through, but changes the phase-relationship between the various frequencies. the frequency with the maximal group delay, that is, the frequency where the center of the phase transition occurs. controls how sharp the tran...
BiquadFilterNode - Web APIs
above it pass through. the cutoff frequency. indicates how peaked the frequency is around the cutoff. the greater the value, the greater the peak. not used bandpass standard second-order bandpass filter. frequencies outside the given range of frequencies are attenuated; the frequencies inside it pass through. the center of the range of frequencies. controls the width of the frequency band. the greater the q value, the smaller the frequency band. not used lowshelf standard second-order lowshelf filter. frequencies lower than the frequency get a boost, or an attenuation; frequencies over it are unchanged. the upper limit of the frequencies getting a boost or an attenuation. not used the boost, in db, to be applied; if negative, i...
... than it are unchanged. the lower limit of the frequencies getting a boost or an attenuation. not used the boost, in db, to be applied; if negative, it will be an attenuation. peaking frequencies inside the range get a boost or an attenuation; frequencies outside it are unchanged. the middle of the frequency range getting a boost or an attenuation. controls the width of the frequency band. the greater the q value, the smaller the frequency band. the boost, in db, to be applied; if negative, it will be an attenuation. notch standard notch filter, also called a band-stop or band-rejection filter. it is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated. ...
...ler the frequency band. the boost, in db, to be applied; if negative, it will be an attenuation. notch standard notch filter, also called a band-stop or band-rejection filter. it is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated. the center of the range of frequencies. controls the width of the frequency band. the greater the q value, the smaller the frequency band. not used allpass standard second-order allpass filter. it lets all frequencies through, but changes the phase-relationship between the various frequencies. the frequency with the maximal group delay, that is, the frequency where the center of the phase transition occurs. controls how sharp ...
CSSCounterStyleRule - Web APIs
the csscounterstylerule interface represents an @counter-style at-rule. ...
...ing 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/cssrule" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssrule</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/...
...="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssrule</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/csscounterstylerule" target="_top"><rect x="116" y="1" width="190" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="211" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">csscounterstylerule</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent ...
Managing screen orientation - Web APIs
to know its orientation, it's good to have the ability to control the screen orientation in order to preserve or adapt the interface of a web application. there are several ways to handle screen orientation, both with css and javascript. the first is the orientation media query. this lets content adjust its layout using css, based on whether the browser window is in landscape mode (that is, its width is greater than its height) or portrait mode (its height is greater than its width). the second way is the javascript screen orientation api that can be used to get the current orientation of the screen itself and eventually lock it. adjusting layout based on the orientation one of the most common cases for orientation changes is when you want to revise the layout of your content based on the ...
... duis lacinia nisi nec sem viverra vitae fringilla nulla ultricies. in ac est dolor, quis tincidunt leo. cras commodo quam non tortor consectetur eget rutrum dolor ultricies. ut interdum tristique dapibus. ...
... margin : 0; padding: .5em; -moz-box-sizing: border-box; box-sizing: border-box; background: black; } li { display: inline-block; margin : 0; padding: 0.5em; background: white; } once we have some common styles we can start defining a special case for the orientation /* for portrait, we want the tool bar on top */ @media screen and (orientation: portrait) { #toolbar { width: 100%; } } /* for landscape, we want the tool bar stick on the left */ @media screen and (orientation: landscape) { #toolbar { position: fixed; width: 2.65em; height: 100%; } p { margin-left: 2em; } li + li { margin-top: .5em; } } and here's the result portrait landscape note: the orientation media qu...
CanvasRenderingContext2D.createImageData() - Web APIs
the canvasrenderingcontext2d.createimagedata() method of the canvas 2d api creates a new, blank imagedata object with the specified dimensions. all of the pixels in the new object are transparent black. syntax imagedata ctx.createimagedata(width, height); imagedata ctx.createimagedata(imagedata); parameters width the width to give the new imagedata object. a negative value flips the rectangle around the vertical axis. height the height to give the new imagedata object. a negative value flips the rectangle around the horizontal axis. imagedata an existing imagedata object from which to copy the width and height. the image itself is not copied. return value a new imagedata object with the specified width and height. the new object is filled with transparent black pixels. errors t...
... examples creating a blank imagedata object this snippet creates a blank imagedata object using the createimagedata() method. ...
... generated object is 100 pixels wide and 50 pixels tall, making 5,000 pixels in all. each pixel within an imagedata object consists of four array values, so the object's data property has a length of 4 × 5,000, or 20,000. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const imagedata = ctx.createimagedata(100, 50); console.log(imagedata); // imagedata { width: 100, height: 50, data: uint8clampedarray[20000] } filling a blank imagedata object this example creates and fills a new imagedata object with purple pixels. html <canvas id="canvas"></canvas> javascript since each pixel consists of four values, the for loop iterates by multiples of four. the array values associated with each pixel are r (red), g (green), b (blue), and a (alpha), in that ...
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const button1 = document.getelementbyid('button1'); const button2 = document.getelementbyid('button2'); document.addeventlistener('focus', redraw, true); document.addeventlistener('blur', redraw, true); canvas.addeventlistener('click', handleclick, false); redraw(); function redraw() { ctx.clearrect(0, 0, canvas.width, canvas.height); drawbutton(button1, 20, 20); drawbutton(button2, 20, 80); } function handleclick(e) { // calculate click coordinates const x = e.clientx - canvas.offsetleft; const y = e.clienty - canvas.offsettop; // focus button1, if appropriate drawbutton(button1, 20, 20); if (ctx.ispointinpath(x, y)) { button1.focus(); } // focus button2, if appropriate drawbutton...
...nvas.offsetleft; const y = e.clienty - canvas.offsettop; // focus button1, if appropriate drawbutton(button1, 20, 20); if (ctx.ispointinpath(x, y)) { button1.focus(); } // focus button2, if appropriate drawbutton(button2, 20, 80); if (ctx.ispointinpath(x, y)) { button2.focus(); } } function drawbutton(el, x, y) { const active = document.activeelement === el; const width = 150; const height = 40; // button background ctx.fillstyle = active ? 'pink' : 'lightgray'; ctx.fillrect(x, y, width, height); // button text ctx.font = '15px sans-serif'; ctx.textalign = 'center'; ctx.textbaseline = 'middle'; ctx.fillstyle = active ? 'blue' : 'black'; ctx.filltext(el.textcontent, x + width / 2, y + height / 2); // define clickable area ctx.beginpath(...
... living standard initial definition ...
CanvasRenderingContext2D.fillRect() - Web APIs
the canvasrenderingcontext2d.fillrect() method of the canvas 2d api draws a rectangle that is filled according to the current fillstyle. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. syntax void ctx.fillrect(x, y, width, height); the fillrect() method draws a filled rectangle whose starting point is at (x, y) and whose size is specified by width and height. the fill style is determined by the current fillstyle attribute. 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 valu...
... const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = '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. ...
...elementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = '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('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillrect(0, 0, canvas.width, canvas.height); specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.fillrect' in that specification. living standard ...
CanvasRenderingContext2D.miterLimit - Web APIs
olor in the canvas tutorial. syntax ctx.miterlimit = value; options value a number specifying the miter limit ratio, in coordinate space units. zero, negative, infinity, and nan values are ignored. the default value is 10.0. examples using the miterlimit property see the chapter applying styles and color in the canvas tutorial for more information. ...
...e chapter applying styles and color in the canvas tutorial for more information. ...
...eginpath(); ctx.moveto(0,0); ctx.linewidth = 15; ctx.lineto(100, 100); ctx.stroke();</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; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); screenshotlive sample specifications specification status comment html liv...
CanvasRenderingContext2D.stroke() - Web APIs
the current path, and 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. ...
... 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. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // first sub-path ctx.linewidth = 26; ctx.strokestyle = 'orange'; ctx.moveto(20, 20); ctx.lineto(160, 20); ctx.stroke(); // second sub-path ctx.linewidth = 14; ctx.strokestyle = 'green'; ctx.moveto(20, 80); ctx.lineto(220, 80); ctx.stroke(); // third sub-path ctx.linewidth = 4; ctx.strokestyle = '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 ...
...oth 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 stroke on top of the fill. the square on the right is drawn with the fill on top of the stroke. ...
CanvasRenderingContext2D.strokeRect() - Web APIs
the canvasrenderingcontext2d.strokerect() method of the canvas 2d api draws a rectangle that is stroked (outlined) according to the current strokestyle and other context settings. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. syntax void ctx.strokerect(x, y, width, height); the strokerect() method draws a stroked rectangle whose starting point is at (x, y) and whose size is specified by width and 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 ...
... const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.strokestyle = 'green'; ctx.strokerect(20, 10, 160, 100); result applying various context settings this example draws a rectangle with a drop shadow and thick, beveled outlines. ...
...strokestyle = 'green'; ctx.strokerect(20, 10, 160, 100); result applying various context settings this example draws a rectangle with a drop shadow and thick, beveled outlines. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.shadowcolor = '#d53'; ctx.shadowblur = 20; ctx.linejoin = 'bevel'; ctx.linewidth = 15; ctx.strokestyle = '#38f'; ctx.strokerect(30, 30, 160, 90); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.strokerect' in that specification. living standard ...
Document.getBoxObjectFor() - Web APIs
returns a boxobject (x, y, width, height) for a specified element. note: this method is obsolete. you should use the element.getboundingclientrect() method instead. syntax boxobject = document.getboxobjectfor(element); boxobject is an nsiboxobject. element is a domelement. ...
...for a specified element. note: this method is obsolete. ...
...lement. note: this method is obsolete. ...
Document.mozSetImageElement() - Web APIs
ction. imageelement is the new element to use as the background corresponding to that image element string. specify null to remove the background element. example this example changes the background of a <div> block each time the block is clicked by the user. view this example live. ...
...="text/css"> #mybox { background-image: -moz-element(#canvasbg); text-align: center; width: 400px; height: 400px; cursor: pointer; } </style> the css defined by the <style> block above is used by our <div> to use an element with the id "canvasbg" as its background. ...
...each time the function is called, the square is a different color (its red component is increased each time), so each time the user clicks the element, the background is filled with a brighter and brighter pattern of red tiles. ...
Element.getClientRects() - Web APIs
er-<svg>'s viewbox transform, if any). originally, microsoft intended this method to return a textrectangle object for each line of text. however, the cssom working draft specifies that it returns a domrect for each border box. for an inline element, the two definitions are the same. but for a block element, mozilla will return only a single rectangle. firefox 3.5 note firefox 3.5 adds width and height properties to the textrectangle object. the amount of scrolling that has been done of the viewport area (or any other scrollable element) is taken into account when computing the rectangles. the returned rectangles do not include the bounds of any child elements that might happen to overflow. for html <area> elements, svg elements that do not render anything themselves, display:non...
...<th>thead</th></tr> </thead> <tbody> <tr><td>tbody</td></tr> </tbody> </table> </div> css the css draws borders around the paragraph and the <span> inside each <div> block for the first example, around the <ol> and <li> for the second example, and around <table>, <th>, and <td> elements for the third example. strong { text-align: center; } div { display: inline-block; width: 150px; } div p, ol, table { border: 1px solid blue; } span, li, th, td { border: 1px solid green; } javascript the javascript code draws the client rects for all html elements that have css class withclientrectsoverlay assigned. function addclientrectsoverlay(elt) { /* absolutely position a div over each client rect so that its border width is the same as the rectangle's width. ...
...er = '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. tablerectdiv.style.width = (rect.width - 2) + 'px'; tablerectdiv.style.height = (rect.height - 2) + 'px'; document.body.appendchild(tablerectdiv); } } (function() { /* call function addclientrectsoverlay(elt) for all elements with assigned class "withclientrectsoverlay" */ var elt = document.getelementsbyclassname('with...
GlobalEventHandlers.onresize - Web APIs
e events. the resize event fires after the window has been resized. syntax window.onresize = functionref; value functionref is a function name or a function expression. the function receives a focusevent object as its sole argument. ...
...size event fires after the window has been resized. syntax window.onresize = functionref; value functionref is a function name or a function expression. the function receives a focusevent object as its sole argument. ...
...ctionref; value functionref is a function name or a function expression. the function receives a focusevent object as its sole argument. examples window size logger <p>resize the browser window to fire the <code>resize</code> event.</p> <p>window height: <span id="height"></span></p> <p>window width: <span id="width"></span></p> const heightoutput = document.queryselector('#height'); const widthoutput = document.queryselector('#width'); function resize() { heightoutput.textcontent = window.innerheight; widthoutput.textcontent = window.innerwidth; } window.onresize = resize; specification specification status comment html living standardthe definition of 'onresize' in that specification. living standard ...
GlobalEventHandlers.ontransitionend - Web APIs
ly 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. ...
...tyle 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. ...
...ion effect which makes the box's color and size change, and causes the box to rotate, while the mouse cursor hovers over it. .box { margin-left: 70px; margin-top: 30px; border-style: solid; border-width: 1px; display: block; width: 100px; height: 100px; background-color: #0000ff; color: #ffffff; padding: 20px; font: bold 1.6em "helvetica", "arial", sans-serif; transition: width 2s, height 2s, background-color 2s, transform 2s, color 2s; } .box:hover { background-color: #ffcccc; color: #000000; width: 200px; height: 200px; 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(eve...
HTMLImageElement.currentSrc - Web APIs
options using the sizes and/or htmlimageelement.srcset properties. currentsrc lets you determine which image from the set of provided images was selected by the browser. example in this example, two different sizes are provided for an image of a clock. one is 200px wide and the other is 400px wide. ...
...ts you determine which image from the set of provided images was selected by the browser. example in this example, two different sizes are provided for an image of a clock. one is 200px wide and the other is 400px wide. the sizes attribute is provided to indicate that the image should be drawn at 50% of the document width if the viewport is under 400px wide; otherwise, the image is drawn at 90% width of the document. ...
... is 400px wide. the sizes attribute is provided to indicate that the image should be drawn at 50% of the document width if the viewport is under 400px wide; otherwise, the image is drawn at 90% width of the document. ...
HTMLImageElement.naturalHeight - Web APIs
uralheight returns 0. example this example simply displays both the natural, density-adjusted size of an image as well as its rendered size as altered by the page's css and other factors. html <div class="box"> <img src="/files/16797/clock-demo-400px.png" class="image"> </div> <div class="output"> </div> the html features a 400x398 pixel image which is placed inside a <div>. css .box { width: 200px; height: 200px; } .image { width: 100%; } .output { padding-top: 2em; } the main thing of note in the css above is that the style used for the container the image will be drawn in is 200px wide, and the image will be drawn to fill its width (100%). javascript let output = document.queryselector(".output"); let image = document.queryselector("img"); window.addeventlistener("load...
... padding-top: 2em; } the main thing of note in the css above is that the style used for the container the image will be drawn in is 200px wide, and the image will be drawn to fill its width (100%). javascript let output = document.queryselector(".output"); let image = document.queryselector("img"); window.addeventlistener("load", event => { output.innerhtml += `natural size: ${image.naturalwidth} x ` + `${image.naturalheight} pixels<br>`; output.innerhtml += `displayed size: ${image.width} x ` + `${image.height} pixels`; }); the javascript code simply dumps the natural and as-displayed sizes into the <div> with the class output. this is done in response to the window's load event handler, in order to ensure that the image is available befor...
... result specifications specification status comment html living standardthe definition of 'htmlimageelement.naturalheight' in that specification. living standard browser compatibility the compatibility table on this page is generated from structured data. ...
KeyboardEvent.code - Web APIs
of what the actual corresponding characters are, such as if the user is using an azerty keyboard. html <p>use the wasd (zqsd on azerty) keys to move and steer.</p> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="world"> <polygon id="spaceship" points="15,0 0,30 30,30"/> </svg> <script>refresh();</script> css .world { margin: 0px; padding: 0px; background-color: black; width: 400px; height: 400px; } #spaceship { fill: orange; stroke: red; stroke-width: 2px; } javascript the first section of the javascript code establishes some variables we'll be using. shipsize contains the size of the ship the player is moving around, for convenience. position is used to track the position of the ship within the play field. moverate and turnrate are the number of pixels f...
...d each keystroke moves the ship and how many degrees of rotation the left and right steering controls apply per keystroke. angle is the current amount of rotation applied to the ship, in degrees; it starts at 0° (pointing straight up). finally, spaceship is set to refer to the element with the id "spaceship", which is the svg polygon representing the ship the player controls. let shipsize = { width: 30, height: 30 }; let position = { x: 200, y: 200 }; let moverate = 9; let turnrate = 5; let angle = 0; let spaceship = document.getelementbyid("spaceship"); next comes the function updateposition(). this function takes as input the distance the ship is to be moved, where positive is a forward movement and negative is a backward movement. this function computes the new position of th...
...position.y -= (math.cos(rad) * offset); if (position.x < 0) { position.x = 399; } else if (position.x > 399) { position.x = 0; } if (position.y < 0) { position.y = 399; } else if (position.y > 399) { position.y = 0; } } the refresh() function handles applying the rotation and position by using an svg transform. ...
Key Values - Web APIs
e keyboards. keyboardevent.key value description virtual keycode windows mac linux android "eisu" [1] the eisu key. this key's purpose is defined by the ime, but may be used to close the ime. kvk_jis_eisu (0x66) gdk_key_eisu_toggle (0xff2f) qt::key_eisu_toggle (0x01001130) keycode_eisu (212) "hankaku" [3] the hankaku (half-width characters) key. vk_oem_auto (0xf3) gdk_key_hankaku (0xff29) qt::key_hankaku (0x01001129) "hiragana" the hiragana key; selects kana characters mode. vk_oem_copy (0xf2) gdk_key_hiragana (0xff25) qt::key_hiragana (0x01001125) "hiraganakatakana" [6] toggles between the hiragana and katakana writing systems. gdk_key_hiragana_katak...
... qt::key_kanji (0x01001121) keycode_kana (218) "katakana" the katakana key. vk_oem_finish (0xf1) gdk_key_katakana (0xff26) qt::key_katakana (0x01001126) "romaji" [5] the romaji key; selects the roman character set. vk_oem_backtab (0xf5) gdk_key_romaji (0xff24) qt::key_romaji (0x01001124) "zenkaku" [4] the zenkaku (full width) characters key. vk_oem_enlw (0xf4) gdk_key_zenkaku (0xff28) qt::key_zenkaku (0x01001128) "zenkakuhanaku" [6] the zenkaku/hankaku (full width/half width) toggle key. gdk_key_zenkaku_hankaku (0xff2a) qt::zenkaku_hankaku (0x0100112a) keycode_zenkaku_hankaku (211) [1] prior to firefox 37, the eisu key was mapped to "romancharacters" by ...
...ankaku (full width/half width) toggle key. gdk_key_zenkaku_hankaku (0xff2a) qt::zenkaku_hankaku (0x0100112a) keycode_zenkaku_hankaku (211) [1] prior to firefox 37, the eisu key was mapped to "romancharacters" by mistake. [2] vk_hangul and vk_kana share the same numeric key value on windows, as do vk_hanja and vk_kanji. [3] prior to firefox 37, the hankaku (half-width) key generated the key value "halfwidth" on firefox. also, this key generates the value "unidentified" on internet explorer (tested on release 9 and 11). [4] internet explorer (tested on release 9 and 11) reports "unidentified" for the zenkaku key; firefox 36 and earlier identify this key as "fullwidth" on japanese keyboard layouts and "unidentified" on all other keyboard layouts. firefox 37 and...
MediaConfiguration - Web APIs
ing information, set the media type to record or transmission. for decoding, set the type to file or media-source. if the media is an audio file, the audio configuration must include a valid audio mime type as contenttype, the number of channels, the bitrate, and the sample rate. video configurations mush include a valid video mime type as contenttype, the bitrate, and framerate, along with the width and the height of the video file. all of these must be present, as in the examples below, or a typeerror will occur. a valid media decoding configuration, to be submitted as the parameter for mediacapabilities.decodinginfo() method, has it's `type` set as: file: for plain playback file. media-source: for media source files. a valid media encoding configuration, to be submitted as...
...ly transmitted. a valid audio configuration includes: contenttype: valid audio mime type. channels: number of channels used by the audio track. bitrate: number of bits used to encode one second of the audio file. samplerate: number of audio samples making up one second of the audio file. a valid video configuration includes: contenttype: valid video mime type. width: width of the video. height: height of the video. bitrate: number of bits used to encode one second of the video file. framerate: number of frames making up one second of video playback. example //create a video configuration to be tested const videodecoderconfig = { type : 'file', // 'record', 'transmission', or 'media-source' video : { contenttype : "video/webm;codecs=vp8",...
...ght: height of the video. bitrate: number of bits used to encode one second of the video file. framerate: number of frames making up one second of video playback. example //create a video configuration to be tested const videodecoderconfig = { type : 'file', // 'record', 'transmission', or 'media-source' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; const audioencoderconfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio...
MediaDevices.ondevicechange - Web APIs
the device's label (name) and whether it's an input or an output device. because the example provides a handler for the devicechange event, the list is refreshed any time a media device is attached to or removed from the device running the sample. ...
...toplay></video><br> <div class="left"> <h2>audio devices:</h2> <ul class="devicelist" id="audiolist"></ul> </div> <div class="right"> <h2>video devices:</h2> <ul class="devicelist" id="videolist"></ul> </div> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } video { margin-top: 20px; border: 1px solid black; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } h2 { margin-bottom: 4px; } .left { float:left; width: 48%; margin-right: 2% } .right { float:right; width: 48%; margin-left: 2% } .devicelist { border: 1px solid black; list-style-type: none; margin-top: 2px...
...e this example work, isn'tt related directly to ondevicechange, so we won't go into any detail. ...
OES_standard_derivatives - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. in webgl 2, the constant is available as gl.fragment_shader_derivative_hint and it requires glsl #version 300 es. constants this extension exposes one new constant, which can be used in the hint() and getparameter() methods. ...
...xt by default. in webgl 2, the constant is available as gl.fragment_shader_derivative_hint and it requires glsl #version 300 es. constants this extension exposes one new constant, which can be used in the hint() and getparameter() methods. ext.fragment_shader_derivative_hint_oes a glenum indicating the accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth. ...
...nt, which can be used in the hint() and getparameter() methods. ext.fragment_shader_derivative_hint_oes a glenum indicating the accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth. ...
PerformanceFrameTiming - Web APIs
browser should process a frame in about 16.7ms. an application can register a performanceobserver for "frame" performance entry types and the observer can retrieve data about the duration of each frame event. this information can be used to help identify areas that take too long to provide a good user experience. ...
...rience. ...
...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/performanceframetiming" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceframetiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but it extends the following performanceentry properties (for "frame" performance e...
PhotoCapabilities - Web APIs
ure.getphotocapabilities(). properties photocapabilities.redeyereduction read only returns one of "never", "always", or "controllable". the "controllable" value means the device's read-eye reduction is controllable by the user. photocapabilities.imageheight read only returns a mediasettingsrange object indicating the image height range supported by the user agent. photocapabilities.imagewidth read only returns a mediasettingsrange object indicating the image width range supported by the user agent. photocapabilities.filllightmode read only returns an array of available fill light options. options may include auto, off, or flash. example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotocapabilities() to modify...
...re; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specification status comment mediastream image capturethe definition of 'photoc...
... android full support 59chrome android full support 59firefox android ? opera android full support 43safari ios ? samsung internet android full support 7.0imagewidth experimentalchrome full support 59edge full support ≤79firefox ? ie ? opera full support 46safari ? webview android full support ...
Pointer Lock API - Web APIs
equestanimationframe() call has previously been made, and if so, calls it again as required, and calls the canvasdraw() function that updates the canvas scene. a tracker is also set up to write out the x and y values to the screen, for reference. ...
...t updates the canvas scene. a tracker is also set up to write out the x and y values to the screen, for reference. ...
...if you lock one iframe, you cannot try to lock another iframe and transfer the target to it; pointer lock will error out. to avoid this limitation, first unlock the locked iframe, and then lock the othe...
Using Pointer Events - Web APIs
d for specifying a single 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. <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 ...
...ingtouchindexbyid(evt.pointerid); log("continuing touch: idx = " + idx); if (idx >= 0) { ctx.beginpath(); log("ctx.moveto(" + ongoingtouches[idx].pagex + ", " + ongoingtouches[idx].pagey + ");"); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); log("ctx.lineto(" + evt.clientx + ", " + evt.clienty + ");"); ctx.lineto(evt.clientx, evt.clienty); ctx.linewidth = 4; ctx.strokestyle = color; ctx.stroke(); ongoingtouches.splice(idx, 1, copytouch(evt)); // swap in the new touch record log("."); } else { log("can't figure out which touch to continue: idx = " + idx); } } this function looks in our cached touch information array for the previous information about each touch to determine the starting point for each touch's new line ...
...handleend() function below. its job is to draw the last line segment for the touch that ended and remove the touch point from the ongoing touch list. ...
RTCDtlsTransport - Web APIs
n about sctp packets transmitted and received by an connection's data channels. features of the dtls transport include the addition of security to the underlying transport; the rtcdtlstransport interface can be used to obtain information about the underlying transport and the security added to it by the dtls layer. ...
...e dtls layer. ...
...nline-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/rtcdtlstransport" target="_top"><rect x="1" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcdtlstransport</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} propertiesicetransport read only the read-only rtcdtlstransport property icetransport contains a reference to the underlying rtcicetr...
RTCRtpEncodingParameters.maxBitrate - Web APIs
crtpencodingparameters dictionary's maxbitrate property specifies the maximum number of bits per second to allow a track encoded with this encoding to use. syntax rtpencodingparameters.maxbitrate = maxbitspersecond; rtpencodingparameters = { maxbitrate: maxbitspersecond }; maxbitspersecond = rtpencodingparameters.maxbitrate; value an unsigned long integer value specifying the maximum bandwidth this encoding is permitted to use for a track of media it encodes in terms of bits per second. other parameters may further reduce the bandwidth used by the track; for example, maxframerate will, if set low enough, constrain the bandwidth as well. in addition, there's no guarantee that the network interface can support the specified bandwidth, in which case the actual bandwidth will be lower. t...
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpencodingparameters.maxbitrate' in that specification. ...
...mple, maxframerate will, if set low enough, constrain the bandwidth as well. in addition, there's no guarantee that the network interface can support the specified bandwidth, in which case the actual bandwidth will be lower. this value is computed using the standard transport independent application specific maximum (tias) bandwidth as defined by rfc 3890, section 6.2.2; this is the maximum bandwidth needed without considering protocol overheads from ip, tcp or udp, and so forth. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpencodingparameters.maxbitrate' in that specification. candidate recommendation initial definition. ...
Range.getBoundingClientRect() - Web APIs
ge.getboundingclientrect() example html <div id="highlight"></div> <p>this example positions a "highlight" rectangle behind the contents of a range. the range's content <b>starts here</b> and continues on until it <b>ends here</b>. ...
... working draft initial specification. ...
... working draft initial specification. ...
SVGAnimateColorElement - Web APIs
the svganimatecolorelement interface corresponds to the <animatecolor> element. ...
...ement. ...
... methods this interf...
SVGExternalResourcesRequired - Web APIs
the svgexternalresourcesrequired interface defines an interface which applies to all elements where this element or one of its descendants can reference an external resource. ...
.... ...
... 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/svgexternalresourcesrequired" target="_top"><rect x="1" y="1" width="280" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="141" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgexternalresourcesrequired</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. properties svgexternalresourcesrequired.externalreso...
SVGFilterPrimitiveStandardAttributes - Web APIs
the svgfilterprimitivestandardattributes interface defines the set of dom attributes that are common across the filter primitive 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/svgfilterprimitivestandardattributes" target="_top"><rect x="1" y="1" width="360" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="181" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfilterprimitivestandardattributes</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgfilterprimitivestandardattributes.
...ributes</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgfilterprimitivestandardattributes.x read only an svganimatedlength corresponding to the x attribute of the given element. svgfilterprimitivestandardattributes.y read only an svganimatedlength corresponding to the y attribute of the given element. svgfilterprimitivestandardattributes.width read only an svganimatedlength corresponding to the width attribute of the given element. svgfilterprimitivestandardattributes.height read only an svganimatedlength corresponding to the height attribute of the given element. svgfilterprimitivestandardattributes.result read only an svganimatedstring corresponding to the result attribute of the given element. methods this interface does ...
SVGFontElement - Web APIs
the svgfontelement interface corresponds to the <font> elements. object-oriented access to the attributes of the <font> element via the svg dom is not possible. ...
... not possible. ...
...inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontelement" target="_top"><rect x="1" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement and implements properties from svgextern...
SVGFontFaceElement - Web APIs
the svgfontfaceelement interface corresponds to the <font-face> elements. object-oriented access to the attributes of the <font-face> element via the svg dom is not possible. ...
... possible. ...
...ne-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfaceelement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfaceelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement. methods this interface has no met...
SVGFontFaceFormatElement - Web APIs
the svgfontfaceformatelement interface corresponds to the <font-face-format> elements. object-oriented access to the attributes of the <font-face-format> element via the svg dom is not possible. ...
...ble. ...
...ck; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfaceformatelement" target="_top"><rect x="1" y="1" width="240" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="121" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfaceformatelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement. methods this interface has...
SVGFontFaceNameElement - Web APIs
the svgfontfacenameelement interface corresponds to the <font-face-name> elements. object-oriented access to the attributes of the <font-face-name> element via the svg dom is not possible. ...
...sible. ...
...lock; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfacenameelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfacenameelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement. methods this interface has n...
SVGFontFaceSrcElement - Web APIs
the svgfontfacesrcelement interface corresponds to the <font-face-src> elements. object-oriented access to the attributes of the <font-face-src> element via the svg dom is not possible. ...
...ssible. ...
...block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfacesrcelement" target="_top"><rect x="1" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="106" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfacesrcelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement. methods this interface has no...
SVGFontFaceUriElement - Web APIs
the svgfontfaceurielement interface corresponds to the <font-face-uri> elements. object-oriented access to the attributes of the <font-face-uri> element via the svg dom is not possible. ...
...ssible. ...
...block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfaceurielement" target="_top"><rect x="1" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="106" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfaceurielement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement. methods this interface has no...
SVGGlyphRefElement - Web APIs
the svgglyphrefelement interface corresponds to the <glyphref> elements. ...
... elements. ...
...ne-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgglyphrefelement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgglyphrefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svgelement and implements properties from svgurireference and sv...
SVGGraphicsElement: copy event - Web APIs
ing setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault(). however, the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard. ...
...wever, the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard. ...
...le html <?xml version="1.0" encoding="utf-8"?> <svg viewbox="0 0 100 30" width="600" height="320" xmlns="http://www.w3.org/2000/svg"> <text x="5" y="10" id="text-to-copy">copy this text</text> <foreignobject x="5" y="20" width="90" height="20"> <input xmlns="http://www.w3.org/1999/xhtml" placeholder="paste it here"/> </foreignobject> </svg> css input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementsbytagname("text")[0].addeventlistener("copy", evt => { evt.clipboarddata.setdata('text/plain', document.getselection().tostring().touppercase()); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2...
getBBox() - Web APIs
te applied to it or the parent elements. ...
... <g id="group_text_1"> <text x="5" y="16" transform="scale(2, 2)">hello world!</text> <text x="8" y="32" transform="translate(0 20) scale(1.25 1)">hello world again!</text> </g> <!-- shows bbox in green --> <rect id="rect_1" stroke="#00ff00" stroke-width="3" fill="none"> </rect> <!-- shows boundingclientrect in red --> <rect id="rect_2" stroke="#ff0000" stroke-width="3" fill="none"></rect> </svg> javascript var rectbbox = document.queryselector('#rect_1'); var rectboundingclientrect = document.queryselector('#rect_2'); var groupelement = document.queryselector('#group_text_1'); var bboxgroup = groupelement.getbbox(); rectbbox.setattribute('x', bboxgroup.x); rectbbox.setattribute('y', bboxgroup.y); rectbbox.setattribute('width', bboxgroup.width); rectbbox...
... bboxgroup.x); rectbbox.setattribute('y', bboxgroup.y); rectbbox.setattribute('width', bboxgroup.width); rectbbox.setattribute('height', bboxgroup.height); var boundingclientrectgroup = groupelement.getboundingclientrect(); rectboundingclientrect.setattribute('x', boundingclientrectgroup.x); rectboundingclientrect.setattribute('y', boundingclientrectgroup.y); rectboundingclientrect.setattribute('width', boundingclientrectgroup.width); rectboundingclientrect.setattribute('height', boundingclientrectgroup.height); specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'getbbox' in that specification. recommendation initial definition (applies to svg elements only). ...
SVGGraphicsElement: paste event - Web APIs
mple to insert some different data or a transformation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually. it's possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents. ...
...dler must cancel the default action using event.preventdefault(), and then insert its desired data manually. it's possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents. ...
...ersion="1.0" encoding="utf-8"?> <svg viewbox="0 0 140 30" width="600" height="320" xmlns="http://www.w3.org/2000/svg"> <foreignobject x="5" y="-10" width="90" height="20"> <input xmlns="http://www.w3.org/1999/xhtml" value="copy this text"/> </foreignobject> <text x="5" y="30" id="element-to-paste-text" tabindex="1">paste it here</text> </svg> css input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementbyid("element-to-paste-text").addeventlistener("paste", evt => { evt.target.textcontent = evt.clipboarddata.getdata("text/plain").touppercase(); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) ...
SVGHKernElement - Web APIs
the svghkernelement interface corresponds to the <hkern> elements. object-oriented access to the attributes of the <hkern> element via the svg dom is not possible. ...
...not possible. ...
...nline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svghkernelement" target="_top"><rect x="1" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svghkernelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement. methods this interface has no method...
SVGMeshElement - Web APIs
the svgmeshelement interface provides access to the properties of <mesh> elements. ...
...esh> elements. ...
...inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgmeshelement" target="_top"><rect x="1" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgmeshelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svggeometryeleme...
SVGMissingGlyphElement - Web APIs
the svgmissingglyphelement interface corresponds to the <missing-glyph> elements. object-oriented access to the attributes of the <missing-glyph> element via the svg dom is not possible. ...
...sible. ...
...lock; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgmissingglyphelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgmissingglyphelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement and implements properties from ...
SVGSolidcolorElement - Web APIs
the svgsolidcolorelement interface corresponds to the <solidcolor> element. ...
...element. ...
...-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgsolidcolorelement" target="_top"><rect x="1" y="1" width="200" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="101" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgsolidcolorelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelemen...
SVGTRefElement - Web APIs
the svgtrefelement interface corresponds to the <tref> elements. object-oriented access to the attributes of the <tref> element via the svg dom is not possible. ...
... not possible. ...
...inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgtrefelement" target="_top"><rect x="1" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtrefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgtextpositioningelement and implements properties...
SVGURIReference - Web APIs
the svgurireference interface is used to reflect the href attribute and the deprecated xlink:href attribute. ...
...ref attribute. ...
...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/svgurireference" target="_top"><rect x="1" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgurireference</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgurireference.href read only an svganimatedstring that represents the value of the href attribute, and, on elements th...
SVGUnitTypes - Web APIs
the svgunittypes interface defines a commonly used set of constants used for reflecting gradientunits, patterncontentunits and other similar attributes. ...
...milar attributes. ...
...it is inva...
SVGVKernElement - Web APIs
the svgvkernelement interface corresponds to the <vkern> elements. object-oriented access to the attributes of the <vkern> element via the svg dom is not possible. ...
...not possible. ...
...nline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgvkernelement" target="_top"><rect x="1" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgvkernelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svgelement. methods this interface has no method...
SVGZoomAndPan - Web APIs
the svgzoomandpan interface is used to reflect the zoomandpan attribute, and is mixed in to other interfaces for elements that support this attribute. ...
... this attribute. ...
...it is in...
Screen.availLeft - Web APIs
Web › API › Screen › availLeft
returns the first available pixel available from the left side of the screen. syntax let availleft = window.screen.availleft; example let setx = window.screen.width - window.screen.availleft; let sety = window.screen.height - window.screen.availtop; window.moveto(setx, sety); notes in most cases, this property returns 0. if you work with two screens this property, evaluated on the right screen, returns the width of the left one in pixels (thereby indicating the x coordinate of the left edge of the screen on the right). on windows, this property depends on which screen is set as your primary, returning the x coordinate of the leftmost available pixel relative to the primary screen. that is, the primary screen's left edge always has the x coordinate 0, even if it's not the lef...
... primary, returning the x coordinate of the leftmost available pixel relative to the primary screen. ...
...l relative to the primary screen. ...
Using the Screen Capture API - Web APIs
never the cursor should never be visible in the generated stream. logicalsurface a boolean which if true indicates that the capture should include offscreen areas of the source, if there are any. none of the constraints are applied in any way until after the content to capture has been selected. the contraints alter what you see in the resulting stream. for example, if you specify a width constraint for the video, it's applied by scaling the video after the user selects the area to share. it doesn't establish a restriction on the size of the source itself. note: constraints never cause changes to the list of sources available for capture by the screen sharing api. this ensures that web applications can't force the user to share specific content by restricting the source list unt...
... to, and begin capturing, screen contents. a second button, "stop capture", which upon being clicked calls stopcapture() to terminate capture of screen contents. a <video> into which the captured screen contents are streamed. a <pre> block into which logged text is placed by the intercepted consolemethod. css the css is entirely cosmetic in this example. ...
...pture", which upon being clicked calls stopcapture() to terminate capture of screen contents. a <video> into which the captured screen contents 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 supp...
StylePropertyMap - Web APIs
the stylepropertymap interface of the the css typed object model api provides a representation of a css declaration block that is an alternative to cssstyledeclaration. ...
...edeclaration. ...
...nline-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/stylepropertymap" target="_top"><rect x="1" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">stylepropertymap</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, stylepropertymapreadonly. methods inherits methods from its parent, stylepropertymap...
Touch events - Web APIs
ime. example this example 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, fals...
... { console.log("continuing 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.strokestyle = 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 e...
...t from the ongoing touch list. ...
VTTRegion - Web APIs
Web › API › VTTRegion
vttregion.lines a double representing the height of the region, in number of lines. ...
... vttregion.lines a double representing the height of the region, in number of lines. ...
...chor y offset, as a percentage of the region. vttregion.viewportanchorx a double representing the viewport anchor x offset, as a percentage of the video. vttregion.viewportanchory a double representing the viewport anchor y offset, as a percentage of the video. vttregion.scroll an enum representing how adding new cues will move existing cues. examples var region = new vttregion(); region.width = 50; // use 50% of the video width region.lines = 4; // use 4 lines of height. region.viewportanchorx = 25; // have the region start at 25% from the left. var cue = new vttcue(2, 3, 'cool text to be displayed'); cue.region = region; // this cue will be drawn only within this region. specifications specification status comment webvtt: the web video text tracks format...
VisualViewport - Web APIs
que visualviewport representing the properties associated with that window. you can get a window's visual viewport using window.visualviewport. note: only the top-level window has a visual viewport that's distinct from the layout viewport. therefore, it's generally only the visualviewport object of the top-level window that's useful. for an <iframe>, visual viewport metrics like visualviewport.width always correspond to layout viewport metrics like document.documentelement.clientwidth. properties visualviewport also inherits properties from its parent, eventtarget. visualviewport.offsetleft read only returns the offset of the left edge of the visual viewport from the left edge of the layout viewport in css pixels. visualviewport.offsettop read only returns the offset of the top ed...
... from the top edge of the layout viewport in css pixels. visualviewport.pageleft read only returns the x coordinate of the visual viewport relative to the initial containing block origin of the top edge in css pixels. visualviewport.pagetop read only returns the y coordinate of the visual viewport relative to the initial containing block origin of the top edge in css pixels. visualviewport.width read only returns the width of the visual viewport in css pixels. visualviewport.height read only returns the height of the visual viewport in css pixels. visualviewport.scale read only returns the pinch-zoom scaling factor applied to the visual viewport. events listen to these events using addeventlistener() or by assigning an event listener to the relevant oneventname property of thi...
...ayoutviewport'); // since the 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. bottombar.style.transform = 'translate(' + offsetleft + 'px,' + offsettop + 'px) ' + 'scale(' + 1/viewport.scale + ')' } window.visualviewport.addeventlistener('scroll', viewporthandler); window.visualviewport.addeventlistener('resize', viewporthandler); note: this technique should be used...
WebGL2RenderingContext.renderbufferStorageMultisample() - Web APIs
possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal format. ...
... height a glsizei specifying the height of the renderbuffer in pixels. return value none. examples gl.renderbufferstoragemultisample(gl.renderbuffer, 4, gl.rbga4, 256, 256); specifications specification status comment webgl 2.0the definition of 'glrenderbufferstoragemultisample' in that specification. ...
...i gl.rg32ui gl.rg32i gl.rgb8 gl.rgba8 gl.srgb8_alpha8 gl.rgba4 gl.rgb565 gl.rgb5_a1 gl.rgb10_a2 gl.rgba8ui gl.rgba8i gl.rgb10_a2ui gl.rgba16ui gl.rgba16i gl.rgba32i gl.rgba32ui gl.depth_component16 gl.depth_component24 gl.depth_component32f gl.depth_stencil gl.depth24_stencil8 gl.depth32f_stencil8 gl.stencil_index8 width a glsizei specifying the width of the renderbuffer in pixels. height a glsizei specifying the height of the renderbuffer in pixels. return value none. examples gl.renderbufferstoragemultisample(gl.renderbuffer, 4, gl.rbga4, 256, 256); specifications specification status comment webgl 2.0the definition of 'glrenderbufferstoragemultisample' in that specification. editor's draft initial def...
WebGL2RenderingContext.texStorage3D() - Web APIs
possible values: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. level a glint specifying the number of texture levels. ...
... height a glsizei specifying the height of the texture. depth a glsizei specifying the depth of the texture. return value none. examples gl.texstorage3d(gl.texture_3d, 1, gl.rgb8, 256, 256, 256); specifications specification status comment webgl 2.0the definition of 'texstorage3d' in that specification. editor's...
...l.rgba16f gl.rgba32f gl.rgba8ui gl.compressed_r11_eac gl.compressed_signed_r11_eac gl.compressed_rg11_eac gl.compressed_signed_rg11_eac gl.compressed_rgb8_etc2 gl.compressed_rgba8_etc2_eac gl.compressed_srgb8_etc2 gl.compressed_srgb8_alpha8_etc2_eac gl.compressed_rgb8_punchthrough_alpha1_etc2 gl.compressed_srgb8_punchthrough_alpha1_etc2 width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. depth a glsizei specifying the depth of the texture. return value none. examples gl.texstorage3d(gl.texture_3d, 1, gl.rgb8, 256, 256, 256); specifications specification status comment webgl 2.0the definition of 'texstorage3d' in that specification. editor's draft initial definition for...
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
the webglrenderingcontext.compressedtexsubimage2d() method of the webgl api specifies a two-dimensional sub-rectangle for a texture image in a compressed format. compressed image formats must be enabled by webgl extensions before using this method or a webgl2renderingcontext must be used. ...
...e image in a compressed format. compressed image formats must be enabled by webgl extensions before using this method or a webgl2renderingcontext must be used. syntax // webgl 1: void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, arraybufferview? pixels); // additionally available in webgl 2: void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, imagesize, offset); void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, arraybufferview srcdata, optional srcoffset, optional srclengthoverride); parameters target a glenum specifying the binding point (target) of the active compressed texture. possible values: gl.texture_2d: a two-dimensional texture. gl.texture_cube_map_positive_...
...-mapped texture. gl.texture_cube_map_negative_z: negative z face for a cube-mapped texture. level a glint specifying the level of detail. level 0 is the base image level and level n is the nth mipmap reduction level. xoffset a glint specifying the horizontal offset within the compressed texture image. yoffset a glint specifying the vertical offset within the compressed texture image. width a glsizei specifying the width of the compressed texture. height a glsizei specifying the height of the compressed texture. format a glenum specifying the compressed image format. compressed image formats must be enabled by webgl extensions before using this method. possible values: when using the webgl_compressed_texture_s3tc extension: ext.compressed_rgb_s3tc_dxt1_ext ext.c...
WebGLRenderingContext.getParameter() - Web APIs
.getparameter(pname); parameters pname a glenum specifying which parameter value to return. see below for possible values. return value depends on the parameter. parameter names webgl 1 you can query the following pname parameters when using a webglrenderingcontext. ...
...ing to the default framebuffer. see also bindframebuffer. gl.front_face glenum gl.cw or gl.ccw. see also frontface. gl.generate_mipmap_hint glenum gl.fastest, gl.nicest or gl.dont_care. see also hint. ...
...s when using webgl extensions: constant returned type extension description ext.max_texture_max_anisotropy_ext glfloat ext_texture_filter_anisotropic maximum available anisotropy. ext.fragment_shader_derivative_hint_oes glenum oes_standard_derivatives accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth. ext.max_color_attachments_webgl glint webgl_draw_buffers the maximum number of framebuffer color attachment points. ext.max_draw_buffers_webgl glint webgl_draw_buffers the maximum number of draw buffers. ext.draw_buffer0_webgl ext.draw_buffer1_webgl ext.draw_buffer2_webgl ext.draw_buffer3_webgl ext.draw_buffer4_webgl ext.draw_buffe...
Raining rectangles - Web APIs
within a game loop. the game loop is responsible for drawing the animation frames, and keeping the animation responsive to user input. here, the game loop is implemented using timeouts. <p>you caught <strong>0</strong>. ...
...ct = this; // we get three random numbers and use them for new rectangle // size and position. for each we use a different number, // because we want horizontal size, vertical size and // position to be determined independently. ...
...rawingbufferwidth - rect.size[0]), gl.drawingbufferheight ]; rect.velocity = 1.0 + 6.0*math.random(); rect.color = getrandomvector(); gl.clearcolor(rect.color[0], rect.color[1], rect.color[2], 1.0); function getrandomvector() { return [math.random(), math.random(), math.random()]; } } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawi...
Scissor animation - Web APIs
ntil we change it again when a new square is created. <p>webgl animation by clearing the drawing buffer with solid color and applying scissor test.</p> <button id="animation-onoff"> press here to <strong>[verb goes here]</strong> the animation</button> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addeventlistener("load", setupanimation, false); // variables to hold the webgl context, and the color and // position of animated squares. var gl, color = getra...
... // decreased, to create the illusion of movement. position[1] -= velocity; // when the sqaure hits the bottom of the drawing buffer, // we override it with new square of different color and // velocity. if (position[1] < 0) { // horizontal position chosen randomly, and vertical // position at the top of the drawing buffer. ...
...size[0]), gl.drawingbufferheight ]; // random velocity between 1.0 and 7.0 velocity = 1.0 + 6.0*math.random(); color = getrandomcolor(); gl.clearcolor(color[0], color[1], color[2], 1.0); } } function getrandomcolor() { return [math.random(), math.random(), math.random()]; } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawi...
Compressed texture formats - Web APIs
ust first be enabled. usage unless otherwise specified, this article applies to both webgl 1 and 2 contexts. if supported, textures can be stored in a compressed format in video memory. this allows for additional detail while limiting the added video memory necessary. textures are uncompressed on the fly when being accessed by a shader. note that this advantage doesn't translate to network bandwidth: while the formats are better than uncompressed data, they are in general far worse than standard image formats such as png and jpg. as compressed textures require hardware support, therefore no specific formats are required by webgl; instead, a context can make different formats available, depending on hardware support. this site shows which formats are supported in the used browser. usage of ...
... texture_3d webgl_compressed_texture_astc yes yes webgl_compressed_texture_atc not usable with compressedtexsubimage2d/copytexsubimage2d. no no webgl_compressed_texture_etc yes no webgl_compressed_texture_etc1* not usable with compressedtexsubimage2d/copytexsubimage2d. no no webgl_compressed_texture_pvrtc width and height must be powers of 2. no no webgl_compressed_texture_s3tc width and height must be multiples of 4. yes no webgl_compressed_texture_s3tc_srgb width and height must be multiples of 4. ? no examples async function getcompressedtextureifavailable(gl) { const texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // creat...
... if not supported if (ext) { // the file is already in the correct compressed format const dataarraybuffer = await fetch('/textures/foobar512x512.rgba_s3tc_dxt1') .then(response => response.arraybuffer()); gl.compressedteximage2d(gl.texture_2d, 0, // set the base image level ext.compressed_rgba_s3tc_dxt1_ext, // the compressed format we are using 512, 512, // width, height of the image 0, // border, always 0 new dataview(dataarraybuffer)); gl.generatemipmap(); // create mipmap levels, like we would for a standard image return texture; } } ...
Adding 2D content to a WebGL context - Web APIs
.depth_test); // enable depth testing gl.depthfunc(gl.lequal); // near things obscure far things // clear the canvas before we start drawing on it. gl.clear(gl.color_buffer_bit | gl.depth_buffer_bit); // create a perspective matrix, a special matrix that is // used to simulate the distortion of perspective in a camera. ...
... matrix, a special matrix that is // used to simulate the distortion of perspective in a camera. // our field of view is 45 degrees, with a width/height // ratio that matches the display size of the canvas // and we only want to see objects between 0.1 units // and 100 units away from the camera. const fieldofview = 45 * math.pi / 180; // in radians const aspect = gl.canvas.clientwidth / gl.canvas.clientheight; const znear = 0.1; const zfar = 100.0; const projectionmatrix = mat4.create(); // note: glmatrix.js always has the first argument // as the destination to receive the result. mat4.perspective(projectionmatrix, fieldofview, aspect, znear, zfar); // set the drawing position to the "...
... projectionmatrix); gl.uniformmatrix4fv( programinfo.uniformlocations.modelviewmatrix, false, modelviewmatrix); { const offset = 0; const vertexcount = 4; gl.drawarrays(gl.triangle_strip, offset, vertexcount); } } the first step is to clear the canvas to our background color; then we establish the camera's perspective. we set a field of view of 45°, with a width to height ratio that matches the display dimensions of our canvas. we also specify that we only want objects between 0.1 and 100 units from the camera to be rendered. then we establish the position of the square plane by loading the identity position and translating away from the camera by 6 units. after that, we bind the square's vertex buffer to the attribute the shader is using for avertexpos...
Using textures in WebGL - Web APIs
gl.bindtexture(gl.texture_2d, texture); // because images have to be download over the internet // they might take a moment until they are ready. // until then put a single pixel in the texture so we can // use it immediately. when the image has finished downloading // we'll update the texture with the contents of the image. ...
...has finished downloading // we'll update the texture with the contents of the image. ...
...pixel); const image = new image(); image.onload = function() { gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, level, internalformat, srcformat, srctype, image); // webgl1 has different requirements for power of 2 images // vs non power of 2 images so check if the image is a // power of 2 in both dimensions. if (ispowerof2(image.width) && ispowerof2(image.height)) { // yes, it's a power of 2. generate mips. gl.generatemipmap(gl.texture_2d); } else { // no, it's not a power of 2. turn off mips and set // wrapping to clamp to edge gl.texparameteri(gl.texture_2d, gl.texture_wrap_s, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); gl.texpa...
Signaling and video calling - Web APIs
compatible candidate, that candidate's sdp is used by each peer to construct and open a connection, through which media then begins to flow. if they later agree on a better (usually higher-performance) candidate, the stream may change formats as needed. though not currently supported, a candidate received after media is already flowing could theoretically also be used to downgrade to a lower-bandwidth connection if needed. each ice candidate is sent to the other peer by sending a json message of type "new-ice-candidate" over the signaling server to the remote peer. each candidate message include these fields: type the message type: "new-ice-candidate". target the username of the person with whom negotiation is underway; the server will direct the message to this user only. candidate t...
...hey can both use to exchange the media, media begins to flow. each peer continues to send candidates until it runs out of options, even after the media has already begun to flow. this is done in hopes of identifying even better options than the one initially selected. if conditions change—for example the network connection deteriorates—one or both peers might suggest switching to a lower-bandwidth media resolution, or to an alternative codec. this triggers a new exchange of candidates, after which a another media format and/or codec change may take place. you can learn more about the codecs which webrtc requires browsers to support, which additional codecs are supported by which browsers, and how to choose the best codecs to use in the guide codecs used by webrtc. optionally, see rfc 8445...
...t when the peers successfully established their connection. in addition, if something happens to cause a change in the streaming scenario, negotiation will begin again, with the negotiationneeded event being sent to the rtcpeerconnection, and the entire process starts again as described before. this can happen in a variety of situations, including: changes in the network status, such as a bandwidth change, transitioning from wifi to cellular connectivity, or the like. switching between the front and rear cameras on a phone. a change to the configuration of the stream, such as its resolution or frame rate. receiving new streams when new tracks are added to the rtcpeerconnection— either by calling its addtrack() method or because of renegotiation of the stream's format—a track event ...
Example and tutorial: Simple synth keyboard - Web APIs
<span>current waveform: </span> <select name="waveform"> <option value="sine">sine</option> <option value="square" selected>square</option> <option value="sawtooth">sawtooth</option> <option value="triangle">triangle</option> <option value="custom">custom</option> </select> </div> </div> css .container { overflow-x: scroll; overflow-y: hidden; width: 660px; height: 110px; white-space: nowrap; margin: 10px; } .keyboard { width: auto; padding: 0; margin: 0; } .key { cursor: pointer; font: 16px "open sans", "lucida grande", "arial", sans-serif; border: 1px solid black; border-radius: 5px; width: 20px; height: 80px; text-align: center; box-shadow: 2px 2px darkgray; display: inline-block; position: relative; ma...
...", "arial", sans-serif; border: 1px solid black; border-radius: 5px; width: 20px; height: 80px; text-align: center; box-shadow: 2px 2px darkgray; display: inline-block; position: relative; margin-right: 3px; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } .key div { position: absolute; bottom: 0; text-align: center; width: 100%; pointer-events: none; } .key div sub { font-size: 10px; pointer-events: none; } .key:hover { background-color: #eef; } .key:active { background-color: #000; color: #fff; } .octave { display: inline-block; padding: 0 6px 0 0; } .settingsbar { padding-top: 8px; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: relative; vertical-align: middl...
...%; pointer-events: none; } .key div sub { font-size: 10px; pointer-events: none; } .key:hover { background-color: #eef; } .key:active { background-color: #000; color: #fff; } .octave { display: inline-block; padding: 0 6px 0 0; } .settingsbar { padding-top: 8px; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: relative; vertical-align: middle; width: 100%; height: 30px; } .left { width: 50%; position: absolute; left: 0; display: table-cell; vertical-align: middle; } .left span, .left input { vertical-align: middle; } .right { width: 50%; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } javascript ...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
if, on this device, it's determined that due to gpu limitations the browser needs to reduce image quality in order to improve performance to an acceptable level, it might choose to halve the resolution. in this case, the value returned by xrwebgllayer.getnativeframebufferscalefactor() will be 2.0. this method of dividing the frame buffer between views is shown in the following diagram. now the width and height of the frame buffer are 50% what they were before, resulting in a total frame buffer size of 1280 by 720 pixels, with each eye's half of the buffer being 640x720 pixels. now we can see the coordinates of each of the viewports representing these two views: since each eye gets half of the frame buffer, the result is that the left eye gets a 640x720 portion of the buffer with the viewp...
... buffer are 50% what they were before, resulting in a total frame buffer size of 1280 by 720 pixels, with each eye's half of the buffer being 640x720 pixels. now we can see the coordinates of each of the viewports representing these two views: since each eye gets half of the frame buffer, the result is that the left eye gets a 640x720 portion of the buffer with the viewport's x and y at 0, the width at 640, and the height set to 720. the right eye gets the other half of the frame buffer, with its viewport's x set at 639. while rendering a frame for this scene, we get the viewport for the view and apply it to webgl, then render the scene. this ensures that the scene we render will not only match the viewpoint we need to express (which is defined by the position and orientation data in the po...
...e for xrsession by calling its updaterenderstate() method, passing the new gllayer in using the xrrenderstate dictionary's xrrenderstate.baselayer property. the result is a rendering context that looks like the diagram below: each time the xrviewerpose's views are iterated over for rendering, the rendering loop obtains an xrview for the left eye which has its top-left corner at (0, 0) with its width and height being 1280x1440 pixels. the right eye it obtains has its top-left corner at 1280, 0 with the same width and height: 1280x1440. specifications specification status comment webxr device apithe definition of 'static xrwebgllayer.getnativeframebufferscalefactor()' in that specification. working draft initial definition. ...
XRWebGLLayer - Web APIs
webglrenderingcontext or webgl2renderingcontext as the destination context. properties antialias read only a boolean value indicating whether or not the webgl context's framebuffer supports anti-aliasing. the specific type of anti-aliasing is determined by the user agent. framebuffer read only returns a webglframebuffer suitable for passing into the bindframebuffer() method. framebufferwidth read only returns the width of the xrwebgllayer's framebuffer. framebufferheight read only returns the height of the layer's framebuffer. ignoredepthvalues read only a boolean which indicates whether or not the webxr compositor should make use of the contents of the layer's depth buffer while compositing the scene. methods getviewport() returns a new xrviewport instance representing...
...in this way, for example, the rendering of the left eye's point of view and of the right eye's point of view are each placed into the correct parts of the framebuffer. ...
...scribing the position and viewing angle of the left eye and another doing the same for the right. let pose = xrframe.getviewerpose(xrreferencespace); if (pose) { let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebffer); for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* render the view */ } } specifications specification status comment webxr device apithe definition of 'xrwebgllayer' in that specification. working draft initial definition. ...
-moz-context-properties - CSS: Cascading Style Sheets
n typediscrete formal syntax none | [ fill | fill-opacity | stroke | stroke-opacity ]# examples exposing fill and stroke to an svg image in this example we have a simple svg embedded using an <img> element. you first need to specify on the embedding element the properties whose values you wish to expose to the embedded svg, using the -moz-context-properties property. ...
...sing the -moz-context-properties property. ...
...roperty. ...
:target - CSS: Cascading Style Sheets
Web › CSS › :target
<figure> <a href="#" class="close"></a> <figcaption>cras risus odio, pharetra nec ultricies et, mollis ac augue. nunc et diam quis sapien dignissim auctor. ...
...pien dignissim auctor. ...
...e; left: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } /* lightbox content */ .lightbox figcaption { width: 25rem; position: relative; padding: 1.5em; background-color: lightpink; } /* close button */ .lightbox .close { position: relative; display: block; } .lightbox .close::after { right: -1rem; top: -1rem; width: 2rem; height: 2rem; position: absolute; display: flex; z-index: 1; align-items: center; justify-content: center; background-color: black; border-radius: 50%; color: white; content: "×"; cursor: pointer; } /* lightbox overlay */ .lightbox .close::before { left: 0; top: 0; width: 100%; height: 100%; position: fixed; background-color: rgba(0,0,0,.7); content: "...
font-stretch - CSS: Cascading Style Sheets
t expanded. <percentage> a <percentage> value between 50% and 200% (inclusive). negative values are not allowed for this property. in earlier versions of the font-stretch specification, the property accepts only the nine keyword values. css fonts level 4 extends the syntax to accept a <percentage> value as well. this enables variable fonts to offer something more like a continuum of character widths. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths. if the font does not provide a face that exactly matches the given value, then values less than 100% map to a narrower face, and values greater than or equal to 100% map to a wider face. keyword to numeric mapping the table below shows the mapping between keyword values and numeric percentages:...
... acce...
... accessibility concerns people with dyslexia and other cognitive conditions may have difficulty reading fonts that are too condensed, especially if the font has a low contrast color ratio. ...
aspect-ratio - CSS: Cascading Style Sheets
the aspect-ratio css media feature can be used to test the aspect ratio of the viewport. syntax the aspect-ratio feature is specified as a <ratio> value representing the width-to-height aspect ratio of the viewport. it is a range feature, meaning you can also use the prefixed min-aspect-ratio and max-aspect-ratio variants to query minimum and maximum values, respectively. examples the example below is contained in an <iframe>, which creates its own viewport. resize the <iframe> to see aspect-ratio in action. html <div id='inner'> watch this element as you resize your viewport's width and height. </div> css /* minimum aspect ratio */ @media (min-aspect-ratio: 8/5) { div { background: #9af; /* blue */ } } /* maximum aspect ratio */ @media (max-aspect-ratio: 3/2) { div { ...
...{ div { background: #9af; /* blue */ } } /* maximum aspect ratio */ @media (max-aspect-ratio: 3/2) { div { background: #9ff; /* cyan */ } } /* exact aspect ratio, put it at the bottom to avoid override*/ @media (aspect-ratio: 1/1) { div { 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-...
...ght: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=w.oninput=function(){ outer.style.width=w.value+"px" wf.textcontent="width:"+w.value } h.onchange=h.oninput=function(){ outer.style.height=h.value+"px" hf.textcontent="height:"+h.value } result specifications specification status com...
@viewport - CSS: Cascading Style Sheets
Web › CSS › @viewport
ode), the initial viewport is usually the portion of a device's screen that is available for application use. this may be either the full screen or the full screen area minus areas controlled by the operating system (such as a taskbar) or the application-available screen area (either the full screen or the screen minus any areas owned by the operating system or other applications). @viewport { width: 100vw; /*sets the width of the actual viewport to the device width*/ } note: the use of <meta name="viewport"> tag overrides @viewport syntax the at-rule contains a set of nested descriptors in a css block that is delimited by curly braces. a zoom factor of 1.0 or 100% corresponds to no zooming. larger values zoom in. smaller values zoom out. descriptors browser support for @viewport is...
...ponds to no zooming. larger values zoom in. smaller values zoom out. descriptors browser support for @viewport is weak at this time, with support being largely available in internet explorer and edge. even in those browsers, only a small number of descriptors are available. browsers will ignore @viewport if they don't support it, and will ignore any descriptors that they don't recognize. min-width used in the determination of the width of the viewport when the document is first displayed. max-width used in the determination of the width of the viewport when the document is first displayed. width a shorthand descriptor for setting both min-width and max-width. min-height used in the determination of the height of the viewport when the document is first displayed. max-height used in...
... zoom factor. max-zoom sets the maximum zoom factor. user-zoom controls whether or not the user should be able to change the zoom factor. orientation controls the document's orientation. viewport-fit controls the display of the document on non-rectangular displays. formal syntax @viewport { <group-rule-body> } examples setting viewport size, zoom, and orientation @viewport { min-width: 640px; max-width: 800px; } @viewport { zoom: 0.75; min-zoom: 0.5; max-zoom: 0.9; } @viewport { orientation: landscape; } specifications specification status comment css round display level 1the definition of '@viewport' in that specification. working draft defined the viewport-fit descriptor. css device adaptationthe definition of '@viewpo...
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
ecorated 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 border-top-right-radius...
... scaling background images describes how to change the size and repeating behavior of background images. ...
... scaling background images describes how to change the size and repeating behavior of background images. ...
CSS Basic Box Model - CSS: Cascading Style Sheets
css basic box model is a module of css that defines the rectangular boxes—including their padding and margin—that are generated for elements and laid out according to the visual formatting model. ...
... css basic box model is a module of css that defines the rectangular boxes—including their padding and margin—that are generated for elements and laid out according to the visual formatting model. ...
...odel is a module of css that defines the rectangular boxes—including their padding and margin—that are generated for elements and laid out according to the visual formatting model. reference properties properties controlling the flow of content in a box overflow overflow-x overflow-y properties controlling the size of a box height width max-height max-width min-height min-width properties controlling the margins of a box margin margin-bottom margin-left margin-right margin-top margin-trim properties controlling the paddings of a box padding padding-bottom padding-left padding-right padding-top other properties visibility guides introduction to the css box model explains one of the fundamental concept of css: the box model. this mod...
CSS Properties Reference - CSS: Cascading Style Sheets
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 borderbottomstyle border-bottom-width borderbottomwidth border-color bordercolor border-left borderleft border-left-color borderleftcolor border-left-style borderleftstyle border-left-width borderleftwidth border-right borderright border-right-color borderrightcolor border-right-style borderrightstyle border-right-width bord...
...derbottomwidth border-color bordercolor border-left borderleft border-left-color borderleftcolor border-left-style borderleftstyle border-left-width borderleftwidth border-right borderright border-right-color borderrightcolor border-right-style borderrightstyle border-right-width borderrightwidth border-style borderstyle border-top bordertop border-top-color bordertopcolor border-top-style bordertopstyle border-top-width bordertopwidth border-width borderwidth clear clear clip clip color color cursor cursor display display filter filter f...
... padding padding padding-bottom paddingbottom padding-left paddingleft padding-right paddingright padding-top paddingtop page-break-after pagebreakafter page-break-before pagebreakbefore position position stroke-dasharray strokedasharray stroke-dashoffset strokedashoffset stroke-width strokewidth text-align textalign text-decoration textdecoration text-indent textindent text-transform texttransform top top vertical-align verticalalign visibility visibility width width z-index zindex ...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
r, you use the custom property value by specifying your custom property name inside the var() function, in place of a regular property value: element { background-color: var(--main-bg-color); } first steps with custom properties let's start with this simple css that applies the same color to elements of different classes: .one { color: white; background-color: brown; margin: 10px; width: 50px; height: 50px; display: inline-block; } .two { color: white; background-color: black; margin: 10px; width: 150px; height: 70px; display: inline-block; } .three { color: white; background-color: brown; margin: 10px; width: 75px; } .four { color: white; background-color: brown; margin: 10px; width: 100px; } .five { background-color: brown; } we'll apply i...
...he cascade and let css inheritance solve this problem naturally. for non-trivial projects, this is not always possible. ...
...claring a custom property on the :root pseudo-class and using it where needed throughout the document, a css author can reduce the need for repetition: :root { --main-bg-color: brown; } .one { color: white; background-color: var(--main-bg-color); margin: 10px; width: 50px; height: 50px; display: inline-block; } .two { color: white; background-color: black; margin: 10px; width: 150px; height: 70px; display: inline-block; } .three { color: white; background-color: var(--main-bg-color); margin: 10px; width: 75px; } .four { color: white; background-color: var(--main-bg-color); margin: 10px; width: 100px; } .five { background-color: var(--main-bg-color); } <div> <div class="one"></div> <div class="two">text <span class="five">- more text</...
align-content - CSS: Cascading Style Sheets
spacing between each pair of adjacent items, the start edge and the first item, and the end edge and the last item, are all exactly the same. stretch if the combined size of the items along the cross axis is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container along the cross axis. safe used alongside an alignment keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes...
...discrete formal syntax normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>where <baseline-position> = [ first | last ]? ...
... = center | start | end | flex-start | flex-end examples css #container { height:200px; width: 240px; align-content: center; /* can be changed in the live sample */ background-color: #8c8c8c; } .flex { display: flex; flex-wrap: wrap; } .grid { display: grid; grid-template-columns: repeat(auto-fill, 50px); } div > div { box-sizing: border-box; border: 2px solid #8c8c8c; width: 50px; display: flex; align-items: center; justify-content: center; } #item1 { background-color: #8cffa0; min-height: 30px; } #item2 { background-color: #a0c8ff; min-height: 50px; } #item3 { background-color: #ffa08c; min-height: 40px; } #item4 { background-color: #ffff8c; min-height: 60px; } #item5 { background-color: #ff8cff; min-height: 70px; } #item6 { backgr...
align-items - CSS: Cascading Style Sheets
propriate axis. baseline first baseline last baseline all flex items are aligned such that their flex container baselines align. the item with the largest distance between its cross-start margin edge and its baseline is flushed with the cross-start edge of the line. stretch flex items are stretched such that the cross-size of the item's margin box is the same as the line while respecting width and height constraints. safe used alongside an alignment keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen...
...lies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]where <baseline-position> = [ first | last ]? ...
... | self-start | self-end | flex-start | flex-end examples css #container { height:200px; width: 240px; align-items: center; /* can be changed in the live sample */ background-color: #8c8c8c; } .flex { display: flex; flex-wrap: wrap; } .grid { display: grid; grid-template-columns: repeat(auto-fill, 50px); } div > div { box-sizing: border-box; border: 2px solid #8c8c8c; width: 50px; display: flex; align-items: center; justify-content: center; } #item1 { background-color: #8cffa0; min-height: 30px; } #item2 { background-color: #a0c8ff; min-height: 50px; } #item3 { background-color: #ffa08c; min-height: 40px; } #item4 { background-color: #ffff8c; min-height: 60px; } #item5 { background-color: #ff8cff; min-height: 70px; } #item6 { backgr...
backdrop-filter - CSS: Cascading Style Sheets
<percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
...alue>? ...
... editor's draft initial definition. ...
backface-visibility - CSS: Cascading Style Sheets
</div> </div> </div> <p> the three back faces (2, 4, 5) are hidden. ...
...re hidden. ...
...lity: visible; } .hidebf div { backface-visibility: hidden; } /* define the container div, the cube div, and a generic face */ .container { width: 150px; height: 150px; margin: 75px 0 0 75px; border: none; } .cube { width: 100%; height: 100%; perspective: 550px; 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; transform: rotatey(180deg) translatez(50px); } .right { background:...
<basic-shape> - CSS: Cascading Style Sheets
nsion that add up to more than the used dimension (such as left and right insets of 75% apiece) define a shape enclosing no area. for this specification, this results in an empty float area. circle() circle( [<shape-radius>]? [at <position>]? ) the <shape-radius> argument represents r, the radius of the circle. negative values are invalid. a percentage value here is resolved from the used width and height of the reference box as sqrt(width^2+height^2)/sqrt(2). the <position> argument defines the center of the circle. this defaults to center if omitted. ellipse() ellipse( [<shape-radius>{2}]? [at <position>]? ) the <shape-radius> arguments represent rx and ry, the x-axis and y-axis radii of the ellipse, in that order. negative values for either radius are invalid. percentage va...
... the position argument defines the center of the ellipse. this defaults to center if omitted. polygon() polygon( [<fill-rule>,]? [<shape-arg> <shape-arg>]# ) <fill-rule> represents the filling rule used to determine the interior of the polygon. possible values are nonzero and evenodd. ...
...h data commands in the same order, interpolate each path data command as real numbers. in all other cases no interpolation occurs. examples animated polygon in this example, we use the @keyframes at-rule to animate a clip path between two polygons. note that both polygons have the same number of vertices, which is necessary for this type of animation to work. ...
border-bottom-left-radius - CSS: Cascading Style Sheets
border-bottom-left-radius css property, the value of this property is then reset to its initial value by the shorthand property. ...
...initial value by the shorthand property. syntax /* the corner is a circle */ /* border-bottom-left-radius: radius */ border-bottom-left-radius: 3px; /* percentage values */ /* circle if box is a square or ellipse if box is a rectangle */ border-bottom-left-radius: 20%; /* same as above: 20% of horizontal(width) and vertical(height) */ border-bottom-left-radius: 20% 20%; /* 20% of horizontal(width) and 10% of vertical(height) */ border-bottom-left-radius: 20% 10%; /* the corner is an ellipse */ /* border-bottom-left-radius: horizontal vertical */ border-bottom-left-radius: 0.5em 1em; border-bottom-left-radius: inherit; with one value: the value is a <length> or a <percentage> denoting the radius of the circle to use for the border in that corner. with two values: the first value...
...second value is a <length> or a <percentage> denoting the vertical semi-major axis of the ellipse to use for the border in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercent...
border-bottom-right-radius - CSS: Cascading Style Sheets
f this property is then reset to its initial value by the shorthand property. ...
... with two values: the first value is a <length> or a <percentage> d...
...second value is a <length> or a <percentage> denoting the vertical semi-major axis of the ellipse to use for the border in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercent...
break-inside - CSS: Cascading Style Sheets
we also have a <figure> containing an image and a caption. by default, it is possible for you to get a break between the image and its caption, which is not what we want. to avoid this, we have set break-inside: avoid on the <figure>, which causes them to always stay together. html <article> <h1>main heading</h1> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla vi...
...ec nisi.</p> <p>in finibus viverra enim vel suscipit. quisque consequat velit eu orci malesuada, ut interdum tortor molestie. proin sed pellentesque augue. nam risus justo, faucibus non porta a, congue vel massa. cras luctus lacus nisl, sed tincidunt velit pharetra ac. ...
...acus nisl, sed tincidunt velit pharetra ac. duis suscipit faucibus dui sed ultricies.</p> </article> css html { font-family: helvetica, arial, sans-serif; } body { width: 80%; margin: 0 auto; } h1 { font-size: 3rem; letter-spacing: 2px; column-span: all; } h1 + p { margin-top: 0; } p { line-height: 1.5; break-after: column; } figure { break-inside: avoid; } img { max-width: 70%; display: block; margin: 0 auto; } figcaption { font-style: italic; font-size: 0.8rem; width: 70%; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-inside' in that specification. candidate recommendation no change. css region...
clamp() - CSS: Cascading Style Sheets
Web › CSS › clamp
tions. as math expressions, so you can use addition, subtraction, multiplication and division without using the calc() function itself. you may also use parentheses to establish computation order when needed. you can use different units for each value in your expressions, and different units in any math function making up any of the arguments. notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified. it is permitted to nest max() and min() functions as expression values, in which case the inner ones are treated as simple parentheses. the expressions are full math expressions, so you can use direct addition, subtra...
...)where <calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*where <calc-product> = <calc-value> [ '*' <calc-value> | '/' <number> ]*where <calc-value> = <number> | <dimension> | <percentage> | ( <calc-sum> ) examples min, max, and clamp comparison in this example we have a simple responsive example that makes use of min(), max(), and clamp() for some of the sizes. the <body> element's width is set as min(1000px, calc(70% + 100px)). this means that the width will be set at 1000px, unless the result of calc(70% + 100px) is less than 1000px, in which case it will be set to that value instead. min() allows you set a maximum value. the <p> element's font-size is set as max(1.2rem, 1.2vw). this means that the font-size will be set at 1.2rem, unless the computed value of 1.2vw is greater ...
...ue nec. nunc eu facilisis lorem. maecenas faucibus sapien eleifend, semper tellus at, pharetra quam. cras feugiat vulputate tortor at rhoncus. class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. nam non felis quis sem lobortis sodales vel id libero. phasellus sit amet placerat lorem. </p> css html { font-family: sans-serif; } body { margin: 0 auto; width: min(1000px, calc(70% + 100px)); } h1 { letter-spacing: 2px; font-size: clamp(1.8rem, 2.5vw, 2.8rem); } p { line-height: 1.5; font-size: max(1.2rem, 1.2vw); } specifications specification status comment css values and units module level 4the definition of 'clamp()' in that specification. editor's draft initial definition. ...
clear - CSS: Cascading Style Sheets
Web › CSS › clear
us sit amet diam. duis mattis varius dui. suspendisse eget dolor.</p> <p class="red">lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> <p class="left">this paragraph clears left.</p> </div> css .wrapper{ border:1px solid black; padding:10px; } .left { border: 1px solid black; clear: left; } .black { float: left; margin: 0; background-color: black; color: #fff; width: 20%; } .red { float: left; margin: 0; background-color: pink; width:20%; } p { width: 50%; } clear: right html <div class="wrapper"> <p class="black">lorem ipsum dolor sit amet, consectetuer adipiscing elit. phasellus sit amet diam. duis mattis varius dui. suspendisse eget dolor.</p> <p class="red">lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> <p class="righ...
...t amet diam. duis mattis varius dui. suspendisse eget dolor.</p> <p class="red">lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> <p class="right">this paragraph clears right.</p> </div> css .wrapper{ border:1px solid black; padding:10px; } .right { border: 1px solid black; clear: right; } .black { float: right; margin: 0; background-color: black; color: #fff; width:20%; } .red { float: right; margin: 0; background-color: pink; width:20%; } p { width: 50%; } clear: both html <div class="wrapper"> <p class="black">lorem ipsum dolor sit amet, consectetuer adipiscing elit. phasellus sit amet diam. duis mattis varius dui. suspendisse eget dolor. fusce pulvinar lacus ac dui.</p> <p class="red">lorem ipsum dolor sit amet, consectetuer adipiscing...
...p class="red">lorem ipsum dolor sit amet, consectetuer adipiscing elit. phasellus sit amet diam. duis mattis varius dui. suspendisse eget dolor.</p> <p class="both">this paragraph clears both.</p> </div> css .wrapper{ border:1px solid black; padding:10px; } .both { border: 1px solid black; clear: both; } .black { float: left; margin: 0; background-color: black; color: #fff; width:20%; } .red { float: right; margin: 0; background-color: pink; width:20%; } p { width: 45%; } specifications specification status comment css logical properties and values level 1the definition of 'float and clear' in that specification. editor's draft adds the values inline-start and inline-end css level 2 (revision 1)the definition of 'cl...
<display-box> - CSS: Cascading Style Sheets
lay: contents is not a css reset | adrian roselli examples in this first example, the paragraph with a class of secret is set to display: none; the box and any content is now not rendered. ...
...is set to display: none; the box and any content is now not rendered. display: none html <p>visible text</p> <p class="secret">invisible text</p> css p.secret { display: none; } result display: contents in this example the outer <div> has a 2-pixel red border and a width of 300px. however it also has display: contents specified therefore this <div> will not be rendered, the border and width will no longer apply, and the child element will be displayed as if the parent had never existed. ...
...contents in this example the outer <div> has a 2-pixel red border and a width of 300px. however it also has display: contents specified therefore this <div> will not be rendered, the border and width will no longer apply, and the child element will be displayed as if the parent had never existed. html <div class="outer"> <div>inner div.</div> </div> css .outer { border: 2px solid red; width: 300px; display: contents; } .outer > div { border: 1px solid green; } result specifications specification status css display module level 3the definition of 'display-box' in that specification. candidate recommendation ...
element() - CSS: Cascading Style Sheets
Web › CSS › element
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. ...
...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 including the paragraph "this box uses the element with the #mybackgro...
...sed 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 draft ...
flex-shrink - CSS: Cascading Style Sheets
tial; flex-shrink: unset; the flex-shrink property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 1. ...
... defaults to 1. formal definition initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set. ...
... candidate recommendation initial definition ...
font-variant - CSS: Cascading Style Sheets
-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, oldstyle-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 valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syn...
...name># ) | character-variant( <feature-value-name># ) | swash( <feature-value-name> ) | ornaments( <feature-value-name> ) | annotation( <feature-value-name> ) | [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] | <numeric-figure-values> | <numeric-spacing-values> | <numeric-fraction-values> | ordinal | slashed-zero | <east-asian-variant-values> | <east-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 | oldstyle-nums ]<n...
...cal-ligatures ]<contextual-alt-values> = [ contextual | no-contextual ]<feature-value-name> = <custom-ident><numeric-figure-values> = [ lining-nums | oldstyle-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">firefox rocks!</p> css p.normal { font-variant: normal; } p.small { font-variant: small-caps; } result specifications specification status comment css fonts module level 3the definition of 'font-variant' ...
font - CSS: Cascading Style Sheets
Web › CSS › font
<input type="text" class="curcss mandatory" id="input_font_family"> <br/> font-family <br/> mandatory </div> </div> </form> <div class="fontshorthand"> this is some sample text. ...
... <br/> font-family <br/> mandatory </div> </div> </form> <div class="fontshorthand"> this is some sample text. ...
...div> <br/><br/><br/><br/><br/><br/> css body, input { font: 14px arial; overflow: hidden; } .propinputcont { float: left; text-align: center; margin-right: 5px; width: 80px; } .setpropcont { float: left; margin-right: 5px; width: 120px; } .propinputs, .setpropcont { margin-bottom: 1em; } .curcss { border: none; border-bottom: 1px solid black; text-align: center; width: 80px; } .mandatory { border-bottom-color: red; } .cf:before, .cf:after { content: " "; display: table; } .cf:after { clear: both; } .tar { width: 40px; text-align: right; } .fontfamily { display: inline-block; } javascript var textareas = document.getelementsbyclassname("curcss"), shorttext = "", getcheckedvalue, setcss, getproperties, injectcss; getprope...
gap (grid-gap) - CSS: Cascading Style Sheets
Web › CSS › gap
0px); gap: calc(20px + 10%) calc(10% - 5px); /* global values */ gap: inherit; gap: initial; gap: unset; this property is specified as a value for <'row-gap'> followed optionally by a value for <'column-gap'>. if <'column-gap'> is omitted, it’s set to the same value as <'row-gap'>. <'row-gap'> and <'column-gap'> are each specified as a <length> or a <percentage>. values <length> is the width of the gutter separating the grid lines. <percentage> is the width of the gutter separating the grid lines, relative to the dimension of the element. formal definition initial valueas each of the properties of the shorthand:row-gap: normalcolumn-gap: normalapplies tomulti-column elements, flex containers, grid containersinheritednocomputed valueas each of the properties of the shorthand:row-...
...lti-column elementsanimation typeas each of the properties of the shorthand:row-gap: a length, percentage or calc();column-gap: a length, percentage or calc(); formal syntax <'row-gap'> <'column-gap'>? ...
...ap: a length, percentage or calc(); formal syntax <'row-gap'> <'column-gap'>? ...
grid-template-columns - CSS: Cascading Style Sheets
repeat(auto-fit, [linename1] 300px) [linename3]; /* global values */ grid-template-columns: inherit; grid-template-columns: initial; grid-template-columns: unset; values none indicates that there is no explicit grid. any columns will be implicitly generated and their size will be determined by the grid-auto-columns property. <length> a non-negative length, giving the width of the column. <percentage> is a non-negative <percentage> value relative to the inline size of the grid container. if the size of the grid container depends on the size of its tracks, then the percentage must be treated as auto. the intrinsic size contributions of the track may be adjusted to the size of the grid container and increase the final size of the track by the minimum amount that wo...
...ines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at...
... candidate recommendation initial definition css grid layout module level 2the definition of 'subgr...
image() - CSS: Cascading Style Sheets
the image is used on an element with opposite directionality, the image will be flipped horizontally in horizontal writing modes. if the directionality is omitted, the image won't be flipped if the language direction is changed. image fragments one key difference between url() and image() is the ability to add a media fragment identifier — a starting point along the x and y axis, along with a width and height — onto the image source to display only a section of the source image. the section of the image defined in the parameter becomes a standalone image. the syntax looks like so: background-image: image('myimage.webp#xywh=0,20,40,60'); the background image of the element will be the portion of the image myimage.webp that starts at the coordinate 0px, 20px (the top left hand corner) and...
...40,60'); the background image of the element will be the portion of the image myimage.webp that starts at the coordinate 0px, 20px (the top left hand corner) and is 40px wide and 60px tall. the #xywh=#,#,#,# media fragment syntax takes four comma separated numeric values. the first two represent the x and y coordates for the starting point of the box that will be created. the third value is the width of the box, and the last value is the height. by default, these are pixel values. the spacial dimension definition in the media specification indicates that percentages will be supported as well: xywh=160,120,320,240 /* results in a 320x240 image at x=160 and y=120 */ xywh=pixel:160,120,320,240 /* results in a 320x240 image at x=160 and y=120 */ xywh=percent:25,25,50,50 /* results in ...
...webp", "try.svg", "try.gif"); } in this example, the browser will display an image as generated content before the content of the element with the class of help. the image displayed will be a webp image, if webp is supported. if not, the svg example will be shown. if svg is not supported, the gif version will display. putting color on top of a background image .quarterlogo {height: 200px; width: 200px; border: 1px solid;} .quarterlogo { background-image: image(rgba(0, 0, 0, 0.25)), url("https://mdn.mozillademos.org/files/12053/firefox.png"); background-size: 25%; background-repeat: no-repeat; } <div class="quarterlogo">if supported, a quarter of this div has a darkened logo</div> the above will put a semi-transparent black mask over the firefox logo background image. ...
inline-size - 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. ...
... 25em; /* <percentage> values */ inline-size: 75%; /* keyword values */ inline-size: max-content; inline-size: min-content; inline-size: fit-content(20em); inline-size: auto; /* global values */ inline-size: inherit; inline-size: initial; inline-size: unset; if the writing mode is vertically oriented, the value of inline-size relates to the height of the element; otherwise, it relates to the width of the element. a related property is block-size, which defines the other dimension of the element. values the inline-size property takes the same values as the width and height properties. formal definition initial valueautoapplies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc();...
...related property is block-size, which defines the other dimension of the element. values the inline-size property takes the same values as the width and height properties. formal definition initial valueautoapplies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc(); formal syntax <'width'> examples setting inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; inline-size: 110px; } result specifications specification status comment css logical properties and values level 1the definition of 'inline-size' in that specification. editor's draft initi...
inset-inline-end - CSS: Cascading Style Sheets
defines the logical inline end inset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. it corresponds to the top, right, bottom, or left property depending on the values defined for writing-mode, direction, and text-orientation. /* <length> values */ inset-inline-end: 3px; inset-inline-end: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-inline-end: 10%; /* keyword value */ inset-inline-end: auto; /* global values */ inset-inline-end: inherit; inset-inline-end: initial; inset-inline-end: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-end property takes the same values as the left property. formal definition initi...
...d value */ inset-inline-end: auto; /* global values */ inset-inline-end: inherit; inset-inline-end: initial; inset-inline-end: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-end property takes the same values as the left property. ...
... editor's draft initial definition ...
inset-inline-start - CSS: Cascading Style Sheets
the logical inline start inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation. it corresponds to the top, right, bottom, or left property depending on the values defined for writing-mode, direction, and text-orientation. /* <length> values */ inset-inline-start: 3px; inset-inline-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-inline-start: 10%; /* keyword value */ inset-inline-start: auto; /* global values */ inset-inline-start: inherit; inset-inline-start: initial; inset-inline-start: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-start property takes the same values as the left property. formal defin...
... inset-inline-start: auto; /* global values */ inset-inline-start: inherit; inset-inline-start: initial; inset-inline-start: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-start property takes the same values as the left property. ...
... editor's draft initial definition ...
inset-inline - CSS: Cascading Style Sheets
physical offsets depending on the element's writing mode, directionality, and text orientation. it corresponds to the top and bottom, or right and left properties depending on the values defined for writing-mode, direction, and text-orientation. ...
.../* global values */ inset-inline: inherit; inset-inline: initial; inset-inline: unset; constituent properties this property is a shorthand for the following css properties: inset-inline-end inset-inline-start syntax values the inset-inline property takes the same values as the left property. ...
...ned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting inline start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline: 20px 50px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-inline' in that specification. editor's draft initial definition ...
justify-items - CSS: Cascading Style Sheets
d first or last baseline set of all the boxes in its baseline-sharing group. the fallback alignment for first baseline is start, the one for last baseline is end. stretch if the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. legacy makes the value inherited by the box descendan...
...ne-position> = [ first | last ]? baseline<overflow-position> = unsafe | safe<self-position> = center | start | end | self-start | self-end | flex-start | flex-end examples simple demonstration in the following example we have a simple 2 x 2 grid layout. initially the grid container is given a justify-items value of stretch (the default), which causes the grid items to stretch across the entire width of their cells. if you hover or tab onto the grid container however, it is given a justify-items value of center, which causes the grid items to span only as wide as their content width, and align in the center of their cells. html <article class="container" tabindex="0"> <span>first child</span> <span>second child</span> <span>third child</span> <span>fourth child</span> </article> c...
... of their cells. ...
justify-self - CSS: Cascading Style Sheets
d first or last baseline set of all the boxes in its baseline-sharing group. the fallback alignment for first baseline is start, the one for last baseline is end. stretch if the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. formal definition initial valueautoapplies toblock-l...
...sition> = [ first | last ]? baseline<overflow-position> = unsafe | safe<self-position> = center | start | end | self-start | self-end | flex-start | flex-end examples simple demonstration in the following example we have a simple 2 x 2 grid layout. initially the grid container is given a justify-items value of stretch — the default — which causes the grid items to stretch across the entire width of their cells. the second, third, and fourth grid items are then given different values of justify-self, to show how these override the justify-items value. these values cause the grid items to span only as wide as their content width, and align in different positions across their cells. html <article class="container"> <span>first child</span> <span>second child</span> <span>third chil...
...positions across their cells. ...
linear-gradient() - CSS: Cascading Style Sheets
, orange 10% 30%, yellow 50% 70%, green 90%); linear-gradient(red 0%, orange 10% 30%, yellow 50% 70%, green 90% 100%); by default, if there is no color with a 0% stop, the first color declared will be at that point. similarly, the last color will continue to the 100% mark, or be at the 100% mark if no length has been declared on that last stop. ...
... a 0% stop, the first color declared will be at that point. similarly, the last color will continue to the 100% mark, or be at the 100% mark if no length has been declared on that last stop. ...
... background: linear-gradient(45deg, red, blue); } gradient that starts at 60% of the gradient line body { width: 100vw; height: 100vh; } body { background: linear-gradient(135deg, orange 60%, cyan); } gradient with multi-position color stops this example uses multi-position color stops, with adjacent colors having the same color stop value, creating a striped effect. body { width: 100vw; height: 100vh; } body { background: linear-gradient(to right, red 20%, orange 20% 40%, yellow 40% 60%, green 60% 80%, blue 80%); } more linear-gradient examples please see using css gradients for more examples. specifications specification status comment css images module level 4the definition of 'gradient color-stops' in that specification. ...
mask-type - CSS: Cascading Style Sheets
Web › CSS › mask-type
i.e., that its alpha channel values must be used when applying it. ...
...ednocomputed valueas specifiedanimation typediscrete formal syntax luminance | alpha examples setting an alpha mask html <div class="redsquare"></div> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0"> <defs> <mask id="m" maskcontentunits="objectboundingbox" style="mask-type:alpha"> <rect x=".1" y=".1" width=".8" height=".8" fill="red" fill-opacity="0.7"/> </mask> </defs> </svg> css .redsquare { height: 100px; width: 100px; background-color: rgb(128, 128, 128); border: solid 1px black; mask: url("#m"); } result setting a luminance mask html <div class="redsquare"></div> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin...
...8" height=".8" fill="red" fill-opacity="0.7"/> </mask> </defs> </svg> css .redsquare { height: 100px; width: 100px; background-color: rgb(128, 128, 128); border: solid 1px black; mask: url("#m"); } result setting a luminance mask html <div class="redsquare"></div> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0"> <defs> <mask id="m" maskcontentunits="objectboundingbox" style="mask-type:luminance"> <rect x=".1" y=".1" width=".8" height=".8" fill="red" fill-opacity="0.7"/> </mask> </defs> </svg> css .redsquare { height: 100px; width: 100px; background-color: rgb(128, 128, 128); border: solid 1px black; mask: url("#m"); mask-type:luminance; } r...
mask - CSS: Cascading Style Sheets
Web › CSS › mask
element within svg graphic used as mask */ /* combined values */ mask: url(masks.svg#star) luminance; /* element within svg graphic used as luminance mask */ mask: url(masks.svg#star) 40px 20px; /* element within svg graphic used as mask positioned 40px from the top and 20px from the left */ mask: url(masks.svg#star) 0 0/50px 50px; /* element within svg graphic used as mask with a width and height of 50px */ mask: url(masks.svg#star) repeat-x; /* element within svg graphic used as horizontally repeated mask */ mask: url(masks.svg#star) stroke-box; /* element within svg graphic used as mask extending to the box enclosed by the stroke */ mask: url(masks.svg#star) exclude; /* element within svg graphic used as mask and combined with background using non-overlapp...
...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 ...
...see mask-image. <masking-mode> sets the masking mode of the mask image. ...
max-inline-size - CSS: Cascading Style Sheets
it relates to max-block-size, which defines the other dimension of the element. the source for this interactive example is stored in a github repository. ...
...it relates to max-block-size, which defines the other dimension of the element. the source for this interactive example is stored in a github repository. ...
...line-size: 300px; max-inline-size: 25em; /* <percentage> values */ max-inline-size: 75%; /* keyword values */ max-inline-size: auto; max-inline-size: max-content; max-inline-size: min-content; max-inline-size: fit-content(20em); /* global values */ max-inline-size: inherit; max-inline-size: initial; max-inline-size: unset; values the max-inline-size property takes the same values as the max-width and max-height properties. formal definition initial value0applies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as max-width and max-heightanimation typea length, percentage or calc(); formal syntax <'max-width'> examples setting max inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode:...
min-inline-size - 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. ...
...s */ min-inline-size: 10%; /* keyword values */ min-inline-size: max-content; min-inline-size: min-content; min-inline-size: fit-content(20em); /* global values */ min-inline-size: inherit; min-inline-size: initial; min-inline-size: unset; if the writing mode is vertically oriented, the value of min-inline-size relates to the minimum height of the element; otherwise, it relates to the minimum width of the element. a related property is min-block-size, which defines the other dimension of the element. values the min-inline-size property takes the same values as the min-width and min-height properties. formal definition initial value0applies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as min-width and min-heightanimation typea length,...
...ock-size, which defines the other dimension of the element. values the min-inline-size property takes the same values as the min-width and min-height properties. ...
minmax() - CSS: Cascading Style Sheets
Web › CSS › minmax
es a share of the remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. formal syntax minmax( [ <length> | <percentage> | min-content | max-content | auto ] , [ <length> | <percentage> | <flex> | min-content | max-content | auto ] ) css properties minmax() function can be used within: grid-template-columns grid-template-rows grid-auto-columns grid-auto-rows examples css #container { display: gr...
... </div> </div> result specifications ...
...grid-template-columns: minmax(min-content, 300px) minmax(200px, 1fr) 150px; grid-gap: 5px; box-sizing: border-box; height: 200px; width: 100%; background-color: #8cffa0; padding: 10px; } #container > div { background-color: #8ca0ff; padding: 5px; } html <div id="container"> <div> item as wide as the content, but at most 300 pixels. </div> <div> item with flexible width but a minimum of 200 pixels. </div> <div> inflexible item of 150 pixels width. </div> </div> result specifications specification status comment css grid layoutthe definition of 'minmax()' in that specification. candidate recommendation initial definition ...
mix-blend-mode - CSS: Cascading Style Sheets
class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> </div> </div> </div> html,body { height: 100%; box-sizing: border-box; background: #eee; } .grid { width: 100%; display: flex; font: 1em monospace; } .row { display: flex; flex: 1 auto; flex-direction: row; flex-wrap: wrap; height: auto; } .col { display: flex; flex: 1 auto; flex-direction: column; height: auto; } .cell { margin: .5em; padding: .5em; background-color: #fff; overflow: hidden; text-align: center; } .note { background: #fff3d4; padding: 1em; ma...
...dden; text-align: center; } .note { background: #fff3d4; padding: 1em; margin: .5em .5em 0; font: .8em sans-serif; text-align: left; white-space: nowrap; } .note + .row .cell { margin-top: 0; } .container { position: relative; background: linear-gradient(to right, #000 0%, transparent 50%, #fff 100%), linear-gradient(to bottom, #ff0 0%, #f0f 50%, #0ff 100%); width: 150px; height: 150px; margin: 0 auto; } .r { transform-origin: center; transform: rotate(-30deg); fill: url(#red); } .g { transform-origin: center; transform: rotate(90deg); fill: url(#green); } .b { transform-origin: center; transform: rotate(210deg); fill: url(#blue); } .isolate .group { isolation: isolate; } .normal .item { mix-blend-mode: normal; } .multiply .
...n; } .hue .item { mix-blend-mode: hue; } .saturation .item { mix-blend-mode: saturation; } .color .item { mix-blend-mode: color; } .luminosity .item { mix-blend-mode: luminosity; } using mix-blend-mode with html html <div class="isolate"> <div class="circle circle-1"></div> <div class="circle circle-2"></div> <div class="circle circle-3"></div> </div> css .circle { width: 80px; height: 80px; border-radius: 50%; mix-blend-mode: screen; position: absolute; } .circle-1 { background: red; } .circle-2 { background: lightgreen; left: 40px; } .circle-3 { background: blue; left: 20px; top: 40px; } .isolate { isolation: isolate; /* without isolation, the background color will be taken into account */ position: relative; } result using mix-b...
overscroll-behavior-block - CSS: Cascading Style Sheets
ueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing block overscrolling in this demo we have two block-level boxes, one inside the other. the outer box has a large height set on it so the page will scroll vertically. the inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large height so it will also scroll vertically. by default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want. to avoid this happening in the block direction, we've set overscroll-behavior-block: contain on the inner b...
...want. to avoid this happening in the block direction, we've set overscroll-behavior-block: contain on the inner box. ...
...> has been used to make it so that when the scroll boundaries of the yellow inner box are reached, the whole page does not begin to scroll.</p> </div> </div> </main> css main { height: 3000px; width: 500px; background-color: white; background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } main > div { height: 300px; width: 400px; overflow: auto; position: relative; top: 50px; left: 50px; overscroll-behavior-block: contain; } div > div { height: 1500px; width: 100%; background-color: yellow; background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } p { padding: 10px; background-color: rgba(255,0,0,0.5); margin: 0; width: 340px;...
overscroll-behavior-inline - CSS: Cascading Style Sheets
efault scroll overflow behavior is prevented. formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing inline overscrolling in this demo we have two block-level boxes, one inside the other. the outer box has a large width set on it so the page will scroll horizontally. the inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large width so it will also scroll horizontally. by default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want. to avoid this happening in...
...nt. to avoid this happening in the inline direction, we've set overscroll-behavior-inline: contain on the inner box. ...
...e> has been used to make it so that when the scroll boundaries of the yellow inner box are reached, the whole page does not begin to scroll.</p> </div> </div> </main> css main { height: 400px; width: 3000px; background-color: white; background-image: repeating-linear-gradient(to right, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } main > div { height: 300px; width: 400px; overflow: auto; position: relative; top: 50px; left: 50px; overscroll-behavior-inline: contain; } div > div { height: 100%; width: 1500px; background-color: yellow; background-image: repeating-linear-gradient(to right, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 19px, rgba(0,0,0,0.5) 20px); } p { padding: 10px; background-color: rgba(255,0,0,0.5); margin: 0; width: 360px;...
padding-block-end - CSS: Cascading Style Sheets
ike to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ padding-block-end: 10px; /* an absolute length */ padding-block-end: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-end: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-end: inherit; padding-block-end: initial; padding-block-end: unset; values the padding-block-end property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. ...
...his property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
...ther paddings of the element. formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block end padding for vertical text html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'padding-block-end' in that specification. editor's draft initial definition ...
padding-block-start - CSS: Cascading Style Sheets
contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ padding-block-start: 10px; /* an absolute length */ padding-block-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-start: inherit; padding-block-start: initial; padding-block-start: unset; values the padding-block-start property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orient...
... this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-end, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
...ich define the other paddings of the element. formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'padding-block-start' in that specification. editor's draft initial definition ...
padding-block - CSS: Cascading Style Sheets
maps to physical padding properties depending on the element's writing mode, directionality, and text orientation. /* <length> values */ padding-block: 10px 20px; /* an absolute length */ padding-block: 1em 2em; /* relative to the text size */ padding-block: 10px; /* sets both start and end values */ /* <percentage> values */ padding-block: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-block: inherit; padding-block: initial; padding-block: unset; these values corresponds to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: padding-block-end pa...
...rty depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: padding-block-end padding-block-start syntax values the padding-block property takes the same values as the padding-left property. ...
... the same values as the padding-left property. formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2} examples setting block padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-block: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'padding-block' in that specification. editor's draft initial definition ...
padding-inline-end - CSS: Cascading Style Sheets
ou'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ padding-inline-end: 10px; /* an absolute length */ padding-inline-end: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-end: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-end: inherit; padding-inline-end: initial; padding-inline-end: unset; values the padding-inline-end property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientatio...
...this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-start, which define the other paddings of the element. ...
...hich define the other paddings of the element. formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline end padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-end: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level 1the definition of 'padding-inline-end' in that specification. editor's draft initial definition ...
padding-inline-start - CSS: Cascading Style Sheets
ike to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ padding-inline-start: 10px; /* an absolute length */ padding-inline-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-start: inherit; padding-inline-start: initial; padding-inline-start: unset; values the padding-inline-start property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-o...
... this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-end, which define the other paddings of the element. ...
...ch define the other paddings of the element. formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-start: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level 1the definition of 'padding-inline-start' in that specification. editor's draft initial definition ...
padding-inline - CSS: Cascading Style Sheets
to physical padding properties depending on the element's writing mode, directionality, and text orientation. /* <length> values */ padding-inline: 10px 20px; /* an absolute length */ padding-inline: 1em 2em; /* relative to the text size */ padding-inline: 10px; /* sets both start and end values */ /* <percentage> values */ padding-inline: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-inline: inherit; padding-inline: initial; padding-inline: unset; constituent properties this property is a shorthand for the following css properties: padding-inline-end padding-inline-start syntax values the padding-inline property takes the same values as the padding-left property. description values for this property correspond to the padding-top an...
... syntax values the padding-inline property takes the same values as the padding-left property. description values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. ...
...riting-mode, direction, and text-orientation. formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2} examples setting inline padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-inline: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'padding-inline' in that specification. editor's draft initial definition ...
padding-left - 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. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. ...
...t: 10%; /* global values */ padding-left: inherit; padding-left: initial; padding-left: unset; the padding-left property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. ...
...st be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal definition initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. ...
padding-right - 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. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. ...
...0%; /* global values */ padding-right: inherit; padding-right: initial; padding-right: unset; the padding-right property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. ...
...st be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal definition initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. ...
perspective - CSS: Cascading Style Sheets
ifferent distances. it also includes classes for the container box and the cube itself, as well as each of its faces. ...
...f, as well as each of its faces. ...
...spective: 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; transform: rotatey(180deg) translatez(50px); } .right { background:...
place-items - CSS: Cascading Style Sheets
d first or last baseline set of all the boxes in its baseline-sharing group. the fallback alignment for first baseline is start, the one for last baseline is end. stretch if the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. formal definition initial valueas each of the properties of the shorthand:align-items: normaljustify-items: legacyapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:align-items: as specifiedjustify-items: as specifiedanimation typediscrete formal syntax <'ali...
...properties of the shorthand:align-items: normaljustify-items: legacyapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:align-items: as specifiedjustify-items: as specifiedanimation typediscrete formal syntax <'align-items'> <'justify-items'>? ...
...ipt var values = document.getelementbyid('values'); var display = document.getelementbyid('display'); var container = document.getelementbyid('container'); values.addeventlistener('change', function (evt) { container.style.placeitems = evt.target.value; }); display.addeventlistener('change', function (evt) { container.classname = evt.target.value; }); css #container { height:200px; width: 240px; place-items: center; /* you can change this value by selecting another option in the list */ background-color: #8c8c8c; } .flex { display: flex; flex-wrap: wrap; } .grid { display: grid; grid-template-columns: repeat(auto-fill, 50px); } result specifications specification status comment css box alignment module level 3the definition of 'plac...
place-self - CSS: Cascading Style Sheets
e set of all the boxes in its baseline-sharing group. the fallback alignment for first baseline is start, the one for last baseline is end. stretch if the combined size of the items along the cross axis is less than the size of the alignment container and the item is auto-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. formal definition initial valueas each of the properties of the shorthand:align-self: autojustify-self: autoapplies toblock-level boxes, absolutely-positioned boxes, and grid itemsinheritednocomputed valueas each of the properties of the shorthand:align-s...
... for justify-self. otherwise the specified value.justify-self: as specifiedanimation typediscrete formal syntax <'align-self'> <'justify-self'>? examples simple demonstration in the following example we have a simple 2 x 2 grid layout. initially the grid container has justify-items and align-items values of stretch — the defaults — which causes the grid items to stretch across the entire width of their cells. the second, third, and fourth grid items are then given different values of place-self, to show how these override the default placements. these values cause the grid items to span only as wide/tall as their content width/height, and align in different positions across their cells, in the block and inline directions. html <article class="container"> <span>first</span> <span...
...ross their cells, in the block and inline directions. ...
scroll-snap-stop - CSS: Cascading Style Sheets
amples snapping in different axes this example is duplicated from scroll-snap-type with minor variances. ...
...snap-type with minor variances. ...
...-snapping { scroll-snap-type: x mandatory; } .y.mandatory-scroll-snapping { scroll-snap-type: y mandatory; } .x.proximity-scroll-snapping { scroll-snap-type: x proximity; } .y.proximity-scroll-snapping { scroll-snap-type: y proximity; } .container > div { text-align: center; scroll-snap-align: center; flex: none; } .x.container > div { line-height: 128px; font-size: 64px; width: 100%; height: 128px; } .y.container > div { line-height: 256px; font-size: 128px; width: 256px; height: 256px; } /* appearance fixes */ .y.container > div:first-child { line-height: 1.3; font-size: 64px; } /* coloration */ .container > div:nth-child(even) { background-color: #87ea87; } .container > div:nth-child(odd) { background-color: #87ccea; } html <div class="containe...
shape-outside - CSS: Cascading Style Sheets
pe follows the normal border radius shaping rules for the outside of the border. padding-box defines the shape enclosed by the outside padding edge. the shape follows the normal border radius shaping rules for the inside of the border. content-box defines the shape enclosed by the outside content edge. each corner radius of this box is the larger of 0 or border-radius - border-width - padding. <basic-shape> the float area is computed based on the shape created by of one of inset(), circle(), ellipse(), polygon(), or as added in the level 2 specification path(). if a <shape-box> is also supplied, it defines the reference box for the <basic-shape> function. otherwise, the reference box defaults to margin-box. <image> the float area is extracted and computed based o...
...= <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples funneling text html <div class="main"> <div class="left"></div> <div class="right"></div> <p> sometimes a web page's text content appears to be funneling your attention towards a spot on the page to drive you to follow a particular link. sometimes you don't notice. ...
...centage> = <angle> | <percentage> examples funneling text html <div class="main"> <div class="left"></div> <div class="right"></div> <p> sometimes a web page's text content appears to be funneling your attention towards a spot on the page to drive you to follow a particular link. sometimes you don't notice. ...
text-decoration-thickness - CSS: Cascading Style Sheets
from-font if the font file includes information about a preferred thickness, use that value. if the font file doesn't include this information, behave as if auto was set, with the browser choosing an appropriate thickness. <length> specifies the thickness of the text decoration line as a <length>, overriding the font file suggestion or the browser default. <perc...
... ...
... ...
text-indent - CSS: Cascading Style Sheets
tribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. horizontal spacing is with respect to the left (or right, for right-to-left layout) edge of the containing block-level element's content box. syntax /* <length> values */ text-indent: 3mm; text-indent: 40px; /* <percentage> value relative to the containing block width */ text-indent: 15%; /* keyword values */ text-indent: 5em each-line; text-indent: 5em hanging; text-indent: 5em hanging each-line; /* global values */ text-indent: inherit; text-indent: initial; text-indent: unset; values <length> indentation is specified as an absolute <length>. negative values are allowed. see <length> values for possible units. <percentage> indentation is a <percent...
...rd values */ text-indent: 5em each-line; text-indent: 5em hanging; text-indent: 5em hanging each-line; /* global values */ text-indent: inherit; text-indent: initial; text-indent: unset; values <length> indentation is specified as an absolute <length>. negative values are allowed. see <length> values for possible units. <percentage> indentation is a <percentage> of the containing block's width. ...
...e> of the containing block's width. each-line indentation affects the first line of the block container as well as each line after a forced line break, but does not affect lines after a soft wrap break. hanging inverts which lines are indented. all lines except the first line will be indented. ...
text-overflow - CSS: Cascading Style Sheets
pplies a fade-out effect near the edge of the line box with complete transparency at the edge. fade( <length> | <percentage> ) this function clips the overflowing inline content and applies a fade-out effect near the edge of the line box with complete transparency at the edge. the argument determines the distance over which the fade effect is applied. ...
...the edge. fade( <length> | <percentage> ) this function clips the overflowing inline content and applies a fade-out effect near the edge of the line box with complete transparency at the edge. the argument determines the distance over which the fade effect is applied. the <percentage> is resolved against the width of the line box. values lower than 0 are clipped to 0. values greater than the width of the line box are clipped to the width of the line box. ...
...d. the <percentage> is resolved against the width of the line box. values lower than 0 are clipped to 0. values greater than the width of the line box are clipped to the width of the line box. ...
transform-box - CSS: Cascading Style Sheets
is used as the reference box. stroke-box the stroke bounding box is used as the reference box. view-box the nearest svg viewport is used as the reference box. if a viewbox attribute is specified for the svg viewport creating element, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute, and the dimension of the reference box is set to the width and height values of the viewbox attribute. formal definition initial valueview-boxapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box | fill-box | stroke-box | view-box examples svg transform-origin scoping in this example we have an svg: <svg id="svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 50 50"> ...
...transform-box: fill-box is used to make the the transform-origin the center of the bounding box, so the rectangle spins in place. without it, the transform origin is the center of the svg canvas, and so you get a very different effec...
...t="10" rx="1" ry="1" stroke="black" fill="none" /> </g> </svg> in the css we have an animation that uses a transform to rotate the rectangle infinitely. transform-box: fill-box is used to make the the transform-origin the center of the bounding box, so the rectangle spins in place. without it, the transform origin is the center of the svg canvas, and so you get a very different effect. ...
translate() - CSS: Cascading Style Sheets
: translate(30%, 200px); transform: translate(30%, 50%); values single <length-percentage> values this value is a <length> or <percentage> representing the abscissa (horizontal, x-coordinate) of the translating vector. the ordinate (vertical, y-coordinate) of the translating vector will be set to 0. for example, translate(2) is equivalent to translate(2, 0). a percentage value refers to the width of the reference box defined by the transform-box property. double <length-percentage> values this value describes two <length> or <percentage> values representing both the abscissa (x-coordinate) and the ordinate (y-coordinate) of the translating vector. a percentage as first value refers to the width, as second part to the height of the reference box defined by the transform-box property. ...
... is not a linear transformation in ℝ2 and can't be represented using a cartesian-coordinate matrix. ...
... working draft initial definition ...
word-spacing - CSS: Cascading Style Sheets
acing: 200%; /* global values */ word-spacing: inherit; word-spacing: initial; word-spacing: unset; values normal the normal inter-word spacing, as defined by the current font and/or the browser. <length> specifies extra spacing in addition to the intrinsic inter-word spacing defined by the font. <percentage> specifies extra spacing as a percentage of the affected character’s advance width. examples html <div id="mozdiv1">here are many words...</div> <div id="mozdiv2">...and many more!</div> css #mozdiv1 { word-spacing: 15px; } #mozdiv2 { word-spacing: 5em; } accessibility concerns a large positive or negative word-spacing value will make the sentences the styling is applied to unreadable. for text styled with a very large positive value, the words will be so far ap...
... text styled with a very large positive value, the words will be so far apart that it will no longer appear to be a sentence. for text styled with a large negative value, the words will overlap each other to the point where the the beginning and end of each word is unrecognizable. ...
...e different character widths. there is no one value that can ensure all font families automatically maintain their legibility. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal definition initial valuenormalapplies toall elements. ...
HTML attribute: size - HTML: Hypertext Markup Language
Web › HTML › Attributes › size
adding size on a select changes the height, definining how many options are visible in the closed state. ...
...adding size on a select changes the height, definining how many options are visible in the closed state. ...
...ut> and the height of the <select> element. for the input, if the type attribute is text or password then it's the number of characters. this must be an integer value 0 or higher. if no size is specified, or an invalid value is specified, the input has no size declared, and the form control will be the default width based on the user agent. if css targets the element with properties impacting the width, css takes precedence. the size attribute has no impact on constraint validation. examples by adding size on some input types, the width of the input can be controlled. adding size on a select changes the height, definining how many options are visible in the closed state. <label for="fruit">enter a fruit</label> <input type="text" size="15" id="fruit"> <label for="vegetable">enter a vegetabl...
HTML attribute reference - HTML: Hypertext Markup Language
ay still support this attribute, it is obsolete. use css background-image instead. bgcolor <body>, <col>, <colgroup>, <marquee>, <table>, <tbody>, <tfoot>, <td>, <th>, <tr> background color of the element. note: this is a legacy attribute. please use the css background-color property instead. border <img>, <object>, <table> the border width. note: this is a legacy attribute. please use the css border property instead. buffered <audio>, <video> contains the time range of already buffered media. capture <input> from the html media capturethe definition of 'media capture' in that specification.spec, specifies a new file can be captured. challenge <keygen> a challenge strin...
...d in an iframe from using certain features (such as submitting forms or opening new windows). scope <th> defines the cells that the header test (defined in the th element) relates to. scoped <style> selected <option> defines a value which will be selected on page load. shape <a>, <area> size <input>, <select> defines the width of the element (in pixels). if the element's type attribute is text or password then it's the number of characters. sizes <link>, <img>, <source> slot global attribute assigns a slot in a shadow dom shadow tree to an element. span <col>, <colgroup> spellcheck global attribute indicates whether spell checking is allowed for the element.
...r whether to leave them unchanged. type <button>, <input>, <command>, <embed>, <object>, <script>, <source>, <style>, <menu> defines the type of the element. usemap <img>, <input>, <object> value <button>, <data>, <input>, <li>, <meter>, <option>, <progress>, <param> defines a default value which will be displayed in the element on page load. width <canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video> for the elements listed here, this establishes the element's width. note: for all other instances, such as <div>, this is a legacy attribute, in which case the css width property should be used instead. wrap <textarea> indicates whether the text should be wrapped. content versus idl ...
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
Web › HTML › Element › bdi
to use based on the contents of the <bdi>. examples no <bdi> with only ltr this example lists the winners of a competition using <span> elements only. when the names only contain ltr text the results look fine: <ul> <li><span class="name">henrietta boffin</span> - 1st place</li> <li><span class="name">jerry cruncher</span> - 2nd place</li> </ul> body { border: 1px solid #3f87a6; max-width: calc(100% - 40px - 6px); padding: 20px; width: calc(100% - 40px - 6px); border-width: 1px 1px 1px 5px; } no <bdi> with rtl text this example lists the winners of a competition using <span> elements only, and one of the winners has a name consisting of rtl text. in this case the "- 1", which consists of characters with neutral or weak directionality, will adopt the directionality of ...
......
...ext this example lists the winners of a competition using <bdi> elements. these elements instruct the browser to treat the name in isolation from its embedding context, so the example output is properly ordered: <ul> <li><bdi class="name">اَلأَعْشَى</bdi> - 1st place</li> <li><bdi class="name">jerry cruncher</bdi> - 2nd place</li> </ul> body { border: 1px solid #3f87a6; max-width: calc(100% - 40px - 6px); padding: 20px; width: calc(100% - 40px - 6px); border-width: 1px 1px 1px 5px; } specifications specification status comment html living standardthe definition of '<bdi>' in that specification. living standard html5the definition of '<bdi>' in that specification. recommendation ...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
rigin policy. also note that programatically removing an <iframe>'s src attribute (e.g. via element.removeattribute()) causes about:blank to be loaded in the frame in firefox (from version 65), chromium-based browsers, and safari/ios. srcdoc inline html to embed, overriding the src attribute. if a browser does not support the srcdoc attribute, it will fall back to the url in the src attribute. width the width of the frame in css pixels. default is 300. deprecated attributes these attributes are deprecated and may no longer be supported by all user agents. you should not use them in new content, and try to remove them from existing content. align the alignment of this element with respect to the surrounding context. frameborder the value 1 (the default) draws a border around thi...
... around this frame. the value 0 removes the border around this frame, but you should instead use the css property border to control <iframe> borders. longdesc a url of a long description of the frame's content. due to widespread misuse, this is not helpful for non-visual browsers. marginheight the amount of space in pixels between the frame's content and its top and bottom borders. marginwidth the amount of space in pixels between the frame's content and its left and right borders. scrolling indicates when the browser should provide a scrollbar for the frame: auto: only when the frame's content is larger than its dimensions. yes: always show a scrollbar. no: never show a scrollbar. non-standard attributes mozbrowser see bug 1318532 for exposing this to webe...
...embedded document within the <iframe> element's box, can be adjusted with the object-position and object-fit properties. examples a simple <iframe> an <iframe> in action. after creating the frame, when the user clicks a button, its title is displayed in an alert. html <iframe src="https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html" title="iframe example 1" width="400" height="300"> </iframe> result accessibility concerns people navigating with assistive technology such as a screen reader can use the title attribute on an <iframe> to label its content. the title's value should concisely describe the embedded content: <iframe title="wikipedia page for avocados" src="https://en.wikipedia.org/wiki/avocado"></iframe> without this title, they have to...
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
s="toolbar"> <input type="color" aria-label="select pen color"> <input type="range" min="2" max="50" value="30" aria-label="select pen size"><span class="output">30</span> <input type="button" value="clear canvas"> </div> <canvas class="mycanvas"> <p>add suitable fallback here.</p> </canvas> body { background: #ccc; margin: 0; overflow: hidden; } .toolbar { background: #ccc; width: 150px; height: 75px; 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.getcont...
...or"], 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.fillstyle = '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 sizepicker output value sizepicker.oninpu...
...ocumentelement.scrollleft : document.body.scrollleft); cury = (window.event) ? e.pagey : e.clienty + (document.documentelement.scrolltop ? ...
<input type="month"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › month
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; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adju...
...ttern nnnn-nn, where n is a number from 0 to 9. of course, this doesn't stop people from entering invalid dates (such as 0000-42), or incorrectly formatted dates that follow the pattern. there's also the problem that the user won't necessarily know which of the many date formats is expected. we have work left to do. ...
...year. the <select> for choosing the month is hardcoded with the names of the months, as they don't change (leaving localization out of things). the list of available year values is dynamically generated depending on the current year (see the code comments below for detailed explanations of how these functions work). 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; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } javascript the javascript code that handles selecting which approach to use and to set up the list of years to include in the non-native year <select> follows. the ...
<input type="number"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › number
mber" placeholder="1.0" step="0.01" min="0" max="10"> see that this example allows any value between 0.0 and 10.0, with decimals to two places. for example, "9.52" is valid, but "9.521" is not. controlling input size <input> elements of type number don't support form sizing attributes such as size. you'll have to resort to css to change the size of these controls. ...
...he size of these controls. for example, to adjust the width of the input to be only as wide as is needed to enter a three-digit number, we can change our html to include an id and to shorten our placeholder since the field will be too narrow for the text we have been using so far: <input type="number" placeholder="x10" step="10" min="0" max="100" id="number"> then we add some css to narrow the width of the element with the id selector #number: #number { width: 3em; } the result looks like this: offering suggested values you can provide a list of default options from which the user can select by specifying the list attribute, which contains as its value the id of a <datalist>, which in turn contains one <option> element per suggested value. each option's value is the corresponding sug...
...s 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. ...
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
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; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the result here is that: only times between 12:00 and 18:00 will be seen as valid; times outside that range will be denoted as invalid. depending on what browser y...
...t as invalid) if your entry doesn't match the pattern nn:nn, where n is a number from 0 to 9. of course, this doesn't stop people from entering invalid times, or incorrectly formatted times that follow the pattern. then there's the problem of the user having no idea exactly what format the time is expected to be in. ...
...el> <select id="hour" name="hour"> </select> </span> <span> <label for="minute">minute:</label> <select id="minute" name="minute"> </select> </span> </div> </div> </form> the hour and minutes values for their <select> elements are dynamically generated. ...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
submittable size email, password, tel, text size of the control src image same as src attribute for <img>; address of image resource step numeric types incremental values that are valid. type all type of form control value all current value of the form control. submitted with the form as part of a name/value pair. width image same as width attribute for <img> a few additional non-standard attributes are listed following the descriptions of the standard attributes. individual attributes accept valid for the file input type only, the accept attribute defines which file types are selectable in a file upload control. see the file input type. alt valid for the image button only, the alt attr...
...mitted. the required attribute is supported text, search, url, tel, email, date, month, week, time, datetime-local, number, password, checkbox, radio, and file. see client-side validation and the html attribute: required for more information. size valid for email, password, tel, and text input types only. specifies how much of the input is shown. basically creates same result as setting css width property with a few specialities. the actual unit of the value depends on the input type. for password and text, it is a number of characters (or em units) with a default value of 20, and for others, it is pixels. css width takes precedence over size attribute. src valid for the image input button only, the src is string specifying the url of the image file to display to represent the graphic...
...itted values are listed in <input> types above. value the input control's value. when specified in the html, this is the initial value, and from then on it can be altered or retrieved at any time using javascript to access the respective htmlinputelement object's value property. the value attribute is always optional, though should be considered mandatory for checkbox, radio, and hidden. width valid for the image input button only, the width is the width of the image file to display to represent the graphical submit button. see the image input type. non-standard attributes the following non-standard attributes are also available on some browsers. as a general rule, you should avoid using them unless it can't be helped. attribute description autocorrect...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
of the resource being linked. these provide useful hints to allow the browser to choose the most appropriate icon available. you can also provide a media type or query inside a media attribute; this resource will then only be loaded if the media condition is true. for example: <link href="print.css" rel="stylesheet" media="print"> <link href="mobile.css" rel="stylesheet" media="screen and (max-width: 600px)"> some interesting new performance and security features have been added to the <link> element too. take this example: <link rel="preload" href="myfont.woff2" as="font" type="font/woff2" crossorigin="anonymous"> a rel value of preload indicates that the browser should preload this resource (see preloading content with rel="preload" for more details), with the as attribute indicat...
...ribute defines the sizes of the icons for visual media contained in the resource. it must be present only if the rel contains a value of icon or a non-standard type such as apple's apple-touch-icon. it may have the following values: any, meaning that the icon can be scaled to any size as it is in a vector format, like image/svg+xml. a white-space separated list of sizes, each in the format <width in pixels>x<height in pixels> or <width in pixels>x<height in pixels>. each of these sizes must be contained in the resource. note: most icon formats are only able to store one single icon; therefore most of the time the sizes attribute contains only one entry. ms's ico format does, as well as apple's icns. ico is more ubiquitous, so you should use this format if cross-browser support is a ...
..." href="favicon32.png"> conditionally loading resources with media queries you can provide a media type or query inside a media attribute; this resource will then only be loaded if the media condition is true. ...
<picture>: The Picture element - HTML: Hypertext Markup Language
Web › HTML › Element › picture
ack in case none of the offered <source> elements are able to provide a usable image. common use cases for <picture>: art direction. cropping or modifying images for different media conditions (for example, loading a simpler version of an image which has too many details, on smaller displays). offering alternative image formats, for cases where certain formats are not supported. saving bandwidth and speeding page load times by loading the most appropriate image for the viewer's display. if providing higher-density versions of an image for high-dpi (retina) display, use srcset on the <img> element instead. this lets browsers opt for lower-density versions in data-saving modes, and you don't have to write explicit media conditions. content categories flow content, phrasing c...
...ment change the selection of the image inside <picture>. the media attribute the media attribute specifies a media condition (similar to a media query) that the user agent will evaluate for each <source> element. if the <source>'s media condition evaluates to false, the browser skips it and evaluates the next element inside <picture>. ...
...t element inside <picture>. <picture> <source srcset="mdn-logo-wide.png" media="(min-width: 600px)"> <img src="mdn-logo-narrow.png" alt="mdn"> </picture> the srcset attribute the srcset attribute is used to offer list of possible images based on size. it is composed of a comma-separated list of image descriptors. each image descriptor is composed of a url of the image, and either... a width descriptor, followed by a w (such as 300w); or a pixel density descriptor, followed by an x (such as 2x) to serve a high-res image for high-dpi screens. <picture> <source srcset="logo-768.png 768w, logo-768-1.5x.png 1.5x"> <source srcset="logo-480.png, logo-480-2x.png 2x"> <img src="logo-320.png" alt="logo"> </picture> the type attribute the type attribute specifies a mime type for t...
<style>: The Style Information element - HTML: Hypertext Markup Language
Web › HTML › Element › style
they will be applied to the dom in the order they are included in the document — make sure you include them in the correct order, to avoid unexpected cascade issues. in the same manner as <link> elements, <style> elements can include media attributes that contain media queries, allowing you to selectively apply internal stylesheets to your document depending on media features such as viewport width. attributes this element includes the global attributes. type this attribute defines the styling language as a mime type (charset should not be specified). this attribute is optional and defaults to text/css if it is not specified; values other than the empty string or text/css are not used. note: there is very little reason to include this attribute in modern web documents. media this at...
...ing: 5px; border: 1px solid black; } </style> <style> p { color: blue; background-color: yellow; } </style> </head> <body> <p>this is my paragraph.</p> </body> </html> including a media query in this example we build on the previous one, including a media attribute on the second <style> element so it is only applied when the viewport is less than 500px in width. ...
...l> including a media query in this example we build on the previous one, including a media attribute on the second <style> element so it is only applied when the viewport is less than 500px in width. <!doctype html> <html> <head> <style> p { color: white; background-color: blue; padding: 5px; border: 1px solid black; } </style> <style media="all and (max-width: 500px)"> p { color: blue; background-color: yellow; } </style> </head> <body> <p>this is my paragraph.</p> </body> </html> technical summary content categories metadata content, and if the scoped attribute is present: flow content. permitted content text content matching the type attribute, that is text/css. tag omission neither tag...
<th> - HTML: Hypertext Markup Language
Web › HTML › Element › th
ete since html5 this enumerated attribute specifies how the cell content's horizontal alignment will be handled. possible values are: left: the content is aligned to the left of the cell. center: the content is centered in the cell. right: the content is aligned to the right of the cell. justify (with text only): the content is stretched out inside the cell so that it covers its entire width. char (with text only): the content is aligned to a character inside the <th> element with minimal offset. this character is defined by the char and charoff attributes. the default value when this attribute is not specified is left. note: do not use this attribute as it is obsolete in the latest standard. to achieve the same effect as the left, center, right or justify values, apply ...
...d of the bottom. if characters don't descend below the baseline, the baseline value achieves the same effect as bottom. bottom: positions the text near the bottom of the cell. middle: centers the text in the cell. and top: positions the text near the top of the cell. note: do not use this attribute as it is obsolete in the latest standard: use the css vertical-align property instead. width deprecated since html4, obsolete since html5 this attribute is used to define a recommended cell width. additional space can be added with the cellspacing and cellpadding properties and the width of the <col> element can also create extra width. but, if a column's width is too narrow to show a particular cell properly, it will be widened when displayed. note: do not use this attribute as it is ...
... examples see <table> for examples on <th>. specifications specification status comment html living standardthe definition of 'th element' in that specification. ...
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
the current document. valid on <link>, <a>, <area>, and <form>, the supported values depend on the element on which the attribute is found. 48 html attribute: required attribute, attributes, constraint validation, forms, required the boolean required attribute 49 html attribute: size attribute, html, input, reference, select the size attribute defines the width of the <input> and the height of the <select> element. for the input, if the type attribute is text or password then it's the number of characters. this must be an integer value 0 or higher. if no size is specified, or an invalid value is specified, the input has no size declared, and the form control will be the default width based on the user agent. if css targets the element with properties im...
...ut> and the height of the <select> element. for the input, if the type attribute is text or password then it's the number of characters. this must be an integer value 0 or higher. if no size is specified, or an invalid value is specified, the input has no size declared, and the form control will be the default width based on the user agent. if css targets the element with properties impacting the width, css takes precedence. 50 html attribute: step attribute, attributes, constrain validation, step valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, the step attribute is a number that specifies the granularity that the value must adhere to or the keyword any. 51 the html autocomplete attribute addre...
...tool to generate automatic name labels for its anchors. 164 <nobr>: the non-breaking text element (obsolete) element, html, non-standard, obsolete, reference, web, nobr the non-standard, obsolete html <nobr> element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text. 165 <noembed>: the embed fallback element (obsolete) element, embedded content, embedding, html, non-standard, obsolete, reference, noembed the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use...
HTTP headers - HTTP
Web › HTTP › Headers
rrent device pixel ratio (dpr), which is the ratio of physical pixels over css pixels (section 5.2 of [cssval]) of the layout viewport (section 9.1.1 of [css2]) on the device. device-memory technically a part of device memory api, this header represents an approximate amount of ram client has. save-data a boolean that indicates the user agent's preference for reduced data usage. ...
...sical pixels over css pixels (section 5.2 of [cssval]) of the layout viewport (section 9.1.1 of [css2]) on the device. device-memory technically a part of device memory api, this header represents an approximate amount of ram client has. save-data a boolean that indicates the user agent's preference for reduced data usage. viewport-width a number that indicates the layout viewport width in css pixels. the provided pixel value is a number rounded to the smallest following integer (i.e. ceiling value). if viewport-width occurs in a message more than once, the last value overrides all previous occurrences. width the width request header field is a number that indicates the desired resource width in physical pixels (i.e. intrinsic size of an image). the provided pi...
... if viewport-width occurs in a message more than once, the last value overrides all previous occurrences. width the width request header field is a number that indicates the desired resource width in physical pixels (i.e. intrinsic size of an image). the provided pixel value is a number rounded to the smallest following integer (i.e. ceiling value). if the desired resource width is not known at the time of the request or the resource does not have a display width, the width header field can be omitted. if width occurs in a message more than once, the last value overrides all previous occurrences conditionals last-modified the last modification date of the resource, used to compare several versions of the same resource. it is less accurate than etag, but easier ...
HTTP Index - HTTP
Web › HTTP › Index
which browser or device they're using. there are ways to develop your website to progressively enhance itself based on the availability of features rather than by targeting specific browsers. 13 compression in http guide, http, compression compression is an important way to increase the performance of a web site. for some documents, size reduction of up to 70% lowers the bandwidth capacity needs. over the years, algorithms also got more efficient, and new ones are supported by clients and servers. 14 configuring servers for ogg media audio, http, media, ogg, video this guide covers a few server configuration changes that may be necessary for your web server to correctly serve ogg media files. 15 connection management in http/1.x connecti...
...ints header which represents the approximate amount of ram client device has. 116 digest http, http header the digest response http header provides a digest of the requested resource. 117 etag http, reference, response, header the etag http response header is an identifier for a specific version of a resource. it lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed. additionally, etags help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). 118 early-data client hints, http, header, request the early-data header is set by an intermediate to indicates that the request has been conveyed in tls early data, and...
... the http get method requests a representation of the specified resource. requests using get should only retrieve data. 210 head http, reference, request method the http head method requests the headers that are returned if the specified resource would be requested with an http get method. such a request can be done before deciding to download a large resource to save bandwidth, for example. 211 options http, reference, request method the http options method is used to describe the communication options for the target resource. the client can specify a url for the options method, or an asterisk (*) to refer to the entire server. 212 patch http, http method, reference, request method the http patch request method applies partial ...
Link prefetching FAQ - HTTP
tored in the cache provided the server sent an "accept-ranges: bytes" response header. this header is typically generated by webservers when serving up static content. when the user visits a prefetched document for real, the remaining portion of the document will be fetched using a http byte-range request. what if i'm downloading something in the background? will link prefetching compete for bandwidth? yes and no. if you are downloading something using mozilla, link prefetching will be delayed until any background downloads complete. for example, if you load a bookmark group (which opens several tabs), any prefetch requests initiated by one of the bookmarked pages will not begin until all of the tabs finish loading. if you are using another application which uses the network, link prefetching...
...ading something using mozilla, link prefetching will be delayed until any background downloads complete. for example, if you load a bookmark group (which opens several tabs), any prefetch requests initiated by one of the bookmarked pages will not begin until all of the tabs finish loading. if you are using another application which uses the network, link prefetching in mozilla may compete for bandwidth with the other application. this is a problem that we hope to address in the future by leveraging operating system services to monitor network idle time. are there any restrictions on what is prefetched? yes, only http:// (and, starting in gecko 1.9.1 https://) urls can be prefetched. other protocols (such as ftp) do not provide rich enough support for client side caching. will mozilla prefetc...
...ppropriate change via about:config): user_pref("network.prefetch-next", false); however, the theory is that if link prefetching needs to be disabled then there must be something wrong with the implementation. we would rather improve the implementation if it does not work correctly, than expect users to locate and tweak some obscure preference. what about folks who pay-per-byte for network bandwidth? basically, there are two ways of looking at this issue: websites can already cause things to be silently downloaded using js/dom hacks. prefetching is a browser feature; users should be able to disable it easily. it is important that websites adopt <link> tag based prefetching instead of trying to roll-in silent downloading using various js/dom hacks. the <link> tag gives the browser the abili...
Populating the page: how browsers work - Web Performance
immediate. navigation navigation is the first step in loading a web page. it occurs whenever a user requests a page by entering a url into the address bar, clicking a link, submitting a form, as well as other actions. one of the goals of web performance is to minimize the amount of time a navigation takes to complete. in ideal conditions, this usually doesn't take too long, but latency and bandwidth are foes which can cause delays. dns lookup the first step of navigating to a web page is finding where the assets for that page are located. if you navigate to https://example.com, the html page is located on the server with ip address of 93.184.216.34. if you’ve never visited this site, a dns lookup must happen. your browser requests a dns lookup, which is eventually fielded by a name serv...
... definitely less than 14kb, but the linked resources aren't requested until the browser encounters the links during parsing, described below. tcp slow start / 14kb rule the first response packet will be 14kb. this is part of tcp slow start, an algorithm which balances the speed of a network connection. slow start gradually increases the amount of data transmitted until the network's maximum bandwidth can be determined. in tcp slow start, after receipt of the initial packet, the server doubles the size of the next packet to around 28kb. subsequent packets increase in size until a predetermined threshold is reached, or congestion is experienced. if you’ve ever heard of the 14kb rule for initial page load, tcp slow start is the reason why the initial response is 14kb, and why web performan...
...nder tree holds all the visible nodes with content and computed styles -- matching up all the relevant styles to every visible node in the dom tree, and determining, based on the css cascade, what the computed styles are for each node. layout the fourth step in the critical rending path is running layout on the render tree to compute the geometry of each node. layout is the process by which the width, height, and location of all the nodes in the render tree are determined, plus the determination of the size and position of each object on the page. reflow is any subsequent size and position determination of any part of the page or the entire document. once the render tree is built, layout commences. the render tree identified which nodes are displayed (even if invisible) along with their comp...
Web Performance
significantly harm download time, render time, in-app performance, battery life, and user experience. this article outlines some javascript best practices that should be considered to ensure even complex content is as performant as possible. mobile performance with web access on mobile devices being so popular, and all mobile platforms having fully-fledged web browsers, but possibly limited bandwidth, cpu and battery life, it is important to consider the performance of your web content on these platforms. this article looks at mobile-specific performance considerations. using performance apis performance api this guide describes how to use the performance interfaces that are defined in the high-resolution time standard. resource timing api resource loading and timing the loading ...
... or it can significantly harm download time, render time, in app performance, battery life, and user experience. this article outlines some javascript best practices that can ensure even complex content's performance is the highest possible. mobile performance with web access on mobile devices being so popular, and all mobile platforms having fully-fledged web browsers, but possibly limited bandwidth, cpu, and battery life, it is important to consider the performance of your web content on these platforms. this article also looks at mobile-specific performance considerations. web font performance an often overlooked aspect of performance landscape are web fonts. web fonts are more prominent in web design than ever, yet many developers simply embed them from a third party service and think n...
...ce and think nothing of it. in this article, we'll covers methods for getting your font files as small as possible with efficient file formats and sub setting. from there, we'll go on to talk about how browsers text, and how you can use css and javascript features to ensure your fonts render quickly, and with minimal disruption to the user experience. performance bottlenecks understanding bandwidth bandwidth is the amount of data measured in megabits(mb) or kilobits(kb) that one can send per second. this article explains the role of bandwidth in media-rich internet applications, how you can measure it, and how you can optimize applications to make the best use of available bandwidth. the role of tls in performance tls—or https as we tend to call it—is crucial in creating ...
divisor - SVG: Scalable Vector Graphics
Web › SVG › Attribute › divisor
color value is divided to yield the destination color value. a divisor that is the sum of all the matrix values tends to have an evening effect on the overall color intensity of the result. ...
...verall color intensity of the result. ...
.../2000/svg"> <filter id="convolvematrix1" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 2 0 0 0 0 0 0 -1" divisor="1"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 2 0 0 0 0 0 0 -1" divisor="8"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes value <number> default value sum of all values in kernelmatrix or 1 if sum is 0 animatable ye...
fx - SVG: Scalable Vector Graphics
Web › SVG › Attribute › fx
cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r="100" fill="url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value coincides with the presentational value of cx for the element whether the value for cx was inherited or not. ...
.... ...
...dth="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sans-serif" font-size="10pt">(cx,cy)</text...
fy - SVG: Scalable Vector Graphics
Web › SVG › Attribute › fy
cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r="100" fill="url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value coincides with the presentational value of cy for the element whether the value for cy was inherited or not. ...
.... ...
...dth="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sans-serif" font-size="10pt">(cx,cy)</text...
height - SVG: Scalable Vector Graphics
Web › SVG › Attribute › height
value <length> | <percentage> default value 100% animatable yes fecolormatrix for <fecolormatrix>, height defines the vertical le...
... value <length> | <percentage> default value 100% animatable yes fecolormatrix for <fecolormatrix>, height defines the vertical length for the rendering area of the primitive. ...
... value <length> | <percentage> default value 100% animatable yes fecolormatrix for <fecolormatrix>, height defines the vertical length for the rendering area of the primitive. value <length> | <percentage> ...
in - SVG: Scalable Vector Graphics
Web › SVG › Attribute › in
same filter element. if no value is provided, the output will only be available for re-use as the implicit input into the next filter primitive if that filter primitive provides no value for its in attribute. workaround for backgroundimage instead of using in="backgroundimage", we need to import one of the images to blend inside the filter itself, using an <feimage> element. html <div style="width: 420px; height: 220px;"> <svg style="width:200px; height:200px; display: inline;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="backgroundmultiply"> <!-- this will not work. --> <feblend in="backgroundimage" in2="sourcegraphic" mode="multiply"/> </filter> </defs> <image xlink:href="https://developer.mozilla.org/files/64...
...200px; height:200px; display: inline;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="backgroundmultiply"> <!-- this will not work. --> <feblend in="backgroundimage" in2="sourcegraphic" mode="multiply"/> </filter> </defs> <image xlink:href="https://developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:url(#backgroundmultiply);" /> </svg> <svg style="width:200px; height:200px; display: inline;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="imagemultiply"> <!-- this is a workaround. --> <feimage xlink:href="https://developer.mozilla.org/files/6...
...40%" r="40%" fill="#c00" style="filter:url(#backgroundmultiply);" /> </svg> <svg style="width:200px; height:200px; display: inline;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="imagemultiply"> <!-- this is a workaround. --> <feimage xlink:href="https://developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <feblend in2="sourcegraphic" mode="multiply"/> </filter> </defs> <circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:url(#imagemultiply);"/> </svg> </div> result specifications specification status comment filter effects module level 1the definition of 'in' in that specification. working draft no change sca...
kernelMatrix - SVG: Scalable Vector Graphics
<feconvolvematrix> element. values are separated by space characters and/or a comma. the number of entries in the list must equal to <orderx> by <ordery> as defined in the order attribute. ...
...x> by <ordery> as defined in the order attribute. ...
...xmlns="http://www.w3.org/2000/svg"> <filter id="convolvematrix1" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 1 0 0 0 0 0 0 -1"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="-1 0 0 0 0 0 0 0 1"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes value <list of numbers> default value none animatable yes <list of numbers> the l...
numOctaves - SVG: Scalable Vector Graphics
quencies and decreasing amplitudes. the higher the number of octaves, the more natural the noise looks. though more octaves also require more calculations, resulting in a negative impact on performance. ...
...quire more calculations, resulting in a negative impact on performance. ...
...urbulence> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" numoctaves="1" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" numoctaves="3" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <integer> default value 1 animatable yes <integer> defines the number of octaves. negative values are forbidden. example <svg width="200" height="200" viewbox="...
order - SVG: Scalable Vector Graphics
Web › SVG › Attribute › order
the order attribute indicates the size of the matrix to be used by a <feconvolvematrix> element. ...
...nt. ...
...mboss1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="0" /> <feconvolvematrix kernelmatrix="3 0 0 0 0 0 0 0 -4" order="3"/> </filter> <filter id="emboss2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="0" /> <feconvolvematrix kernelmatrix="3 0 0 0 0 0 0 0 -4" order="1 1 1"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter:url(#emboss1);" /> <rect x="0" y="0" width="200" height="200" style="filter:url(#emboss2); transform: translatex(220px);" /> </svg> usage notes value <number-optional-number> default value 3 animatable yes <number-optional-number> this value indicates the number of cells in each dimension for the kernel matrix...
paint-order - SVG: Scalable Vector Graphics
inally the markers. [ fill || stroke || markers ] the order of these three keywords indicates the order in which the painting happens, from left to right. if any of the three painting components is omitted, they will be painted in their default order after the specified components. for example, using stroke is equivalent to stroke fill markers. ...
...inting components is omitted, they will be painted in their default order after the specified components. for example, using stroke is equivalent to stroke fill markers. ...
...specified components. for example, using stroke is equivalent to stroke fill markers. ...
patternUnits - SVG: Scalable Vector Graphics
the patternunits attribute indicates which coordinate system to use for the geometry properties of the <pattern> element. ...
... viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- all geometry properties are relative to the current user space --> <pattern id="p1" x="12.5" y="12.5" width="25" height="25" patternunits="userspaceonuse"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- all geometry properties are relative to the target bounding box --> <pattern id="p2" x=".125" y=".125" width=".25" height=".25" patternunits="objectboundingbox"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- left square with user space tiles --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> <!-- right square with bounding box tiles --> <rect x="110" y="10" width="80" height="80" fill="url(#p2)" /> </svg> pattern for <pattern>, patter...
...="10" cy="10" r="10" /> </pattern> <!-- left square with user space tiles --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> <!-- right square with bounding box tiles --> <rect x="110" y="10" width="80" height="80" fill="url(#p2)" /> </svg> pattern for <pattern>, patternunits defines the coordinate system in use for the geometry properties (x, y, width and height) of the element. value userspaceonuse | objectboundingbox default value objectboundingbox animatable yes userspaceonuse this value indicates that all coordinates for the geometry properties refer to the user coordinate system as defined when the pattern was applied. objectboundingbox this value indicates that all coordinates for the geom...
preserveAlpha - SVG: Scalable Vector Graphics
the preservealpha attribute indicates how a <feconvolvematrix> element handled alpha transparency. ...
...handled alpha transparency. ...
... id="convolvematrix1" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 -1 2 0 0 0 0 0 -2" preservealpha="true"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 -1 2 0 0 0 0 0 -2" preservealpha="false"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes default value false value true | false animatable yes true this value indicates tha...
r - SVG: Scalable Vector Graphics
Web › SVG › Attribute › r
with a value lower or equal to zero the circle won't be drawn at all. value <length> | <percen...
...with a value lower or equal to zero the circle won't be drawn at all. value <length> | <percentage> default value 0 animatable yes note: sta...
... <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cx="50" cy="50" r="0"/> <circle cx="150" cy="50" r="25"/> <circle cx="250" cy="50" r="50"/> <rect x="20" y="120" width="60" height="60" fill="url(#mygradient000)" /> <rect x="120" y="120" width="60" height="60" fill="url(#mygradient050)" /> <rect x="220" y="120" width="60" height="60" fill="url(#mygradient100)" /> </svg> circle for <circle>, r defines the radius of the circle and therefor its size. with a value lower or equal to zero the circle won't be drawn at all. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, r is a geometry property meaning this attribute can also be ...
rx - SVG: Scalable Vector Graphics
Web › SVG › Attribute › rx
the rx attribute defines a radius on the x-axis. two elements are using this attribute: <ellipse>, and <rect> html,body,svg { height:100% } <svg viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="50" cy="50" rx="0" ry="25" /> <ellipse cx="150" cy="50" rx="25" ry="25" /> <ellipse cx="250" cy="50" rx="50" ry="25" /> <rect x="20" y="120" width="60" height="60" rx="0" ry="15"/> <rect x="120" y="120" width="60" height="60" rx="15" ry="15"/> <rect x="220" y="120" width="60" height="60" rx="150" ry="15"/> </svg> ellipse for <ellipse>, rx defines the x-radius of the shape. with a value lower or equal to zero the ellipse won't be drawn at all. value <length> | <percentage> | auto default value auto animatable yes ...
... auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for ellipses. rect for <rect>, rx defines the x-axis radius of the ellipse used to round off the corners of the rectangle. ...
... attribute is interpreted depend on both the ry attribute and the width of the rectangle: if a properly specified value is provided for rx but not for ry (or the opposite), then the browser will consider the missing value equal to the defined one. if neither rx nor ry has a properly specified value, then the browser will draw a rectangle with square corners. if rx is greater than half of the width of the rectangle, then the browser will consider the value for rx as half of the width of the rectangle. value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for rects. specifications specification status comm...
ry - SVG: Scalable Vector Graphics
Web › SVG › Attribute › ry
the ry attribute defines a radius on the y-axis. two elements are using this attribute: <ellipse>, and <rect> html,body,svg { height:100% } <svg viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="50" cy="50" ry="0" rx="25" /> <ellipse cx="150" cy="50" ry="25" rx="25" /> <ellipse cx="250" cy="50" ry="50" rx="25" /> <rect x="20" y="120" width="60" height="60" ry="0" rx="15"/> <rect x="120" y="120" width="60" height="60" ry="15" rx="15"/> <rect x="220" y="120" width="60" height="60" ry="150" rx="15"/> </svg> ellipse for <ellipse>, ry defines the y-radius of the shape. with a value lower or equal to zero the ellipse won't be drawn at all. value <length> | <percentage> | auto default value auto animatable yes ...
... auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for ellipses. rect for <rect>, ry defines the y-axis radius of the ellipse used to round off the corners of the rectangle. ...
... attribute is interpreted depend on both the rx attribute and the width of the rectangle: if a properly specified value is provided for ry but not for rx (or the opposite), then the browser will consider the missing value equal to the defined one. if neither ry nor rx has a properly specified value, then the browser will draw a rectangle with square corners. if ry is greater than half of the width of the rectangle, then the browser will consider the value for ry as half of the width of the rectangle. value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for rects. specifications specification status comm...
seed - SVG: Scalable Vector Graphics
Web › SVG › Attribute › seed
the seed attribute represents the starting number for the pseudo random number generator of the <feturbulence> filter primitive. ...
...or the pseudo random number generator of the <feturbulence> filter primitive. ...
...bute: <feturbulence> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="0" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="100" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter:url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter:url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacement...
vector-effect - SVG: Scalable Vector Graphics
eometry of a shape with a specified paint, then stroke the outline with a specified paint. non-scaling-stroke this value modifies the way an object is stroked. normally stroking involves calculating stroke outline of the shapeʼs path in current user coordinate system and filling that outline with the stroke paint (color or gradient). the resulting visual effect of this value is that the stroke width is not dependant on the transformations of the element (including non-uniform scaling and shear transformations) and zoom level. non-scaling-size this value specifies a special user coordinate system used by the element and its descendants. the scale of that user coordinate system does not change in spite of any transformation changes from a host coordinate space. however, it does not specify t...
...ion changes from a host coordinate space. however, it does not specify the suppression of rotation, skew and scaling. when this vector effect and the transform property are defined at the same time, that property is consumed for this effect. ...
...ansform property are defined at the same time, that property is consumed for this effect. example example: vector-effect="non-scaling-stroke" <svg viewbox="0 0 500 240"> <!-- normal --> <path d="m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> <!-- scaled --> <path transform="translate(100,0)scale(4,1)" d="m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> <!-- fixed--> <path vector-effect="non-scaling-stroke" transform="translate(300,0)scale(4,1)" d="m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> </svg> result specifications specification status comment scalable vector graphics (svg) 2the definition of 'vector-effect' in that specification. cand...
<feBlend> - SVG: Scalable Vector Graphics
Web › SVG › Element › feBlend
de attribute. usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in in2 mode dom interface this element implements the svgfeblendelement interface. ...
...ributes presentation attributes filter primitive attributes class style specific attributes in in2 mode dom interface this element implements the svgfeblendelement interface. ...
...xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="spotlight"> <feflood result="floodfill" x="0" y="0" width="100%" height="100%" flood-color="green" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="multiply"/> </filter> </defs> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#spotlight);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feblend>' in that specification. working draft outsourced blend modes to compositing and blending level 1 scalable vector graphics (svg) 1.1 (second edition)the definition of '<feblend>...
<feMerge> - SVG: Scalable Vector Graphics
Web › SVG › Element › feMerge
the <femerge> svg element allows filter effects to be applied concurrently instead of sequentially. this is achieved by other filters storing their output via the result attribute and then accessing it in a <femergenode> child. ...
...f sequentially. this is achieved by other filters storing their output via the result attribute and then accessing it in a <femergenode> child. ...
...ode> example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <filter id="feoffset" x="-40" y="-20" width="100" height="200"> <feoffset in="sourcegraphic" dx="60" dy="60" /> <fegaussianblur stddeviation="5" result="blur2" /> <femerge> <femergenode in="blur2" /> <femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green; filter: url(#feoffset);" /> </svg> result attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes none dom interface this element implements the svgfemergeelement interface. specifications specification status comment ...
<feOffset> - SVG: Scalable Vector Graphics
Web › SVG › Element › feOffset
dy attributes. usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dx dy dom interface this element implements the svgfeoffsetelement interface. ...
...of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dx dy dom interface this element implements the svgfeoffsetelement interface. ...
...ibutes filter primitive attributes class style specific attributes in dx dy dom interface this element implements the svgfeoffsetelement interface. example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <filter id="offset" width="180" height="180"> <feoffset in="sourcegraphic" dx="60" dy="60" /> </filter> </defs> <rect x="0" y="0" width="100" height="100" stroke="black" fill="green"/> <rect x="0" y="0" width="100" height="100" stroke="black" fill="green" filter="url(#offset)"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feoffset>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (seco...
<feTile> - SVG: Scalable Vector Graphics
Web › SVG › Element › feTile
o the one of a <pattern>. usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dom interface this element implements the svgfetileelement interface. ...
...e>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dom interface this element implements the svgfetileelement interface. ...
... filter primitive attributes class style specific attributes in dom interface this element implements the svgfetileelement interface. example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="tile" x="0" y="0" width="100%" height="100%"> <fetile in="sourcegraphic" x="50" y="50" width="100" height="100" /> <fetile/> </filter> </defs> <image xlink:href="/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#tile);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<fetile>' in that specification. working draft no c...
<image> - SVG: Scalable Vector Graphics
Web › SVG › Element › image
lements, in any order:animation elementsdescriptive elements attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired transform specific attributes x: positions the image horizontally from the origin. y: positions the image vertically from the origin. width: the width the image renders at. unlike html's <img>, this attribute is required. height: the height the image renders at. unlike html's <img>, this attribute is required. href and xlink:href: points at a url for the image file. preserveaspectratio: controls how the image is scaled. dom interface <image> implements the svgimageelement interface. example basic rendering of a png image in s...
... image renders at. unlike html's <img>, this attribute is required. height: the height the image renders at. unlike html's <img>, this attribute is required. href and xlink:href: points at a url for the image file. preserveaspectratio: controls how the image is scaled. dom interface <image> implements the svgimageelement interface. example basic rendering of a png image in svg: svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="200" width="200"/> </svg> result specifications specification status comment scalable vector graphics (svg) 2the definition of '<image>' in that specification. candidate reco...
...3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="200" width="200"/> </svg> result specifications specification status comment scalable vector graphics (svg) 2the definition of '<image>' in that specification. candidate recommendation allows omitting height and width scalable vector graphics (svg) 1.1 (second edition)the definition of '<image>' in that specification. recommendation initial definition ...
<mpath> - SVG: Scalable Vector Graphics
Web › SVG › Element › mpath
nt as the definition of a motion path. usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes core attributes » xlink attributes » externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgmpathelement interface. example svg <svg width="100%" height="100%" viewbox="0 0 500 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <rect x="1" y="1" width="498" height="298" fill="none" stroke="blue" stroke-width="2" /> <!-- draw the outline of the motion path in blue, along with three small circles at the start, middle and end. --> <path id="path1" d="m100,250 c 100,...
...p://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <rect x="1" y="1" width="498" height="298" fill="none" stroke="blue" stroke-width="2" /> <!-- draw the outline of the motion path in blue, along with three small circles at the start, middle and end. --> <path id="path1" d="m100,250 c 100,50 400,50 400,250" fill="none" stroke="blue" stroke-width="7.06" /> <circle cx="100" cy="250" r="17.64" fill="blue" /> <circle cx="250" cy="100" r="17.64" fill="blue" /> <circle cx="400" cy="250" r="17.64" fill="blue" /> <!-- here is a triangle which will be moved about the motion path. it is defined with an upright orientation with the base of the triangle centered horizontally just above the origin. --> <path d="m-25,-12.5...
... <circle cx="250" cy="100" r="17.64" fill="blue" /> <circle cx="400" cy="250" r="17.64" fill="blue" /> <!-- here is a triangle which will be moved about the motion path. it is defined with an upright orientation with the base of the triangle centered horizontally just above the origin. --> <path d="m-25,-12.5 l25,-12.5 l 0,-87.5 z" fill="yellow" stroke="red" stroke-width="7.06" > <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="auto" > <mpath xlink:href="#path1"/> </animatemotion> </path> </svg> result specifications specification status comment svg animations level 2the definition of '<mpath>' in that specification. editor's draft no change sc...
<rect> - SVG: Scalable Vector Graphics
Web › SVG › Element › rect
the <rect> element is a basic svg shape that draws rectangles, defined by their position, width, and height. the rectangles may have their corners rounded. html,body,svg { height:100% } <svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <!-- simple rectangle --> <rect width="100" height="100" /> <!-- rounded corner rectangle --> <rect x="120" width="100" height="100" rx="15" /> </svg> attributes x the x coordinate of the rect. value type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the rect. value type: <length>|<percentage> ; default value: 0; animatable: yes width the width of the rect. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes height the height of the rect. value type: auto|<l...
...pe: auto|<length>|<percentage> ; default value: auto; animatable: yes ry the vertical corner radius of the rect. defaults to rx if it is specified. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes pathlength the total length of the rectangle's perimeter, in user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2, x, y, width, height, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element. global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attrib...
...vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<symbol> - SVG: Scalable Vector Graphics
Web › SVG › Element › symbol
le times in the same document adds structure and semantics. documents that are rich in structure may be rendered graphically, as speech, or as braille, and thus promote accessibility. ...
...ercentage>|left|center|right ; default value: 0; animatable: yes refy this attribute determines the y coordinate of the reference point of the symbol. value type: <length>|<percentage>|top|center|bottom ; default value: 0; animatable: yes viewbox this attribute defines the bound of the svg viewport for the current symbol. value type: <list-of-numbers> ; default value: none; animatable: yes width this attribute determines the width of the symbol. value type: <length>|<percentage> ; default value: auto; animatable: yes x this attribute determines the x coordinate of the symbol. value type: <length>|<percentage> ; default value: 0; animatable: yes y this attribute determines the y coordinate of the symbol. value type: <length>|<percentage> ; default value: 0; animatable: yes globa...
...butes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<tref> - SVG: Scalable Vector Graphics
Web › SVG › Element › tref
wing elements, in any order:descriptive elements<animate>, <animatecolor>, <set> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgtrefelement interface. ...
... recommendation initial definition ...
... recommendation initial definition ...
Namespaces crash course - SVG: Scalable Vector Graphics
mespace name".) redeclaring the default namespace so if all the descendants of the root element are also defined to be in the default namespace, how do you mix in content from another namespace? easy. you just redefine the default namespace. here's a short example. <html xmlns="http://www.w3.org/1999/xhtml"> <body> <!-- some xhtml tags here --> <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="200px"> <!-- some svg tags here --> </svg> <!-- some xhtml tags here --> </body> </html> in this example the xmlns parameter on the root <html> element declares the default namespace to be xhtml. as a result, it and all its child elements are interpreted by the user agent as belonging to xhtml, except for the <svg> element. the <svg> element has its own xmlns par...
...t names. this tells the user agent that that particular element (but not its children this time!) belongs to the namespace assigned to the prefix. knowing this will save you some confusion if you come across markup like in the following example: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <body> <h1>svg embedded inline in xhtml</h1> <svg:svg width="300px" height="200px"> <svg:circle cx="150" cy="100" r="50" fill="#ff0000"/> </svg:svg> </body> </html> note that because a namespace prefix is used for the <svg:svg> element and its child <svg:circle>, it wasn't necessary to redeclare the default namespace. in general though it is better to redeclare the default namespace rather than prefix lots of elements in this way. scripting...
...to the server). for example: elt.setattributens('http://www.w3.org/1999/xlink', 'xlink:href', 'otherdoc.svg'); as a final example, here's a demonstration of how you should dynamically create an <image> element using script: var svg_ns = 'http://www.w3.org/2000/svg'; var xlink_ns = 'http://www.w3.org/1999/xlink'; var image = document.createelementns(svg_ns, 'image'); image.setattributens(null, 'width', '100'); image.setattributens(null, 'height', '100'); image.setattributens(xlink_ns, 'xlink:href', 'flower.png'); conclusion make sure you always declare the namespaces you use in your xml files. if you don't, user agents such as firefox won't recognize your content and will simply show the xml markup or inform the user that there's an error in the xml. it's a good idea to use a template that...
Filter effects - SVG: Scalable Vector Graphics
filter is needed to do anything beyond. example filters are defined by <filter> element, which should be put in the <defs> section of your svg file. between the filter tags, goes a list of primitives, basic operations that build on top of the previous operations (like blurring, adding a lighting effect, etc). to apply your created filter on a graphic element, you set the filter attribute. ...
...that build on top of the previous operations (like blurring, adding a lighting effect, etc). to apply your created filter on a graphic element, you set the filter attribute. ...
...urcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litpaint"/> <!-- merge offsetblur + litpaint --> <femerge> <femergenode in="offsetblur"/> <femergenode in="litpaint"/> </femerge> </filter> </defs> <!-- graphic elements --> <g filter="url(#myfilter)"> <path fill="none" stroke="#d90000" stroke-width="10" d="m50,66 c-50,0 -50,-60 0,-60 h100 c50,0 50,60 0,60z" /> <path fill="#d90000" d="m60,56 c-30,0 -30,-40 0,-40 h80 c30,0 30,40 0,40z" /> <g fill="#ffffff" stroke="black" font-size="45" font-family="verdana" > <text x="52" y="52">svg</text> </g> </g> </svg> step 1 <fegaussianblur in="sourcealpha" stddeviation="4" ...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
n { stop-color:yellow; } stop.end { stop-color:green; } body.invalid stop.end { stop-color:red; } #err { display:none; } body.invalid #err { display:inline; } </style> <script> function signalerror() { document.getelementbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; t...
.../p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;"> <lineargradient id="gradient"> <stop class="begin" offset="0%"/> <stop class="end" offset="100%"/> </lineargradient> <rect x="0" y="0" width="100" height="100" style="fill:url(#gradient)" /> <circle cx="50" cy="50" r="30" style="fill:url(#gradient)" /> </svg> </body> </html> discussion the page is mainly regular html, css and javascript. the only interesting part is the <svg> element it contains. this element and its children are declared to be in the svg namespace. the element contains a gradient and two shapes filled with the g...
.../xlink", "xlink:href", "move.png"); details the viewbox attribute establishes a logical coordinate system which the svg picture's coordinates are relative to. in this case our picture is laid out in a 100 by 100 viewport. the preserveaspectratio attribute specifies that the aspect ratio must be preserved by centering the picture in the available size, sizing to the maximum of the height or width and then cutting off any overflow. the style attribute pins the svg element to the background of the form. related links another svg in html example: a swarm of motes working example that works in both mozilla and in internet explorer with adobe's svg viewer installed. (for inline svg to work in both firefox and internet explorer it is necessary to serve documents with a different content-t...
Creating annotations - Archive of obsolete content
annotation editor content script in the corresponding content script we do two things: handle a message from the add-on code by giving the text area focus list...
...a = document.getelementbyid('annotation-box'); textarea.value = ''; textarea.focus(); }); save this inside data/editor as annotation-editor.js. updating main.js again now we'll update main.js again to create the editor and use it. ...
Storing annotations - Archive of obsolete content
ch we also need to supply: function annotation(annotationtext, anchor) { this.annotationtext = annotationtext; this.url = anchor[0]; this.ancestorid = anchor[1]; this.anchortext = anchor[2]; } now we need to link this code to the annotation editor, so that when the user presses the return key in the editor, we create and store the new annotation: var annotationeditor = panels.panel({ width: 220, height: 220, contenturl: data.url('editor/annotation-editor.html'), contentscriptfile: data.url('editor/annotation-editor.js'), onmessage: function(annotationtext) { if (annotationtext) handlenewannotation(annotationtext, this.annotationanchor); annotationeditor.hide(); }, onshow: function() { this.postmessage('focus'); } }); listing stored annotations to p...
... italic; } body { background-color: #f5f5f5; font: 100% arial, helvetica, sans-serif; } h1 { font-family: georgia,serif; font-size: 1.5em; text-align:center; } save these in data/list as annotation-list.html and annotation-list.css respectively. updating main.js here's the code to create the panel, which can go in the main function. ...
Embedding SVG - Archive of obsolete content
here --> </body> </html> example: <?xml version="1.0" encoding="utf-8"?> <!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" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <body> <p>hello</p> <svg:svg version="1.1" baseprofile="full" width="150" height="150"> <svg:rect x="10" y="10" width="100" height="100" fill="red"/> <svg:circle cx="50" cy="50" r="30" fill="blue"/> </svg:svg> <p>world</p> </body> </html> embedding into xul make sure you use the right namespace when embedding <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymas...
... <!-- xul and svg go here --> </window> example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <vbox> <label value="hello"/> <svg:svg version="1.1" baseprofile="full" width="150" height="150"> <svg:rect x="10" y="10" width="100" height="100" fill="red"/> <svg:circle cx="50" cy="50" r="30" fill="blue"/> </svg:svg> <label value="world"/> </vbox> </window> ...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
olumn always had to be drawn first. for sites that rely on a left or right column for primary navigation, this content order requirement of float usage may produce desired and advantageous behavior. i also found a lot of trouble ensuring a consistent vertical start position of columns using floats. two column layouts using floats seemed easy. but adding a third column to the mix created too many width variables for some browsers to dynamically calculate a total. resizing the browser window often resulted in one column getting pushed to the bottom of another. using absolute positioning for left and right columns allowed the markup for each column to fall in any order. there are some technicalities in the order of our markup and some ad units that would require too much to cover here. but posit...
... cover here. but positioning did allow the center column to fall first in the markup. it also guarantees each column will start in the same vertical position. to be fair, i did note two disadvantages of positioning. when one or more columns is positioned absolutely, there is no way to ensure a footer would always appear at the bottom of the longest column. we ended up confining the footer to the width of the center column to avoid any possible overlap. the other disadvantage comes into play at small browser window sizes. while floats automatically reconfigure if they don't fit within the window width, absolute positioned columns always remain in the same place, even if it means content in one column begins to overlap another column. both of these put together weren't enough to dissuade me from...
Creating reusable content with CSS and XBL - Archive of obsolete content
</method> </implementation> <handlers> <handler event="click" button="0"><![cdata[ if (event.originaltarget == this.button) this.dodemo() ]]></handler> </handlers> </binding> </bindings> make a new css file, bind6.css. this separate stylesheet contains style for the binding. copy and paste the content from here: /*** xbl demonstration ***/ [anonid="square"] { width: 20em; height: 20em; border: 2px inset gray; } [anonid="button"] { margin-top: 1em; padding: .5em 2em; } open the document in your browser and press the button. this wiki does not support javascript in pages, so it is not possible to show the demonstration here. it looks something like this, before and after you press the button: notes about this demonstration: ...
...nk any javascript code. the document does not contain any buttons. it only contains the text of the button's label. the button is added by the binding. the document stylesheet links the binding. the binding links its own stylesheet, and it supplies its own content and javascript code. so the binding is self-contained. challenges change the xbl file so that the square doubles in width when it changes color, instead of jumping to the right. use the dom inspector tool to inspect the document, revealing the added content. what next? if you had difficulty understanding this page, or if you have other comments about it, please contribute to its discussion page. in this demonstration, the square and the button make a self-contained widget that functions within an html ...
XUL user interfaces - Archive of obsolete content
copy and paste the content from here, making sure that you scroll to get all of it: // xul demonstration var datebox, daybox, currentday, status; // elements ...
...copy and paste the content from here, making sure that you scroll to get all of it: // xul demonstration var datebox, daybox, currentday, status; // elements // called by window onload function init() { datebo...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
response. that new page may have links that take you to other pages, which may in turn have more links, and so on. this model of web navigation is so common that most internet users do little else. but as the internet matures, this model has begun to show its age and its limitations. for web developers, for example, it provides less fine-grained control over the experience, and it can strain bandwidth and other resources. and for users it usually doesn't begin to approach the seamlessness and usability of good application user interfaces. recently, however, modern browsers and enriched web standards have begun to make new navigational and presentational models possible. one such model is inner-browsing, which is our name for a model in which all navigation occurs within a single page, as in a ...
...ommon to see selects where content is dependent on the selection made on another select. for example, imagine a web form where users have to choose their city, by first selecting country then state. for example, imagine a web form where users have to choose their city, by first selecting country then state. updating the selects without refreshing the page provides a better user experience and bandwidth savings. webmail application the flexibility to easily access and manage all message headers in mail applications (like netscape mail or eudora) is probably one of the useful features when compared with web-based mail applications. in general, when a webmail account has more than a few messages, clicking 'next page' sends a request to the server. you receive a new page with the next block of mess...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
ge 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. in the simplest case, we might add a style like this: td img {display: block;} consider this rule when applied to the following markup: <table cellspacing="0" cellpadding="0" border="0" width="500"> <tr><td><img src="nav1.gif"><img src="nav2.gif"><img src="nav3.gif"><img src="nav4.gif"><img src="nav5.gif"></td></tr> <tr><td style="background: red;"> <img src="smallred.gif" height="1" width="1"></td></tr> <tr><td> <p style="margin: 0.5em;">this is text in another cell of the table. within the textthere is an icon <img src="icon2.gif"> that indicates a link to another site. it's ver...
... many single-pixel cells intended to create cool stacked lines, or something like that. if you have markup that lends itself well to this approach, you could class the table rows instead of the images. thus you might have: tr.decoration img {display: block;} ...along with the following change in the markup: <tr class="decoration"><td style="background: red;"> <img src="smallred.gif" height="1" width="1"> </td></tr> the result is that of only making the spacer gif block-level, thus leaving the other images alone. this leads to the result seen in figure 9. alternatively, you could class table cells instead of rows, if that's a better choice for you. in any of these cases, though, making images block-level could have unintended side effects if your table cells have more than just a single i...
Introducing the Audio API extension - Archive of obsolete content
d mozframebufferlength: number of samples collected in all channels this information is needed later to decode the audio data stream. ...
...nel2-sample1 channel1-sample2 channel2-sample2 channel1-sample3 channel2-sample3. ...
Table Cellmap - Archive of obsolete content
{ // add your action here } rowindex -= map->getrowcount(); map = map->getnextsibling(); } data entry the usual way to populate the cellmap is via nstableframe::insertrows. enabling the debug code at the function entrance and exit gives a quite complete picture of the cellmap structure. below follows the dump for the 2x2 table. ...
... row(0)=02763344 cell(0)=02763528 cell(0)=0276381c row(0)=02763940 cell(0)=02763990 cell(0)=02763ab4 ***** start table cell map dump ***** 023566b0 cols array orig/span-> 023566b0 ***** start group cell map dump ***** 023565b0 maprowcount=0 tablerowcount=0 ***** end group cell map dump ***** ***** end table cell map dump ***** ***end table dump*** insertrowsafter ***start table dump*** mcolwidths=-1 -1 row(0)=02763344 cell(0)=02763528 cell(1)=0276381c row(1)=02763940 cell(0)=02763990 cell(1)=02763ab4 ***** start table cell map dump ***** 023566b0 cols array orig/span-> 023566b00=2/0 1=2/0 ***** start group cell map dump ***** 023565b0 maprowcount=2 tablerowcount=2 row 0 : c0,0 c0,1 row 1 : c1,0 c1,1 c0,0=02763528(0) c0,1=0276381c(1) c1,0=02763990(0) c1,1=02763ab4(1) ***...
Table Layout Regression Tests - Archive of obsolete content
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:\moz_src\mozilla\layout\html\tests\block\rtest.lst. ...
...ote: styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running baseline test for e:\moz_src\mozilla\layout\html\tests\block\rtest.lst. ...
sizetopopup - Archive of obsolete content
« xul reference home sizetopopup type: one of the values below indicates how the menu width and the menupopup width are determined. if the sizetopopup attribute is left out or set to none, the menu will be its preferred width and the popup may extend outside of this width, unaffected by the maximum width of the menu itself. otherwise, the menu will size itself to at least the size of the popup. if the menu has a maximum width, the popup will also be this width. none the width of the popup will not be constrained to the size of the menu. pref the preferred width of the menu label or button will be the size needed for the popup contents. ...
...e menu will size itself to at least the size of the popup. if the menu has a maximum width, the popup will also be this width. none the width of the popup will not be constrained to the size of the menu. pref the preferred width of the menu label or button will be the size needed for the popup contents. this is the default value for menulists. always both the preferred and minimum width of the menu label or button will be the same as that necessary for the menupopup. ...
Attribute (XUL) - Archive of obsolete content
nbuttons highlightnonmatches homepage href icon id ignoreblurwhilesearching ignorecase ignoreincolumnpicker ignorekeys image inactivetitlebarcolor increment index inputtooltiptext insertafter insertbefore instantapply inverted iscontainer isempty key keycode keytext label lastpage lastselected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialogaccept ondialogcancel ondialogclosure ondia...
... sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri useraction validate value var visuallyselected wait-cursor width windowtype wrap wraparound ...
Introduction to XUL - Archive of obsolete content
he obvious ui components: toolbars, menus and dialogs. conceptually, the xul language will allow someone with a text editor, given a package of components which can work together, the ability to put together an application by specifying something like this (for an application on an os using menubars across the top of its applications' windows): main window containing menubar area at top across width of window containing menubar (and its contents) toolbar area below menubar across width of window containing main toolbar (and its contents) application-specific content area below toolbar area structure of a xul file our language of choice is xml, flavoured with css stylistic information. having said that, the details of a particular application of xml; say, the syntax for specify...
... it. strictly speaking, that is unnecessary for this example. however in practice, most nodes in xul have these identifiers, which enable the nodes to be retrieved easily using the aom's getelementbyid method. identifiers are also useful for css, since rules can be applied to individual elements in xul using the same # syntax that is possible for html elements. #main-window { display: block; width: 100%; height: 100%; } for example, the above style rule would apply to the main window and dictates that the window should consume the full width and height available to it in a content area. the next element in the example declares the menubar. the menubar contains a single menu called "file". this menu contains a single menu item that has a simple javascript onclick handler attached to it...
sizeTo - Archive of obsolete content
Archive › Mozilla › XUL › Method › sizeTo
...
... ...
Tree Widget Changes - Archive of obsolete content
nscomptr<nsiatom> atom; acol->getatom(getter_addrefs(atom)); if (atom = kmycol) ... one feature that has been added is restorenaturalorder which may be used to restore the original order of the columns before the user moved the...
... nscomptr<nsiatom> atom; acol->getatom(getter_addrefs(atom)); if (atom = kmycol) ... one feature that has been added is restorenaturalorder which may be used to restore the original order of the columns before the user moved them around. t...
Adding Labels and Images - Archive of obsolete content
splayed on a single line. this syntax is the most common of labels. if the text needs to wrap, you can place the text content inside opening and closing tags as in the following example: example 2 : <label>this is some longer text that will wrap onto several lines.</label> as with html, line breaks and extra whitespace are collapsed into a single space. later, we'll find out how to constrain the width of elements so that we can see the wrapping more easily. control attribute you can use the control attribute to set which control the label is associated with. when the user clicks on an associated label, that control will be focused. this association is also important for accessibility, so that screen readers read aloud the label for the control as the user tabs to it. set the value of the contr...
...ml content inside opening and closing description tags for longer blocks of text. it is more common to use the attribute syntax for labels, and the text content syntax for descriptions. example 4 : source view <description> this longer section of text is displayed. </description> you can set the text via script using the textcontent property, as in the following example: <description id="text" width="200"/> document.getelementbyid('text').textcontent = "some lengthy word wrapped text goes here."; internally, both the label element and the description elements are the same. the label element is intended for labels of controls, such as text fields. the control attribute is only supported for labels. the description element is intended for other descriptive text such as informative text at th...
Creating a Window - Archive of obsolete content
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 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 xm...
...d 'chrome' is necessary to indicate to the browser that this is a chrome document to open. this will open the window without the toolbars and menus and so forth that a normal browser window has. the syntax is described below: window.open(url,windowname,flags); where the flags contains the flag "chrome" as in this example window.open("chrome://navigator/content/navigator.xul", "bmarks", "chrome,width=600,height=300"); if you are using firefox, try below: window.open("chrome://browser/content/places/places.xul", "bmarks", "chrome,width=600,height=300"); you can test lines of javascript like these in the error console. choose tools – error console, type a line of javascript, and press the evaluate button, or the return or enter key. the findfile.xul example let's begin by creating the...
Persistent Data - Archive of obsolete content
to allow the saving of state, you simply add a persist attribute to the element which holds a value you want to save. the persist attribute should be set to a space-separated list of attributes of the element that you want to save. the element must also have an id attribute in order to identify it. for example, to save the size of a window, you would do the following: <window id="somewindow" width="200" height="300" persist="width height" . . . the two attributes of the window element, the width and the height will be saved. you could add additional attributes by adding a space and another attribute name to the persist attribute. you can add the persist attribute to any element and store any attribute. you might use unusual values if you adjust attributes using a script. our fin...
... the persist attribute to any element and store any attribute. you might use unusual values if you adjust attributes using a script. our find files example let's add the persist attribute to some of the elements in the find files dialog. to save the position of the window. to do this, we need to modify the window. <window id="findfile-window" title="find files" persist="screenx screeny width height" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> this will cause the x and y position of the window and the width and height of the window to be saved. we could extend it further to save the collapsed state of the splitter. it doesn't really make sense to save the current tab state. find files example so far : source view next, we'll loo...
Tabboxes - Archive of obsolete content
e find button to begin the search. ...
...you can see the two tabs, search and options. clicking on each one...
Tree Box Objects - Archive of obsolete content
'image' if there is an image in the tree cell and the coordinate corresponds to a location where the image is. of course, in many cases you may not care what part of the cell the coordinate is on and just want the row and column. to go in reverse and get the coordinates of a specific cell, use the getcoordsforcellitem() function. it takes seven arguments, as described below. var x = {}, y = {}, width = {}, height = {}; if (typeof tree.columns != "undefined") column = tree.columns[column]; tree.boxobject.getcoordsforcellitem( row, column, part, x, y, width, height ); the row, column, and part arguments are similar to those returned from the getcellat() function. again, the column should be either a string or a column object depending on which version you are using. the cell part type may be ...
...the getcellat() function. again, the column should be either a string or a column object depending on which version you are using. the cell part type may be used to get the coordinates of either the text, the entire cell, the twisty or the image in the cell. the same values as the getcellat() function are used. the getcoordsforcellitem() function returns the x and y coordinates in addition to the width and height, all as out parameters. next, we'll look at rdf which can be used to automatically populate trees and other elements. « previousnext » ...
Trees and Templates - Archive of obsolete content
flex="1" sort="rdf:http://home.netscape.com/web-rdf#lastmodifieddate"/> </treecols> persisting column state one additional thing you might want to do is persist which column is currently sorted, so that it is remembered between sessions. to do this, we use the persist attribute on each treecol element. ...
... remembered between sessions. to do this, we use the persist attribute on each treecol element. there are five attributes of columns that need to be persisted, to save the column width, the column order, whether the column is visible, which column is currently sorted and the sort direction. the following example shows a sample column: <treecol id="date" label="date" flex="1" persist="width ordinal hidden sortactive sortdirection" sort="rdf:http://home.netscape.com/web-rdf#lastmodifieddate"/> more details about the persist attribute will be described in the later section. additional rule attributes there are two additional attributes that can be added to the rule element that allow it to match in certain special circumstances. both are boolean attributes. iscon...
Using Spacers - Archive of obsolete content
button. by adding a spacer and resizing the window, you can see that the spacer has expanded to fill the space. the buttons have been pushed over. our find file example the code to add a spacer is shown below. insert it just before the find button. <spacer flex="1"/> <button id="find-button" label="find"/> more about flexibility xul lays out elements on a window by calculating suitable widths and heights for the elements and then adding space where they are flexible. unless you specify information about the width and height of an element, the default size of an element is determined by its contents. you'll notice that the cancel button in the dialogs has always set its width so that it fits the text inside it. if you create a button with a very long label, the button's default size w...
...default sizes of the children of a box are determined, the flexibility values are used to divide up the remaining empty space in the box. for example, if a box is 200 pixels wide and contains two flexible buttons, the first 50 pixels and the other 90 pixels, there will be 60 pixels of space left over. if both buttons have a flex value of 1, the space will be divided evenly with 30 extra pixels of width going to each button. if the second button's flexibility was increased to 2, the first button would receive 20 pixels of the extra space and the second button would receive 40 pixels of extra space instead. the flex attribute can be placed on any element, however it only has any meaning when placed on an element directly inside a xul box. this means that even though you can place a flex on an htm...
arrowscrollbox - Archive of obsolete content
quoise"/> <button label="peach"/> <button label="maroon"/> <button label="black"/> </arrowscrollbox> attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width clicktoscroll type: boolean clicktoscroll, if true, the arrows must be clicked to scroll the scrollbox content...
... 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. 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...
box - Archive of obsolete content
Archive › Mozilla › XUL › box
</box> <box orient="horizontal"> <label value="three"/> <label value="four"/> </box> </box> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
button - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } dir type: one of the values below the direction in which the child elements of the element are placed. ...
caption - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no...
checkbox - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the elem...
hbox - Archive of obsolete content
Archive › Mozilla › XUL › hbox
on the right --> <hbox> <spacer flex="1"/> <button label="connect"/> <button label="ping"/> </hbox> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
iframe - Archive of obsolete content
sparentthis results in the iframe's background being transparent. ...
...iframe's background being transparent. this can be used to workaround things like bug 540911 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element. ...
label - Archive of obsolete content
Archive › Mozilla › XUL › label
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the elem...
listcol - Archive of obsolete content
stitem> <listitem> <listcell label="john"/> <listcell label="painter"/> </listitem> </listbox> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
listcols - Archive of obsolete content
stitem> <listitem> <listcell label="john"/> <listcell label="painter"/> </listitem> </listbox> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
listitem - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } current type: boolean this attribute will be set to true if the listitem is the current item. this is typica...
menuseparator - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the elem...
panel - Archive of obsolete content
Archive › Mozilla › XUL › panel
when the panel doesn't have room. a sliding panel will have the start (or end) position extended such that the panel can be the requested size, meaning the arrow will no longer be at the start (or end) of the panel - i.e., the arrow will appear to have been slid along the panel to ensure the arrow is still pointing at the anchor. in this image, the panel has flip="slide" and has a width which is greater than the distance from the anchor to the right of the screen (or window), so the panel extends past the left of the anchor, and the arrow slides towards the middle of the panel such that it is still aligned with the anchor. without flip="slide", the panel would have had its width truncated and the panel would not extend to the left of the anchor. ignorekeys type: boolean...
...ed the popup (such as a mouse click, if the user clicked something to open the popup). openpopupatscreen( x, y, iscontextmenu ) return type: no return value open the popup at a specific screen position specified by x and y. this position may be adjusted if it would cause the popup to be off of the screen. the x and y coordinates are measured in css pixels. sizeto( width, height ) return type: no return value changes the current size of the popup to the new width and height. related interfaces nsiaccessibleprovider, nsidomxulpopupelement ...
popupset - Archive of obsolete content
uitem label="paste"/> </menupopup> </popupset> <label value="right click for popup" context="clipmenu"/> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
radio - Archive of obsolete content
Archive › Mozilla › XUL › radio
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the elem...
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the elem...
tabpanels - Archive of obsolete content
selectedindex type: integer gets and sets the index of the currently selected panel. the first item is at index 0. ...
...ger gets and sets the index of the currently selected panel. the first item is at index 0. 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element. selectedindex ...
toolbarbutton - Archive of obsolete content
the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. ...
... the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } dir type: one of the values below the direction in which the child elements of the element are placed. n...
toolbaritem - Archive of obsolete content
/> <toolbarbutton id="myext-button2" class="toolbarbutton-1" label="labe2l" /> </toolbaritem> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
toolbarpalette - Archive of obsolete content
tooltiptext="&mytiptext;" oncommand="somefunction()"/> </toolbarpalette> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
t. the view object implements the nsitreeview interface. the view is queried for the data to appear in the tree. there are several ways in which trees are used, as listed below. the second column lists the interfaces available via the tree's view property. the third column indicates whether treeitem element are used. if you would like to allow the tree to be horizontally scrolled, simply set the width attributes for each column to make the tree wider than its containing object. tree type view interfaces has dom nodes? description content tree nsitreeview, nsitreecontentview yes this tree has treeitem elements placed within the treechildren element. in this situation, a content view (which implements the interface nsitreecontentview) which is a more speciali...
...hereever.com"/> <treecell label="let's do lunch"/> </treerow> </treeitem> </treechildren> </tree> a tree with several columns and nested items <tree id="mytree" flex="1" hidecolumnpicker="false" seltype="single" class="tree" rows="5"> <treecols id="mytree2-treecols"> <treecol id="mytree2-treecol0" primary="true" flex="2" label="column a" persist="width" ordinal="1"/> <splitter class="tree-splitter" ordinal="2"/> <treecol id="mytree2-treecol1" flex="1" label="column b" persist="width" ordinal="3"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="1"/> <treecell label="a"/> </treerow> </treeitem> <!-- make sure to set container="true" --> <treeitem container="tru...
vbox - Archive of obsolete content
Archive › Mozilla › XUL › vbox
two labels at bottom --> <vbox> <spacer flex="1"/> <label value="one"/> <label value="two"/> </vbox> attributes 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, 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...
...-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, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens...
CommandLine - Archive of obsolete content
</window> original document information author: georges-etienne legendre last updated date: august 21st, 2007 ...
...</window> original document information author: georges-etienne legendre last updated date: august 21st, 2007 ...
Gecko Compatibility Handbook - Archive of obsolete content
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 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 he...
...e 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 or internet explorer 4 and 5, be sure to specify quirks mod...
Common Firefox theme issues and solutions - Archive of obsolete content
ng and chrome://browser/skin/identity-icons-https-ev.png to your browser folder. you can modify/redesign these icons to match your theme provided appropriate padlock icons are used for secure sites but not on insecure sites. ...
... chrome://global/content/aboutmemory.css. about:permissions domain names don't line up in about:permissions the domains on the domain list of about:permissions do not line up properly due to missing placeholder icons for domains without favicons. ...
Create Your Own Firefox Background Theme - Archive of obsolete content
e no larger than 300 kb in file size tips subtle, soft contrast images and gradients work best; highly detailed images will compete with the browser ui. firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window. the upper right-hand side of the image should have the most important information—as a user increases the width of the browser window, the browser reveals more of the left-hand side of the image. online image editor resources pixlr — pixlr offers professional and easy-to-use tools for creating and editing images within a browser. photoshop — tweak, rotate and touch up photos with photoshop® express, a free online photo editor. creating a theme footer image in older versions of firefox, or new...
...ger than 300 kb in file size tips subtle, soft contrast images and gradients work best; highly detailed images will compete with the browser ui. firefox may reveal more of the upper portion of the image if the find bar is open or if an extension adds more height to the bottom of the window. the left-hand side of the image should have the most important information—as a user increases the width of the browser window, the browser reveals more of the right-hand side of the image. submitting your theme images to get started submitting your images, go to the theme submission page: name your theme — pick a unique name for your theme. duplicate names are not allowed, so you may need to try a few times to find a unique name. pick a category and tags — select a category and enter som...
Theme changes in Firefox 3 - Archive of obsolete content
o update. filename css file details changes to the default theme the table below lists changes made in the default theme for firefox 3; you can use this information as a starting point for figuring out the changes you need to make. all file list all platforms file description of change browser/themes/*/browser/browser.css the width of the drag and drop indicator is no longer calculated during the drag (tabbrowser.xml). instead a '-moz-margin-start' property must be added to .tab-drop-indicator-bar, with a value that is half of the width of the indicator image. also, the visibility of the indicator is now controlled by setting collapsed in tabbrowser.xml. as a result, the 'display' property should be removed from .tab-drop-i...
...e browser/themes/pinstripe/browser/tabbrowser/tabdragindicator.png removed superfluous blank pixels from the edges, so that the image is smaller. may or may not affect other mac themes that use it. browser/themes/pinstripe/browser/browser.css .tabbrowser-tab[first-tab="true"] > .tab-image-left no longer has a margin-left. instead .tabs-left now displayed and given the same width as the former margin-left. it was already done this way in winstripe. changes in browser --- changes in global all platforms the yellow background for the location bar has been deprecated; instead, themes should style the new #identity-box element depending on its verifieddomain/verifiedidentity class. the go button is now located inside the location bar, so the image for it (chrome:/...
-ms-scroll-snap-points-x - Archive of obsolete content
0%, and the interval is set to 100%. in the second selector, each snap-point is listed separately — 100%, 200%, 300%, and so on. ...
... remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. ...
-ms-scroll-snap-points-y - Archive of obsolete content
0%, and the interval is set to 100%. in the second selector, each snap-point is listed separately — 100%, 200%, 300%, and so on. ...
... remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. ...
-ms-scrollbar-arrow-color - Archive of obsolete content
ntage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples the following example shows how to use -ms-scrollbar-arrow-color and -ms-scrollbar-face-color to display a scroll bar with a blue scroll box and arrows, and a scroll bar with a green scroll box and arrows. ...
... <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples the following example shows how to use -ms-scrollbar-arrow-color and -ms-scrollbar-face-color to display a scroll bar with a blue scroll box and arrows, and a scroll bar with a green scroll box and arrows. ...
-ms-scrollbar-base-color - Archive of obsolete content
ge>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-base-color and -ms-scrollbar-arrow-color to create two <div> objects with different scroll bar color schemes. ...
...entage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-base-color and -ms-scrollbar-arrow-color to create two <div> objects with different scroll bar color schemes. ...
-ms-scrollbar-face-color - Archive of obsolete content
= hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-face-color and -ms-scrollbar-arrow-color to display a scroll bar with a blue scroll box and arrows, and a scroll bar with a green scroll box and arrows. ...
...ntage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-face-color and -ms-scrollbar-arrow-color to display a scroll bar with a blue scroll box and arrows, and a scroll bar with a green scroll box and arrows. ...
-ms-scrollbar-highlight-color - Archive of obsolete content
? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-highlight-color, -ms-scrollbar-face-color, and -ms-scrollbar-arrow-color to create two <div> objects with different scroll bar color schemes. ...
...value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-highlight-color, -ms-scrollbar-face-color, and -ms-scrollbar-arrow-color to create two <div> objects with different scroll bar color schemes. ...
-ms-scrollbar-track-color - Archive of obsolete content
ue>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-track-color, -ms-scrollbar-face-color, and -ms-scrollbar-arrow-color to create two <div> elements with different scroll bar color schemes. ...
...ha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples this example uses -ms-scrollbar-track-color, -ms-scrollbar-face-color, and -ms-scrollbar-arrow-color to create two <div> elements with different scroll bar color schemes. ...
-ms-text-autospace - Archive of obsolete content
the -ms-text-autospace css property is a microsoft extension that specifies the autospacing and narrow space width adjustment of text. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none no effect takes place; that is, no extra space is added. this is the default value. ideograph-alpha creates extra spacing between runs of ideographic and non-ideographic text, such as latin-based, cyrillic, greek, arabic, or hebrew text. ideograph-numeric creates extra spacing between runs of ideographic text and numeric characters. ...
...eograph-alpha creates extra spacing between runs of ideographic and non-ideographic text, such as latin-based, cyrillic, greek, arabic, or hebrew text. ideograph-numeric creates extra spacing between runs of ideographic text and numeric characters. ideograph-parenthesis creates extra spacing between a normal (non-wide) parenthesis and an ideograph. ideograph-space extends the width of the space character when it is adjacent to ideographs. formal syntax none | ideograph-alpha | ideograph-numeric | ideograph-parenthesis | ideograph-space specifications not part of any specification. remarks this property requires windows 8 or later. this property is an extension to css, and can be used as a synonym for text-autospace in ie8 standards mode. an ideograph is a char...
CSS - Archive of obsolete content
Archive › Web › CSS
the extension is implemented in microsoft edge and internet explorer 11.-ms-overflow-stylethe -ms-overflow-style css property is a microsoft extension controlling the behavior of scr...
...t extension that specifies the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.-ms-scrollbar-track-colorthe -ms-scrollbar-track-color css property is a microsoft extension that specifies the color of the track element of a scrollbar.-ms-text-autospacethe -ms-text-autospace css property is a microsoft extension that specifies the autospacing and narrow space width adjustment of text.-ms-touch-selectthe -ms-touch-select css property is a microsoft extension that toggles the gripper visual elements that enable touch text selection.-ms-wrap-flowthe -ms-wrap-flow css property is a microsoft extension that specifies how exclusions impact inline content within block-level elements.-ms-wrap-marginthe -ms-wrap-margin css property is a microsoft extension that spec...
2D collision detection - Game development
a review of the most common techniques used to provide collision detection in 2d games. axis-aligned bounding box one of the simpler forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. the algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. any gap means a collision does not exist. ...
...vide collision detection in 2d games. axis-aligned bounding box one of the simpler forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. the algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. any gap means a collision does not exist. var rect1 = {x: 5, y: 5, width: 50, height: 50} var rect2 = {x: 20, y: 10, width: 10, height: 10} if (rect1.x < rect2.x + rect2.width && rect1.x + rect1.width > rect2.x && rect1.y < rect2.y + rect2.height && rect1.y + rect1.height > rect2.y) { // collision detected! } // filling in the values => if (5 < 30 && 55 > 20 && 5 < 20 && 55 > 10) { // collision detected! } rect code <div id="cr-stage"></div> <p>move the rectangle with arrow keys. g...
Building up a basic demo with Babylon.js - Game development
our experiments in. saving a copy of the latest babylon.js engine inside your directory. opening the babylon.js documentation in a separate tab — it is useful to refer to. ...
...the first <script> element includes the babylon.js library in the page; we will write our example code in the second one. there is one helper variable already included, which will store a reference to the <canvas> element. ...
Building up a basic demo with the PlayCanvas engine - Game development
periments in. saving a copy of the latest playcanvas engine inside your directory. opening the playcanvas documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use. ...
...the first <script> element includes the playcanvas library in the page; we will write our example code in the second one. there is one helper variable already included, which will store a reference to the <canvas> element. ...
Unconventional controls - Game development
/>' + ' strength: ' + grabstrength + ''; } }); the code above is calculating and assigning the horizontaldegree, verticaldegree and grabstrength values that we will use later on, and outputting it in html so we can see the actual values. when those variables are up-to-date, we can use them in the draw() function to move the ship: function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); // ... if(horizontaldegree > degreethreshold) { playerx -= 5; } else if(horizontaldegree < -degreethreshold) { playerx += 5; } if(verticaldegree > degreethreshold) { playery += 5; } else if(verticaldegree < -degreethreshold) { playery -= 5; } if(grabstrength == 1) { alert('boom!'); } ctx.dr...
...icrophone. if the frequency of the bounced sound is shifted from the original one, then we can detect that the movement of that object occured. that way we can detect a hand movement by using only a built-in microphone! this can be accomplished using a small library created by daniel rapp — it can be as simple as calculating the difference between two frequencies: doppler.init(function(bandwidth) { var diff = bandwidth.left - bandwidth.right; }); the diff would be the difference between the initial position of the hand and the final one. this approach won't give us the full flexibility of using a gamepad, or even leap motion, but it's definitely an interesting, unconventional alternative. you can use it to scroll a page hands-free, or play theremin, but it should also be enough to ...
Square tilemaps implementation: Static maps - Game development
, 64, 64); in order to support atlases with multiple rows and columns, you would need to know how many rows and columns there are to be able to compute the source x and y. the tilemap data structure to store that map data, we can use a plain object or a custom class. for the sake of simplicity, in the example code a plain object has been used. it contains the basic map properties: cols: the width of the map, in columns. rows: the height of the map, in rows. tsize: the tile size, in pixels. tiles: a 1-dimensional array containing the visual grid. gettile(): a helper method that gets the tile index in a certain position. tiles contains the actual visual map data. we are representing the tiles with indices, assigned to the tiles dependant on their position in the atlas (e.g. 0 for the ...
... tileatlas: an image object containing the tile atlas. map: the tilemap object discussed above. for (var c = 0; c < map.cols; c++) { for (var r = 0; r < map.rows; r++) { var tile = map.gettile(c, r); if (tile !== 0) { // 0 => empty tile context.drawimage( tileatlas, // image (tile - 1) * map.tsize, // source x 0, // source y map.tsize, // source width map.tsize, // source height c * map.tsize, // target x r * map.tsize, // target y map.tsize, // target width map.tsize // target height ); } } } demo our static tilemap implementation demo pulls the above code together to show what an implementation of this map looks like. you can see a live demo and grab the full source code. ...
Create the Canvas and draw on it - Game development
the body contains <canvas> and <script> elements — we will render the game inside the first one and write the javascript code that controls it in the second one. the <canvas> element has an id of mycanvas to allow us to easily gra...
... load your index.html in a browser to try it out. ctx.beginpath(); ctx.rect(20, 40, 50, 50); ctx.fillstyle = "#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 screen and 40 pixels from the top side, and is 50 pixels wide and 50 pixels high, which makes it a perfect square. the fillstyle property stores a color that will be used by the fill() method to paint the square, in our case, red. we're not limited to rectangles — here's a piece of code for pr...
Game over - Game development
uld be good from the gameplay point of view to be able to lose. the logic behind losing in breakout is simple. if you miss the ball with the paddle and let it reach the bottom edge of the screen, then it's game over. implementing game over let's try to implement game over in our game. here's the piece of code from the third lesson where we made the ball bounce off the walls: if(x + dx > canvas.width-ballradius || x + dx < ballradius) { dx = -dx; } if(y + dy > canvas.height-ballradius || y + dy < ballradius) { dy = -dy; } instead of allowing the ball to bounce off all four walls, let's only allow three now — left, top and right. hitting the bottom wall will end the game. we'll edit the second if block so it's an if else block that will trigger our "game over" state upon the ball c...
...een the ball and the paddle, so it can bounce off it and get back into the play area. the easiest thing to do is to check whether the center of the ball is between the left and right edges of the paddle. update the last bit of code you modified again, to the following: if(y + dy < ballradius) { dy = -dy; } else if(y + dy > canvas.height-ballradius) { if(x > paddlex && x < paddlex + paddlewidth) { dy = -dy; } else { alert("game over"); document.location.reload(); clearinterval(interval); } } if the ball hits the bottom edge of the canvas we need to check whether it hits the paddle . if yes, then it bounces off just like you'd expect; if not then the game is over as before. compare your code here's the working code for you to compare yours a...
Mouse controls - Game development
ovehandler, false); anchoring the paddle movement to the mouse movement we can update the paddle position based on the pointer coordinates — the following handler function will do exactly that. add the following function to your code, below the previous line you added: function mousemovehandler(e) { var relativex = e.clientx - canvas.offsetleft; if(relativex > 0 && relativex < canvas.width) { paddlex = relativex - paddlewidth/2; } } in this function we first work out a relativex value, which is equal to the horizontal mouse position in the viewport (e.clientx) minus the distance between the left edge of the canvas and left edge of the viewport (canvas.offsetleft) — effectively this is equal to the distance between the canvas left edge and the mouse pointer. if the re...
...n we first work out a relativex value, which is equal to the horizontal mouse position in the viewport (e.clientx) minus the distance between the left edge of the canvas and left edge of the viewport (canvas.offsetleft) — effectively this is equal to the distance between the canvas left edge and the mouse pointer. if the relative x pointer position is greater than zero and lower than the canvas width, the pointer is within the canvas boundaries, and the paddlex position (anchored on the left edge of the paddle) is set to the relativex value minus half the width of the paddle, so that the movement will actually be relative to the middle of the paddle. the paddle will now follow the position of the mouse cursor, but since we're restricting the movement to the size of the canvas, it won't disap...
Track the score and win - Game development
ne to the collisiondetection() function to increment the value of the score variable each time a collision is detected. ...
...all, so you should display a winning message if all available points have been collected. ...
Buttons - Game development
'img/button.png', 120, 40); a single button frame is 120 pixels wide and 40 pixels high. you also need to grab the button spritesheet from github, and save it in your /img directory. adding the button to the game adding the new button to the game is done by using the add.button method. ...
...ch looks a bit silly. to stop this, we can take advantage of the playing variable and make the paddle movable only when the game has started. to do that, adjust the update() function like so: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); if(playing) { paddle.x = game.input.x || game.world.width*0.5; } } that way the paddle is immovable after everything is loaded and prepared, but before the start of the actual game. compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps the last thing we will do in this article series is make the gameplay even more interesting by adding some ran...
CSS pixel - MDN Web Docs Glossary: Definitions of Web-related terms
by definition, this is the physical size of a single pixel at a pixel density of 96 dpi, located an arm's length away from the viewer's eyes. that definition, of course, leaves a lot of wiggle room, as the terms "be comfortably seen" and "an arm's length away" are imprecise, varying from person to person. ...
...rther away from their eyes than when they're on a cell phone, for instance. as such, it generally suffices to say that when the unit px is used, the goal is to try to have the distance 96px equal about 1 inch on the screen, regardless of the actual pixel density of the screen. in other words, if the user is on a phone with a pixel density of 266 dpi, and an element is placed on the screen with a width of 96px, the actual width of the element would be 266 device pixels. learn more technical reference css values and units module, section 5.2: absolute lengths learn about it css length explained on the mdn hacks blog ...
Intrinsic Size - MDN Web Docs Glossary: Definitions of Web-related terms
in css, the intrinsic size of an element is the size it would be based on its content, if no external factors were applied to it. for example, inline elements are sized intrinsically: width, height, and vertical margin and padding have no impact, though horizontal margin and padding do. how intrinsic sizes are calculated is defined in the css intrinsic and extrinsic sizing specification. intrinsic sizing takes into account the min-content and max-content size of an element. ...
... intrinsic sizing takes into account the min-content and max-content size of an element. for text the min-content size would be if the text wrapped as small as it can in the inline direction without causing an overflow, doing as much soft-wrapping as possible. for a box containing a string of text, the min-content size would be defined by the longest word. the keyword value of min-content for the width property will size an element according to the min-content size. the max-content size is the opposite — in the case of text, this would have the text display as wide as possible, doing no soft-wrapping, even if an overflow was caused. the keyword value max-content exposes this behavior. ...
Accessible multimedia - Learn web development
e resources are provided along with the audio + transcript, and specifically link to them in the places where they are referred to in the transcript. this of course will help all users, not just people who are deaf. note: an audio transcript will in general help multiple user groups. ...
... note: text tracks are also useful for potentially any user, not just those with disabilities. ...
Cascade and inheritance - Learn web development
stood 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 information box, usually at the bottom of the specifications section, which lists a number of data points about that property, including whether it is inherited or not. see t...
...sts nested inside it. we have given the outer <ul> a border, padding, and a font color. the color has applied to the direct children, but also the indirect children — the immediate child <li>s, and those inside the first nested list. we have then added a class of special to the second nested list and applied a different color to it. this then inherits down through its children. things like widths (as mentioned above), margins, padding, and borders do not inherit. if a border were to be inherited by the children of our list, every single list and list item would gain a border — probably not an effect we would ever want! which properties are inherited by default and which aren't is largely down to common sense. controlling inheritance css provides four special universal property value...
Overflowing content - Learn web development
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 overflow and how to manage it. what is overflow? everything in css is a box. you can constrain the size of these boxes by assigning values of width and height (or inline-size and block-size). overflow happens when there is too much content to fit in a box. css provides various tools to manage overflow. as you go further with css layout and writing css, you will encounter more overflow situations. css tries to avoid "data loss" let's consider two examples that demonstrate the default behavior of css when there is overflow. the first exampl...
...ause data loss. the problem with data loss is that you might not notice. website visitors may not notice. if the submit button on a form disappears and no one can complete the form, this could be a big problem! instead, css overflows in visible ways. you are more likely to see there is a problem. at worst, a site visitor will let you know that content is overlapping. if you restrict a box with a width or a height, css trusts you to know what you are doing. css assumes that you are managing the potential for overflow. in general, restricting the block dimension is problematic when the box contains text. there may be more text than you expected when designing the site, or the text may be larger. (for example, if the user has increased their font size) the next two lessons explain different appr...
Pseudo-classes and pseudo-elements - Learn web development
times see this in code or examples. modern browsers support the early pseudo-elements with single- or double-colon syntax for backwards compatibility. for example, if you wanted to select the first line of a paragraph you could wrap it in a <span> element and use an element selector; however, that would fail if the number of words you had wrapped were longer or shorter than the parent element's width. as we tend not to know how many words will fit on a line — as that will change if the screen width or font-size changes — it is impossible to robustly do this by adding html. the ::first-line pseudo-element selector will do this for you reliably — if the number of words increases and decreases it will still only select the first line. it acts as if a <span> was magically wrapped around...
...ed in the example below, which is a visual indicator that we wouldn't want read out by a screenreader: these pseudo-elements are also frequently used to insert an empty string, which can then be styled just like any element on the page. in this next example, we have added an empty string using the ::before pseudo-element. we have set this to display: block in order that we can style it with a width and height. we then use css to style it just like any element. you can play around with the css and change how it looks and behaves. the use of the ::before and ::after pseudo-elements along with the content property is referred to as "generated content" in css, and you will often see this technique being used for various tasks. a great example is the site css arrow please, which helps you to ...
Test your skills: Multicol - Learn web development
you will be working through three small tasks which use different elements of the material you have just covered. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. multicol one in this task you need to create three columns, with a 50px gap between each column. ...
...elp section at the bottom of this page. multicol one in this task you need to create three columns, with a 50px gap between each column. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. multicol two create columns which have a minimum width of 200px. then, add a 5px, grey rule between each column, ensuring there is 10px of space between the edge of the rule and the column content. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. multicol three cause the element containing ...
Styling lists - Learn web development
ing with bullet types, spacing, or whatever else you can find. 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 a potential answer. ...
...1px solid #0095dd;"><ul> <li>first, light the candle.</li> <li>next, open the box.</li> <li>finally, place the three magic items in the box, in this exact order, to complete the spell: <ol> <li>the book of spells</li> <li>the shiny rod</li> <li>the goblin statue</li> </ol> </li> </ul></textarea> <h2>css input</h2> <textarea id="code" class="css-input" style="width: 90%;height: 10em;padding: 10px;border: 1px solid #0095dd;"></textarea> <h2>output</h2> <div class="output" style="width: 90%;height: 12em;padding: 10px;border: 1px solid #0095dd;overflow: auto;"></div> <div class="controls"> <input id="reset" type="button" value="reset" style="margin: 10px 10px 0 0;"> <input id="solution" type="button" value="show solution" style="margin: 10px 0 0...
How do you make sure your website works properly? - Learn web development
ntly the resource has moved to a new location. you won't see this much in your browser, but it's good to know about "301" since search engines use this information a lot to update their indexes. 304: not modified the file has not changed since the last time you asked for it, so your browser can display the version from its cache, resulting in faster response times and more efficient use of bandwidth. 403: forbidden you aren't allowed to display the resource. usually it has to do with a configuration mistake (e.g. your hosting provider forgot to give you access rights to a directory). 404: not found self-explanatory. we'll discuss how to solve this below. 500: internal server error something went wrong on the server. for instance, maybe the server-side language (php, .net, etc.) stopped...
... how's the performance? does the page load fast enough? resources like webpagetest.org or browser add-ons like yslow can tell you a few interesting things: grades go from a to f. our page is just small and meets most criteria. but we can already note it would have been better to use a cdn. that doesn't matter very much when we're only serving one image, but it would be critical for a high-bandwidth website serving many thousands of images. is the server responsive enough? ping is a useful shell tool that tests the domain name you provide and tells you if the server's responding or not: $ ping mozilla.org ping mozilla.org (63.245.215.20): 56 data bytes 64 bytes from 63.245.215.20: icmp_seq=0 ttl=44 time=148.741 ms 64 bytes from 63.245.215.20: icmp_seq=1 ttl=44 time=148.541 ms 64 bytes fro...
Example - Learn web development
r title="required">*</abbr></strong> <em>formatted as mm/dd/yyyy</em> </label> <input type="date" id="date" name="expiration"> </p> </section> <section> <p> <button type="submit">validate the payment</button> </p> </section> </form> css content h1 { margin-top: 0; } ul { margin: 0; padding: 0; list-style: none; } form { margin: 0 auto; width: 400px; padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div+div { margin-top: 1em; } label span { display: inline-block; width: 120px; text-align: right; } input, textarea { font: 1em sans-serif; width: 250px; box-sizing: border-box; border: 1px solid #999; } input[type=checkbox], input[type=radio] { width: auto; border: none; } ...
...ock; width: 120px; text-align: right; } input, textarea { font: 1em sans-serif; width: 250px; box-sizing: border-box; border: 1px solid #999; } input[type=checkbox], input[type=radio] { width: auto; border: none; } input:focus, textarea:focus { border-color: #000; } textarea { vertical-align: top; height: 5em; resize: vertical; } fieldset { width: 250px; box-sizing: border-box; margin-left: 136px; border: 1px solid #999; } button { margin: 20px 0 0 124px; } label { position: relative; } label em { position: absolute; right: 5px; top: 20px; } result ...
Test your skills: Advanced styling - Learn web development
nt or further help section at the bottom of this page. advanced form styling 1 in our first advanced styling tasks, we want you to handle making a search input as consistent as possible across browsers — a trickier task than with standard text inputs, even on modern browsers. we've already provided you with a basic reset to build upon. first of all, try giving the search box a consistent width, height, padding, and border color across browsers. you'll find that some browsers will not behave in terms of the form element's height. this is due to native os styling being used in some cases. how can you remove this native styling? once you've removed the native styling, you'll need to add back one of the features it was providing, to keep same look and feel we originally had. how do you d...
... styling 2 in our next task we provide you with a set of three radio buttons. we want you to give them custom styling. we've already provided you with a basic reset to build upon. first of all, get rid of their default styling. next, give the radio buttons a reasonable base style — the style they have when the page first loads. this can be anything you like, but you probably want to set a width and height (of somewhere between about 18 and 24 pixels), and a subtle border and/or background color. now give the radio buttons a different style for when they are selected. align the radio buttons nicely with the labels. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. advan...
Example - Learn web development
<div> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_email"> </div> <div> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </div> <div class="button"> <button type="submit">send your message</button> </div> </form> css content form { /* just to center the form on the page */ margin: 0 auto; width: 400px; /* to see the limits of the form */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div + div { margin-top: 1em; } label { /* to make sure that all label have the same size and are properly align */ display: inline-block; width: 90px; text-align: right; } input, textarea { /* to make sure that all text field have the same font settings by default, ...
...v + div { margin-top: 1em; } label { /* to make sure that all label have the same size and are properly align */ display: inline-block; width: 90px; text-align: right; } input, textarea { /* to make sure that all text field have the same font settings by default, textarea are set with a monospace font */ font: 1em sans-serif; /* to give the same size to all text field */ width: 300px; -moz-box-sizing: border-box; box-sizing: border-box; /* to harmonize the look & feel of text field border */ border: 1px solid #999; } input:focus, textarea:focus { /* to give a little highligh on active elements */ border-color: #000; } textarea { /* to properly align multiline text field with their label */ vertical-align: top; /* to give enough room to type ...
Your first form - Learn web development
cky 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. ...
...ike so: <style> </style> inside the style tags, add the following css: form { /* center the form on the page */ margin: 0 auto; width: 400px; /* form outline */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } ul { list-style: none; padding: 0; margin: 0; } form li + li { margin-top: 1em; } label { /* uniform size & alignment */ display: inline-block; width: 90px; text-align: right; } input, textarea { /* to make sure that all text fields have the same font settings by default, textareas have a monospace font */ font: 1em sans-serif; /* uniform text field size */ width: 300px; box-sizing: border-box; /* match form field borders */ border: 1px solid #999; } input:focus, textarea:focus { /* additional highlight for focused e...
Tips for authoring fast-loading HTML pages - Learn web development
minify and compress your images large images cause your page to take more time to load. consider compressing your images before adding them to your page, using compression features built into image-manipulation tools such as photoshop, or using a specialized tool such as compress jpeg or tiny png,. specify sizes for images and tables if the browser can immediately determine the height and/or width of your images and tables, it will be able to display a web page without having to reflow the content. this not only speeds the display of the page but prevents annoying changes in a page's layout when the page completes loading. for this reason, height and width should be specified for images, whenever possible. tables should use the css selector: property combination: table-layout: fixed; ...
...tables, it will be able to display a web page without having to reflow the content. this not only speeds the display of the page but prevents annoying changes in a page's layout when the page completes loading. for this reason, height and width should be specified for images, whenever possible. tables should use the css selector: property combination: table-layout: fixed; and should specify widths of columns using the <col> and the <colgroup> elements. use lazy loading for images by default, imags are loaded eagerly; that is, the image is fetched and rendered as soon as it's processed in the html. all eagerly loaded images are rendered before the document's load event is sent. switching to lazy loading of images tells the browser to hold off on loading images until they're about to be n...
Function return values - Learn web development
red in a variable; and you can use this variable in the next stage of the calculation. using return values in your own functions to return a value from a custom function, you need to use the return keyword. we saw this in action recently in our random-canvas-circles.html example. our draw() function draws 100 random circles somewhere on an html <canvas>: function draw() { ctx.clearrect(0, 0, width, height); for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } inside each loop iteration, three calls are made to the random() function, to generate a random value for the current circle's x-coordinate, y-coordinate, and radius, respectively. the random() func...
...umber) { const result = math.floor(math.random() * number); return result; } but the first version is quicker to write, and more compact. we are returning the result of the calculation math.floor(math.random() * number) each time the function is called. this return value appears at the point the function was called, and the code continues. so when you execute the following: ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); if the three random() calls returned the values 500, 200, and 35, respectively, the line would actually be run as if it were this: ctx.arc(500, 200, 35, 0, 2 * math.pi); the function calls on the line are run first, and their return values substituted for the function calls, before the line itself is then executed. active learning: our own return...
Inheritance in JavaScript - Learn web development
), so it defeats the point of what we are trying to do. it also takes more lines of code. inheriting from a constructor with no parameters note that if the constructor you are inheriting from doesn't take its property values from parameters, you don't need to specify them as additional arguments in call(). ...
...t also takes more lines of code. inheriting from a constructor with no parameters note that if the constructor you are inheriting from doesn't take its property values from parameters, you don't need to specify them as additional arguments in call(). so, for example, if you had something really simple like this: function brick() { this.width = 10; this.height = 20; } you could inherit the width and height properties by doing this (as well as the other steps described below, of course): function blueglassbrick() { brick.call(this); this.opacity = 0.5; this.color = 'blue'; } note that we've only specified this inside call() — no other parameters are required as we are not inheriting any properties from the parent that are set via parameters. setting teacher()'s prototype and c...
Gecko info for Windows accessibility vendors
support isimpledomnode as well as isimpledomtext. ...
...o window hresult get_clippedsubstringbounds( [in] unsigned int startindex, [in] unsigned int endindex, [out] int *x, [out] int *y, [out] int *width, [out] int *height); // bounding rect unclipped hresult get_unclippedsubstringbounds( [in] unsigned int startindex, [in] unsigned int endindex, [out] int *x, [out] int *y, [out] int *width, [out] int *height); // scroll to this part of the subsstring hresult scrolltosubstring( [in] unsigned int startindex, [in] unsigned int endindex); // get the current font being used -- this is better than using // the isimpledomnode css property methods, because it provides // a single font name, rather than a comma delineated list of possibilities hresult fontfamily([ou...
Creating MozSearch plugins
ch format is similar to the opensearch format. the only difference is the root element and xml namespace. ...
...isible, the browser will take them to http://search.yahoo.com/, the value of the <searchform> element. example: searching mdc this plugin lets you easily search the mozilla developer center web site. ...
HTMLIFrameElement.getContentDimensions()
syntax var instanceofdomrequest = instanceofhtmliframeelement.getcontentdimensions(); returns a domrequest for handling the dimensions request. its request.onsuccess handler handles the success case, and its request.onerror handler handles the failure case. ...
...dler handles the success case, and its request.onerror handler handles the failure case. the x and y dimensions are available in the request.result.x and request.result.y properties, respectively. parameters none. examples var browser = document.queryselector('iframe'); var request = browser.getcontentdimensions(); request.onsuccess = function() { console.log("page size:", request.result.width + "x" + request.result.height); } request.onerror = function() { console.log("download error"); } specification not part of any specification. ...
IME handling guide
textunderline underline style can be specified with the following prefs. the values are integer, 0: none, 1: dotted, 2: dashed, 3: solid, 4: double, 5: wavy (the values same as ns_style_text_decoration_style_* defined in nsstyleconsts.h. ui.imerawinputunderlinestyle ui.imeselectedrawtextunderlinestyle ui.imeconvertedtextunderlinestyle ui.imeselectedconvertedtextunderlinestyle underline width can be specified with "ui.imeunderlinerelativesize" pref. this affects all types of clauses. the value should be 100 or 200. 100 means normal width, 200 means double width. on some platforms, ime may support its own style for each clause. currently, this feature is supported in tsf mode of windows and on linux. the style information is stored in textrangestyle which is defined in textrange.h. it...
...ion::requesttocommit() synthesizes dom composition events and a dom text event for emulating to commit composition synchronously. additionally, textcomposition ignores comming events which are dispatched by widget when the widget receives native ime events. in this case, using the last composition string as commit string. however, if the last composition string is only an ideographic space (fullwidth space), the composition string may be a placeholder of some old chinese ime on windows. in this case, although, we should not commit the placeholder character because it's not a character which the user wanted to input but we commit it as is. the reason is, inputting an ideographic space causes a composition. therefore, we cannot distinguish if committing composition is unexpected. if the user...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
e and nameprep when mozilla receives idn input from the user via the location bar or a request to process non-ascii host name links, it first turns them into unicode, then normalizes the input string to make it conform to general uri requirement. the process will convert uppercase characters to lowercase ones (case folding), unify characters with multiple representation, e.g. conversion of half-width kana characters in japanese into full-width ones (normalization), eliminate prohibited characters (e.g. space), eliminate ambiguities in bi-directional text (e.g. arabic and hebrew), and check whether or not unassigned characters in the unicode repertoire are used -- allowing them for "query strings" but disallowing them for "stored strings" such as the data input for domain name registration. t...
...zilla's support for idn is not without some bugs. one notable bug is that non-ascii names are not always displayed correctly in some ui areas such as preference panels, bookmarks and history. non-ascii names are not always correctly displayed in the location bar due to the fact that ace to unicode conversion is not implemented yet. of particular concern for japanese users is the one in which full-width japanese roman characters are not normalized to ascii roman characters. (cf. bug 210734.) this forces the japanese user to shift out of the japanese input mode to write the top domain names such as .jp causing inconvenience. for other bugs, see this link. idn is a global trend and is likely to be adopted by a large number of sites making it easier for average internet users to find web sites. ma...
Creating localizable web applications
> </html> notice that <body/> is given a class equal to the current locale. this is useful to add minor corrective rules to the css that apply only for selected locales. for example, for locales that tend to have longer words than english, you may want to make an element slightly wider. snippet 3. good: body.de foo, body.fr foo, body.pl foo { /* locale-specific rules for the foo element */ width: 10em; /* originally 8em */ } adapt the interaction to rtl locales right-to-left locales not only require good images handling (see images), but also should be taken into account when designing the interaction on the website. consider the following example: a filmreel-like slideshow showcasing highlighted features of the product or featured designs. for right-to-left languages, the slideshow sh...
...t doesn't sit in a <img/> element. this is generally considered a good practice for decorative graphics. don't use images as buttons instead, use <button/> and style it with css. image 1. bad: snippet 1. ...
Mozilla MathML Status
nd not currently supported. sections related to semantics/content mathml or irrelevant features are left blank or not listed at all. if only the main features of an element are implemented then its section is marked as supported but details of unsupported attributes are specified below. the top-level math element see § 2.2. attribute notes display implemented. maxwidth, overflow not implemented. see bug 534962. altimg, altimg-width, altimg-height, altimg-valign, alttext accepted, but do not have any effect on the rendering. mathml is always enabled since bug 660762. cdgroup accepted, but does not have any effect on the rendering. attributes shared by all mathml elements see § 2.1.6 and § 3.1.10. attribute notes ...
...der implemented. mover implemented. munderover implemented. mmultiscripts implemented. tabular math element [- attribute] notes mtable implemented. mtable - alignmentscope not implemented. see bug 122253. mtable - columnspacing, rowspacing, framespacing implemented. see bug 330964. mtable - columnwidth not implemented. see bug 958953. mtable - equalrows, equalcolumns not implemented. see bug 958954. mtable - side, minlabelspacing not implemented. see bug 356870. mtr implemented. mlabeledtr not implemented. see bug 689641. mtd implemented. * - groupalign. not implemented. see bug 122253. maligngroup not implem...
NSPR Types
shared library. ...
...some systems require emulation of 64-bit fields by using two 32-bit numeric fields bound in a structure. since the types (long long versus struct l...
imgIDecoderObserver
when an image is known to be animated. this should be fired at the earliest possible time. void onimageisanimated( in imgirequest arequest ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. onstartcontainer() this load notification is called once enough data has been loaded from the network that we were able to parse the width and height from the image. by the time this callback is been called, the size has been set on the container and status_size_available has been set on the associated imgrequest. void onstartcontainer( in imgirequest arequest, in imgicontainer acontainer ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. acontainer ...
...r( in imgirequest arequest, in imgicontainer acontainer ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. acontainer missing description onstartdecode() this decode notification is called as soon as the image begins getting decoded. this does not include "header-only" decodes used by decode-on-draw to parse the width/height out of the image. thus, it is a decode notification only. void onstartdecode( in imgirequest arequest ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. onstartframe() this is a decode notification which is called when each frame is created. void onstartframe( in imgirequest arequest, in unsigned long aframe );...
nsIAccessNode
at( in long childnum ); parameters childnum zero-based child index. return value the nth nsiaccessnode child. exceptions thrown ns_error_failure indicates that the access node is unattached from the accessible tree. getcomputedstylecssvalue() retrieve the computed style value as nsidomcssprimitivevalue for the dom node this access node is associated with. note: the meanings of width, height and other size measurements depend on the version of css being used. therefore, for bounds information, it is better to use nsiaccessible.getbounds(). nsidomcssprimitivevalue getcomputedstylecssvalue( in domstring pseudoelt, in domstring propertyname ); parameters pseudoelt the pseudo element to retrieve style for, or empty string for general computed style information for the ...
...ormation for the node. propertyname retrieve the computed style value for this property name. return value the nsidomcssprimitivevalue computed style value. exceptions thrown ns_error_failure indicates that the access node is unattached from the accessible tree. getcomputedstylevalue() retrieve the computed style value for this dom node, if it is a dom element. note: the meanings of width, height and other size measurements depend on the version of css being used. therefore, for bounds information, it is better to use nsiaccessible.getbounds(). domstring getcomputedstylevalue( in domstring pseudoelt, in domstring propertyname ); parameters pseudoelt the pseudo element to retrieve style for, or null for general computed style information for this node. propertyname ret...
nsIAccessibleImage
accessible/public/nsiaccessibleimage.idlscriptable this interface allows in-process accessibility clients to retrieve information about an image. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getimageposition(in unsigned long coordtype, out long x, out long y); void getimagesize(out long width, out long height); methods getimageposition() returns the coordinates of the image accessible. this method is the same as nsiaccessible.getbounds() excepting coordinate origin parameter. void getimageposition( in unsigned long coordtype, out long x, out long y ); parameters coordtype specifies coordinates origin (for available constants refer to nsiaccessiblecoordinatetype). x the x coordi...
...tants refer to nsiaccessiblecoordinatetype). x the x coordinate of the image accessible position. y the y coordinate of the image accessible position. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. getimagesize() returns the size of the image accessible. this method is the same as nsiaccessible.getbounds(). void getimagesize( out long width, out long height ); parameters width the width of the image accessible. height the height of the image accessible. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ...
nsIAppStartup
rts last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/toolkit/app-startup;1. ...
...ake place on startup. methods createhiddenwindow() create the hidden window. void createhiddenwindow(); parameters none. createstartupstate() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) creates the initial state of the application by launching tasks specfied by "general.startup.*" prefs. note: size_to_content may be used for width or height. boolean createstartupstate( in long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the initial window(s) opened. awindowheight the height to make the initial window(s) opened. return value true if a window was opened. destroyhiddenwindow() destroys the hidden window. this will have no effect if the hidden window has not yet been creat...
nsIContentView
support for using this api for all scrollable elements is coming; see bug 618975 for details. method overview void scrollby(in float dxpx, in float dypx); void scrollto(in float xpx, in float ypx); void setscale(in float xscale, in float yscale); attributes attribute type description contentheight float read only. contentwidth float dimensions of scrolled content in chrome-document css pixels. read only. id nscontentviewid id that can be used in conjunction with nsidomwindowutils to change the actual document, instead of just how it is transformed; this is a 64-bit unsigned integer. read only. scrollx float horizontal scroll offset in chrome-document css pixels. when this v...
...rst lined up with the content's scroll offset. note: when this view becomes inactive, the new content view will have scroll values that are reset to the default. read only. scrolly float horizontal scroll offset in chrome-document css pixels. read only. viewportheight float height of the viewport in chrome-document css pixels. read only. viewportwidth float width of the viewport in chrome-document css pixels. read only. methods scrollby() scrolls the content view by the specified number of chrome-document css pixels along each axis. fails if the view isn't valid. void scrollby( in float dxpx, in float dypx ); parameters dxpx the number of css pixels to scroll on the x axis; specify a positive value to scroll to the ri...
nsIDOMClientRect
cal to bottom minus top). read only. left float x-coordinate, relative to the viewport origin, of the left of the rectangle box. read only. right float x-coordinate, relative to the viewport origin, of the right of the rectangle box. read only. top float y-coordinate, relative to the viewport origin, of the top of the rectangle box. read only. width float width of the rectangle box (this is identical to right minus left). read only. x float x-coordinate, relative to the viewport origin, of the left of the rectangle box. read only. y float y-coordinate, relative to the viewport origin, of the top of the rectangle box. read only. see also cssom view module : the clientrect interfacewd this objec...
...rigin, of the left of the rectangle box. read only. y float y-coordinate, relative to the viewport origin, of the top of the rectangle box. read only. see also cssom view module : the clientrect interfacewd this object was renamed a few times: initial name was textrectangle, then clientrect, then domrect. initially it had just the top/left/right/bottom attributes, then width/height/x/y were added. ...
nsIDOMXULElement
ue of the element's height attribute. hidden boolean true if the element's hidden attribute is the string "true", otherwise false. removes the attribute if you set it to false. id domstring gets/sets the value of the element's id attribute. left domstring gets/sets the value of the element's left attribute. maxheight domstring gets/sets the value of the element's maxheight attribute. maxwidth domstring gets/sets the value of the element's maxwidth attribute. menu domstring gets/sets the value of the element's menu attribute. minheight domstring gets/sets the value of the element's minheight attribute. minwidth domstring gets/sets the value of the element's minwidth attribute. observes domstring gets/sets the value of the element's observes attribute. ordinal domstring gets/s...
... style nsidomcssstyledeclaration read only. obsolete since gecko 1.9 returns an object that may be used to read or write individual css style properties for the element. tooltip domstring gets/sets the value of the element's tooltip attribute. tooltiptext domstring gets/sets the value of the element's tooltiptext attribute. top domstring gets/sets the value of the element's top attribute. width domstring gets/sets the value of the element's width attribute. methods blur() attempts to remove focus from the element. void blur(); parameters none. click() unless the element is disabled, sends mouse events that simulate the effect of clicking the mouse on the element, then calls the docommand() method. void click(); parameters none. docommand() generates and dispatches a basic command e...
nsIFile
ible between different volumes (disks or partitions). this method attempts to do the "right thing" when moving files across volumes. that is, it will copy the old file to the new location, try to assign the file attributes as the old file had them, and then delete the old file. you should be aware of these possible problems: this process may take a long time if the file is large and/or the bandwidth is narrow. if the copyto() method loses data, such as mac resource data, then so will such a move. if attribute data cannot be recreated (like the file owner if you don't have enough privileges, or acl data if moving to a non-acl volume), then those attributes will be lost. the new file's serial number will almost certainly be different, because it is a different file, probably stored in a dif...
...ible between different volumes (disks or partitions). this method attempts to do the "right thing" when moving files across volumes. that is, it will copy the old file to the new location, try to assign the file attributes as the old file had them, and then delete the old file. you should be aware of these possible problems: this process may take a long time if the file is large and/or the bandwidth is narrow. if the copyto() method loses data, such as mac resource data, then so will such a move. if attribute data cannot be recreated (like the file owner if you don't have enough privileges, or acl data if moving to a non-acl volume), then those attributes will be lost. the new file's serial number will almost certainly be different, because it is a different file, probably stored in a dif...
nsIScreenManager
read only. primaryscreen nsiscreen the primary display screen; this is the screen with the menu bar (on the mac) or taskbar or equivalent on windows or linux. read only. methods native code only!screenfornativewidget returns the nsiscreen instance for ...
...en instance for the native widget pointer. screenforrect() returns the nsiscreen containing the specified rectangle. if the rectangle overlaps multiple screens, the screen containing the majority of the rectangle's area is selected and returned. the coordinates must be specified using global (screen) coordinates, and are in pixels. nsiscreen screenforrect( in long left, in long top, in long width, in long height ); parameters left the left edge of the rectangle. top the top edge of the rectangle. width the width of the rectangle. height the height of the rectangle. return value the nsiscreen containing the majority of the rectangle's area. see also nsiscreen ...
nsISelectionController
void wordmove(in boolean forward, in boolean extend); attributes attribute type description caretvisible boolean this is true if the car...
...t. pr_false to disable. setcaretvisibilityduringselection() show the caret even in selections. by default the caret is hidden unless the selection is collapsed. use this function to show the caret even in selections. void setcaretvisibilityduringselection( in boolean visibility ); parameters visibility pr_true to show the caret in selections. pr_false to hide. setcaretwidth() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) set the carets width. can be called any time. void setcaretwidth( in short pixels ); parameters pixels the width to set the caret to in pixels. setdisplayselection() will set the display mode for the selection. void setdisplayselection( in short toggle ); parameters toggle ...
Flash Activation: Browser Comparison - Plugins
pages should create the plugin element so that it's visible on the page, and should resize or hide it only after the user has activated the plugin. ...
...ee the plugin, so hide it by resizing var plugin = document.getelementbyid('myplugin'); plugin.height = 0; plugin.width = 0; plugin.callpluginmethod(); } the html, by default, specifies the flash object to be a size that makes it visible, like this: <!-- give the plugin an initial size so it is visible --> <object type="application/x-shockwave-flash" data="myapp.swf" id="myplugin" width="300" height="300"> <param name="callback" value="plugincreated()"> </object> the callback parameter defined in the html can be called in flash using its flash.external.externalinterface api. using a script callback to determine when a plugin is activated similarly, a site's script shouldn't attempt to script a plugin immediately upon creation. instead, the plugin object should call into a j...
Drawing and Event Handling - Plugins
e browser calls the npp_setwindow method with an npwindow structure that represents a window. ...
...endent additional data */ #endif /* xp_unix */ npwindowtype type; /* whether this is a window or a drawable */ } npwindow; the window parameter is a platform-specific handle to a native window element in the browser window hierarchy on windows and unix. on mac os, window is a pointer to an np_port. the x and y fields specify the top-left corner of the plug-in relative to the page. the width and height fields specify the dimensions of the plug-in area. these values should not be modified by the plug-in. the cliprect field defines the clipping rectangle of the plug-in in a coordinate system where the origin is the top-left corner of the drawable or window. the browser calls npp_setwindow whenever the drawable changes. for windowless plugins, a cliprect of 0,0,0,0 signals that the plu...
Initialization and Destruction - Plugins
lign) and its value (for example, top). the argn array contains the attribute names; the argv array contains the attribute values. the browser ignores any nonstandard attributes in an embed element, so the web page author can use the arg parameters to specify private attributes defined for a particular plug-in. ...
...te names; the argv array contains the attribute values. the browser ignores any nonstandard attributes in an embed element, so the web page author can use the arg parameters to specify private attributes defined for a particular plug-in. for example, the following embed element has the standard attributes src, height, and width and the private attribute loop: <embed src="movie.avi" height="100" width="100" loop="true"> with the embed element in the example, the browser passes the values in argv to the plug-in instance: argc = 4 argn = { "src", "height", "width", "loop" } argv = { "movie.avi", "100", "100", "true" } the saved parameter allows an instance of a plug-in to save its data and, when the instance is destroyed, pass the data to the next instance of the plug-in at the same url. the...
Network request list - Firefox Developer Tools
reload the current page. you can override this behavior by checking "enable persistent logs" in the settings. network request columns you can toggle columns on and off by right-clicking on the table header and choosing the specific column from the context menu. a reset columns command is available on the context menu to reset the columns to their initial configuration. you can also change the width of the columns to help make the information you are looking for easier to view. the mouse pointer changes to a resize icon when you move it over the border of a column. you can drag to manually set the size of column. starting in firefox 76 you can double-click a column divider to resize the column to the left of it to fit its contents. the reset columns command on the context menu also resets t...
... the columns to help make the information you are looking for easier to view. the mouse pointer changes to a resize icon when you move it over the border of a column. you can drag to manually set the size of column. starting in firefox 76 you can double-click a column divider to resize the column to the left of it to fit its contents. the reset columns command on the context menu also resets the width of the columns to the default values. clicking the column header label sorts the request list by that column. you can reset the sort to the default by selecting "reset sorting" from the context menu. here is a list of all available columns: status: the http status code returned. the numeric code is displayed on a colored background, to help unusual ones stand out. if there was no respons...
Animation inspector example: CSS transitions - Firefox Developer Tools
tion using css transitions. ...
... 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } .icon { width: 50px; height: 50px; filter: grayscale(100%); transition: transform 750ms ease-in, filter 750ms ease-in-out; } .note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; transition: opacity 500ms 150ms, width 500ms 150ms; } .icon#selected { filter: grayscale(0%); transform: scale(1.5); } .icon#selected+span { opacity: 1; width: 300px; } javascript content function toggleselection(e) { if (e.button != 0) { return; } if (e.target.classlist.contains("icon")) { var wasselected = (e.target.getattribute("id") == "selected"); clearse...
Animation inspector example: Web Animations API - Firefox Developer Tools
n using the web animations api. ...
...content .channel { padding: 2em; margin: 0.5em; box-shadow: 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } #icon { width: 50px; height: 50px; filter: grayscale(100%); } #note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; } javascript content var iconkeyframeset = [ { transform: 'scale(1)', filter: 'grayscale(100%)'}, { filter: 'grayscale(100%)', offset: 0.333}, { transform: 'scale(1.5)', offset: 0.666 }, { transform: 'scale(1.5)', filter: 'grayscale(0%)'} ]; var notekeyframeset = [ { opacity: '0', width: '0'}, { opacity: '1', width: '300px'} ]; var iconkeyframeoptions = { duration: 750, ...
AnalyserNode.getByteTimeDomainData() - Web APIs
); ... ...
...8; const bufferlength = analyser.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.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = '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); canvasc...
AnalyserNode.getFloatFrequencyData() - Web APIs
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.getfloatfrequencydata(dataarray); //draw black background canvasctx.fillstyle = 'rgb(0, 0...
...dow.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.fillstyle = '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.fillstyle = 'rgb(' + math.floor(barheight + 100) + ', 50, 50)'; canvasctx.fillrect(posx, canvas.height - barheight / 2, barwidth, barheight / 2); posx += barwidth + 1; } }; dr...
CanvasPattern.setTransform() - Web APIs
x.fillstyle = 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" 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'; i...
...};</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 drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', drawcanvas); window.addeventlistener('load', drawcanvas); specifications specification status comment html living standardthe defin...
CanvasRenderingContext2D.arcTo() - Web APIs
out. in other words, the arc is tangential to both segments. ...
... living standard ...
CanvasRenderingContext2D.clip() - Web APIs
s id="canvas"></canvas> javascript the clipping region is a full circle, with its center at (100, 75), and a radius of 50. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create circular clipping region ctx.beginpath(); ctx.arc(100, 75, 50, 0, math.pi * 2); ctx.clip(); // draw stuff that gets clipped ctx.fillstyle = 'blue'; ctx.fillrect(0, 0, canvas.width, canvas.height); ctx.fillstyle = 'orange'; ctx.fillrect(0, 0, 100, 100); result specifying a path and a fillrule this example saves two rectangles to a path2d object, which is then made the current clipping region using the clip() method. the "evenodd" rule creates a hole where the clipping rectangles intersect; by default (with the "nonzero" rule), there would be no hole. html <canvas id...
...nzero" rule), there would be no hole. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create clipping path let region = new path2d(); region.rect(80, 10, 20, 130); region.rect(40, 50, 100, 50); ctx.clip(region, "evenodd"); // draw stuff that gets clipped ctx.fillstyle = 'blue'; ctx.fillrect(0, 0, canvas.width, canvas.height); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.clip' in that specification. living standard ...
CanvasRenderingContext2D.getImageData() - Web APIs
nformation about getimagedata() and general manipulation of canvas contents in pixel manipulation with canvas. syntax ctx.getimagedata(sx, sy, sw, sh); parameters sx the x-axis coordinate of the top-left corner of the rectangle from which the imagedata will be extracted. sy the y-axis coordinate of the top-left corner of the rectangle from which the imagedata will be extracted. sw the width of the rectangle from which the imagedata will be extracted. positive values are to the right, and negative to the left. sh the height of the rectangle from which the imagedata will be extracted. positive values are down, and negative are up. return value an imagedata object containing the image data for the rectangle of the canvas specified. the coordinates of the rectangle's top-left corne...
...d securityerror being thrown in this situation, configure cors to allow the source image to be used in this way. see allowing cross-origin use of images and canvas. example getting image data from a canvas this example draws a rectangle, and then uses getimagedata() to grab a portion of the canvas. html <canvas id="canvas"></canvas> javascript the object retrieved by getimagedata() has a width of 200 and a height of 100, for a total of 20,000 pixels. of those pixels, most are either transparent or taken from off the canvas; only 5,000 of them are opaque black (the color of the drawn rectangle). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.rect(10, 10, 100, 100); ctx.fill(); let imagedata = ctx.getimagedata(60, 60, 200, 100); ctx.putimaged...
CanvasRenderingContext2D.getTransform() - Web APIs
e following example, we have two <canvas> elements. we apply a transform to the first one's context using canvasrenderingcontext2d.settransform() and draw a square on it, then retrieve the matrix from it using gettransform(). we then apply the retrieved matrix directly to the second canvas context by passing the dommatrix object directly to settransform(), and draw a circle on it. ...
...wo <canvas> elements. we apply a transform to the first one's context using canvasrenderingcontext2d.settransform() and draw a square on it, then retrieve the matrix from it using gettransform(). we then apply the retrieved matrix directly to the second canvas context by passing the dommatrix object directly to settransform(), and draw a circle on it. ...
CanvasRenderingContext2D.imageSmoothingEnabled - Web APIs
value; options value a boolean indicating whether to smooth scaled images or not. the default value is true. examples disabling image smoothing this example compares three images. the first image is drawn at its natural size, the second is scaled to 3x and drawn with image smoothing enabled, and the third is scaled to 3x but drawn with image smoothing disabled. ...
...ith image smoothing disabled. ...
CanvasRenderingContext2D.isPointInStroke() - Web APIs
e checks whether the cursor is in the stroke of an elliptical path2d path. if yes, the ellipse's stroke becomes green, otherwise it is red. ...
... living standard ...
CanvasRenderingContext2D.rect() - Web APIs
eringcontext2d.rect() method of the canvas 2d api adds a rectangle to the current path. like other methods that modify the current path, this method does not directly render anything. to draw the rectangle onto a canvas, you can use the fill() or stroke() methods. note: to both create and render a rectangle in one step, use the fillrect() or strokerect() methods. syntax void ctx.rect(x, y, width, height); the rect() method creates a rectangular path whose starting point is at (x, y) and whose size is specified by width and 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.
...th. positive values are to the right, and negative to the left. height the rectangle's height. positive values are down, and negative are up. examples drawing a rectangle this example creates a rectangular path using the rect() method. the path is then rendered using the fill() method. html <canvas id="canvas"></canvas> javascript the rectangle's corner is located at (10, 20). it has a width of 150 and a height of 100. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.rect(10, 20, 150, 100); ctx.fill(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.rect' in that specification. living standard ...
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
llpathintoview method this example demonstrates the scrollpathintoview() method. ...
...playable-code"> ctx.beginpath(); ctx.rect(10, 10, 30, 30); ctx.scrollpathintoview();</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; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); specifications specification status comment html living standardthe defin...
CanvasRenderingContext2D.setTransform() - Web APIs
elements. we apply a transform to the first one's context using the first type of settransform() and draw a square on it, then retrieve the matrix from it using canvasrenderingcontext2d.gettransform(). we then apply the retrieved matrix directly to the second canvas context by passing the dommatrix object directly to settransform() (i.e. the second type), and draw a circle on it. ...
...m to the first one's context using the first type of settransform() and draw a square on it, then retrieve the matrix from it using canvasrenderingcontext2d.gettransform(). we then apply the retrieved matrix directly to the second canvas context by passing the dommatrix object directly to settransform() (i.e. the second type), and draw a circle on it. ...
CanvasRenderingContext2D.shadowColor - Web APIs
adows' color, while shadowoffsetx and shadowoffsety set their position relative to the shapes. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowoffsetx = 10; ctx.shadowoffsety = 10; // filled rectangle ctx.fillrect(20, 20, 100, 100); // stroked rectangle ctx.linewidth = 6; ctx.strokerect(170, 20, 100, 100); result shadows on translucent shapes a shadow's opacity is affected by the transparency level of its parent object (even when shadowcolor specifies a completely opaque value). this example strokes and fills a rectangle with translucent colors. html <canvas id="canvas"></canvas> javascript the resulting alpha value of the fill shadow is .8 * .2, or...
...s .8 * .2, or .16. the alpha of the stroke shadow is .8 * .6, or .48. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'rgba(255, 0, 0, .8)'; ctx.shadowblur = 8; ctx.shadowoffsetx = 30; ctx.shadowoffsety = 20; // filled rectangle ctx.fillstyle = 'rgba(0, 255, 0, .2)'; ctx.fillrect(10, 10, 150, 100); // stroked rectangle ctx.linewidth = 10; ctx.strokestyle = 'rgba(0, 0, 255, .6)'; ctx.strokerect(10, 10, 150, 100); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.shadowcolor' in that specification. living standard ...
CustomElementRegistry.define() - Web APIs
ent('img'); img.src = imgurl; icon.appendchild(img); // create some css to apply to the shadow dom var 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;' + ...
...-radius: 10px;' + 'opacity: 0;' + 'transition: 0.6s all;' + 'position: absolute;' + 'bottom: 20px;' + 'left: 10px;' + 'z-index: 3;' + '}' + 'img {' + 'width: 1.2rem' + '}' + '.icon:hover + .info, .icon:focus + .info {' + 'opacity: 1;' + '}'; // attach the created elements to the shadow dom shadow.appendchild(style); shadow.appendchild(wrapper); wrapper.appendchild(icon); wrapper.appendchild(info); } } // define the new e...
DOMRectReadOnly() - Web APIs
the domrectreadonly() constructor creates a new domrectreadonly object. syntax const mydomrectreadonly = new domrectreadonly(x, y, width, height) parameters x the x coordinate of the domrectreadonly's origin. y the y coordinate of the domrectreadonly's origin. width the width of the domrectreadonly. height the height of the domrectreadonly. ...
...e x coordinate of the domrectreadonly's origin. y the y coordinate of the domrectreadonly's origin. width the width of the domrectreadonly. height the height of the domrectreadonly. examples to create a new dompoint, you could run a line of code like so: const mydomrect = new domrectreadonly(0, 0, 100, 100) // running 'mydomrect' in the console would then return // domrect { x: 0, y: 0, width: 100, height: 100, top: 0, right: 100, bottom: 100, left: 0 } specifications specification status comment geometry interfaces module level 1the definition of 'domrectreadonly()' in that specification. candidate recommendation initial definition. ...
DataTransfer.effectAllowed - Web APIs
ning any other value to effectallowed has no effect and the old value is retained. internet explorer will change the value to be lowercased; thus, linkmove will become linkmove, and so on. example this example shows the use of the effectallowed and dropeffect properties. ...
...r value to effectallowed has no effect and the old value is retained. internet explorer will change the value to be lowercased; thus, linkmove will become linkmove, and so on. example this example shows the use of the effectallowed and dropeffect properties. ...
DataTransfer.items - Web APIs
ransferitemlist object containing datatransferitem objects representing the items being dragged in a drag operation, one list item for each object being dragged. if the drag operation had no data, the list is empty. example this example shows the use of the items and types properties. ...
...st object containing datatransferitem objects representing the items being dragged in a drag operation, one list item for each object being dragged. if the drag operation had no data, the list is empty. example this example shows the use of the items and types properties. ...
DataTransfer.setData() - Web APIs
ing representing the type of the drag data to add to the drag object. data a domstring representing the data to add to the drag object. return value void example this example shows the use of the datatransfer object's getdata(), setdata() and cleardata() methods. ...
...ing the type of the drag data to add to the drag object. data a domstring representing the data to add to the drag object. return value void example this example shows the use of the datatransfer object's getdata(), setdata() and cleardata() methods. <!doctype html> <html lang=en> <title>examples of datatransfer's setdata(), getdata() and cleardata()</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; // set the drag's format and data. u...
DataTransfer.setDragImage() - Web APIs
used. the image will typically be an <image> element but it can also be a <canvas> or any other visible element. the method's x and y coordinates define how the image should appear relative to the mouse pointer. these coordinates define the offset into the image where the mouse cursor should be. for instance, to display the image so that the pointer is at its center, use values that are half the width and height of the image. this method must be called in the dragstart event handler. syntax void datatransfer.setdragimage(img | element, xoffset, yoffset); arguments img | element an image element element to use for the drag feedback image. if element is an img element, then set the drag data store bitmap to the element's image (at its intrinsic size); otherwise, set the drag data store...
...e void example this example shows how to use the setdragimage() method. note the example refers to an image file named example.gif. if that file is present, it will be used as the drag image and if that file is not present, the browser will use its default drag image. demo <!doctype html> <html lang=en> <title>example of datatransfer.setdragimage()</title> <meta name="viewport" content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart"); // set the drag's format and data. use the event target's id for the data ev.datatransfer.setdata("text/plain", ev.target.id); // create an i...
DataTransfer.types - Web APIs
s used in the drag operation. each format is string. if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. example this example shows the use of the types and items properties. ...
... drag operation. each format is string. if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. example this example shows the use of the types and items properties. ...
DataTransferItem.webkitGetAsEntry() - Web APIs
zone itself, which is a <div> element with the id "dropzone", and an unordered list element with the id "listing". <p>drag files and/or directories to the box below!</p> <div id="dropzone"> <div id="boxtitle"> drop files here </div> </div> <h2>directory tree:</h2> <ul id="listing"> </ul> css content the styles used by the example are shown here. ...
...>directory tree:</h2> <ul id="listing"> </ul> css content the styles used by the example are shown here. #dropzone { text-align: center; width: 300px; height: 100px; margin: 10px; padding: 10px; border: 4px dashed red; border-radius: 10px; } #boxtitle { display: table-cell; vertical-align: middle; text-align: center; color: black; font: bold 2em "arial", sans-serif; width: 300px; height: 100px; } body { font: 14px "arial", sans-serif; } javascript content first, let's look at the recursive scanfiles() function. this function takes as input a filesystementry representing an entry in the file system to be scanned and processed (the item parameter), and an element into which to insert the list of contents (the container parameter). note that to read all file...
DocumentOrShadowRoot.msElementsFromRect() - Web APIs
the mselementsfromrect method returns the node list of elements that are under a rectangle defined by left, top, width, and height. this proprietary method is specific to internet explorer and microsoft edge. syntax object.mselementsfromrect(left, top, width, height, retval) parameters left [in] type: floating-point top[in] type: floating-point width[in] type: floating-point height [in] type: floating-point retval [out, reval] type: nodelist example to find all of the elements under a given point, use mselementsfrompoint(x, y). to find all of the elements which intersect a rectangle, use mselementsfromrect(top, left, width, height). ...
...e: floating-point top[in] type: floating-point width[in] type: floating-point height [in] type: floating-point retval [out, reval] type: nodelist example to find all of the elements under a given point, use mselementsfrompoint(x, y). to find all of the elements which intersect a rectangle, use mselementsfromrect(top, left, width, height). var nodelist = document.mselementsfromrect(x,y,width,height) var nodelist = document.mselementsfrompoint(x,y) the returned nodelist is sorted by z-index so that you can tell the relative stacking order of the elements. see also advanced hit testing apis demo for mselementsfrompoint() and mselementsfromrect() microsoft api extensions ...
Element.clientTop - Web APIs
Web › API › Element › clientTop
note: this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). ...
...ll that lies between the two locations (offsettop and client area top) is the element's border. this is because the offsettop indicates the location of the top of the border (not the margin) while the client area starts immediately below the border, (client area includes padding.) therefore, the clienttop value will always equal the integer portion of the .getcomputedstyle() value for "border-top-width". (actually might be math.round(parsefloat()).) for example, if the computed "border-top-width" is zero, then clienttop is also zero. note: this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). gecko-based applications support clienttop starting with gecko 1.9 (firefox 3, implemented in bug 111207). this property is not supporte...
Element: mousedown event - Web APIs
the event handler calls the drawline function to draw a line from the stored x and y values to the current location. when the drawline() function returns, we adjust the coordinates and then save them in x and y. the mouseup event draws the final line segment, sets x and y to 0, and stops further drawing by setting isdrawing to false. html <h1>drawing with mouse events</h1> <canvas id="mypics" width="560" height="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. // ad...
... working draft document object model (dom) level 3 events specificationthe definition of 'mousedown' in that specification. obsolete ...
Element: mousemove event - Web APIs
the event handler calls the drawline function to draw a line from the stored x and y values to the current location. when the drawline() function returns, we adjust the coordinates and then save them in x and y. the mouseup event draws the final line segment, sets x and y to 0, and stops further drawing by setting isdrawing to false. html <h1>drawing with mouse events</h1> <canvas id="mypics" width="560" height="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. // ad...
... working draft document object model (dom) level 3 events specificationthe definition of 'mousemove' in that specification. obsolete ...
Element: mouseup event - Web APIs
the event handler calls the drawline function to draw a line from the stored x and y values to the current location. when the drawline() function returns, we adjust the coordinates and then save them in x and y. the mouseup event draws the final line segment, sets x and y to 0, and stops further drawing by setting isdrawing to false. html <h1>drawing with mouse events</h1> <canvas id="mypics" width="560" height="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. // ad...
... working draft document object model (dom) level 3 events specificationthe definition of 'mouseup' in that specification. obsolete ...
Element.removeAttribute() - Web APIs
living standard ...
... living standard ...
Element.removeAttributeNS() - Web APIs
e specified attribute from an element. syntax element.removeattributens(namespace, attrname); parameters namespace is a string that contains the namespace of the attribute. attrname is a string that names the attribute to be removed from the current node. ...
...space of the attribute. attrname is a string that names the attribute to be removed from the current node. ...
Element.scrollHeight - Web APIs
nis dis parturient montes, nascetur ridiculus mus. cras vulputate libero sed arcu iaculis nec lobortis orci fermentum. ...
...sed arcu iaculis nec lobortis orci fermentum. ...
Element.scrollLeft - Web APIs
specified as a value less than 0 (greater than 0 for right-to-left elements), scrollleft is set to 0. if specified as a value greater than the maximum that the content can be scrolled, scrollleft is set to the maximum. ...
... to 0. if specified as a value greater than the maximum that the content can be scrolled, scrollleft is set to the maximum. example html <div id="container"> <div id="content">click the button to slide right!</div> </div> <button id="slide" type="button">slide right</button> css #container { width: 100px; height: 100px; border: 1px solid #ccc; overflow-x: scroll; } #content { width: 250px; background-color: #ccc; } javascript const button = document.getelementbyid('slide'); button.onclick = function () { document.getelementbyid('container').scrollleft += 20; }; result specifications specification status comment css object model (cssom) view modulethe definition of 'scrollleft' in that specification. working draft ...
Comparison of Event Targets - Web APIs
and originaltarget todo: only available in a mozilla-based browser? todo: only suitable for extension-developers? ...
...pointing device entered todo: also needs descriptions for dragenter and dragexit events. example <hbox id="outer"> <hbox id="inner" onmouseover="dump('mouseover ' + event.relatedtarget.id + ' > ' + event.target.id + '\n');" onmouseout="dump('mouseout ' + event.target.id + ' > ' + event.relatedtarget.id + '\n');" style="margin: 100px; border: 10px solid black; width: 100px; height: 100px;" /> </hbox> ...
EventTarget - Web APIs
. element, document, and window are the most common event targets, but other objects can be event targets, too. for example xmlhttprequest, audionode, audiocontext, and others. many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes. ...
...es and attributes. <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="#f4f7f8" 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" alignment-baseline="middle">eventtarget</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor eventtarget() creates a new eventtarget object instance. me...
Using files from web applications - Web APIs
ust not be hidden using display: none (nor visibility: hidden), otherwise the label would not be keyboard-accessible. use the visually-hidden technique instead. consider this html: <input type="file" id="fileelem" multiple accept="image/*" class="visually-hidden"> <label for="fileelem">select some files</label> and this css: .visually-hidden { position: absolute !important; height: 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 lab...
... in firefox, to have the pdf appear embedded in the iframe (rather than propos...
FileSystemDirectoryReader.readEntries() - Web APIs
zone itself, which is a <div> element with the id "dropzone", and an unordered list element with the id "listing". <p>drag files and/or directories to the box below!</p> <div id="dropzone"> <div id="boxtitle"> drop files here </div> </div> <h2>directory tree:</h2> <ul id="listing"> </ul> css content the styles used by the example are shown here. ...
...>directory tree:</h2> <ul id="listing"> </ul> css content the styles used by the example are shown here. #dropzone { text-align: center; width: 300px; height: 100px; margin: 10px; padding: 10px; border: 4px dashed red; border-radius: 10px; } #boxtitle { display: table-cell; vertical-align: middle; text-align: center; color: black; font: bold 2em "arial", sans-serif; width: 300px; height: 100px; } body { font: 14px "arial", sans-serif; } javascript content first, let's look at the recursive scanfiles() function. this function takes as input a filesystementry representing an entry in the file system to be scanned and processed (the item parameter), and an element into which to insert the list of contents (the container parameter). note that to read all file...
Guide to the Fullscreen API - Web APIs
m = document.getelementbyid("myvideo"); if (elem.requestfullscreen) { elem.requestfullscreen(); } this code checks for the existence of the requestfullscreen() method before calling it. ...
...worth noting a key difference here between the gecko and webkit implementations at this time: gecko automatically adds css rules to the element to stretch it to fill the screen: "width: 100%; height: 100%". webkit doesn't do this; instead, it centers the fullscreen element at the same size in a screen that's otherwise black. to get the same fullscreen behavior in webkit, you need to add your own "width: 100%; height: 100%;" css rules to the element yourself: #myvideo:-webkit-full-screen { width: 100%; height: 100%; } on the other hand, if you're trying to emulate webkit's behavior on gecko, you need to place the element you want to present inside another element, which you'll make fullscreen instead, and use css rules to adjust the inner element to match the appearance you want. notific...
GlobalEventHandlers.ondrag - Web APIs
a global event handler for the drag event. syntax var draghandler = targetelement.ondrag; return value draghandler the drag event handler for element targetelement. example this example includes the use of the ondrag attribute handler to set an element's drag event handler. ...
...t handler for the drag event. syntax var draghandler = targetelement.ondrag; return value draghandler the drag event handler for element targetelement. example this example includes the use of the ondrag attribute handler to set an element's drag event handler. ...
GlobalEventHandlers.ondragend - Web APIs
dragend event. syntax var dragendhandler = targetelement.ondragend; return value dragendhandler the dragend event handler for element targetelement. example this example shows two ways to use the ondragend attribute handler to set an element's dragend event handler. ...
...t. syntax var dragendhandler = targetelement.ondragend; return value dragendhandler the dragend event handler for element targetelement. example this example shows two ways to use the ondragend attribute handler to set an element's dragend event handler. ...
GlobalEventHandlers.ondragenter - Web APIs
event. syntax var dragenterhandler = targetelement.ondragenter; return value dragenterhandler the dragenter event handler for element targetelement. example this example demonstrates using the ondragenter attribute handler to set an element's dragenter event handler. ...
...x var dragenterhandler = targetelement.ondragenter; return value dragenterhandler the dragenter event handler for element targetelement. example this example demonstrates using the ondragenter attribute handler to set an element's dragenter event handler. ...
GlobalEventHandlers.ondragexit - Web APIs
ner instead. syntax var dragexithandler = targetelement.ondragexit; return value dragexithandler the dragexit event handler for element targetelement. example this example demonstrates using the ondragexit attribute handler to set an element's dragexit event handler. ...
... syntax var dragexithandler = targetelement.ondragexit; return value dragexithandler the dragexit event handler for element targetelement. example this example demonstrates using the ondragexit attribute handler to set an element's dragexit event handler. ...
GlobalEventHandlers.ondragleave - Web APIs
event. syntax var dragleavehandler = targetelement.ondragleave; return value dragleavehandler the dragleave event handler for element targetelement. example this example demonstrates using the ondragleave attribute handler to set an element's dragleave event handler. ...
...x var dragleavehandler = targetelement.ondragleave; return value dragleavehandler the dragleave event handler for element targetelement. example this example demonstrates using the ondragleave attribute handler to set an element's dragleave event handler. ...
GlobalEventHandlers.ondragover - Web APIs
the dragover event. syntax var dragoverhandler = targetelement.ondragover; return value dragoverhandler the dragover event handler for element targetelement. example this example demonstrates using the ondragover attribute handler to set an element's dragover event handler. ...
...event. syntax var dragoverhandler = targetelement.ondragover; return value dragoverhandler the dragover event handler for element targetelement. example this example demonstrates using the ondragover attribute handler to set an element's dragover event handler. ...
GlobalEventHandlers.ondragstart - Web APIs
gstart event. syntax var dragstarthandler = targetelement.ondragstart; return value dragstarthandler the dragstart event handler for element targetelement. example this example demonstrates using the ondragstart attribute handler to set an element's dragstart event handler. ...
... syntax var dragstarthandler = targetelement.ondragstart; return value dragstarthandler the dragstart event handler for element targetelement. example this example demonstrates using the ondragstart attribute handler to set an element's dragstart event handler. ...
GlobalEventHandlers.ondrop - Web APIs
a global event handler for the drop event. syntax var drophandler = targetelement.ondrop; return value drophandler the drop event handler for element targetelement. example this example demonstrates the use of the ondrop attribute to define an element's drop event handler. ...
...nt handler for the drop event. syntax var drophandler = targetelement.ondrop; return value drophandler the drop event handler for element targetelement. example this example demonstrates the use of the ondrop attribute to define an element's drop event handler. ...
GlobalEventHandlers.onmousedown - Web APIs
tion expression. the function receives a mouseevent object as its sole argument. example this example reveals part of an image when you press and hold a mouse button. it uses the onmousedown, onmouseup, and onmousemove event handlers. ...
...le this example reveals part of an image when you press and hold a mouse button. it uses the onmousedown, onmouseup, and onmousemove event handlers. ...
GlobalEventHandlers.onmouseup - Web APIs
. example in this example, a piece of "toast" hides when you click down with the mouse, and reappears when you release. it uses the onmousedown and onmouseup event handlers. ...
... event handlers. ...
HTMLCanvasElement.height - Web APIs
the htmlcanvaselement.height property is a positive integer reflecting the height html attribute of the <canvas> element interpreted in css pixels. when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. this is one of the two properties, the other being htmlcanvaselement.width, that controls the size of the canvas. ...
...canvas> element interpreted in css pixels. when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. this is one of the two properties, the other being htmlcanvaselement.width, that controls the size of the canvas. syntax var pxl = canvas.height; canvas.height = pxl; examples given this <canvas> element: <canvas id="canvas" width="300" height="300"></canvas> you can get the height of the canvas with the following code: var canvas = document.getelementbyid('canvas'); console.log(canvas.height); // 300 specifications specification status comment html living standardthe definition of 'htmlcanvaselement.height' in that specification. living standard no change since the latest snapshot, html...
HTMLCanvasElement.toBlob() - Web APIs
95% quality a way to convert a canvas to an ico (mozilla only) this uses -moz-parse to convert the canvas to ico. windows xp doesn't support converting from png to ico, so it uses bmp instead. a download link is created by setting the download attribute. the value of the download attribute is the name it will use as the file name. ...
...canvas.toblob(blobcallback('passthisstring'), 'image/vnd.microsoft.icon', '-moz-parse-options:format=bmp;bpp=32'); save toblob to disk with os.file (chrome/add-on context only) this technique saves it to the desktop and is only useful in firefox chrome context or add-on code as os apis are not present on web sites. var canvas = document.getelementbyid('canvas'); var d = canvas.width; ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(d / 2, 0); ctx.lineto(d, d); ctx.lineto(0, d); ctx.closepath(); ctx.fillstyle = 'yellow'; ctx.fill(); function blobcallback(iconname) { return function(b) { var r = new filereader(); r.onloadend = function () { // r.result contains the arraybuffer. cu.import('resource://gre/modules/osfile.jsm'); var writepath = os.
HTMLDetailsElement - Web APIs
the htmldetailselement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <details> elements. ...
...lating <details> elements. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/htmldetailselement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldetailselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmld...
HTMLDialogElement - Web APIs
the htmldialogelement interface provides methods to manipulate <dialog> elements. it inherits properties and methods from the htmlelement interface. ...
... the htmlelement interface. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/htmldialogelement" target="_top"><rect x="1" y="1" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="86" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldialogelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldi...
HTMLImageElement.height - Web APIs
height is expressed in css pixels. otherwise, the image's height is represented using its natural (intrinsic) height, adjusted for the display density as indicated by naturalheight. example in this example, two different sizes are provided for an image of a clock using the srcset attribute. one is 200px wide and the other is 400px wide. further, the sizes attribute is provided to specify the width at which the image should be drawn given the viewport's width. html specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 300px. <p>image height: <span class="size">?</span>px (resize to update)</p> <img src="/files/17373/clock-demo-200px.png" alt="clock" srcset="/files/17373/clock-demo-200px.png 200w, /files/17374/...
... viewport's width. html specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 300px. <p>image height: <span class="size">?</span>px (resize to update)</p> <img src="/files/17373/clock-demo-200px.png" alt="clock" srcset="/files/17373/clock-demo-200px.png 200w, /files/17374/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 300px"> javascript the javascript code looks at the height to determine the height of the image given the width at which it's currently drawn. var clockimage = document.queryselector("img"); let output = document.queryselector(".size"); const updateheight = event => { output.innertext = clockimage.height; }; window.addeventlistener("load", updateheight); window.addeventlistene...
HTMLImageElement.loading - Web APIs
s finally loaded, the browser will determine the final size of the <img> element based on the style and intrinsic size of the image, then reflow the document as needed to update the positions of elements based on any size change made to the element to fit the image. to prevent this reflow from occurring, you should explicitly specify the size of the image's presentation using the image element's width and height attributes. by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows. example the addimagetolist() function shown below adds a photo thumbnail to a ...
...own below adds a photo thumbnail to a list of items, using lazy-loading to avoid loading the image from the network until it's actually needed. function addimagetolist(url) { const list = document.queryselector("div.photo-list"); let newitem = document.createelement("div"); newitem.classname = "photo-item"; let newimg = document.createelement("img"); newimg.loading = "lazy"; newimg.width = 320; newimg.height = 240; newimg.src = url; newitem.appendchild(newimg); list.appendchild(newitem); } specifications specification status comment html living standardthe definition of 'htmlimageelement.loading' in that specification. living standard ...
HTMLMediaElement: loadstart event - Web APIs
the loadstart event is fired when the browser has started to load a resource. ...
... interface event event handler property onloadstart examples live example html <div class="example"> <button type="button">load video</button> <video controls width="250"></video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } video { grid-area: video; } .event-log { grid-area: log; } .event-log>label { display: block; } js const loadvideo = docu...
HTMLMediaElement: progress event - Web APIs
the progress event is fired periodically as the browser loads a resource. ...
... interface event event handler property onprogress examples live example html <div class="example"> <button type="button">load video</button> <video controls width="250"></video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } video { grid-area: video; } .event-log { grid-area: log; } .event-log>label { display: block; } javascript const loadvide...
Ajax navigation example - Web APIs
it is shared between all ajax pages.</p> include/before_content.php: <p> [ <a class="ajax-nav" href="first_page.php">first example...
...it is shared between all ajax pages.</p> include/before_content.php: <p> [ <a class="ajax-nav" href="first_page.php">first example</a> | <a class="ajax-nav" href="second_page.php">second example</a> | <a class="aja...
ImageCapture.getPhotoSettings() - Web APIs
ntaining the current photo configuration settings. syntax const settingspromise = imagecapture.getphotosettings() return value a promise that resolves with a photosettings object containing the following properties: filllightmode: the flash setting of the capture device, one of "auto", "off", or "on". imageheight: the desired image height as an integer. the user agent selects the closest width value to this setting if it only supports discrete heights. imagewidth: the desired image width as an integer. the user agent selects the closest width value to this setting if it only supports discrete widths. redeyereduction: a boolean indicating whether the red-eye reduction should be used if it is available. example the following example, extracted from chrome's image capture / photo res...
...re; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specification status comment mediastream image capturethe definition of 'getpho...
ImageCapture - Web APIs
nvas, imagebitmap); }) .catch(error => console.log(error)); } function ontakephotobuttonclick() { imagecapture.takephoto() .then(blob => createimagebitmap(blob)) .then(imagebitmap => { const canvas = document.queryselector('#takephotocanvas'); drawcanvas(canvas, imagebitmap); }) .catch(error => console.log(error)); } /* utils */ function drawcanvas(canvas, img) { canvas.width = getcomputedstyle(canvas).width.split('px')[0]; canvas.height = getcomputedstyle(canvas).height.split('px')[0]; let ratio = math.min(canvas.width / img.width, canvas.height / img.height); let x = (canvas.width - img.width * ratio) / 2; let y = (canvas.height - img.height * ratio) / 2; canvas.getcontext('2d').clearrect(0, 0, canvas.width, canvas.height); canvas.getcontext('2d').drawi...
...canvas).width.split('px')[0]; canvas.height = getcomputedstyle(canvas).height.split('px')[0]; let ratio = math.min(canvas.width / img.width, canvas.height / img.height); let x = (canvas.width - img.width * ratio) / 2; let y = (canvas.height - img.height * ratio) / 2; canvas.getcontext('2d').clearrect(0, 0, canvas.width, canvas.height); canvas.getcontext('2d').drawimage(img, 0, 0, img.width, img.height, x, y, img.width * ratio, img.height * ratio); } document.queryselector('video').addeventlistener('play', function() { document.queryselector('#grabframebutton').disabled = false; document.queryselector('#takephotobutton').disabled = false; }); specifications specification status comment mediastream image capturethe definition of 'imagecapture' in ...
MediaQueryList - Web APIs
ibility; if possible, you should generally use removeeventlistener() to remove change notification callbacks (which should have previously been added using addeventlistener()). events the following events are delivered to mediaquerylist objects: change sent to the mediaquerylist when the result of running the media query against the document changes. for example, if the media query is (min-width: 400px), the change event is fired any time the width of the document's viewport changes such that its width moves across the 400px boundary in either direction. also available using the onchange event handler property. examples this simple example creates a mediaquerylist and then sets up a listener to detect when the media query status changes, running a custom function when it does to chan...
...dth moves across the 400px boundary in either direction. also available using the onchange event handler property. examples this simple example creates a mediaquerylist and then sets up a listener to detect when the media query status changes, running a custom function when it does to change the appearence of the page. ...
MediaSettingsRange - Web APIs
the mediasettingsrange interface of the the mediastream image capture api provides the possible range and value size of photocapabilities.imageheight and photocapabilities.imagewidth. a photocapabilities object can be retrieved by calling imagecapture.photocapabilities(). properties mediasettingsrange.max returns the maximum value of this settings. mediasettingsrange.min returns the minimum value of this setting. mediasettingsrange.step returns the minimum difference between consecutive values of this setting. example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotocapabilities().imagewidth to modify the size of an input range. const input = document.queryselector('input[type="range"]'); var imagecaptur...
...re; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specification status comment mediastream image capturethe definition of 'medias...
MediaStreamTrack.applyConstraints() - Web APIs
not be applied, the promise is rejected with a mediastreamerror whose name is overconstrainederror, to indicate that the constraints could not be met. this can happen if the specified constraints are too strict to find a match when attempting to configure the track. examples the following shows how to specify a basic and advanced set of constraints. ...
... page or web app needs a width between 640 and 1280 and a height between 480 and 720, with the later number in each pair being preferred. the advanced property further specifies that an image size of 1920 by 1280 is the preferred or an aspect ratio of 1.333 if that is not available. note that these constraints also illustrate what the spec refers to as a backoff strategy. const constraints = { width: {min: 640, ideal: 1280}, height: {min: 480, ideal: 720}, advanced: [ {width: 1920, height: 1280}, {aspectratio: 1.333} ] }; navigator.mediadevices.getusermedia({ video: true }) .then(mediastream => { const track = mediastream.getvideotracks()[0]; track.applyconstraints(constraints) .then(() => { // do something with the track such as using the image capture api. }) .
MediaTrackSettings - Web APIs
e-precision floating point value indicating the current value of the volume property, specifying the volume level of the track. this value will be between 0.0 (silent) to 1.0 (maximum supported volume). properties of video tracks aspectratio a double-precision floating point value indicating the current value of the aspectratio property, specified precisely to 10 decimal places. this is the width of the image in pixels divided by its height in pixels. common values include 1.3333333333 (for the classic television 4:3 "standard" aspect ratio, also used on tablets such as apple's ipad), 1.7777777778 (for the 16:9 high-definition widescreen aspect ratio), and 1.6 (for the 16:10 aspect ratio common among widescreen computers and tablets). facingmode a domstring indicating the current value ...
...icating the current value of the framerate property, specifying how many frames of video per second the track includes. if the value can't be determined for any reason, the value will match the vertical sync rate of the device the user agent is running on. height a long integer value indicating the current value of the height property, specifying the height of the track's video data in pixels. width a long integer value indicating the current value of the width property, specifying the width of the track's video data in pixels. resizemode a domstring indicating the current value of the resizemode property, specifying the mode used by the user agent to derive the resolution of the track. the value will be one of: "none" the track has the resolution offered by the camera, its driver o...
Navigator.getUserMedia() - Web APIs
video.onloadedmetadata = function(e) { // do something with the video here. }; } errorcallback when the call fails, the function specified in the errorcallback is invokedwith a mediastreamerror object as its sole argument; this object is is modeled on domexception. see {anch("errors")}} below for a list of the errors which can occur. return value undefined. errors examples width and height here's an example of using getusermedia(), including code to cope with various browsers' prefixes. note that this is the deprecated way of doing it: see the examples section under the mediadevices.getusermedia() for modern examples. navigator.getusermedia = navigator.getusermedia || navigator.webkitgetusermedia || navigator.mozgetuser...
...ous browsers' prefixes. note that this is the deprecated way of doing it: see the examples section under the mediadevices.getusermedia() for modern examples. ...
NetworkInformation.downlink - Web APIs
note that chrome-based browsers do not conform to the specification, and arbitrarily cap the reported downlink at a maximum of 10 mbps as an anti-fingerprinting measure. ...
... note that chrome-based browsers do not conform to the specification, and arbitrarily cap the reported downlink at a maximum of 10 mbps as an anti-fingerprinting measure. ...
PointerEvent.PointerEvent() - Web APIs
object instance. syntax event = new pointerevent(type, pointereventinit); arguments type is a domstring representing the name of the event (see pointerevent event types). pointereventinitoptional is a pointereventinit dictionary, having the following fields: pointerid — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.pointerid. width — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.width. height — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.height. pressure — optional and defaulting to 0, of type float, that sets the value of the instance's pointerevent.pressure. tangentialpressure — optional and defaulting to ...
...e boolean, that sets the value of the instance's pointerevent.isprimary. note: the pointereventinit dictionary also accepts fields from the mouseevent, uieventinit and eventinit dictionaries. example var moveevent = new pointerevent("pointermove"); var downevent = new pointerevent("pointerdown", {pointerid: 1, bubbles: true, cancelable: true, pointertype: "touch", width: 100, height: 100, isprimary: true }); ...
Pointer events - Web APIs
rd also includes some extensions to the element and navigator interfaces. the following sub-sections contain short descriptions of each interface and property. pointerevent interface the pointerevent interface extends the mouseevent interface and has the following properties. (all of the following properties are read only .) pointerid a unique identifier for the pointer causing the event. width the width (magnitude on the x axis), in css pixels, of the contact geometry of the pointer. height the height (magnitude on the y axis), in css pixels, of the contact geometry of the pointer. pressure the normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. tangentialpres...
... process_touch(event) { // process the touch pointer event } function process_tilt(tiltx, tilty) { // tilt data handler } function process_pressure(pressure) { // pressure handler } function process_non_primary(event) { // non primary handler } function down_handler(ev) { // calculate the touch point's contact area var area = ev.width * ev.height; // compare cached id with this event's id and process accordingly if (id == ev.identifier) process_id(ev); // call the appropriate pointer type handler switch (ev.pointertype) { case "mouse": process_mouse(ev); break; case "pen": process_pen(ev); break; case "touch": process_touch(ev);...
ResizeObserver() - Web APIs
editor's draft initial definition. ...
... editor's draft initial definition. ...
ResizeObserverEntry.borderBoxSize - Web APIs
array is necessary to support elements that have multiple fragments, which occur in multi-column scenarios. each object in the array contains two properties: blocksize the length of the observed element's border box in the block dimension. for boxes with a horizontal writing-mode, this is the vertical dimension, or height; if the writing-mode is vertical, this is the horizontal dimension, or width. inlinesize the length of the observed element's border box in the inline dimension. for boxes with a horizontal writing-mode, this is the horizontal dimension, or width; if the writing-mode is vertical, this is the vertical dimension, or height. note: for more explanation of writing modes and block and inline dimensions, read handling different text directions. examples const resizeobser...
... editor's draft initial definition. ...
ResizeObserverEntry.contentBoxSize - Web APIs
ze = resizeobserverentry.contentboxsize; value an object containing the new content box size of the observed element. this object contains two properties: blocksize the length of the observed element's content box in the block dimension. for boxes with a horizontal writing-mode, this is the vertical dimension, or height; if the writing-mode is vertical, this is the horizontal dimension, or width. inlinesize the length of the observed element's content box in the inline dimension. for boxes with a horizontal writing-mode, this is the horizontal dimension, or width; if the writing-mode is vertical, this is the vertical dimension, or height. note: for more explanation of writing modes and block and inline dimensions, read handling different text directions. examples the following sn...
...ze. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { entry.target.style.borderradius = math.min(100, (entry.contentboxsize.inlinesize/10) + (entry.contentboxsize.blocksize/10)) + 'px'; } else { entry.target.style.borderradius = math.min(100, (entry.contentrect.width/10) + (entry.contentrect.height/10)) + 'px'; } } }); resizeobserver.observe(document.queryselector('div')); specifications specification status comment resize observerthe definition of 'target' in that specification. editor's draft initial definition. ...
ResizeObserverEntry - Web APIs
erties, but it is left over from an earlier implementation of the resize observer api, is still included in the spec for web compat reasons, and may be deprecated in future versions. resizeobserverentry.target read only a reference to the element or svgelement being observed. note: the content box is the box in which content can be placed, meaning the border box minus the padding and border width. the border box encompasses the content, padding, and border. see the box model for further explanation. methods none. examples the following snippet is taken from the resize-observer-text.html (see source) example. this uses a simple feature detection test to see if the browser supports the newer contentboxsize property — if so, it uses that to get the sizing data it needs. if not, it use...
...e older contentrect property. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.contentboxsize.inlinesize/600) + 'rem'; } else { h1elem.style.fontsize = math.max(1.5, entry.contentrect.width/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.contentrect.width/600) + 'rem'; } } }); resizeobserver.observe(divelem); specifications specification status comment resize observerthe definition of 'resizeobserverentry' in that specification. editor's draft initial definition. ...
Resize Observer API - Web APIs
just implement this using border-radius with a percentage, but that quickly leads to ugly-looking elliptical corners, whereas the above solution gives you nice square corners that scale with the box size. resize-observer-text.html (see source): here we use the resize observer to change the font-size of a header and paragraph as a slider’s value is changed causing the containing <div> to change width. this shows that you can respond to changes in an element’s size, even if they have nothing to do with the viewport. the code will usually follow this kind of pattern (taken from resize-observer-border-radius.html): const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { entry.target.style.borderradius = math.min(100, (entry.
... ...
SVGAltGlyphDefElement - Web APIs
the svgaltglyphdefelement interface corresponds to the <altglyphdef> element. ...
...element. <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/svgaltglyphdefelement" target="_top"><rect x="1" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="106" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgaltglyphdefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. ...
SVGAltGlyphItemElement - Web APIs
the svgaltglyphitemelement interface corresponds to the <altglyphitem> element. ...
...lement. <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/svgaltglyphitemelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgaltglyphitemelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. ...
SVGAnimationElement: beginEvent event - Web APIs
t restarts, but not when it repeats). it may be raised both in the course of normal (i.e. scheduled or interactive) timeline play, as well as in the case that the element was begun with a dom method. ...
...as in the case that the element was begun with a dom method. ...
SVGAnimationElement: endEvent event - Web APIs
e end of each animation repeat. this event may be raised both in the course of normal (i.e. scheduled or interactive) timeline play, as well as in the case that the element was ended with a dom method. ...
... as in the case that the element was ended with a dom method. ...
SVGAnimationElement: repeatEvent event - Web APIs
the event object. the value is a 0-based integer, but the repeat event is not raised for the first iteration and so the observed values will be >= 1. this is supported in firefox, but not in chrome. ...
... be >= 1. this is supported in firefox, but not in chrome. ...
SVGGeometryElement.isPointInFill() - Web APIs
fill. the point argument is interpreted as a point in the local coordiante system of the element. syntax boolean someelement.ispointinfill(dompointinit point); parameters point a dompointinit interpreted as a point in the local coordiante system of the element. return value a boolean indicating whether the given point is within the fill or not. ...
...it point); parameters point a dompointinit interpreted as a point in the local coordiante system of the element. return value a boolean indicating whether the given point is within the fill or not. ...
SVGGeometryElement.isPointInStroke() - Web APIs
. the point argument is interpreted as a point in the local coordiante system of the element. syntax boolean someelement.ispointinstroke(dompointinit point); parameters point a dompointinit interpreted as a point in the local coordinate system of the element. return value a boolean indicating whether the given point is within the stroke or not. ...
... point); parameters point a dompointinit interpreted as a point in the local coordinate system of the element. return value a boolean indicating whether the given point is within the stroke or not. ...
SVGGlyphElement - Web APIs
the svgglyphelement interface corresponds to the <glyph> element. object-oriented access to the attributes of the <glyph> element via the svg dom is not possible. ...
... not possible. <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/svgglyphelement" target="_top"><rect x="1" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgglyphelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. proper...
SVGLength - Web APIs
Web › API › SVGLength
thtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_cm = 6 svg_lengthtype_mm = 7 svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normative document svg 1.1 (2nd edition) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval; // read x in pixel and cm units console.log("value: " + val.value + ", valueinspecifiedunits: " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring);...
... = 20pt to inches and read out in pixel and inch units val.converttospecifiedunits(svglength.svg_lengthtype_in); console.log("value: " + val.value + ", valueinspecifiedunits " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); } ]]></script> <rect id="myrect" x="1cm" y="1cm" fill="green" stroke="black" stroke-width="1" width="1cm" height="1cm" /> </svg> results on a desktop monitor (pixel units will be dpi-dependent): value: 37.7952766418457, valueinspecifiedunits: 6: 1, valueasstring: 1cm value: 26.66666603088379, valueinspecifiedunits 9: 20, valueasstring: 20pt value: 26.66666603088379, valueinspecifiedunits 8: 0.277777761220932, valueasstring: 0.277778in constants name value ...
SVGRenderingIntent - Web APIs
the svgrenderingintent interface defines the enumerated list of possible values for rendering-intent attributes or descriptors. ...
...escriptors. <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/svgrenderingintent" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgrenderingintent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. con...
Screen.availHeight - Web APIs
the read-only screen interface's availheight property returns the height, in css pixels, of the space available for web content on the screen. since screen is exposed on the window interface's window.screen property, you access availheight using window.screen.availheight. you can similarly use screen.availwidth to get the number of pixels which are horizontally available to the browser for its use. syntax let availheight = window.screen.availheight; value a numeric value indicating the number of css pixels tall the screen's available space is. this can be no larger than the value of window.screen.height, and will be less if the device or user agent reserves any vertical space for itself. for instance, on a mac whose dock is located at the bottom of screen (which is the default), the val...
...eb application needs to open a new window, such as a tool palette which can contain multiple panels, and wants to position it so that it occupies the entire vertical space available, you can do so using code similar to what's seen here. in the main window, when it's time to open the panels, code like the following is used. let palettewindow = window.open("panels.html", "panels", "left=0, top=0, width=200"); the panels window's html, in panels.html, has javascript code of its own, which is executed as soon as the window is created. it doesn't even need to wait for any particular event (or any event at all). that code handles resizing the window based on the available space: window.outerheight = window.screen.availheight; the result is something similar to the below. note the panels window f...
Screen - Web APIs
Web › API › Screen
of the first pixel that is not allocated to permanent or semipermanent user interface features. screen.availleft returns the first available pixel available from the left side of the screen. screen.availheight specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the taskbar on windows. screen.availwidth returns the amount of horizontal space in pixels available to the window. screen.colordepth returns the color depth of the screen. screen.height returns the height of the screen in pixels. screen.left returns the distance in pixels from the left side of the main screen to the left side of the current screen. screen.orientation returns the screenorientation instance associated with this...
... the height of the screen in pixels. screen.left returns the distance in pixels from the left side of the main screen to the left side of the current screen. screen.orientation returns the screenorientation instance associated with this screen. screen.pixeldepth gets the bit depth of the screen. screen.top returns the distance in pixels from the top side of the current screen. screen.width returns the width of the screen. screen.mozenabled boolean. setting to false will turn off the device's screen. screen.mozbrightness controls the brightness of a device's screen. a double between 0 and 1.0 is expected. events handler screen.onorientationchange a handler for the orientationchange event. methods screen.lockorientation lock the screen orientation (only wor...
Touch.radiusX - Web APIs
Web › API › Touch › radiusX
g area (e.g. finger, stylus) along the axis perpendicular to that indicated by touch.rotationangle. the touch.rotationangle is the angle (in degrees) that the ellipse described by radiusx and radiusy is rotated clockwise about its center. the following simple code snippet, registers a single handler for the touchstart, touchmove and touchend events. when the src element is touched, the element's width and height will be calculate based on the touch point's radiusx and radiusy values and the element will then be rotated using the touch point's rotationangle. <div id="src"> ... </div> var src = document.getelementbyid("src"); src.addeventlistener('touchstart', rotate); src.addeventlistener('touchmove', rotate); src.addeventlistener('touchend', rotate); function rotate (e) { var touch = e.
...ng the touch point's rotationangle. <div id="src"> ... </div> var src = document.getelementbyid("src"); src.addeventlistener('touchstart', rotate); src.addeventlistener('touchmove', rotate); src.addeventlistener('touchend', rotate); function rotate (e) { var touch = e.changedtouches.item(0); // turn off default event handling e.preventdefault(); // rotate element 'src'. src.style.width = touch.radiusx * 2 + 'px'; src.style.height = touch.radiusy * 2 + 'px'; src.style.transform = "rotate(" + touch.rotationangle + "deg)"; }; specifications specification status comment touch events – level 2 draft non-stable version. ...
VRStageParameters - Web APIs
represents the values describing the the stage area for devices that support room-scale experiences. this interface is accessible through the vrdisplay.stageparameters property. properties vrstageparameters.sittingtostandingtransform read only contains a matrix that transforms the sitting-space view matrices of vrframedata to standing-space. vrstageparameters.sizex read only returns the width of the play-area bounds in meters. vrstageparameters.sizey read only returns the depth of the play-area bounds in meters. examples var info = document.queryselector('p'); var vrdisplay; navigator.getvrdisplays().then(function(displays) { vrdisplay = displays[0]; var stageparams = vrdisplay.stageparameters; // stageparams is a vrstageparameters object if(stageparams === null) { ...
... draft initial definition ...
VideoConfiguration - Web APIs
bilities methods encodinginfo() and decodinginfo() to determine whether or not the described video configuration is supported, and how smoothly and how smoooth and power-efficient it can be handled. properties the videoconfiguration dictionary is made up of five video properties, including: contenttype: a valid video mime type. see our web video codec guide for types which may be supported. width: the width of the video. height: the height of the video. bitrate: the number of bits used to encode one second of the video file. framerate: the number of frames making up one second of video playback. examples // create media configuration to be tested const mediaconfig = { type : 'file', // see mediadecodingconfiguration and mediaencodingconfiguration video : { contentty...
... bitrate: the number of bits used to encode one second of the video file. framerate: the number of frames making up one second of video playback. examples // create media configuration to be tested const mediaconfig = { type : 'file', // see mediadecodingconfiguration and mediaencodingconfiguration video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; specifications specification status comment media capabilitiesthe definition of 'videoconfiguration' in that specification. draft initial...
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
the webgl2renderingcontext.compressedtexsubimage3d() method of the webgl api specifies a three-dimensional sub-rectangle for a texture image in a compressed format. syntax // read from the buffer bound to gl.pixel_unpack_buffer void gl.compressedtexsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imagesize, offset); void gl.compressedtexsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, arraybufferview srcdata, optional srcoffset, optional srclengthoverride); parameters target a glenum specifying the binding point (target) of the active texture. possible values: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. level a glint specifying the level of de...
...two-dimensional array texture. level a glint specifying the level of detail. level 0 is the base image level and level n is the nth mipmap reduction level. xoffset a glint specifying the x offset within the compressed texture image. yoffset a glint specifying the y offset within the compressed texture image. zoffset a glint specifying the z offset within the compressed texture image. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. depth a glsizei specifying the depth of the texture. format a glenum specifying the compressed image format. possible values: gl.compressed_r11_eac gl.compressed_signed_r11_eac gl.compressed_rg11_eac gl.compressed_signed_rg11_eac gl.compressed_rgb8_etc2 gl.compressed_rgba8_et...
WebGL2RenderingContext.copyTexSubImage3D() - Web APIs
possible values: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. level a glint specifying the level of detail. ...
...reduction level. xoffset a glint specifying the x offset within the texture image. yoffset a glint specifying the y offset within the texture image. zoffset a glint specifying the z offset within the texture image. x a glint specifying the x coordinate of the lower left corner where to start copying. y a glint specifying the y coordinate of the lower left corner where to start copying. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.copytexsubimage3d(gl.texture_3d, 0, 0, 0, 0, 0, 0, 16, 16); specifications specification status comment webgl 2.0the definition of 'copytexsubimage3d' in that specification. editor's draft initial definition. opengl ...
WebGL2RenderingContext.invalidateSubFramebuffer() - Web APIs
possible values: gl.framebuffer: collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.draw_framebuffer: equivalent to gl.framebuffer. gl.read_framebuffer: used as a source for reading operations. ...
...buffers. gl.depth_attachment: invalidates the framebuffer's depth buffer. gl.stencil_attachment: invalidates the framebuffer's stencil buffer. gl.depth_stencil_attachment: invalidates both the framebuffer's depth and stencil buffer. x a glint specifying the left origin of the pixel rectangle to invalidate. y a glint specifying the bottom origin of the pixel rectangle to invalidate. width a glsizei specifying the width of the pixel rectangle to invalidate. height a glsizei specifying the height of the pixel rectangle to invalidate. return value none. examples gl.invalidatesubframebuffer(gl.read_framebuffer, [gl.color_attachment0, gl.color_attachment1], 0, 0, 256, 256); specifications specification statu...
WebGL2RenderingContext.texStorage2D() - Web APIs
possible values: gl.texture_2d: a two-dimensional texture. gl.texture_cube_map: a cube-mapped texture. levels a glint specifying the number of texture levels. internalformat a glenum specifying the texture store format. ...
...ble them via the webgl_compressed_texture_etc extension, though. gl.compressed_r11_eac gl.compressed_signed_r11_eac gl.compressed_rg11_eac gl.compressed_signed_rg11_eac gl.compressed_rgb8_etc2 gl.compressed_rgba8_etc2_eac gl.compressed_srgb8_etc2 gl.compressed_srgb8_alpha8_etc2_eac gl.compressed_rgb8_punchthrough_alpha1_etc2 gl.compressed_srgb8_punchthrough_alpha1_etc2 width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.texstorage2d(gl.texture_2d, 1, gl.rgb8, 256, 256); specifications specification status comment webgl 2.0the definition of 'texstorage2d' in that specification. editor's draft initial definition for webgl. opengl es 3...
WebGLRenderingContext.copyTexImage2D() - Web APIs
possible values: gl.texture_2d: a two-dimensional texture. gl.texture_cube_map_positive_x: positive x face for a cube-mapped texture. gl.texture_cube_map_negative_x: negative x face for a cube-mapped texture. ...
... red, green, blue and alpha components are read from the color buffer. gl.luminance: each color component is a luminance component, alpha is 1.0. gl.luminance_alpha: each component is a luminance/alpha component. x a glint specifying the x coordinate of the lower left corner where to start copying. y a glint specifying the y coordinate of the lower left corner where to start copying. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. border a glint specifying the width of the border. must be 0. return value none. examples gl.copyteximage2d(gl.texture_2d, 0, gl.rgba, 0, 0, 512, 512, 0); specifications specification status comment webgl 1.0the definition of 'copyteximage2d' in that specifica...
WebGLRenderingContext.copyTexSubImage2D() - Web APIs
possible values: gl.texture_2d: a two-dimensional texture. gl.texture_cube_map_positive_x: positive x face for a cube-mapped texture. gl.texture_cube_map_negative_x: negative x face for a cube-mapped texture. ...
... the base image level and level n is the nth mipmap reduction level. xoffset a glint specifying the horizontal offset within the texture image. yoffset a glint specifying the vertical offset within the texture image. x a glint specifying the x coordinate of the lower left corner where to start copying. y a glint specifying the y coordinate of the lower left corner where to start copying. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.copytexsubimage2d(gl.texture_2d, 0, 0,0, 0, 0, 16, 16); specifications specification status comment webgl 1.0the definition of 'copytexsubimage2d' in that specification. recommendation initial definition. opengl es 2...
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
d of the webgl api returns information about the renderbuffer. syntax any gl.getrenderbufferparameter(target, pname); parameters target a glenum specifying the target renderbuffer object. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal format. pname a glenum specifying the information to query. possible values: gl.renderbuffer_width: returns a glint indicating the width of the image of the currently bound renderbuffer. gl.renderbuffer_height: returns a glint indicating the height of the image of the currently bound renderbuffer. gl.renderbuffer_internal_format: returns a glenum indicating the internal format of the currently bound renderbuffer. the default is gl.rgba4. possible return values: gl.rgba4: 4 red bits...
...when using a webgl 2 context, the following value is available additionally: gl.renderbuffer_samples: returns a glint indicating the number of samples of the image of the currently bound renderbuffer. return value depends on the requested information (as specified with pname). either a glint or a glenum. examples gl.getrenderbufferparameter(gl.renderbuffer, gl.renderbuffer_width); specifications specification status comment webgl 1.0the definition of 'getrenderbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetrenderbufferparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the definition of 'getrenderbuffe...
WebGLRenderingContext.readPixels() - Web APIs
the webglrenderingcontext.readpixels() method of the webgl api reads a block of pixels from a specified rectangle of the current color framebuffer into an arraybufferview object. syntax // webgl1: void gl.readpixels(x, y, width, height, format, type, pixels); // webgl2: void gl.readpixels(x, y, width, height, format, type, glintptr offset); void gl.readpixels(x, y, width, height, format, type, arraybufferview pixels, gluint dstoffset); parameters x a glint specifying the first horizontal pixel that is read from the lower left corner of a rectangular block of pixels. y a glint specifying the first vertical pixel that is read from the lower left corner of a rectangular block of pixels. width a glsizei specifying the width of the rectangle. height a glsizei specifying the height of...
...mat is not gl.rgb. type is gl.unsigned_short_4_4_4_4 and format is not gl.rgba. type does not match the typed array type of pixels. a gl.invalid_framebuffer_operation error is thrown if the currently bound framebuffer is not framebuffer complete. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var pixels = new uint8array(gl.drawingbufferwidth * gl.drawingbufferheight * 4); gl.readpixels(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight, gl.rgba, gl.unsigned_byte, pixels); console.log(pixels); // uint8array specifications specification status comment webgl 1.0the definition of 'readpixels' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glreadpixels' ...
WebGLRenderingContext.renderbufferStorage() - Web APIs
possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal format. internalformat a glenum specifying the internal format of the renderbuffer. possible values: gl.rgba4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.rgb565: 5 red bits, 6 green bits, 5 blue bits. ...
... ext.rgba32f_ext: rgba 32-bit floating-point type. ext.rgb32f_ext: rgb 32-bit floating-point type. when using the ext_srgb extension: ext.srgb8_alpha8_ext: 8-bit srgb and alpha. when using a webgl 2 context and the ext_color_buffer_float extension: gl.r16f gl.rg16f gl.rgba16f gl.r32f gl.rg32f gl.rgba32f gl.r11f_g11f_b10f width a glsizei specifying the width of the renderbuffer in pixels. height a glsizei specifying the height of the renderbuffer in pixels. return value none. examples gl.renderbufferstorage(gl.renderbuffer, gl.rgba4, 256, 256); specifications specification status comment webgl 1.0the definition of 'renderbufferstorage' in that specification. recommendation initia...
WebGLRenderingContext.scissor() - Web APIs
the webglrenderingcontext.scissor() method of the webgl api sets a scissor box, which limits the drawing to a specified rectangle. syntax void gl.scissor(x, y, width, height); parameters x a glint specifying the horizontal coordinate for the lower left corner of the box. default value: 0. y a glint specifying the vertical coordinate for the lower left corner of the box. default value: 0. width a non-negative glsizei specifying the width of the scissor box. default value: width of the canvas. height a non-negative glsizei specifying the height of the scissor box. default value: height of the canvas. return value none. exceptions if either width or height is a negative value, a gl.invalid_value error is thrown. examples when the scissor test is enabled, only pixels within th...
...clear) // turn off scissor test again gl.disable(gl.scissor_test); to get the current scissor box dimensions, query the scissor_box constant which returns an int32array. ...
Boilerplate 1 - Web APIs
run within an immediate function, which is a common javascript technique (see function). the function declaration and invocation will also be hidden. html <p>[ some descriptive text about the example. ]</p> <button>[ optional button element. ...
... html5 canvas.</canvas> css body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } javascript function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawi...
Clearing by clicking - Web APIs
the event handler removes // itself, because it only needs to run once. window.remov...
...f failed, alert user of failure. // otherwise, initialize the drawing buffer (the viewport). if (!gl) { gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { alert("failed to get webgl context.\n" + "your browser or device may not support webgl."); return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); } // get a random color value using a helper function. var color = getrandomcolor(); // set the clear color to the random color. gl.clearcolor(color[0], color[1], color[2], 1.0); // clear the context with the newly set color. this is // the function call that actually does the drawing. gl.clear(gl.color_buffer_bit); } // random color ...
Clearing with colors - Web APIs
four numerical components for red, green, blue and alpha (opacity). therefore, clearcolor() takes four arguments. <p>a very simple webgl program that shows some color.</p> <!-- text within a canvas element is displayed only if canvas is not supported. --> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it, // and to not mess up the global scope. we are giving the event // handler a name (setupwebgl) so that we can refer to the // function object within the functio...
...iled, inform user of failure. otherwise, initialize // the drawing buffer (the viewport) and clear the context // with a solid color. if (!gl) { paragraph.innerhtml = "failed to get webgl context. " + "your browser or device may not support webgl."; return; } paragraph.innerhtml = "congratulations! your browser supports webgl. "; gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); // set the clear color to darkish green. gl.clearcolor(0.0, 0.5, 0.0, 1.0); // clear the context with the newly set color. this is // the function call that actually does the drawing. gl.clear(gl.color_buffer_bit); }, false); the source code of this example is also available on github. « previousnext » ...
Color masking - Web APIs
lue, so the final result on the screen is that of the clear color, tinted by the color mask. ...
....removeeventlistener(evt.type, setupanimation, false); var canvas = document.queryselector("canvas"); var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); var timer = setinterval(drawanimation, 1000); var mask = [true, true, true]; var redtoggle = document.queryselector("#red-toggle"), greentoggle = document.queryselector("#green-toggle"), bluetoggle = document.queryselector("#blue-toggle"); redtoggle.addeventlistener("click", setcolormask, false); greentoggle.addeventlistener("click", setcolormask, fal...
Hello GLSL - Web APIs
check the output of the next example, which draws exactly the same thing. but remember to read through the explanations and code on this page, before moving on to the next. hello world program in glsl a very simple first shader program. ...
...izeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.vertexattribpointer(0, 1, gl.float, false, 0, 0); } function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawi...
Simple color animation - Web APIs
p>a simple webgl program that shows color animation.</p> <p>you can click the button below to toggle the color animation on or off.</p> <canvas id="canvas-view">your browser does not seem to support html5 canvas.</canvas> <button id="animation-onoff"> press here to <strong>[verb goes here]</strong> the animation </button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addeventlistener("load", function setupanimation (evt) { "use strict" window.removeeventlistener(evt.type, setupanimation, false); // a variable to hold a timer that drives the anim...
... var color = getrandomcolor(); // set the webglrenderingcontext clear color to the // random color. gl.clearcolor(color[0], color[1], color[2], 1.0); // clear the context with the newly set color. gl.clear(gl.color_buffer_bit); } // random color helper function. function getrand...
Textures from code - Web APIs
t shaders. that is, using code to generate textures for use in shading webgl objects. drawing textures with code texturing a point sprite with calculations done per-pixel in the fragment shader. <p>texture from code. ...
... gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array([0.0, 0.0]), gl.static_draw); gl.vertexattribpointer(0, 2, gl.float, false, 0, 0); } function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawi...
Matrix math for the web - Web APIs
]; 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 generate a 4x4 matrix, then update the <div...
... dom element let moveme = document.getelementbyid('move-me'); // returns a result like: "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 50, 100, 0, 1);" let matrix3drule = matrixarraytocssmatrix(translationmatrix); // set the transform moveme.style.transform = matrix3drule; view on jsfiddle scale matrix a scale matrix makes something larger or smaller in one or more of the three dimensions: width, height, and depth. in typical (cartesian) coordinates. this causes stretching or contracting of the object in the corresponding directions. the amount of change to apply to each of the width, height, and depth is placed diagonally starting at the top-left corner and making their way down toward the bottom-right. let w = 1.5; // width (x) let h = 0.7; // height (y) let d = 1; // depth (z) ...
Animating textures in WebGL - Web APIs
pixel in it, and set its filtering for later use: function inittexture(gl) { const texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // because video has to be download over the internet // they might take a moment until it's ready so // put a single pixel in the texture so we can // use it immediately. ...
...t's ready so // put a single pixel in the texture so we can // use it immediately. const level = 0; const internalformat = gl.rgba; const width = 1; const height = 1; const border = 0; const srcformat = gl.rgba; const srctype = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internalformat, width, height, border, srcformat, srctype, pixel); // turn off mips and set wrapping to clamp to edge so it // will work regardless of the dimensions of the video. gl.texparameteri(gl.texture_2d, gl.texture_wrap_s, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); ret...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
m effect, but the result is generally close enough to get the job done. ...
...ing the framebuffer"); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit | gl.depth_buffer_bit); checkglerror("clearing the framebuffer"); const deltatime = (time - lastframetime) * 0.001; lastframetime = time; for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); checkglerror(`setting viewport for eye: ${view.eye}`); myrenderscene(gl, view, scenedata, deltatime); } } } the callback begins by calling a custom function, applypositionoffsets(), which takes a reference space and applies to its transform matrix any changes that need to be made to take into account things such as user inputs from devices not controlled by...
Fundamentals of WebXR - Web APIs
that you need to know before you learn how to develop xr code. field of view the term field of view (fov) is one which applies to any visual technology, from old film cameras to modern digital video cameras, including the cameras in computers and mobile devices. what is field of view? the field of view is, at its essence, the extent of the environment you are able to see at any one time. the width of the field of view is measured as the angle defining the arc from the far left edge of your field of view to the far right edge, and is specified in either degrees or radians. a human eye is typically able to take in a fov of around 135°. assuming a person has two healthy eyes, their total field of view is about 200° to 220° wide. why is the fov wider with two eyes, but not double the singl...
..., only the horizontal fov is specifically defined and managed by applications. for more details about this, see the optics of 3d in rendering and the webxr frame animation callback. field of view and mixed reality devices to achieve a wide enough field of view that the user's eyes are tricked into believing that the virtual world completely surrounds them, the fov needs to at least approach the width of the binocular vision area. basic headsets typically start around 90° or so, while the best headsets generally have a field of view of around 150°. because the fov is a matter of the size of the lenses and how close they are to the user's eyes, there are limitations on how wide the fov can get without installing lenses into the user's eyeballs. a wide fov can substantially improve the user's...
Rendering and the WebXR frame animation callback - Web APIs
// use this value to ensure your animation runs at the exact // rate you intend. const deltatime = currentframetime - lastframetime; lastframetime = time; // now call the scene rendering code once for each of // the session's views. for (let view of viewerpose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); mydrawsceneintoview(view, deltatime); } } } the mydrawframe() function grabs the xrsession from the xrframe object specified by the frame parameter, then calls the session's requestanimationframe() method to immediately schedule the rendering of the next frame. this ensures we get into the queue right away, allowing the rest of the time spent in this iteration of ...
...e framebuffer which represents the current eye's visible image. we begin by preparing webgl to render the eye's contents by getting the viewport that restricts drawing to the area within the framebuffer that's reserved for the current eye's image by calling the xrwebgllayer method getviewport(). we then set the webgl viewport to match, passing in the x and y origin of the viewport along with its width and height into gl.viewport(). finally, we call our method mydrawsceneintoview() to actually use webgl to render the scene. into this, we pass the xrview representing the eye we're drawing for (in order to perform perspective mapping and the like) and deltatime, so the scene drawing code can accurately represent the elapsed time when determining the positions of objects moving over time. when t...
Controlling multiple parameters with ConstantSourceNode - Web APIs
iv id="playbutton" class="button"> ▶️ </div> </div> <div class="right"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.8" name="volume" id="volumecontrol"> </div> </div> <p>use the button above to start and stop the tones, and the volume control to change the volume of the notes e and g in the chord.</p> css .controls { width: 400px; position: relative; vertical-align: middle; height: 44px; } .button { font-size: 32px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: 50%; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: absolute; right: 0; display: table-cell; ve...
... user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: 50%; font: 14px "open sans", "lucida grande", "arial", sans-serif; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } .left { width: 50%; position: absolute; left: 0; display: table-cell; vertical-align: middle; } .left span, .left input { vertical-align: middle; } javascript now let's take a look at the javascript code, a piece at a time. setting up let's start by looking at the global variable initialization. let context = null; let playbutton = null; let volumecontrol = null; let oscnode1 = null; let osc...
Web Authentication API - Web APIs
which become the authenticatorresponse.clientdatajson. one of the most important parameters is the origin, which is recorded as part of the clientdata so that the origin can be verified by the server later. the parameters to the create() call are passed to the authenticator, along with a sha-256 hash of the clientdatajson (only a hash is sent because the link to the authenticator may be a low-bandwidth nfc or bluetooth link and the authenticator is just going to sign over the hash to ensure that it isn't tampered with). authenticator creates new key pair and attestation - before doing anything, the authenticator will typically ask for some form of user verification. this could be entering a pin, using a fingerprint, doing an iris scan, etc. to prove that the user is present and consenting to t...
...ults, which become the authenticatorresponse.clientdatajson. one of the most important parameters is the origin, which recorded as part of the clientdata so that the origin can be verified by the server later. the parameters to the get() call are passed to the authenticator, along with a sha-256 hash of the clientdatajson (only a hash is sent because the link to the authenticator may be a low-bandwidth nfc or bluetooth link and the authenticator is just going to sign over the hash to ensure that it isn't tampered with). authenticator creates an assertion - the authenticator finds a credential for this service that matches the relying party id and prompts a user to consent to the authentication. assuming both of those steps are successful, the authenticator will create a new assertion by signin...
Window.devicePixelRatio - Web APIs
ecting 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). var size = 200; canvas.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. ctx.scale(scale, scale); ctx.fillstyle = "#bada...
...r-container"> <p>this example demonstrates the effect of zooming the page in and out (or moving it to a screen with a different scaling factor) on the value of the property <code>window.devicepixelratio</code>. ...
Window.innerHeight - Web APIs
the read-only innerheight property of the window interface returns the interior height of the window in pixels, including the height of the horizontal scroll bar, if present. the value of innerheight is taken from the height of the window's layout viewport. the width can be obtained using the innerwidth property. syntax let intviewportheight = window.innerheight; value an integer value indicating the window's layout viewport height in pixels. the property is read only and has no default value. ...
...ng the height of the horizontal scroll bar, if present. the value of innerheight is taken from the height of the window's layout viewport. the width can be obtained using the innerwidth property. syntax let intviewportheight = window.innerheight; value an integer value indicating the window's layout viewport height in pixels. the property is read only and has no default value. to change the width of the window, call one of its resize methods, such as resizeto() or resizeby(). usage notes to obtain the height of the window minus its horizontal scroll bar and any borders, use the root <html> element's clientheight() property instead. both innerheight and innerwidth are available on any window or any object that behaves like a window, such as a tab or frame. example assuming a frameset ...
Window.matchMedia() - Web APIs
Web › API › Window › matchMedia
alue of the matches property, which will be true if the document meets the media query's requirements. if you need to be kept aware of whether or not the document matches the media query at all times, you can instead watch for the change event to be delivered to the object. there's a good example of this in the article on window.devicepixelratio. ...
...this in the article on window.devicepixelratio. examples this example runs the media query (max-width: 600px) and displays the value of the resulting mediaquerylist's matches property in a <span>; as a result, the output will say "true" if the viewport is less than or equal to 600 pixels wide, and will say "false" if the window is wider than that. javascript let mql = window.matchmedia('(max-width: 600px)'); document.queryselector(".mq-value").innertext = mql.matches; the javascript code simply passes the media query to match into matchmedia() to compile it, then sets the <span>'s innertext to the value of the results' matches property, so that it indicates whether or not the document matches the media query at the moment the page was loaded. html <span class="mq-value"></span> a sim...
Window.open() - Web APIs
Web › API › Window › open
sally implemented by browser manufacturers (it is 29 pixels in ie6 sp2 with the default theme) and its purpose is to help users to notice new windows opening. if the most recently used window was maximized, then there is no offset: the new window will be maximized as well. size if only one of them is specified, the behavior is implementation-dependent, and web author should not rely on it. width or innerwidth specifies the width of the content area, viewing area of the new secondary window in pixels. the width value includes the width of the vertical scrollbar if present. the width value does not include the sidebar if it is expanded. the minimum required value is 100. height or innerheight specifies the height of the content area, viewing area of the new secondary window in pixels. t...
... scrollbar if present. the height value does not include other ui parts such as location bar, title bar, tab bar, etc. the minimum required value is 100. if the windowfeatures parameter is non-empty and no size features are defined, then the new window dimensions will be the same as the dimensions of the most recently rendered window. browser-dependent size features do not use them. outerwidth (only on firefox, obsolete from firefox 80) specifies the width of the whole browser window in pixels. this outerwidth value includes the window vertical scrollbar (if present) and left and right window resizing borders. outerheight (only on firefox, obsolete from firefox 80) specifies the height of the whole browser window in pixels. this outerheight value includes any/all present toolbar, wi...
Window.screenLeft - Web APIs
Web › API › Window › screenLeft
moved. ...
... + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.requestanimationframe(positionelem); } window.requestanimationframe(positionelem); also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills i...
Window.screenTop - Web APIs
Web › API › Window › screenTop
moved. ...
... + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.requestanimationframe(positionelem); } window.requestanimationframe(positionelem); also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills i...
Window.screenX - Web APIs
Web › API › Window › screenX
moved. ...
... also in the code we include a snippet that detects ...
Window.screenY - Web APIs
Web › API › Window › screenY
moved. ...
... also in the code we include a snippet that detects ...
self.createImageBitmap() - Web APIs
be an <img>, svg <image>, <video>, <canvas>, htmlimageelement, svgimageelement, htmlvideoelement, htmlcanvaselement, blob, imagedata, imagebitmap, or offscreencanvas object. sx the x coordinate of the reference point of the rectangle from which the imagebitmap will be extracted. sy the y coordinate of the reference point of the rectangle from which the imagebitmap will be extracted. sw the width of the rectangle from which the imagebitmap will be extracted. this value can be negative. sh the height of the rectangle from which the imagebitmap will be extracted. this value can be negative. options optional an object that sets options for the image's extraction. the available options are: imageorientation: specifies whether the image should be presented as is or flipped vertically. ...
...ne (default) or flipy. premultiplyalpha: specifies whether the bitmap's color channels should be premultiplied by the alpha channel. one of none, premultiply, or default (default). colorspaceconversion: specifies whether the image should be decoded using color space conversion. either none or default (default). the value default indicates that implementation-specific behavior is used. resizewidth: a long integer that indicates the output width. resizeheight: a long integer that indicates the output height. resizequality: specifies the algorithm to be used for resizing the input to match the output dimensions. one of pixelated, low (default), medium, or high. return value a promise which resolves to an imagebitmap object containing bitmap data from the given rectangle. example ...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
ame 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-size: 12px; text-align: center;">copyleft 2012 by <a href="https://developer.mozilla.org/" target="_blank">mozilla developer network</...
...l consectetur dolor. nunc eget elit eget velit pulvinar fringilla consectetur aliquam purus. curabitur convallis, justo posuere porta egestas, velit erat ornare tortor, non viverra justo diam eget arcu. phasellus adipiscing fermentum nibh ac commodo. nam turpis nunc, suscipit a hendrerit vitae, volutpat non ipsum.</p> <form> <p>phasellus ac nisl lorem: <input type="text" /><br /> <textarea style="width: 400px; height: 200px;">nullam commodo suscipit lacus non aliquet. phasellus ac nisl lorem, sed facilisis ligula. nam cursus lobortis placerat. sed dui nisi, elementum eu sodales ac, placerat sit amet mauris. pellentesque dapibus tellus ut ipsum aliquam eu auctor dui vehicula. quisque ultrices laoreet erat, at ultrices tortor sodales non. sed venenatis luctus magna, ultricies ultricies nunc fring...
XRWebGLLayer.framebufferHeight - Web APIs
the read-only xrwebgllayer property framebufferheight indicates the height of the framebuffer, in pixels. you can get the width of the framebuffer using the framebufferwidth property. syntax let bufferheight = xrwebgllayer.framebufferheight; value the height in pixels of the xr device's framebuffer. each of the framebuffer's attachments (pixel, depth, color, and/or stencil buffers, for example) are all this many pixels tall. examples this snippet simply fetches the framebuffer's width and height for later use. ...
...ferheight; value the height in pixels of the xr device's framebuffer. each of the framebuffer's attachments (pixel, depth, color, and/or stencil buffers, for example) are all this many pixels tall. examples this snippet simply fetches the framebuffer's width and height for later use. let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); framewidth = gllayer.framebufferheight; frameheight = gllayer.framebufferheight; specifications specification status comment webxr device apithe definition of 'xrwebgllayer.framebufferheight' in that specification. working draft initial definition. ...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
ssible (underlined alt+combo mnemonic) get_accfocus: which child is focused? [important] get_accselection: which children of this item are selected? get_accdefaultaction: get a description or name of the default action for this component, such as "jump" for links. accselect: select the item associated with this iaccessible. [important] acclocation: get the x,y coordinates, and the height and width of this iaccessible node. [important] accnavigate: navigate to the first/last child, previous/next sibling, up, down, left or right from this iaccessible. [important, but no need to implement up/down/left/right] acchittest: find out what iaccessible exists and a specific coordinate. accdodefaultaction: perform the action described by get_accdefaultaction. put_accname: change the name. put_ac...
...s list boxes, even though those lines are not blinking. the assistive technology may not see your caret at all. solution: make sure there is a configuration file for each assistive technology specific to your application. read the manual or help, and find the keystroke or commands for training the caret, and save this information in the configuration file. make sure the caret always has the same width (1px or 2px) within a given window class. don't support the msaa caret unless you need home page reader's desktop reader application to work with your application -- no one else uses the msaa caret. hacky highlight tracking causes problems problem: screen readers ignore the msaa focus whenever a highlight bar moves, speaking the current highlighted text instead. the implementation of automated ...
Color contrast - Accessibility
div styles here */ } .good { background-color: #fae6fa; } .bad { background-color: #400064; } both pieces of text have their default black color. ...
...make the color contrast as good as it can be within your design constraints — ideally go for the aaa rating (see 1.4.6 below), but at least meet t...
-moz-float-edge - CSS: Cascading Style Sheets
the non-standard -moz-float-edge css property specifies whether the height and width properties of the element include the margin, border, or padding thickness. /* keyword values */ -moz-float-edge: border-box; -moz-float-edge: content-box; -moz-float-edge: margin-box; -moz-float-edge: padding-box; /* global values */ -moz-float-edge: inherit; -moz-float-edge: initial; -moz-float-edge: unset; syntax values border-box the height and width properties include the content, padding and border but not the margin. content-box the height and width properties include the content, but not the padding, border or margin. ...
...e: margin-box; -moz-float-edge: padding-box; /* global values */ -moz-float-edge: inherit; -moz-float-edge: initial; -moz-float-edge: unset; syntax values border-box the height and width properties include the content, padding and border but not the margin. content-box the height and width properties include the content, but not the padding, border or margin. margin-box the height and width properties include the content, padding, border and margin. padding-box the height and width properties include the content and padding but not the border or margin. formal definition initial valuecontent-boxapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax border-box | content-box | margin-box | padding-box examples html <div class="box"> ...
::-moz-progress-bar - CSS: Cascading Style Sheets
...
... ...
::-webkit-scrollbar - CSS: Cascading Style Sheets
ress bar) not covered by the handle. ::-webkit-scrollbar-corner — the bottom corner of the scrollbar, where both horizontal and vertical scrollbars meet. ::-webkit-resizer — the draggable resizing handle that appears at the bottom corner of some elements. ...
...e resizing handle that appears at the bottom corner of some elements. syntax syntax not found in db! examples .visible-scrollbar, .invisible-scrollbar, .mostly-customized-scrollbar { display: block; width: 10em; overflow: auto; height: 2em; } .invisible-scrollbar::-webkit-scrollbar { display: none; } /* demonstrate a "mostly customized" scrollbar * (won't be visible otherwise if width/height is specified) */ .mostly-customized-scrollbar::-webkit-scrollbar { width: 5px; height: 8px; background-color: #aaa; /* or add it to the track */ } /* add a thumb */ .mostly-customized-scrollbar::-webkit-scrollbar-thumb { background: #000; } <div class="visible-scrollbar"> etiam sagittis sem sed lacus laoreet, eu fermentum eros auctor. proin at nulla elementum, consectetur ...
::before (:before) - CSS: Cascading Style Sheets
Web › CSS › ::before
note that there are no icons us...
...note that there are no icons used, and the check-mark is actually the ::before that has been styled in css. go ahead and get some stuff done. result ...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
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-letter /* css2 syntax */ :fir...
...eading</h2> <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. at vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gubergren, no sea takimata sanctus est.</p> <p>duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.</p> css p { width: 500px; line-height: 1.5; } h2 + p::first-letter { color: white; background-color: black; border-radius: 2px; box-shadow: 3px 3px 0 red; font-size: 250%; padding: 6px 3px; margin-right: 6px; float: left; } result effect on special punctuation and non-latin characters this example illustrates the effect of ::first-letter on special punctuation and non-latin characters. htm...
any-pointer - CSS: Cascading Style Sheets
users with at least one coarse pointer. the big checkbox takes precedence because it is declared after the small one. ...
... candidate recommendation initial definition. ...
size - CSS: Cascading Style Sheets
Web › CSS › @page › size
used to represent a page. most of the time, this size corresponds to the target size of the printed page if applicable. size may either be defined with a "scalable" keyword (in this case the page will fill the available dimensions) or with absolute dimensions. syntax /* keyword values for scalable size */ size: auto; size: portrait; size: landscape; /* <length> values */ /* 1 value: height = width */ size: 6in; /* 2 values: width then height */ size: 4in 6in; /* keyword values for absolute size */ size: a4; size: b5; size: jis-b4; size: letter; /* mixing size and orientation */ size: a4 portrait; values auto the user agent decides the size of the page. in most cases, the dimensions and orientation of the target sheet are used. landscape the content of the page is displayed in la...
... dimensions and orientation of the target sheet are used. landscape the content of the page is displayed in landscape mode (i.e. the longest side of the box is horizontal). portrait the content of the page is displayed in portrait mode (i.e. the longest side of the box is vertical). this is the default orientation. <length> any length value (see <length>). the first value corresponds to the width of the page box and the second one corresponds to its height. if only one value is provided, it is used for both width and height. <page-size> a5 this matches the standard, iso dimensions: 148mm x 210mm. a4 this matches the standard, iso dimensions: 210mm x 297mm. (most frequently used dimensions for personal printing.) a3 this matches the standard, iso dimensions: 297mm x 420mm.
Coordinate systems - CSS: Cascading Style Sheets
">0</span>, <span id="screeny">0</span> </p> </div> </div> </div> css the css is pretty much just for appearances here. the class "outer" is used for the containing box, which is intentionally too wide to show in the mdn window, to allow you to scroll it horizontally. the "inner" box is the one that we track events in and in which we show the mouse coordinates. ...
... the css is pretty much just for appearances here. the class "outer" is used for the containing box, which is intentionally too wide to show in the mdn window, to allow you to scroll it horizontally. the "inner" box is the one that we track events in and in which we show the mouse coordinates. .outer { width: 1000px; height: 200px; background-color: red; } .inner { position: relative; width: 500px; height: 150px; top: 25px; left: 100px; background-color: blue; color: white; cursor: crosshair; user-select: none; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; } .log { position: relative; width: 100%; text-align: center; } result here you can see the results in action. as you mouse in and around the blue box, watch the values of ...
CSS Animations tips and tricks - CSS: Cascading Style Sheets
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. ...
...the "box" class is the basic description of the box's appearance, without any animation information included. ...
Box alignment in grid layout - CSS: Cascading Style Sheets
ent works in the context of css grid layout. as this page aims to detail things which are specific to css grid layout and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods. basic example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. the first item overrides the align-items value set on the group by setting align-self to center. grid axes as a two-dimensional layout method, when working with grid layout we always have two axes on whi...
...spect ratio, for example an image. in this case the item will be aligned to start in both dimensions in order that the image is not distorted. content alignment justify-content align-content place-content these properties deal with aligning the tracks of the grid when there is extra space to distribute. this scenario will occur if the tracks that you have defined total less than the total width of the grid container. gap and legacy grid-gap properties row-gap column-gap gap grid-row-gap grid-column-gap grid-gap the grid specification originally contained the definition for the properties grid-row-gap, grid-column-gap and grid-gap. these have since been moved into the box alignment specification and renamed to row-gap, column-gap, and gap. this allows them to be used for other...
Handling Overflow in Multicol - CSS: Cascading Style Sheets
in this guide we look at how multicol deals with overflow, both inside the column boxes and in situations where there is more content than will fit into the container. overflow inside column boxes an overflow situation happens when an item's size is larger than the column box. for example, the situation could happen when an image in a column is wider than the column-width value or the width of the column based on the number of columns declared with column-count. in this situation, the content should visibly overflow into the next column, rather than be clipped by the column box. you can see an example of this below, with an image of the expected rendering as, at the time of writing, browsers deal with this differently. if you want an image to size down to fit the column box, the standa...
... with column-count. in this situation, the content should visibly overflow into the next column, rather than be clipped by the column box. you can see an example of this below, with an image of the expected rendering as, at the time of writing, browsers deal with this differently. if you want an image to size down to fit the column box, the standard responsive images solution of setting max-width: 100% will achieve that for you. more columns than will fit how overflowing columns are handled depends on whether you are in a fragmented media context, such as print, or a continuous media context, such as a web page. in fragmented media, once a fragment (for example a page) is filled with columns, the columns will move to a new page and fill that up with columns. in continuous media, colu...
Basic concepts of flexbox - CSS: Cascading Style Sheets
n doing so, you should consider each line as a new flex container. any space distribution will happen across that line, without reference to the lines either side. to cause wrapping behaviour add the property flex-wrap with a value of wrap. now, should your items be too large to all display in one line, they will wrap onto another line. the live sample below contains items that have been given a width, the total width of the items being too wide for the flex container. as flex-wrap is set to wrap, the items wrap. set it to nowrap, which is also the initial value, and they will instead shrink to fit the container because they are using initial flexbox values that allows items to shrink. using nowrap would cause an overflow if the items were not able to shrink, or could not shrink small enough t...
...tover space between the items. this is what the flex properties that we apply to the items themselves, will do. the flex-basis property the flex-basis is what defines the size of that item in terms of the space it leaves as available space. the initial value of this property is auto — in this case the browser looks to see if the items have a size. in the example above, all of the items have a width of 100 pixels and so this is used as the flex-basis. if the items don’t have a size then the content's size is used as the flex-basis. this is why when we just declare display: flex on the parent to create flex items, the items all move into a row and take only as much space as they need to display their contents. the flex-grow property with the flex-grow property set to a positive integer, ...
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
mensional method like flexbox, we only control the row or column. in two dimensional layout like grid we control both at the same time. if you want the space distribution row by row, use flexbox. if you don’t, use grid. how do flexbox-based grid systems work? typically flexbox-based grid systems work by taking flexbox back to the familiar world of float-based layouts. if you assign percentage widths to flex items — either as flex-basis or by adding a width to the item itself leaving the value of flex-basis as auto — you can get the impression of a two dimensional layout. you can see this working in the example below. here i have set flex-grow and flex-shrink to 0 to make inflexible flex items and am then controlling flexibility using percentages, just like we used to do in float layout...
...tself leaving the value of flex-basis as auto — you can get the impression of a two dimensional layout. you can see this working in the example below. here i have set flex-grow and flex-shrink to 0 to make inflexible flex items and am then controlling flexibility using percentages, just like we used to do in float layouts. if you need flex items to line up in the cross axis, controlling the width in this way will achieve that. in most cases however, adding widths to flex items in this way demonstrates that you would probably be better served by switching to grid layout for that component. creating gutters between items when wrapping flex items, the need to space them out is likely to arise. at the current time we do not have any implementations of the gap properties from the box alignme...
CSS Fonts - CSS: Cascading Style Sheets
Web › CSS › CSS Fonts
css fonts is a module of css that defines font-related properties and how font resources are loaded. it lets you define the style of a font, such as its family, size and weight, line height, and the glyph variants to use when multiple are available for a single character. basic example the following example shows a simple use of basic font properties to style a paragraph of text. ...
...c 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. variable fonts guide variable fonts are an evolution of the opentype font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style. this article will give you all you need to know to get you started using variable fonts. specifications specification status comment css fonts module level 4 working draft adds font-variation-settings (and related higher-level properties) and font-optical-sizing. css fonts module level 3 candidate recommendation adds font-feat...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } the fr unit tracks can be defined using any length unit. grid also introduces an additional length unit to help us create flexible grid tracks. the new fr unit represents a fraction of the available space in the grid container. the next grid definition would create three equal width tracks that grow and shrink according to the available space. <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> .wrapper { display: grid; grid-template-columns: 1fr 1fr 1fr; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { bo...
... in this next example, we create a definition with a 2fr track then two 1fr tracks. the available space is split into four. two parts are given to the first track and one part each to the next two tracks. .wrapper { display: grid; grid-template-columns: 2fr 1fr 1fr; } in this final example, we mix absolute sized tracks with fraction units. the first track is 500 pixels, so the fixed width is taken away from the available space. the remaining space is divided into three and assigned in proportion to the two flexible tracks. .wrapper { display: grid; grid-template-columns: 500px 1fr 2fr; } track listings with repeat() notation large grids with many tracks can use the repeat() notation, to repeat all or a section of the track listing. for example the grid definition: .wrappe...
Layout using named grid lines - CSS: Cascading Style Sheets
e lines in your grid a unique name then you will need to write out the track definition long-hand rather than using the repeat syntax, as you need to add the name in square brackets while defining the tracks. if you do use the repeat syntax you will end up with multiple lines that have the same name, however this can be very useful too. in this next example i am creating a grid with twelve equal width columns. before defining the 1fr size of the column track i am also defining a line name of [col-start]. this means that we will end up with a grid that has 12 column lines all named col-start before a 1fr width column. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; borde...
...l-start line 7 spanning 3 lines</div> </div> if you take a look at this layout in the firefox grid highlighter you can see how the column lines are shown, and how our items are placed against these lines. the repeat syntax can also take a track list, it doesn’t just need to be a single track size that is being repeated. the code below would create an eight track grid, with a narrower 1fr width column named col1-start followed by a wider 3fr column named col2-start. .wrapper { grid-template-columns: repeat(4, [col1-start] 1fr [col2-start] 3fr); } if your repeating syntax puts two lines next to each other then they will be merged, and create the same result as giving a line multiple names in a non-repeating track definition. the following definition, creates four 1fr tracks, which e...
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
row. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> .wrapper { width: 500px; display: flex; flex-wrap: wrap; } .wrapper > div { flex: 1 1 150px; } in the image, you can see that two items have wrapped onto a new line. these items are sharing the available space and not lining up underneath the items above. this is because when you wrap flex items, each new row (or column when working by column) becomes a new flex container. space distribution happens ac...
...you allow the auto-placement rules to place the items into the grid cells according to that strict grid. it is possible to create tracks that respond to the size of the content, however, they will also change the entire track. if you are using flexbox and find yourself disabling some of the flexibility, you probably need to use css grid layout. an example would be if you are setting a percentage width on a flex item to make it line up with other items in a row above. in that case, a grid is likely to be a better choice. box alignment the feature of flexbox that was most exciting to many of us was that it gave us proper alignment control for the first time. it made it easy to center a box on the page. flex items can stretch to the height of the flex container, meaning that equal height column...
Using z-index - CSS: Cascading Style Sheets
rel2"> <b>div #3</b> <br />position: relative; <br />z-index: 2; </div> <div id="abs2"> <b>div #4</b> <br />position: absolute; <br />z-index: 1; </div> <div id="sta1"> <b>div #5</b> <br />no positioning <br />z-index: 8; </div> css div { padding: 10px; opacity: 0.7; text-align: center; } b { font-family: sans-serif; } #abs1 { z-index: 5; position: absolute; width: 150px; height: 350px; top: 10px; left: 10px; border: 1px dashed #900; background-color: #fdd; } #rel1 { z-index: 3; height: 100px; position: relative; top: 30px; border: 1px dashed #696; background-color: #cfc; margin: 0px 50px 0px 50px; } #rel2 { z-index: 2; height: 100px; position: relative; top: 15px; left: 20px; border: 1px dashed #696; background-colo...
...round-color: #fdd; } #rel1 { z-index: 3; height: 100px; position: relative; top: 30px; border: 1px dashed #696; background-color: #cfc; margin: 0px 50px 0px 50px; } #rel2 { z-index: 2; height: 100px; position: relative; top: 15px; left: 20px; border: 1px dashed #696; background-color: #cfc; margin: 0px 50px 0px 50px; } #abs2 { z-index: 1; position: absolute; width: 150px; height: 350px; top: 10px; right: 10px; border: 1px dashed #900; background-color: #fdd; } #sta1 { z-index: 8; height: 70px; border: 1px dashed #996; background-color: #ffc; margin: 0px 50px 0px 50px; } ...
Stacking with floated blocks - CSS: Cascading Style Sheets
><br />position: absolute;</div> <div id="flo1"> <b>div #2</b><br />float: left;</div> <div id="flo2"> <b>div #3</b><br />float: right;</div> <br /> <div id="sta1"> <b>div #4</b><br />no positioning</div> <div id="abs2"> <b>div #5</b><br />position: absolute;</div> css div { padding: 10px; text-align: center; } b { font-family: sans-serif; } #abs1 { position: absolute; width: 150px; height: 200px; top: 10px; right: 140px; border: 1px dashed #900; background-color: #fdd; } #sta1 { height: 100px; border: 1px dashed #996; background-color: #ffc; margin: 0px 10px 0px 10px; text-align: left; } #flo1 { margin: 0px 10px 0px 20px; float: left; width: 150px; height: 200px; border: 1px dashed #090; background-color: #cfc; } #flo2 { margin: ...
...; right: 140px; border: 1px dashed #900; background-color: #fdd; } #sta1 { height: 100px; border: 1px dashed #996; background-color: #ffc; margin: 0px 10px 0px 10px; text-align: left; } #flo1 { margin: 0px 10px 0px 20px; float: left; width: 150px; height: 200px; border: 1px dashed #090; background-color: #cfc; } #flo2 { margin: 0px 20px 0px 10px; float: right; width: 150px; height: 200px; border: 1px dashed #090; background-color: #cfc; } #abs2 { position: absolute; width: 150px; height: 100px; top: 130px; left: 100px; border: 1px dashed #990; background-color: #fdd; } ...
Stacking context example 3 - CSS: Cascading Style Sheets
evel menus are made of several divs contained in an absolutely positioned container. this is useful to group and position all of them at once. ...
...1/dtd/xhtml1-transitional.dtd"> <html> <head><style type="text/css"> div { font: 12px arial; } span.bold { font-weight: bold; } div.lev1 { width: 250px; height: 70px; position: relative; border: 2px outset #669966; background-color: #ccffcc; padding-left: 5px; } #container1 { z-index: 1; position: absolute; top: 30px; left: 75px; } div.lev2 { 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> <b...
Shapes from box values - CSS: Cascading Style Sheets
element which has padding, a border, and a margin defined in order that you can see the different ways in which content will flow. margin-box the margin-box is the shape defined by the outside margin edge and includes the corner radius of the shape, should border-radius have been used in defining the element. in the example below, we have a circular purple item which is a <div> with a height, width, and background colour. the border-radius property has been used to create a circle by setting border-radius: 50%. as the element has a margin, you can see that the content is flowing around the circular shape and the margin applied to it. border-box the border-box value is the shape defined by the outside border edge. this shape follows all of the normal border radius shaping rules for the o...
...ox value defines the shape enclosed by the outside padding edge. this shape follows all of the normal border radius shaping rules for the inside of the border. if you have no padding then padding-box is the same as content-box. content-box the content-box value defines the shape enclosed by the outside content edge. each corner radius of this box is the larger of 0 or border-radius − border-width − padding. this means that it is impossible to have a negative value here. when to use the box values using box values is a simple way to create shapes, however this is by nature only going to work with very simple shapes that can be defined using the well-supported border-radius property. the examples shown above show one such use case. you can create a circular shape using border-radius a...
CSS values and units - CSS: Cascading Style Sheets
unit relative to em font size of the element. ex x-height of the element's font. cap cap height (the nominal height of capital letters) of the element's font. ch average character advance of a narrow glyph in the element’s font, as represented by the “0” (zero, u+0030) glyph. ic average character advance of a full width glyph in the element’s font, as represented by the “水” (cjk water ideograph, u+6c34) glyph. rem font size of the root element. lh line height of the element. rlh line height of the root element. vw 1% of viewport's width. vh 1% of viewport's height. vi 1% of viewport's size in the root element's inline axis. ...
...other value. percentage values are always relative to another quantity, for example a length. each property that allows percentages also defines the quantity to which the percentage refers. this quantity can be a value of another property of the same element, the value of a property of an ancestor element, a measurement of a containing block, or something else. as an example, if you specify the width of a box as a percentage, it refers to the percentage of the box's parent's computed width: .box { width: 50%; } mixing percentages and dimensions some properties accept a dimension that could be either one of two types, for example a <length> or a <percentage>. in this case the allowed value is detailed in the specification as a combination unit, e.g. <length-percentage>. other possible com...
Recipe: Media objects - CSS: Cascading Style Sheets
the media object. another reason to use grid layout is in order that i can use fit-content() for the track sizing of the image. by using fit-content with a maximum size of 200 pixels, when we have a small image such as the icon, the track only gets as large as the size of that image — the max-content size. if the image is larger, the track stops growing at 200 pixels and as the image has a max-width of 100% applied, it scales down so that it continues to fit inside the column. by using grid-template-areas to achieve the layout, i can see the pattern in the css. i define my grid once we have a max-width of 500 pixels, so on smaller devices the media object stacks. an option for the pattern is to flip it to switch the image to the other side — this is done by adding the media-flip class, ...
...ng on the browsers you wish to support. a good catch-all would be to float the image left, and to add a clearfix to the box to ensure that it contained the floats. download this example once floated elements become grid items the float no longer applies so you don’t need to do anything special to clear the float. what you will need to do is remove any margins applied to the item, and any widths which we don’t need in a grid context (we have the gap property to control it in grids, and the track takes control of the sizing). relevant resources on mdn css grid layout progressive enhancement and grid layout using grid template areas fit-content grid-template-areas ...
animation-timing-function - CSS: Cascading Style Sheets
<div class="easein">ease-in</div> <div class="easeout">ease-out</div> <div class="easeinout">ease-in-out</div> <div class="linear">linear</div> <div class="cb">cubic-bezier(0.2,-2,0.8,2)</div> </div> .parent > div[class] { animation-name: changeme; animation-duration: 10s; animation-iteration-count: infinite; margin-bottom: 4px; } @keyframes changeme { 0% { min-width: 12em; width: 12em; background-color: black; border: 1px solid red; color: white; } 100% { width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; } } .ease { animation-timing-function: ease; } .easein { animation-timing-function: ease-in; } .easeout { animation-timing-function: ea...
...">jump-both</div> <div class="jump-none">jump-none</div> <div class="start">start</div> <div class="end">end</div> <div class="step-start">step-start</div> <div class="step-end">step-end</div> </div> .parent > div[class] { animation-name: changeme; animation-duration: 10s; animation-iteration-count: infinite; margin-bottom: 4px; } @keyframes changeme { 0% { min-width: 12em; width: 12em; background-color: black; border: 1px solid red; color: white; } 100% { width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; } } .jump-start { animation-timing-function: steps(5, jump-start); } .jump-end { animation-timing-function: steps(5, jump-end); } .jump-no...
background-position-x - CSS: Cascading Style Sheets
the container. a value of 0% means that the left edge of the background image is aligned with the left edge of the container, and a value of 100% means that the right edge of the background image is aligned with the right edge of the container, thus a value of 50% horizontally centers the background image. ...
...e formal syntax [ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]#where <length-percentage> = <length> | <percentage> examples basic example the following example shows a simple background image implementation, with background-position-x and background-position-y used to define the image's horizontal and vertical positions separately. ...
background-repeat - CSS: Cascading Style Sheets
ed evenly between the images. the background-position property is ignored unless only one image can be displayed without clipping. the only case where clipping happens using space is when there isn't enough room to display one image. round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room (space left >= half of the image width) for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the background image painting ar...
...iv> </li> <li>space <div class="five"></div> </li> <li>round <div class="six"></div> </li> <li>repeat-x, repeat-y (multiple images) <div class="seven"></div> </li> </ol> css /* shared for all divs in example */ ol, li { margin: 0; padding: 0; } li { margin-bottom: 12px; } div { background-image: url(https://mdn.mozillademos.org/files/12005/starsolid.gif); width: 160px; height: 70px; } /* background repeats */ .one { background-repeat: no-repeat; } .two { background-repeat: repeat; } .three { background-repeat: repeat-x; } .four { background-repeat: repeat-y; } .five { background-repeat: space; } .six { background-repeat: round; } /* multiple images */ .seven { background-image: url(https://mdn.mozillademos.org/files/12005/starsolid.
border-color - CSS: Cascading Style Sheets
css backgrounds and borders module level 3the definition of 'border...
... css backgrounds and borders module level 3the definition of 'border-color' in that specification. candidate recommendation t...
border-end-end-radius - CSS: Cascading Style Sheets
us: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-bottom-right-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercent...
... editor's draft initial ...
border-end-start-radius - CSS: Cascading Style Sheets
adius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-top-right-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercent...
... editor's draft in...
border-image-outset - CSS: Cascading Style Sheets
ed, the first applies to the top, the second to the left and right, and the third to the bottom. if four values are specified, they apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the border-image outset as a dimension — a number with a unit. <number> the size of the border-image outset as a multiple of the element's corresponding border-widths. for example, if an element has border-width: 1em 2px 0 1.5rem, and border-image-outset: 2, the final border-image-outset would be calculated as 2em 4px 0 3rem. formal definition initial value0applies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednocomputed valueas specified, but with relative lengths converted into...
...pt internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typeby computed value type formal syntax [ <length> | <number> ]{1,4} examples outsetting a border image html <div id="outset">this element has an outset border image!</div> css #outset { width: 10rem; background: #cef; border: 1.4rem solid; border-image: radial-gradient(#ff2, #55f) 40; border-image-outset: 1.5; /* 1.5 × 1.4rem = 2.1rem */ margin: 2.1rem; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-outset' in that specification. candidate recommendation i...
border-left-style - CSS: Cascading Style Sheets
class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding: 3px; } /* border-left-style example classes */ .b1 {border-left-style: none;} .b2 {border-left-style: hidden;} .b3 {border-left-style: dotted;} .b4 {border-left-style: dashed;} .b5 {border-left-style: solid;} .b6 {border-left-style: double;} .b7 {border-left-style: groove;} .b8 {border-left-style: ridge;} .b9 {border-left-style: inset;} .b...
... ...
border-radius - CSS: Cascading Style Sheets
lement's box. it is used only in the four-value syntax. <length> denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipse, using length values. negative values are invalid. <percentage> denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipse, using percentage values. percentages for the horizontal axis refer to the width of the box; percentages for the vertical axis refer to the height of the box. negative values are invalid. for example: border-radius: 1em/5em; /* ... is equivalent to: */ border-top-left-radius: 1em 5em; border-top-right-radius: 1em 5em; border-bottom-right-radius: 1em 5em; border-bottom-left-radius: 1em 5em; border-radius: 4px 3px 6px / 2px 4px; /* ... is equivalent to: */ border...
...where <length-percentage> = <length> | <percentage> examples border: solid 10px; /* the border will curve into a 'd' */ border-radius: 10px 40px 40px 10px; border: groove 1em red; border-radius: 2em; background: gold; border: ridge gold; border-radius: 13em/3em; border: none; border-radius: 40px 10px; border: none; border-radius: 50%; border: dotted; border-width: 10px 4px; border-radius: 10px 40px; border: dashed; border-width: 2px 4px; border-radius: 40px; live samples sample 1 : http://jsfiddle.net/tripad/qngkj/2/ sample 2 : http://jsfiddle.net/tripad/qngkj/3/ sample 3 : http://jsfiddle.net/tripad/qngkj/4/ sample 4 : http://jsfiddle.net/tripad/qngkj/5/ sample 5 : http://jsfiddle.net/tripad/qngkj/6/ specifications specific...
border-right-style - CSS: Cascading Style Sheets
class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding: 3px; } /* border-right-style example classes */ .b1 {border-right-style: none;} .b2 {border-right-style: hidden;} .b3 {border-right-style: dotted;} .b4 {border-right-style: dashed;} .b5 {border-right-style: solid;} .b6 {border-right-style: double;} .b7 {border-right-style: groove;} .b8 {border-right-style: ridge;} .b9 {border-right-style: ...
... ...
border-start-end-radius - CSS: Cascading Style Sheets
ius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-bottom-left-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercent...
... editor's draft in...
border-start-start-radius - CSS: Cascading Style Sheets
radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-top-left-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercent...
... editor's draft...
box-align - CSS: Cascading Style Sheets
Web › CSS › box-align
tle>css box-align example</title> <style> div.example { display: box; /* as specified */ display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ /* make this box taller than the children, so there is room for the box-pack */ height: 400px; /* make this box wider than the children so there is room for the box-align */ width: 300px; /* children should be oriented vertically */ box-orient: vertical; /* as specified */ -moz-box-orient: vertical; /* mozilla */ -webkit-box-orient: vertical; /* webkit */ /* align children to the horizontal center of this box */ box-align: center; /* as specified */ -moz-box-align: center; /* mozilla */ -webkit-box-align: center; ...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to con...
box-pack - CSS: Cascading Style Sheets
Web › CSS › box-pack
alueas specifiedanimation typediscrete formal syntax start | center | end | justify examples div.example { border-style: solid; display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ /* make this box taller than the children, so there is room for the box-pack */ height: 300px; /* make this box wide enough to show the contents are centered horizontally */ width: 300px; /* children should be oriented vertically */ -moz-box-orient: vertical; /* mozilla */ -webkit-box-orient: vertical; /* webkit */ /* align children to the horizontal center of this box */ -moz-box-align: center; /* mozilla */ -webkit-box-align: center; /* webkit */ /* pack children to the bottom of this box */ -moz-box-pack: end; /* mozilla */ -webkit-box-p...
... ...
break-after - CSS: Cascading Style Sheets
by default, the subheadings and paragraphs were laid out rather messily because the headings were not in a uniform place. however, we used break-after: column on the <p> elements to force a column break after each one, meaning that you end up with an <h2> neatly at the top of each column. html <article> <h1>main heading</h1> <h2>subheading</h2> <p>lorem ipsum dolor sit amet, co...
..., congue vel massa. cras luctus lacus nisl, sed tincidunt velit pharetra ac. duis suscipit faucibus dui sed ultricies.</p> </article> css html { font-family: helvetica, arial, sans-serif; } h1 { font-size: 3rem; letter-spacing: 2px; column-span: all; } h2 { font-size: 1.2rem; color: red; letter-spacing: 1px; } p { line-height: 1.5; break-after: column; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-after' in that specification. candidate recommendation adds the recto and verso keywords. changes the media type of this property from paged to visual. defines the breaking algorithm with different kinds of breaks. css r...
break-before - CSS: Cascading Style Sheets
by default, the subheadings and paragraphs were laid out rather messily because the headings were not in a uniform place. however, we used break-before: column on the <h2> elements to force a column break before each one, meaning that you end up with an <h2> neatly at the top of each column. html <article> <h1>main heading</h1> <h2>subheading</h2> <p>lorem ipsum dolor sit amet,...
... congue vel massa. cras luctus lacus nisl, sed tincidunt velit pharetra ac. duis suscipit faucibus dui sed ultricies.</p> </article> css html { font-family: helvetica, arial, sans-serif; } h1 { font-size: 3rem; letter-spacing: 2px; column-span: all; } h2 { font-size: 1.2rem; color: red; letter-spacing: 1px; break-before: column; } p { line-height: 1.5; } article { column-width: 200px; gap: 20px; } result specifications specification status comment css fragmentation module level 3the definition of 'break-before' in that specification. candidate recommendation adds the recto and verso keywords. changes the media type of this property from paged to visual. defines the breaking algorithm with different kinds of breaks. css ...
caption-side - CSS: Cascading Style Sheets
t side of the table. this value was proposed for css 2, but removed from the final css 2.1 specification. it is non-standard. right the caption box should be positioned on the right side of the table. this value was proposed for css 2, but removed from the final css 2.1 specification. it is non-standard. ...
... the css 2.1 specification notes that the css 2 specification described a different behavior for the bottom value, which will be reintroduced by this value in a future specification. ...
float - CSS: Cascading Style Sheets
Web › CSS › float
ample, there are three colored squares. two are floated left, and one is floated right. note that the second "left" square is placed to the right of the first. additional squares would continue to stack to the right, until they filled the containing box, after which they would wrap to the next line. a floated element is at least as tall as it's tallest nested floated children. we gave the parent width: 100% and floated it to ensure it is tall enough to encompass it's floated children, and to make sure it takes up the width of the parent so we don't have to clear it's adjacent sibling. html <section> <div class="left">1</div> <div class="left">2</div> <div class="right">3</div> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. morbi tristique sapien ac erat tincidunt, s...
...lass="right">3</div> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. morbi tristique sapien ac erat tincidunt, sit amet dignissim lectus vulputate. donec id iaculis velit. aliquam vel malesuada erat. praesent non magna ac massa aliquet tincidunt vel in massa. phasellus feugiat est vel leo finibus congue.</p> </section> css section { border: 1px solid blue; width: 100%; float: left; } div { margin: 5px; width: 50px; height: 150px; } .left { float: left; background: pink; } .right { float: right; background: cyan; } result clearing floats sometimes you may want to force an item to move below any floated elements. for instance, you may want paragraphs to remain adjacent to floats, but force headings to be on their own line. see clear...
font-stretch - CSS: Cascading Style Sheets
t expanded. <percentage> a <percentage> value between 50% and 200% (inclusive). negative values are not allowed for this property. in earlier versions of the font-stretch specification, the property accepts only the nine keyword values. css fonts level 4 extends the syntax to accept a <percentage> value as well. this enables variable fonts to offer something more like a continuum of character widths. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths. however, note that the <percentage> syntax is not yet supported by all browsers: check the browser compatibility table for details. keyword to numeric mapping the table below shows the mapping between keyword values and numeric percentages: keyword percentage ultra-con...
... league mono variable helvetica neue, which is installed by default on macos, has a single condensed face in addition to the normal face. all values of font-stretch less than 100% select the condensed face, while all other values select the normal face. league mono variable is a variable font that offers something like a continuous range of widths for different percentage values of font-stretch. formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea font stretch formal syntax <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expand...
font-weight - CSS: Cascading Style Sheets
most fonts have a particular weight which corresponds to one of the numbers in common weight name mapping. however some fonts, called variable fonts, can support a range of weights with a more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight. for truetype or opentype variable fonts, the "wght" variation is used to implement varying widths. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-weight can be any number between 1 and 1000. html <header> <input type="range" id="weight" name="weight" min="1" max="1000" /> <label for="weight">weight</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, fo...
.../master/license */ @font-face { src: url('https://mdn.mozillademos.org/files/16011/mutatorsans.ttf'); font-family:'mutatorsans'; font-style: normal; } label { font: 1rem monospace; white-space: nowrap; } .container { max-height: 150px; overflow-y: auto; } .sample { text-transform: uppercase; font: 1.5rem 'mutatorsans', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascript let weightlabel = document.queryselector('label[for="weight"]'); let weightinput = document.queryselector('#weight'); let sampletext = document.queryselector('.sample'); func...
grid-auto-rows - CSS: Cascading Style Sheets
han min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. as a minimum, it is treated as zero (or minimal content, if the grid container is sized under a minimal content constraint). auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. formal definition initial valueautoapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valuethe percentage as specified or the absolute lengthanimation typedi...
... candidate recommendation initial definition ...
inset-block-end - CSS: Cascading Style Sheets
y defines the logical block end offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. it corresponds to the top, right, bottom, or left property depending on the values defined for writing-mode, direction, and text-orientation. /* <length> values */ inset-block-end: 3px; inset-block-end: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-end: 10%; /* keyword value */ inset-block-end: auto; /* global values */ inset-block-end: inherit; inset-block-end: initial; inset-block-end: unset; syntax values the inset-block-end property takes the same values as the left property. formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of c...
... editor's draft initial definition ...
inset-block-start - CSS: Cascading Style Sheets
nes the logical block start offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation. it corresponds to the top, right, bottom, or left property depending on the values defined for writing-mode, direction, and text-orientation. /* <length> values */ inset-block-start: 3px; inset-block-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-start: 10%; /* keyword value */ inset-block-start: auto; /* global values */ inset-block-start: inherit; inset-block-start: initial; inset-block-start: unset; syntax values the inset-block-start property takes the same values as the left property. formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical...
... editor's draft initial definition ...
inset-block - CSS: Cascading Style Sheets
to physical offsets depending on the element's writing mode, directionality, and text orientation. it corresponds to the top and bottom, or right and left properties depending on the values defined for writing-mode, direction, and text-orientation. /* <length> values */ inset-block: 3px 10px; inset-block: 2.4em 3em; inset-block: 10px; /* value applied to start and end */ /* <percentage>s of the width or height of the containing block */ inset-block: 10% 5%; /* keyword value */ inset-block: auto; /* global values */ inset-block: inherit; inset-block: initial; inset-block: unset; constituent properties this property is a shorthand for the following css properties: inset-block-end inset-block-start syntax values the inset-block property takes the same values as the left property. f...
... editor's draft initial definition ...
inset - CSS: Cascading Style Sheets
Web › CSS › inset
rientation. it has the same multi-value syntax of the margin shorthand. it is a shorthand that corresponds to the top, right, bottom, and/or left properties. /* <length> values */ inset: 10px; /* value applied to all edges */ inset: 4px 8px; /* top/bottom left/right */ inset: 5px 15px 10px; /* top left/right bottom */ inset: 2.4em 3em 3em 3em; /* top right bottom left */ /* <percentage>s of the width (left/right) or height (top/bottom) of the containing block */ inset: 10% 5% 5% 5%; /* keyword value */ inset: auto; /* global values */ inset: inherit; inset: initial; inset: unset; syntax values the inset property takes the same values as the left property. formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed v...
... editor's draft initial definition ...
isolation - CSS: Cascading Style Sheets
Web › CSS › isolation
candidate recommendation init...
... candidate recommendation initial definition ...
justify-content - CSS: Cascading Style Sheets
tween each pair of adjacent items, the main-start edge and the first item, and the main-end edge and the last item, are all exactly the same. stretch if the combined size of the items along the main axis is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container along the main axis. note: stretch is not supported by flexible boxes (flexbox). safe used alongside an alignment keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe us...
...? ...
<length-percentage> - CSS: Cascading Style Sheets
or a <percentage>. syntax refer to the documentation for <length> and <percentage> for details of the individual syntaxes allowed by this type. examples length-percentage examples the following simple example demonstrates several properties that use <length-percentage> values. ...
...gth examples */ text-shadow: 1px 1px 1px red; border: 5px solid red; letter-spacing: 3px; /* percentage example */ text-size-adjust: 20%; } result use in calc() where a <length-percentage> is specified as an allowable type, this means that the percentage resolves to a length and therefore can be used in a calc() expression. therefore, all of the following values are acceptable for width: width: 200px; width: 20%; width: calc(100% - 200px); specifications specification status comment css values and units module level 4the definition of '<length-percentage>' in that specification. editor's draft css values and units module level 3the definition of '<length-percentage>' in that specification. candidate recommendation defines <le...
margin-block-end - CSS: Cascading Style Sheets
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 /* <length> values */ margin-block-end: 10px; /* an absolute length */ margin-block-end: 1em; /* relative to the text size */ margin-block-end: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-block-end: auto; /* global values */ margin-block-end: inherit; margin-block-end: initial; margin-block-end: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-start, margin-inline-start, and margin-inline-end,...
... editor's draft initial definition ...
margin-block-start - CSS: Cascading Style Sheets
e 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 /* <length> values */ margin-block-start: 10px; /* an absolute length */ margin-block-start: 1em; /* relative to the text size */ margin-block-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-block-start: auto; /* global values */ margin-block-start: inherit; margin-block-start: initial; margin-block-start: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-end, margin-inline-start, and margin-inlin...
... editor's draft initial definition ...
margin-block - CSS: Cascading Style Sheets
ock css shorthand property defines the logical block start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation. /* <length> values */ margin-block: 10px 20px; /* an absolute length */ margin-block: 1em 2em; /* relative to the text size */ margin-block: 5% 2%; /* relative to the nearest block container's width */ margin-block: 10px; /* sets both start and end values */ /* keyword values */ margin-block: auto; /* global values */ margin-block: inherit; margin-block: initial; margin-block: unset; these values corresponds to the margin-top and margin-bottom, or margin-right, and margin-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent propert...
... editor's draft initial definition. ...
margin-inline-end - CSS: Cascading Style Sheets
e 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 /* <length> values */ margin-inline-end: 10px; /* an absolute length */ margin-inline-end: 1em; /* relative to the text size */ margin-inline-end: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-end: auto; /* global values */ margin-inline-end: inherit; margin-inline-end: initial; margin-inline-end: unset; it relates to margin-block-start, margin-block-end, and margin-inline-start, which define the other margins of the element. values the margin-inline-end property takes the same values as the margin-left property. formal definition initial ...
... editor's draft initial definition ...
margin-inline-start - CSS: Cascading Style Sheets
s 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 /* <length> values */ margin-inline-start: 10px; /* an absolute length */ margin-inline-start: 1em; /* relative to the text size */ margin-inline-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-start: auto; /* global values */ margin-inline-start: inherit; it relates to margin-block-start, margin-block-end, and margin-inline-end, which define the other margins of the element. values the margin-inline-start property takes the same values as the margin-left property. formal definition initial value0applies tosame as margininheritednopercentages...
... editor's draft initial definition ...
margin-inline - CSS: Cascading Style Sheets
property that defines both the logical inline start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation. /* <length> values */ margin-inline: 10px 20px; /* an absolute length */ margin-inline: 1em 2em; /* relative to the text size */ margin-inline: 5% 2%; /* relative to the nearest block container's width */ margin-inline: 10px; /* sets both start and end values */ /* keyword values */ margin-inline: auto; /* global values */ margin-inline: inherit; margin-inline: initial; margin-inline: unset; this property corresponds to the margin-top and margin-bottom, or margin-right, and margin-left properties, depending on the values defined for writing-mode, direction, and text-orientation. cons...
... editor's draft initial definition. initial value0applies tosame as margin...
margin-top - CSS: Cascading Style Sheets
to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this property has no effect on non-replaced inline elements, such as <span> or <code>. syntax /* <length> values */ margin-top: 10px; /* an absolute length */ margin-top: 1em; /* relative to the text size */ margin-top: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-top: auto; /* global values */ margin-top: inherit; margin-top: initial; margin-top: unset; the margin-top property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the w...
...percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable value to use. see margin. formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. ...
mask-border-slice - CSS: Cascading Style Sheets
d, can be placed anywhere in the declaration. values <number> represents an edge offset in pixels for raster images and coordinates for vector images. for vector images, the number is relative to the element's size, not the size of the source image, so percentages are generally preferable in these cases. <percentage> represents an edge offset as a percentage of the source image's size: the width of the image for horizontal offsets, the height for vertical offsets. fill preserves the middle image region. its width and height are sized to match the top and left image regions, respectively. description the slicing process creates nine regions in total: four corners, four edges, and a middle region. four slice lines, set a given distance from their respective sides, control the size of ...
... corner regions. each one is used a single time to form the corners of the final border image. zones 5-8 are edge regions. these are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element. zone 9 is the middle region. it is discarded by default, but is used like a background image if the keyword fill is set. the mask-border-repeat, mask-border-width, and mask-border-outset properties determine how these regions are used to form the final mask border. formal definition initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to size of the mask border imagecomputed valueas specifiedanimation typediscrete formal syntax <number-percentage>{...
mask-clip - CSS: Cascading Style Sheets
Web › CSS › mask-clip
to the object bounding box. stroke-box the painted content is clipped to the stroke bounding box. view-box uses the nearest svg viewport as reference box. if a viewbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the reference box is set to the width and height values of the viewbox attribute. no-clip the painted content is not clipped. border this keyword behaves the same as border-box. padding this keyword behaves the same as padding-box. content this keyword behaves the same as content-box. text this keyword clips the mask image to the text of the element. formal definition initial valueborder-boxapplies toall elements; in...
...o container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <geometry-box> | no-clip ]#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples clipping a mask to the border box css #masked { width: 100px; height: 100px; background-color: #8cffa0; margin: 20px; border: 20px solid #8ca0ff; padding: 20px; mask-image: url(https://mdn.mozillademos.org/files/12668/mdn.svg); mask-size: 100% 100%; mask-clip: border-box; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="clipbox"> <option value="content-box">content-box</option> <option value...
mask-origin - CSS: Cascading Style Sheets
lative to the object bounding box. stroke-box the position is relative to the stroke bounding box. view-box uses the nearest svg viewport as reference box. if a viewbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the reference box is set to the width and height values of the viewbox attribute. content same as content-box. padding same as padding-box. border same as border-box. formal definition initial valueborder-boxapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <geometry-box>#where ...
... it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <geometry-box>#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples setting mask origin to border-box css #masked { width: 100px; height: 100px; margin: 10px; border: 10px solid blue; background-color: #8cffa0; padding: 10px; mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); mask-origin: border-box; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="origin"> <option value="content-box">content-box</option> <option value="padding-box">padding-bo...
mask-position - CSS: Cascading Style Sheets
ition>#where <position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? ...
...right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? ...
mask-repeat - CSS: Cascading Style Sheets
yed without clipping. the only case where clipping happens using space is when there isn't enough room to display one image. round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the mask painting area will not necessarily be entirely covered). the position of the non-repeated mask image is defined by the mask-position css property. formal defin...
...ueno-repeatapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueconsists of two keywords, one per dimensionanimation typediscrete formal syntax <repeat-style>#where <repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2} examples setting repeat for a single mask css #masked { width: 250px; height: 250px; background: blue linear-gradient(red, blue); mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); mask-repeat: repeat; /* can be changed in the live sample */ margin-bottom: 10px; } html content <div id="masked"> </div> <select id="repetition"> <option value="repeat-x">repeat-x</option> <option value="repeat-y">repeat-y</option> <option va...
max() - CSS: Cascading Style Sheets
Web › CSS › max
y value. the max() function can be used anywhere a <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> is allowed. 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 the first above example, the width will be at least 400px, but will be wider if the the viewport is more than 2000px wide (in which case 1vw would be 20px, so 20vw would be 400px). think of the max() value as providing the minimum value a property can have. syntax the max() function takes one or more comma-separated expressions as its parameter, with the largest (most positive) expression value used as the value of the property ...
...ressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions. you can use different units for each value in your expression. you may also use parentheses to establish computation order when needed. notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified. it is permitted to nest min() and other max() functions as expression values. the expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc(...
object-position - CSS: Cascading Style Sheets
/ object-position: inherit; object-position: initial; object-position: unset; values <position> from one to four values that define the 2d position of the element. relative or absolute offsets can be used. note: the position can be set so that the replaced element is drawn outside its box. ...
... two <img> elements, each displaying the mdn logo. <img id="object-position-1" src="https://udn.realityripple.com/samples/db/4f9fbd7dfb.svg" alt="mdn logo"/> <img id="object-position-2" src="https://udn.realityripple.com/samples/db/4f9fbd7dfb.svg" alt="mdn logo"/> css the css includes default styling for the <img> element itself, as well as separate styles for each of the two images. img { width: 300px; height: 250px; border: 1px solid black; background-color: silver; margin-right: 1em; object-fit: none; } #object-position-1 { object-position: 10px; } #object-position-2 { object-position: 100% 10%; } the first image is positioned with its left edge inset 10 pixels from the left edge of the element's box. the second image is positioned with its right edge flush against t...
offset-anchor - CSS: Cascading Style Sheets
lace an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
...th. the other two cause the <div>'s top-right and bottom-left points to move along the path, respectively. ...
offset - CSS: Cascading Style Sheets
Web › CSS › offset
/ 50px 100px; formal definition initial valueas each of the properties of the shorthand:offset-position: autooffset-path: noneoffset-distance: 0offset-anchor: autooffset-rotate: autoapplies totransformable elementsinheritednopercentagesas each of the properties of the shorthand:offset-position: refertosizeofcontainingblockoffset-distance: refer to the total path lengthoffset-anchor: relativetowidthandheightcomputed valueas each of the properties of the shorthand:offset-position: for <length> the absolute value, otherwise a percentageoffset-path: as specifiedoffset-distance: for <length> the absolute value, otherwise a percentageoffset-anchor: for <length> the absolute value, otherwise a percentageoffset-rotate: as specifiedanimation typeas each of the properties of the shorthand:offset-posi...
... working draft initial definition ...
overscroll-behavior-x - CSS: Cascading Style Sheets
applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling horizontally in our simple overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other. the outer box has a large width set on it so the page will scroll horizontally. the inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large width so it will scroll horizontally. by default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want. to avoid this, you can set over...
...th (and height) set on it so it sits comforably inside the viewport, but its content is given a large width so it will scroll horizontally. by default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is probably not what we want. to avoid this, you can set overscroll-behavior-x: contain on the inner box: main > div { height: 300px; width: 500px; overflow: auto; position: relative; top: 100px; left: 100px; overscroll-behavior-x: contain; } specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior-x' in that specification. working draft ...
padding-bottom - CSS: Cascading Style Sheets
/* global values */ padding-bottom: inherit; padding-bottom: initial; padding-bottom: unset; the padding-bottom property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. ...
...st be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal definition initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. ...
padding-top - CSS: Cascading Style Sheets
g-top: 10%; /* global values */ padding-top: inherit; padding-top: initial; padding-top: unset; the padding-top property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. ...
...st be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal definition initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. ...
padding - CSS: Cascading Style Sheets
Web › CSS › padding
e left and right. when three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom. when four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the padding as a fixed value. ...
... to the width of the containing block. formal definition initial valueas each of the properties of the shorthand:padding-bottom: 0padding-left: 0padding-right: 0padding-top: 0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. ...
page-break-inside - CSS: Cascading Style Sheets
span> <ol> <li>one</li> <!-- <li>two</li> --> </ol> </section> <ul> <li>one</li> <!-- <li>two</li> --> </ul> <p>this is the second paragraph.</p> <p>this is the third paragraph, it contains more text.</p> <p>this is the fourth paragraph. ...
...- <li>two</li> --> </ol> </section> <ul> <li>one</li> <!-- <li>two</li> --> </ul> <p>this is the second paragraph.</p> <p>this is the third paragraph, it contains more text.</p> <p>this is the fourth paragraph. it has a little bit more text than the third one.</p> </div> css .page { background-color: #8cffa0; height: 90px; width: 200px; columns: 1; column-width: 100px; } .list, ol, ul, p { break-inside: avoid; } p { background-color: #8ca0ff; } ol, ul, .list { margin: 0.5em 0; display: block; background-color: orange; } p:first-child { margin-top: 0; } result specifications specification status comment css paged media module level 3the definition of 'page-break-inside' in that specification. working dr...
paint-order - CSS: Cascading Style Sheets
paint order. stroke, fill, markers specify some or all of these values in the order you want them to be painted in. ...
... candidate recommendation initial definition. ...
perspective-origin - CSS: Cascading Style Sheets
following is also valid */ perspective-origin: y-position x-position; /* global values */ perspective-origin: inherit; perspective-origin: initial; perspective-origin: unset; values x-position indicates the position of the abscissa of the vanishing point. it can have one of the following values: <length-percentage> indicating the position as an absolute length value or relative to the width of the element. the value may be negative. left, a keyword being a shortcut for the 0 length value. center, a keyword being a shortcut for the 50% percentage value. right, a keyword being a shortcut for the 100% percentage value. y-position indicates the position of the ordinate of the vanishing point. it can have one of the following values: <length-percentage> indicating the pos...
...pomr { perspective-origin: right; } .pobl { perspective-origin: bottom left; } .pobm { perspective-origin: bottom; } .pobr { perspective-origin: bottom right; } .po200200neg { 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; } /* de...
place-content - CSS: Cascading Style Sheets
tainer. the spacing between each pair of adjacent items, the main-start edge and the first item, and the main-end edge and the last item, are all exactly the same. ...
...byid("writingmode"); writingm.addeventlistener("change", function (evt) { document.getelementbyid("container").style.writingmode = evt.target.value; }); var direction = document.getelementbyid("direction"); direction.addeventlistener("change", function (evt) { document.getelementbyid("container").style.direction = evt.target.value; }); css #container { display: flex; height:240px; width: 240px; flex-wrap: wrap; background-color: #8c8c8c; writing-mode: horizontal-tb; /* can be changed in the live sample */ direction: ltr; /* can be changed in the live sample */ place-content: flex-end center; /* can be changed in the live sample */ } div > div { border: 2px solid #8c8c8c; width: 50px; background-color: #a0c8ff; } .small { font-size: 12px; height: 40px; } .l...
radial-gradient() - CSS: Cascading Style Sheets
virtual gradient ray that extends horizontally from the center towards the right. percentage-based color-stop positions are relative to the intersection between the ending shape and this gradient ray, which represents 100%. each shape is a single color determined by the color on the gradient ray it intersects. ...
...100%. each shape is a single color determined by the color on the gradient ray it intersects. examples simple gradient <div class="radial-gradient"></div> .radial-gradient { width: 240px; height: 120px; } .radial-gradient { background-image: radial-gradient(cyan 0%, transparent 20%, salmon 40%); } non-centered gradient <div class="radial-gradient"></div> .radial-gradient { width: 240px; height: 120px; } .radial-gradient { background-image: radial-gradient(farthest-corner at 40px 40px, #f35 0%, #43e 100%); } more radial-gradient examples please see using css gradients for more examples. specifications specification status comment css images module level 3the definition of 'radial-gradients()' in that specification. candidat...
repeating-conic-gradient() - CSS: Cascading Style Sheets
ge represented by the conic gradient will not be accessible to screen reader users. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. ...
...explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 examples black and white starburst div { width: 200px; height: 200px; } <div></div> div { background-image: repeating-conic-gradient(#fff 0 9deg, #000 9deg 18deg); } off-centered gradient this gradient repeats 18 times, but since we only see the right half, we only see 9 repeats. div { width: 200px; height: 200px; } <div></div> div { background: repeating-conic-gradient( from 3deg at 25% 25%, green, blue 2deg 5deg, green, yellow 15deg 18deg, green 20deg); } more repeating-conic-gradient examples please see using css gradients for more examples. specifications specification status comment css images module level 4the definition of 'r...
repeating-linear-gradient() - CSS: Cascading Style Sheets
the gradient line list of color stops where <side-or-corner> = [left | right] || [top | bottom] and <color-stop-list> = [ <linear-color-stop> [, <color-hint>? ]? ]#, <linear-color-stop> and <linear-color-stop> = <color> [ <color-stop-length> ]? ...
...mples zebra stripes body { width: 100vw; height: 100vh; } body { background-image: repeating-linear-gradient(-45deg, transparent, transparent 20px, black 20px, black 40px); /* with multiple color stop lengths */ background-image: repeating-linear-gradient(-45deg, transparent 0 20px, black 20px 40px); } ten repeating horizontal bars body { width: 100vw; height: 100vh; } body { background-image: repeating-linear-gradient(to bottom, rgb(26,198,204), rgb(26,198,204) 7%, rgb(100,100,100) 10%); } because the last color stop is 10% and the gradient is vertical, each gradient in the repeated gradient is 10% of the height, fitting 10 horizontal bars. note: please see using css gradients for more examples. specific...
repeating-radial-gradient() - CSS: Cascading Style Sheets
e | farthest-corner | farthest-side and <color-stop-list> = [ <linear-color-stop> [, <color-hint>? ]? ]#, <linear-color-stop> and <linear-color-stop> = <color> [ <color-stop-length> ]? ...
... [ <percentage> | <length> ]{1,2} and <color-hint> = [ <percentage> | <length> ] examples black and white gradient <div class="radial-gradient"></div> .radial-gradient { width: 120px; height: 120px; } .radial-gradient { background: repeating-radial-gradient(black, black 5px, white 5px, white 10px); } farthest-corner <div class="radial-gradient"></div> .radial-gradient { width: 240px; height: 120px; } .radial-gradient { background: repeating-radial-gradient(ellipse farthest-corner at 20% 20%, red, black 5%, blue 5%, green 10%); background: repeating-radial-gradient(ellipse farthest-corner at 20% 20%, red 0 5%, green 5% 10%); } the elliptical gradient will be centered 20% from the top left, and will repeat 10 times between the center and the fart...
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
Web › CSS › row-gap
support browsers that implemented grid-row-gap and not row-gap for grid, you will need to use the prefixed property as in the interactive example above. syntax /* <length> values */ row-gap: 20px; row-gap: 1em; row-gap: 3vmin; row-gap: 0.5cm; /* <percentage> value */ row-gap: 10%; /* global values */ row-gap: inherit; row-gap: initial; row-gap: unset; values <length-percentage> is the width of the gutter separating the rows. <percentage> values are relative to the dimension of the element. formal definition initial valuenormalapplies tomulti-column elements, flex containers, grid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsa...
...nd normal computing to zero except on multi-column elementsanimation typea length, percentage or calc(); formal syntax normal | <length-percentage>where <length-percentage> = <length> | <percentage> examples flex layout html <div id="flexbox"> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> css #flexbox { display: flex; flex-wrap: wrap; width: 300px; row-gap: 20px; } #flexbox > div { border: 1px solid green; background-color: lime; flex: 1 1 auto; width: 100px; height: 50px; } result grid layout html <div id="grid"> <div></div> <div></div> <div></div> </div> css #grid { grid-row-gap: 20px; } #grid { display: grid; height: 200px; grid-template-columns: 200px; grid-template-rows: repeat(3, 1fr);...
scale - CSS: Cascading Style Sheets
Web › CSS › scale
o scaling should be applied. ...
... editor's draft initial definition. ...
scroll-margin-inline-end - CSS: Cascading Style Sheets
to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the right of each block. html the html that represents the blocks is very simple: <div class="scroller"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> </div> css let's walk through the css. ...
...x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. ...
scroll-margin-inline-start - CSS: Cascading Style Sheets
to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the left of each block. html the html that represents the blocks is very simple: <div class="scroller"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> </div> css let's walk through the css. ...
...x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. ...
scroll-margin-inline - CSS: Cascading Style Sheets
to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the right of each block. html the html that represents the blocks is very simple: <div class="scroller"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> </div> css let's walk through the css. ...
...x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. ...
scroll-margin - CSS: Cascading Style Sheets
to create four horizontally-scrolling blocks, the second and third of which snap into place, near but not quite at the left of each block. html the html that represents the blocks is very simple: <div class="scroller"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> </div> css let's walk through the css. ...
...x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point. ...
scroll-snap-points-x - CSS: Cascading Style Sheets
l-snap-points-x: unset; syntax values none the scroll container does not define any snap points. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. formal definition initial valuenoneapplies toscroll containersinheritednopercentagesrelative to same axis of the padding-box of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax none | repeat( <length-percentage> )where <length-percentage> = <length> | <percentage> examples setting...
...he padding-box of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax none | repeat( <length-percentage> )where <length-percentage> = <length> | <percentage> examples setting horizontal scroll snap points html <div id="container"> <div>1</div> <div>2</div> <div>3</div> </div> css #container { width: 200px; overflow: auto; white-space: nowrap; scroll-snap-points-x: repeat(100%); scroll-snap-type: mandatory; font-size: 0; } #container > div { width: 200px; height: 200px; display: inline-block; line-height: 200px; text-align: center; font-size: 100px; } #container > div:nth-child(even) { background-color: #87ea87; } #container > div:nth-child(odd) { background-colo...
scroll-snap-points-y - CSS: Cascading Style Sheets
-snap-points-y: unset; syntax values none the scroll container does not define any snap points. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. formal definition initial valuenoneapplies toscroll containersinheritednopercentagesrelative to same axis of the padding-box of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax none | repeat( <length-percentage> )where <length-percentage> = <length> | <percentage> examples setting...
...of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax none | repeat( <length-percentage> )where <length-percentage> = <length> | <percentage> examples setting vertical scroll snap points html <div id="container"> <div>1</div> <div>2</div> <div>3</div> </div> css #container { height: 200px; width: 220px; overflow-x: hidden; overflow-y: auto; scroll-snap-points-y: repeat(200px); scroll-snap-type: mandatory; font-size: 0; } #container > div { width: 200px; height: 200px; display: inline-block; line-height: 200px; text-align: center; font-size: 100px; } #container > div:nth-child(even) { background-color: #87ea87; } #container > div:nth-child(odd) { background-co...
scroll-snap-type - CSS: Cascading Style Sheets
tl</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> </div> </div> css /* setup */ html, body, .holster { height: 100%; } .holster { display: flex; align-items: center; justify-content: space-between; flex-flow: column nowrap; font-family: monospace; } .container { display: flex; overflow: auto; outline: 1px dashed lightgray; flex: none; } .container.x { width: 100%; height: 128px; flex-flow: row nowrap; } .container.y { width: 256px; height: 256px; flex-flow: column nowrap; } /* scroll-snap */ .x.mandatory-scroll-snapping { scroll-snap-type: x mandatory; } .y.mandatory-scroll-snapping { scroll-snap-type: y mandatory; } .x.proximity-scroll-snapping { scroll-snap-type: x proximity; } .y.proximity-scroll-snapping { scroll-snap-type:...
...-snapping { scroll-snap-type: x mandatory; } .y.mandatory-scroll-snapping { scroll-snap-type: y mandatory; } .x.proximity-scroll-snapping { scroll-snap-type: x proximity; } .y.proximity-scroll-snapping { scroll-snap-type: y proximity; } .container > div { text-align: center; scroll-snap-align: center; flex: none; } .x.container > div { line-height: 128px; font-size: 64px; width: 100%; height: 128px; } .y.container > div { line-height: 256px; font-size: 128px; width: 256px; height: 100%; } /* appearance fixes */ .y.container > div:first-child { line-height: 1.3; font-size: 64px; } /* coloration */ .container > div:nth-child(even) { background-color: #87ea87; } .container > div:nth-child(odd) { background-color: #87ccea; } results specifications ...
text-size-adjust - CSS: Cascading Style Sheets
rd values */ text-size-adjust: none; text-size-adjust: auto; /* <percentage> value */ text-size-adjust: 80%; /* global values */ text-size-adjust: inherit; text-size-adjust: initial; text-size-adjust: unset; because many websites have not been developed with small devices in mind, mobile browsers differ from desktop browsers in the way they render web pages. instead of laying out pages at the width of the device screen, they lay them out using a viewport that is much wider, usually 800 or 1000 pixels. to map the extra-wide layout back to the original device size, they either show only part of the whole render or scale the viewport down to fit. since text that has been scaled down to fit a mobile screen may be very small, many mobile browsers apply a text inflation algorithm to enlarge the ...
... or 1000 pixels. to map the extra-wide layout back to the original device size, they either show only part of the whole render or scale the viewport down to fit. since text that has been scaled down to fit a mobile screen may be very small, many mobile browsers apply a text inflation algorithm to enlarge the text to make it more readable. when an element containing text uses 100% of the screen's width, the algorithm increases its text size, but without modifying the layout. the text-size-adjust property allows web authors to disable or modify this behavior, as web pages designed with small screens in mind do not need it. syntax the text-size-adjust property is specified as none, auto, or a <percentage>. values none disables the browser's inflation algorithm. auto enables the browser's...
rotate() - CSS: Cascading Style Sheets
for example, if you rotate before translating, the translat...
... about the order in which you specify your transformations. ...
scale() - CSS: Cascading Style Sheets
— use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences. ...
... working draft initial definition ...
scale3d() - CSS: Cascading Style Sheets
cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. ...
... editor's draft initial definition ...
translate3d() - CSS: Cascading Style Sheets
es on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. a translation is not a linear transformation in ℝ3 and can't be represented using a cartesian-coordinate matrix. ...
...>moved</div> <div>static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { /* equivalent to perspective(500px) translatex(10px) */ transform: perspective(500px) translate3d(10px, 0, 0px); background-color: pink; } result combining z-axis and x-axis translation html <div>static</div> <div class="moved">moved</div> <div>static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { transform: perspective(500px) translate3d(10px, 0, 100px); background-color: pink; } result specifications specification status comment css transforms level 2the definition of 'translate3d()' in that specification. editor's draft initial definition ...
translateX() - CSS: Cascading Style Sheets
on the 2d plane. its result is a <transform-function> data type. note: translatex(tx) is equivalent to translate(tx, 0) or translate3d(tx, 0, 0). syntax /* <length-percentage> values */ transform: translatex(200px); transform: translatex(50%); values <length-percentage> is a <length> or <percentage> representing the abscissa of the translating vector. a percentage value refers to the width of the reference box defined by the transform-box property. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear transformation in ℝ2 and can't be represented using a cartesian-coordinate matrix. 10t010001 10t010001 100t010000100001...
...ogeneous coordinates on ℝℙ3 a translation is not a linear transformation in ℝ2 and can't be represented using a cartesian-coordinate matrix. 10t010001 10t010001 100t010000100001 [1 0 0 1 t 0] formal syntax translatex(<length-percentage>) examples html <div>static</div> <div class="moved">moved</div> <div>static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { transform: translatex(10px); /* equal to translate(10px) */ background-color: pink; } result specifications specification status comment css transforms level 1the definition of 'translatex()' in that specification. working draft initial definition ...
transition-timing-function - CSS: Cascading Style Sheets
> = jump-start | jump-end | jump-none | jump-both | start | end examples cubic-bezier examples <div class="parent"> <div class="ease">ease</div> <div class="easein">ease-in</div> <div class="easeout">ease-out</div> <div class="easeinout">ease-in-out</div> <div class="linear">linear</div> <div class="cb">cubic-bezier(0.2,-2,0.8,2)</div> </div> .parent {} .parent > div[class] { width: 12em; min-width: 12em; margin-bottom: 4px; background-color: black; border: 1px solid red; color: white; transition-property: all; transition-duration: 7s; } .parent > div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration: 2s; } function up...
... .cb { transition-timing-function: cubic-bezier(0.2,-2,0.8,2); } step examples <div class="parent"> <div class="jump-start">jump-start</div> <div class="jump-end">jump-end</div> <div class="jump-both">jump-both</div> <div class="jump-none">jump-none</div> <div class="step-start">step-start</div> <div class="step-end">step-end</div> </div> .parent {} .parent > div[class] { width: 12em; min-width: 12em; margin-bottom: 4px; background-color: black; border: 1px solid red; color: white; transition-property: all; transition-duration:7s; } .parent > div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration:2s; } function upda...
translate - CSS: Cascading Style Sheets
Web › CSS › translate
cified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes formal syntax none | <length-percentage> [ <length-percentage> <length>? ...
... editor's draft initial definition. initial valuenoneapplies totran...
z-index - CSS: Cascading Style Sheets
Web › CSS › z-index
recommendation...
... recommendation initial definition ...
Adding captions and subtitles to HTML5 video - Developer guides
if (subtitlesmenu) { subtitlesmenu.style.display = (subtitlesmenu.style.display == 'block' ? ...
... the ::cue pseudo-element is the key to targetting individual text track cues for styling, as it matches any defined cue. there are only a handful of ...
Live streaming web audio and video - Developer guides
c file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below). usually, we require different formats and special server-side software to achieve this. adaptive streaming one of the main priorities for live streaming is to keep the player synchronized with the stream: adaptive streaming is a technique for doing this in the case of low bandwidth. the idea is that the data transfer rate is monitored and if it looks like it's not keeping up, we drop down to a lower bandwidth (and consequently lower quality) stream. in order to have this capability, we need to use formats that facilitate this. live streaming formats generally allow adaptive streaming by breaking streams into a series of small segments and making those segments available at ...
...reaming technology is not used exclusively for live streams. it can also be used instead of the traditional progressive download method for audio and video on demand: there are several advantages to this: latency is generally lower so media will start playing more quickly adaptive streaming makes for better experiences on a variety of devices media is downloaded just in time which makes bandwidth usage more efficient streaming protocols while static media is usually served over http, there are several protocols for serving adaptive streams; let's take a look at the options. http for now, http is by far the most commonly supported protocol used to transfer media on demand or live. rtmp real time messaging protocol (rtmp) is a proprietary protocol developed by macromedia (now adobe) ...
Rich-Text Editing in Mozilla - Developer guides
ndchild(opre); } else { if (document.all) { odoc.innerhtml = odoc.innertext; } else { ocontent = document.createrange(); ocontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { 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 sel...
...bar=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();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}re...
Making content editable - Developer guides
false, "div"); } else { if (document.all) { odoc.innerhtml = odoc.innertext; } else { ocontent = document.createrange(); ocontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { 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 sel...
...bar=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();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}re...
Mobile Web Development - Developer guides
Web › Guide › Mobile
ign is a term for a set of techniques that enables your web site to adapt its layout as its viewing environment — most obviously, the size and orientation of the screen — changes. it includes techniques such as: fluid css layouts, to make the page adapt smoothly as the browser window size changes the use of media queries to conditionally include css rules appropriate for the device screen width and height the viewport meta tag instructs the browser to display your site at the appropriate scale for the user's device. working with touch screens to use a touch screen you'll need to work with dom touch events. you won't be able to use the css :hover pseudo-class, and will need to design clickable items like buttons to respect the fact that fingers are fatter than mouse pointers. see thi...
...ts. you won't be able to use the css :hover pseudo-class, and will need to design clickable items like buttons to respect the fact that fingers are fatter than mouse pointers. see this article on designing for touch screens. you can use the pointer or any-pointer media query to load different css on a touch-enabled device. optimizing images to help users whose devices have low or expensive bandwidth, you can optimize images by loading images appropriate to the device screen size and resolution. you do this in css by querying for screen height, width, and pixel ratio. you can also make use of css properties to implement visual effects like gradients and shadows without images. mobile apis finally, you can take advantage of the new possibilities offered by mobile devices, such as orientatio...
Printing - Developer guides
window (for example, the printer-friendly version of a document) after the user prints its contents, you can use code like this: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>javascript window close example </title> <script type="text/javascript"> function popuponclick() { my_window = window.open('', 'mywindow', 'status=1,width=350,height=150'); my_window.document.write('<html><head><title>print me</title></head>'); my_window.document.write('<body onafterprint="self.close()">'); my_window.document.write('<p>when you print this window, it will close afterward.</p>'); my_window.document.write('</body></html>'); } </script> </head> <body> <p>to try out the <code>afterprint</code> event, click ...
...ndow.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 external page!</span></p> </body> </html> note: older versions of internet explorer cannot print the conten...
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
he image data has been received. finally, the image's src attribute is set to the url of the image to download; this triggers the download to begin. ...
... received. finally, the image's src attribute is set to the url of the image to download; this triggers the download to begin. receiving and saving the image the code that handles the newly-downloaded image is found in the imagereceived() method: function imagereceived() { let canvas = document.createelement("canvas"); let context = canvas.getcontext("2d"); canvas.width = downloadedimg.width; canvas.height = downloadedimg.height; context.drawimage(downloadedimg, 0, 0); imagebox.appendchild(canvas); try { localstorage.setitem("saved-image-example", canvas.todataurl("image/png")); } catch(err) { console.log("error: " + err); } } imagereceived() is called to handle the "load" event on the htmlimageelement that receives the downloaded image. this event is trigger...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
Web › HTML › Element › applet
cripts. object this attribute specifies the url of a serialized representation of an applet. src as defined for internet explorer 4 and higher, this attribute specifies a url for an associated file for the applet. the meaning and use is unclear and not part of the html standard. vspace this attribute specifies additional vertical space, in pixels, to be reserved above and below the applet. ...
...url of a serialized representation of an applet. src as defined for internet explorer 4 and higher, this attribute specifies a url for an associated file for the applet. the meaning and use is unclear and not part of the html standard. vspace this attribute specifies additional vertical space, in pixels, to be reserved above and below the applet. width this attribute specifies in pixels the width that the applet needs. example html <applet code="game.class" align="left" archive="game.zip" height="250" width="350"> <param name="difficulty" value="easy"> <b>sorry, you need java to play this game.</b> </applet> specifications specification status comment html 5.2the definition of '<applet>' in that specification. recommendation html 5.
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
Web › HTML › Element › embed
ication, document, img, none, presentation dom interface htmlembedelement attributes this element's attributes include the global attributes. height the displayed height of the resource, in css pixels. this must be an absolute value; percentages are not allowed. src the url of the resource being embedded. type the mime type to use to select the plug-in to instantiate. width the displayed width of the resource, in css pixels. this must be an absolute value; percentages are not allowed. usage notes you can use the object-position property to adjust the positioning of the embedded object within the element's frame, and the object-fit property to control how the object's size is adjusted to fit within the frame. examples <embed type="video/quicktime" src="movie.mo...
...the title's value should concisely describe the embedded content. ...
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
Web › HTML › Element › hr
dom interface htmlhrelement attributes this element's attributes include the global attributes. align sets the alignment of the rule on the page. if no value is specified, the default value is left. color sets the color of the rule through color name or hexadecimal value. noshade sets the rule to have no shading. size sets the height, in pixels, of the rule. width sets the length of the rule on the page through a pixel or percentage value. example html <p> this is the first paragraph of text. this is the first paragraph of text. this is the first paragraph of text. this is the first paragraph of text. </p> <hr> <p> this is the second paragraph of text. this is the second paragraph of text. this is the second paragraph of text. this...
...tions specification status comment html living standardthe definition of '<hr>' in that specification. living standard definition of the <hr> element html5the definition of '<hr>' in that specification. recommendation html 4.01 specificationthe definition of '<hr>' in that specification. recommendation the align, noshade, size, and width attributes are deprecated ...
<input type="datetime-local"> - HTML: Hypertext Markup Language
id 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:invalid+span:after { content: '✖'; padding-left: 5px; } input:valid+span:after { content: '✓'; padding-left: 5px; } important: html form validation is not a substitute for scripts that ensure that the entered data is in the proper format. it's far too easy for someone to make adjustments to the html that allow them to bypass the validation, or to remove it...
...hile the day and year values are dynamically generated depending on the currently selected month and year, and the current year respectively (see the code comments below for detailed explanations of how these functions work.) we also decided to dynamically generate the hours and minutes, as there are so many of them! ...
<input type="text"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › text
de directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. size the size attribute is a numeric value indicating how many characters wide the input field should be. the value must be a number greater than zero, and the default value is 20. since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use). this does not set a limit on how many characters the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit o...
...'s foreground color, and automatically vanishes when the user begins to enter text into the field (or whenever the field has a value set programmatically by setting its value attribute. physical input element size the physical size of the input box can be controlled using the size attribute. with it, you can specify the number of characters the text input can display at a time. this affects the width of the element, letting you specify the width in terms of characters rather than pixels. in this example, for instance, the input is 30 characters wide: <form> <div> <label for="uname">choose a username: </label> <input type="text" id="uname" name="name" placeholder="lower case, all one word" size="30"> </div> <div> <button>submit</button> </div> </form>...
<input type="url"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › url
de directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. size the size attribute is a numeric value indicating how many characters wide the input field should be. the value must be a number greater than zero, and the default value is 20. since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use). this does not set a limit on how many characters the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit o...
...l of the page that has a problem, and a message describing what is wrong. but we want the url to only successfully validate if the entered url is in a myco domain. since inputs of type url validate against both the standard url validation and the specified pattern, you can implement this easily. ...
<input type="week"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › week
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; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the result here is that only weeks between w01 and w52 in 2017 will be seen as valid and be selectable in supporting browsers. making week values required in additio...
... <span> <label for="year">year:</label> <select id="year" name="year"> <option value="2017" selected>2017</option> <option value="2018">2018</option> </select> </span> </div> </div> </form> the week values are dynamically generated by the javascript code below. 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; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the other part of the code that may be of interest is the feature detection code. to detect whether the browser supports <input type="week">, we create a new <input> ...
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › marquee
ldelay sets the interval between each scroll movement in milliseconds. the default value is 85. note that any value smaller than 60 is ignored and the value 60 is used instead, unless truespeed is specified. truespeed by default, scrolldelay values lower than 60 are ignored. if truespeed is present, those values are not ignored. vspace sets the vertical margin in pixels or percentage value. width sets the width in pixels or percentage value. event handlers onbounce fires when the marquee has reached the end of its scroll position. it can only fire when the behavior attribute is set to alternate. onfinish fires when the marquee has finished the amount of scrolling that is set by the loop attribute. it can only fire when the loop attribute is set to some number that is greater than...
...ly fire when the loop attribute is set to some number that is greater than 0. onstart fires when the marquee starts scrolling. methods start() starts scrolling of the marquee. stop() stops scrolling of the marquee. examples <marquee>this text will scroll from right to left</marquee> <marquee direction="up">this text will scroll from bottom to top</marquee> <marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid"> <marquee behavior="alternate"> this text will bounce </marquee> </marquee> specifications specification status comment html living standardthe definition of '<marquee>' in that specification. living standard make it obsolete in favor of css but define its expected behavior, for backward com...
<object> - HTML: Hypertext Markup Language
Web › HTML › Element › object
t. implicit aria role no corresponding role permitted aria roles application, document, image dom interface htmlobjectelement attributes this element includes the global attributes. archivehtml 4 onlyobsolete since html5 a space-separated list of uris for archives of resources for the object. borderdeprecated since html4.01obsolete since html5 the width of a border around the control, in pixels. classidhtml 4 onlyobsolete since html5 the uri of the object's implementation. it can be used together with, or in place of, the data attribute. codebasehtml 4 onlyobsolete since html5 the base path used to resolve relative uris specified by classid, data, or archive. if not specified, the default is the base uri of the current document. codetypehtm...
...on order for the current document. type the content type of the resource specified by data. at least one of data and type must be defined. typemustmatchhtml5 this boolean attribute indicates if the type attribute and the actual content type of the resource must match to be used. usemap a hash-name reference to a <map> element; that is a '#' followed by the value of a name of a map element. width the width of the display resource, in css pixels. -- (absolute values only. no percentages) examples embed a flash movie <!-- embed a flash movie --> <object data="movie.swf" type="application/x-shockwave-flash"></object> <!-- embed a flash movie with parameters --> <object data="movie.swf" type="application/x-shockwave-flash"> <param name="foo" value="bar"> </object> specifications ...
<spacer> - HTML: Hypertext Markup Language
Web › HTML › Element › spacer
irefox, which is the descendant of netscape's browsers, removed support for <spacer> in version 4. attributes like all other html elements, this element supports the global attributes. type this attribute determines type of spacer. possible values are horizontal, vertical and block. size this attribute can be used for defining size of spacer in pixels when type is horizontal or vertical. width this attribute can be used for defining width of spacer in pixels when type is block. height this attribute can be used for defining height of spacer in pixels when type is block. align this attribute determines alignment of spacer. possible values are left, right and center. example <span>just a text node</span> <spacer type="horizontal" size="10"></spacer> <span>just another text node</...
...d for defining width of spacer in pixels when type is block. height this attribute can be used for defining height of spacer in pixels when type is block. align this attribute determines alignment of spacer. possible values are left, right and center. example <span>just a text node</span> <spacer type="horizontal" size="10"></spacer> <span>just another text node</span> <spacer type="block" width="10" height="10"></spacer> specification not part of any specification. ...
<table>: The Table element - HTML: Hypertext Markup Language
Web › HTML › Element › table
st column and the bottom of the table and the last row. to achieve a similar effect, apply the border-spacing property to the <table> element. border-spacing does not have any effect if border-collapse is set to collapse. frame this enumerated attribute defines which side of the frame surrounding the table must be displayed. to achieve a similar effect, use the border-style and border-width properties. rules this enumerated attribute defines where rules, i.e. lines, should appear in a table. it can have the following values: none, which indicates that no rules will be displayed; it is the default value; groups, which will cause the rules to be displayed between row groups (defined by the <thead>, <tbody> and <tfoot> elements) and between column groups (defined by the ...
...ill cause the rules to be displayed between columns; all, which will cause the rules to be displayed between rows and columns. to achieve a similar effect, apply the border property to the appropriate <thead>, <tbody>, <tfoot>, <col>, or <colgroup> elements. summary this attribute defines an alternative text that summarizes the content of the table. use the <caption> element instead. width this attribute defines the width of the table. use the css width property instead. examples simple table <table> <tr> <td>john</td> <td>doe</td> </tr> <tr> <td>jane</td> <td>doe</td> </tr> </table> more examples <p>simple table with header</p> <table> <tr> <th>first name</th> <th>last name</th> </tr> <tr> <td>john</td> <td>doe</td> <...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
Web › HTML › Element › td
ute. align this enumerated attribute specifies how the cell content's horizontal alignment will be handled. possible values are: left: the content is aligned to the left of the cell. center: the content is centered in the cell. right: the content is aligned to the right of the cell. justify (with text only): the content is stretched out inside the cell so that it covers its entire width. char (with text only): the content is aligned to a character inside the <th> element with minimal offset. this character is defined by the char and charoff attributes unimplemented (see bug 2212). the default value when this attribute is not specified is left. note: to achieve the same effect as the left, center, right or justify values, apply the css text-align property to the elem...
... aligns it with the baseline of the characters instead of the bottom. if characters don't descend below the baseline, the baseline value achieves the same effect as bottom. bottom: positions the text near the bottom of the cell. middle: centers the text in the cell. and top: positions the text near the top of the cell. to achieve a similar effect, use the css vertical-align property. width this attribute is used to define a recommended cell width. use the css width property instead. examples see <table> for examples on <td>. specifications specification status comment html living standardthe definition of 'td element' in that specification. living standard html5the definition of 'td element' in that specification. recommendatio...
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
> element is a descendant of or the form element whose id is specified by the form attribute of the input element. for more information, see the autocomplete attribute in <form>. autofocus this boolean attribute lets you specify that a form control should have input focus when the page loads. only one form-associated element in a document can have this attribute specified. cols the visible width of the text control, in average character widths. if it is specified, it must be a positive integer. if it is not specified, the default value is 20. disabled this boolean attribute indicates that the user cannot interact with the control. if this attribute is not specified, the control inherits its setting from the containing element, for example <fieldset>; if there is no containing element w...
... grammar checked. default : indicates that the element is to act according to a default behavior, possibly based on the parent element's own spellcheck value. false : indicates that the element should not be spell checked. wrap indicates how the control wraps text. possible values are: hard: the browser automatically inserts line breaks (cr+lf) so that each line has no more than the width of the control; the cols attribute must also be specified for this to take effect. soft: the browser ensures that all line breaks in the value consist of a cr+lf pair, but does not insert any additional line breaks. off : like soft but changes appearance to white-space: pre so line segments exceeding cols are not wrapped and the <textarea> becomes horizontally scrollable. if this attribu...
Cross-Origin Resource Sharing (CORS) - HTTP
Web › HTTP › CORS
no readablestream object is used in the request. note: these are the same kinds of cross-site req...
... no readablestream object is used in the request. note: these are the same kinds of cross-site requests th...
HTTP conditional requests - HTTP
ondition, and the result of the request will be different if the precondition is matched or not. the different behaviors are defined by the method of the request used, and by the set of headers used for a precondition: for safe methods, like get, which usually tries to fetch a document, the conditional request can be used to send back the document, if relevant only. therefore, this spares bandwidth. for unsafe methods, like put, which usually uploads a document, the conditional request can be used to upload the document, only if the original it is based on is the same as that stored on the server. validators all conditional headers try to check if the resource stored on the server matches a specific version. to achieve this, the conditional requests need to indicate the version of the r...
...lient uses this new resource (and caches it). besides the setting of the validators on the server side, this mechanism is transparent: all browsers manage a cache and send such conditional requests without any special work to be done by web developers. integrity of a partial download partial downloading of files is a functionality of http that allows to resume previous operations, saving bandwidth and time, by keeping the already obtained information: a server supporting partial downloads broadcasts this by sending the accept-ranges header. once this happens, the client can resume a download by sending a ranges header with the missing ranges: the principle is simple, but there is one potential problem: if the downloaded resource has been modified between both downloads, the obtained ...
Content negotiation - HTTP
ver to select an appropriate response. valid values are: value meaning device-memory indicates the approximate amount of device ram. this value is an approximation given by rounding to the nearest power of 2 and dividing that number by 1024. for example, 512 megabytes will be reported as 0.5. dpr indicates the client's device pixel ratio. viewport-width indicates the layout viewport width in css pixels. width indicates the resource width in physical pixels (in other words the intrinsic size of an image). the accept-charset header the accept-charset header indicates to the server what kinds of character encodings are understood by the user-agent. traditionally, it was set to a different value for each locale for the browser...
...supported compressions). the value is a q-factor list (e.g.: br, gzip;q=0.8) that indicates the priority of the encoding values. the default value identity is at the lowest priority (unless otherwise declared). compressing http messages is one of the most important ways to improve the performance of a web site, it shrinks the size of the data transmitted and makes better use of the available bandwidth; browsers always send this header and the server should be configured to abide to it and to use compression. the accept-language header the accept-language header is used to indicate the language preference of the user. it is a list of values with quality factors (like: "de, en;q=0.7"). a default value is often set according the language of the graphical interface of the user agent, but most br...
constructor - JavaScript
with the name "constructor" in a class. having more than one occurrence of a constructor method in a class will throw a syntaxerror error. examples using the constructor method this code snippet is taken from the classes sample (live demo). ...
... extends polygon { constructor(length) { // here, it calls the parent class' constructor with lengths // provided for the polygon's width and height super(length, length); // note: in derived classes, `super()` must be called before you // can use `this`. leaving this out will cause a referenceerror. this.name = 'square'; } get area() { return this.height * this.width; } set area(value) { this.height = value**0.5; this.width = value**0.5; } } another example here the prototype of square class is changed—but the constructor of its base class polygon is still called when a new instance of a square is created. class polygon { constructor() { this.name = "polygon"; } } class square extends polygon { constructor() { ...
String.prototype.padStart() - JavaScript
uncated from the end. the default value is " " (u+0020 'space'). return value a string of the specified targetlength with padstring applied from the start. ...
...ng of the specified targetlength with padstring applied from the start. examples basic examples 'abc'.padstart(10); // " abc" 'abc'.padstart(10, "foo"); // "foofoofabc" 'abc'.padstart(6,"123465"); // "123abc" 'abc'.padstart(8, "0"); // "00000abc" 'abc'.padstart(1); // "abc" fixed width string number conversion // javascript version of: (unsigned) // printf "%0*d" width num function leftfillnum(num, targetlength) { return num.tostring().padstart(targetlength, 0); } const num = 123; console.log(leftfillnum(num, 5)); // expected output: "00123" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.padstart' in that specification. ...
<mpadded> - MathML
possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . 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. voffset sets or increments the vertical position. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . width sets or increments the width. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . pseudo-units it is possible to use the keywords "depth", "height", and "width" as a pseudo-unit for the attributes depth, height, lspace, voffset, and width. they represent each length of the same-named dimension. prior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamon...
... recommendation current specification mathml 2.0the definition of 'mpadded' in that specification. ...
<mtable> - MathML
Web › MathML › Element › mtable
lumns (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 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. displaystyle 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 displaystyle is set to true. unimplemented equalcolumns a boolean value indicating whether to force all columns...
...lues separated by space are allowed and apply to the corresponding rows (e.g. rowlines="none none solid"). possible values are: none (default), solid and dashed. unimplemented rowspacing specifies the space between table rows. unimplemented side specifies the position where <mlabeledtr> label elements should be placed. possible values are: left, right (default), leftoverlap and rightoverlap. width specifies the width of the entire table. accepts length values. examples alignment with row number rendering: <math> <mi>x</mi> <mo>=</mo> <mtable frame="solid" rowlines="solid" align="axis 3"> <mtr> <mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> </mtr> <mtr> <mtd><mi>c</mi></mtd> <mtd><mi>d</mi></mtd> ...
Autoplay guide for media and Web Audio APIs - Web media technologies
s true, the media will automatically begin to play as soon as possible after the following have occurred: the page is allowed to use autoplay functionality the element has been created during page load enough media has been received to begin playback and continue to play through to the end of the media without interruption, assuming there are no dramatic changes in network performance or bandwidth. example: the autoplay attribute an <audio> element using the autoplay attribute might look like this: <audio id="musicplayer" autoplay> <source src="/music/chapter1.mp4"> </audio> example 2: detecting autoplay failure if you rely on autoplay for anything important, or if autoplay failure will impact your app in any way, you will probably want to be able to tell when it autoplay didn't b...
...the http header is: feature-policy: autoplay 'none' using the <iframe>'s allow attribute: <iframe src="mediaplayer.html" ...
Media container formats (file types) - Web media technologies
system's media framework. [3] requires web media extensions to be installed. 3gp the 3gp or 3gpp media container is used to encapsulate audio and/or video that is specifically intended for transmission over cellular networks for consumption on mobile devices. the format was designed for use on 3g mobile phones, but can still be used on more modern phones and networks. however, the improved bandwidth availability and increased data caps on most networks has reduced the need for the 3gp format. however, this format is still used for slower networks and for lower-performance phones. this media container format is derived from the iso base media file format and mpeg-4, but is specifically streamlined for lower bandwidth scenarios. base 3gp media mime types audio video ...
...ice, with a fallback in mp4 format. you could even choose to offer a retro-like quicktime or avi fallback for good measure. to do this, you create a <video> (or <audio>) element with no src attribute. then add child <source> elements within the <video> element, one for each version of the video you offer. this can be used to offer various versions of a video that can be selected depending on bandwidth availability, but in our case, we'll use it to offer format options. in the example shown here, a video is offered to the browser in two formats: webm and mp4. 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 video...
OpenSearch description format
late below. sections in [square brackets] should be customized for the specific plugin you're writing. ...
...g the character encoding to use when submitting input to the search engine. image uri of an icon for the search engine. when possible, include a 16×16 image of type image/x-icon (such as /favicon.ico) and a 64×64 image of type image/jpeg or image/png. the uri may also use the data: uri scheme. (you can generate a data: uri from an icon file at the data: uri kitchen.) <image height="16" width="16" type="image/x-icon">https://example.com/favicon.ico</image> <!-- or --> <image height="16" width="16">data:image/x-icon;base64,aaabaaeaebaaa … daaa=</image> firefox caches the icon as a base64 data: uri (search plug-ins are stored in the profile's searchplugins/ folder). http: and https: urls are converted to data: uris when this is done. note: for icons loaded remotely (that is, fr...
Animation performance and frame rate - Web Performance
can result in jank as the browser struggles to hit a smooth frame rate. for animated media, such as video and animated gifs, the main performance concern is file size - downloading the file size fast enough to not negatively impact performance is the greatest issue. code based animations, be it css, svg, <canvas>, webgl or other javascript animations, can cause performance issues even if the bandwidth footprint is small. these animations can consume cpu and/or cause jank. while performance is sensitive to the particular system and its load, performance tools can help you understand the work the browser's doing to render your site, and help you prevent and diagnose problems when they occur. users expect all interface interactions to be smooth and all user interfaces to be responsive. animatio...
...enced need to fit into a single frame, since the screen isn't updated until it is complete. 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 handled in composition. transform opacity the css trigge...
Performance fundamentals - Web Performance
artup (this is called "front-loading"). then when the data is needed later, hopefully it's already available and the application doesn't have to wait. note: for much more information on improving startup performance, read optimizing startup performance. on the same note, notice that locally-cached, static resources can be loaded much faster than dynamic data fetched over high-latency, low-bandwidth mobile networks. network requests should never be on the critical path to early application startup. local caching/offline apps can be achieved via service workers. see making pwas work offline with service workers for a guide as to how. framerate the first important thing for high framerate is to choose the right tool. use html and css to implement content that's mostly static, scrolled, and i...
...ls with the android browser by running firefox and enabling remote debugging. in particular, making dozens or hundreds of network requests takes longer in mobile browsers. rendering large images and css gradients can also take longer. simply downloading large files can take longer, even over a fast network, because mobile hardware is sometimes too slow to take advantage of all the available bandwidth. for useful general tips on mobile web performance, have a look at maximiliano firtman's mobile web high performance talk. testcases and submitting bugs if the firefox and chrome developer tools don't help you find a problem, or if they seem to indicate that the web browser has caused the problem, try to provide a reduced test case that maximally isolates the problem. that often helps in diagno...
Responsive Navigation Patterns - Progressive web apps (PWAs)
us are common on larger screens, but are often not the optimal way to present information on small screens because of the reduced screen real estate. therefore, it is necessary to consider the presentation of content and ease of navigation for all screen sizes. note: html/css for the corresponding patterns will be available soon. pattern 1: top toggle menu in this pattern, as the screen width is reduced, the top navigation items rearrange until there is not enough space. at that point, some items move from the top navigation to a drop-down menu. in the smallest screen, all navigation items live in a toggle menu, and the user has to tap to expand the toggle menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. pros: one b...
...at that point, some items move from the top navigation to a drop-down menu. you could rank the item priorities to ensure the most important items always appear in the top navigation. in the smallest screen, several items stay on the bottom of the screen, and the rest of the items are hidden. the user can flip the menu open and select from the rest of the navigat...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical|inherit; ...
...ength>; animatable: yes stroke-linecap defines the shape to be used at the end of open subpaths when they are stroked. value: butt|round|square; animatable: yes stroke-linejoin defines the shape to be used at the corners of paths when they are stroked. value: arcs|bevel|miter|miter-clip|round; animatable: yes stroke-miterlimit defines a limit on the ratio of the miter length to the stroke-width used to draw a miter join. value: <number>; animatable: yes stroke-opacity defines the opacity of the stroke of a shape. value: <opacity-value>|<percentage>; animatable: yes stroke-width defines the width of the stroke to be applied to the shape. value: <length>|<percentage>; animatable: yes text-anchor defines the vertical alignment a string of text. value: start|middle|end|inherit; an...
class - SVG: Scalable Vector Graphics
Web › SVG › Attribute › class
a template for an ebnf grammar describing the <list-of-ts> syntax: list-of-ts ::= t | t, list-of-ts within the svg dom, values of a <list-of-ts> type are represented by an interface specific for the particular type t. for example, a <list-of-lengths> is represented in the svg dom using an svglengthlist or svganimatedlengthlist object. ...
... <![cdata[ rect.rectclass { stroke: #000066; fill: #00cc00; } circle.circleclass { stroke: #006600; fill: #cc0000; } ]]> </style> <rect class="rectclass" x="10" y="10" width="100" height="100"/> <circle class="circleclass" cx="40" cy="50" r="26"/> </svg> </body> </html> elements the following elements can use the class attribute: <a> <altglyph> <circle> <clippath> <defs> <desc> <ellipse> <feblend> <fecolormatrix> <fecomponenttransfer> <fecomposite> <feconvolvematrix> <fediffuselighting> <fedisplacementmap> <feflood> <fe...
clip-path - SVG: Scalable Vector Graphics
mage>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> html,body,svg { height:100% } <svg viewbox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <clippath id="myclip" clippathunits="objectboundingbox"> <circle cx=".5" cy=".5" r=".5" /> </clippath> <!-- top-left: apply a custom defined clipping path --> <rect x="1" y="1" width="8" height="8" stroke="green" clip-path="url(#myclip)" /> <!-- top-right: apply a css basic shape on a fill-box geometry. this is the same as having a custom clipping path with a clippathunits set to objectboundingbox --> <rect x="11" y="1" width="8" height="8" stroke="green" clip-path="circle() fill-box" /> <!-- bottom-left --> <rect x="1" y="11" width="8"...
...h="8" height="8" stroke="green" clip-path="circle() fill-box" /> <!-- bottom-left --> <rect x="1" y="11" width="8" height="8" stroke="green" clip-path="circle() stroke-box" /> <!-- bottom-right: apply a css basic shape on a view-box geometry. ...
clip-rule - SVG: Scalable Vector Graphics
resentation attribute, it also can be used as a property directly inside a css stylesheet usage context categories presentation attribute value nonzero | evenodd | inherit animatable yes normative document svg 1.1 (2nd edition) nonzero see description of fill-rule property. evenodd see description of fill-rule property. ...
...d see description of fill-rule property. example <svg width="100" viewbox="0 0 100 90" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- define star path --> <defs> <path d="m50,0 21,90 98,35 2,35 79,90z" id="star" /> </defs> <!-- left: evenodd --> <clippath id="emptystar"> <use xlink:href="#star" clip-rule="evenodd" /> </clippath> <rect clip-path="url(#emptystar)" width="50" height="90" fill="blue" /> <!-- right: nonzero --> <clippath id="filledstar"> <use xlink:href="#star" clip-rule="nonzero" /> </clippath> <rect clip-path="url(#filledstar)" width="50" height="90" x="50" fill="red" /> </svg> elements the following elements can use the clip-rule attribute, but only if they are inside a <clippath> element. graphical elements » browser com...
clipPathUnits - SVG: Scalable Vector Graphics
attribute: <clippath> html,body,svg { height:100% } <svg viewbox="0 0 100 100"> <clippath id="myclip1" clippathunits="userspaceonuse"> <circle cx="50" cy="50" r="35" /> </clippath> <clippath id="myclip2" clippathunits="objectboundingbox"> <circle cx=".5" cy=".5" r=".35" /> </clippath> <!-- some reference rect to materialized to clip path --> <rect id="r1" x="0" y="0" width="45" height="45" /> <rect id="r2" x="0" y="55" width="45" height="45" /> <rect id="r3" x="55" y="55" width="45" height="45" /> <rect id="r4" x="55" y="0" width="45" height="45" /> <!-- the first 3 rect are clipped with usespaceonuse units --> <use clip-path="url(#myclip1)" xlink:href="#r1" fill="red" /> <use clip-path="url(#myclip1)" xlink:href="#r2" fill="red" /> <use clip-path=...
...nates inside the <clippath> element refer to the user coordinate system as defined when the clipping path was created. objectboundingbox this value indicates that all coordinates inside the <clippath> element are relative to the bounding box of the element the clipping path is applied to. it means that the origin of the coordinate system is the top left corner of the object bounding box and the width and height of the object bounding box are considered to have a length of 1 unit value. specifications specification status comment css masking module level 1the definition of 'clippathunits' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'clippathunits' in that specification. r...
diffuseConstant - SVG: Scalable Vector Graphics
ting model. in svg, this can be any non-negative number. it’s used to determine the final rgb value of a given pixel. the brighter the lighting-color, the smaller this number should be. ...
...this attribute: <fediffuselighting> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" diffuseconstant="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" diffuseconstant="2"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes ...
dur - SVG: Scalable Vector Graphics
Web › SVG › Attribute › dur
the dur attribute indicates the simple duration of an animation. ...
...the value must be greater than 0 and ...
dx - SVG: Scalable Vector Graphics
Web › SVG › Attribute › dx
for <altglyph>, if it contains a single value, dx defines a shift along the x-axis for all alternate glyph. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the remain...
... for <tref>, if it contains a single value, dx defines a shift along the x-axis for all glyphs. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a val...
dy - SVG: Scalable Vector Graphics
Web › SVG › Attribute › dy
for <altglyph>, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remai...
... for <tref>, if it contains a single value, dy defines a shift along the y-axis for all glyphs. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a val...
exponent - SVG: Scalable Vector Graphics
<svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="1"/> <fefuncg type="gamma" exponent="1"/> <fefuncb type="gamma" exponent="1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="5"/> <fefuncg type="gamma" exponent="5"...
... type="gamma" exponent="1"/> <fefuncb type="gamma" exponent="1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="5"/> <fefuncg type="gamma" exponent="5"/> <fefuncb type="gamma" exponent="5"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes <number> if the type attribute of the compo...
flood-color - SVG: Scalable Vector Graphics
note: as a presentation attribute, flood-color can be used as a css property. ...
...it can be applied to any element but it has effect only on the following two elements: <feflood> and <fedropshadow> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="flood1"> <feflood flood-color="skyblue" x="0" y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood2); transform: translatex(220px);" /> </svg> usage notes value color initial value black animatable yes specifications specification status comment ...
flood-opacity - SVG: Scalable Vector Graphics
tion attribute, flood-opacity can be used as a css property. ...
... has effect only on the following two elements: <feflood> and <fedropshadow> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="flood1"> <feflood flood-color="seagreen" flood-opacity="1" x="0" y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" flood-opacity="0.3" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood2); transform: translatex(220px);" /> </svg> usage notes value <alpha-value> initial value 1 animatable yes <alpha-value> a number or percentage indicating the opacit...
fr - SVG: Scalable Vector Graphics
Web › SVG › Attribute › fr
<stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r="100" fill="url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value 0 animatable none example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-wid...
... id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sans-serif" font-size="10pt">(cx,cy)</text> </svg> specifications specification status comment ...
id - SVG: Scalable Vector Graphics
Web › SVG › Attribute › id
the id must be unique within the node tree, must not be an empty string, and must not contain any whitespace characters. ...
...the id must be unique within the node tree, must not be an empty string, and must not contain any whitespace characters. ...
intercept - SVG: Scalable Vector Graphics
<svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0"/> <fefuncg type="linear" intercept="0"/> <fefuncb type="linear" intercept="0"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0.3"/> <fefuncg type="linear" i...
...ntercept="0"/> <fefuncb type="linear" intercept="0"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0.3"/> <fefuncg type="linear" intercept="0.1"/> <fefuncb type="linear" intercept="0.8"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification stat...
k1 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › k1
the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
... = k1*i1*i2 + k2*i1 + k3*i2 + k4 only one element is using this attribute: <fecomposite> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="composite1" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="10" k2="0" k3="0" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#...
k2 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › k2
the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
... = k1*i1*i2 + k2*i1 + k3*i2 + k4 only one element is using this attribute: <fecomposite> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="composite1" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="1" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="10" k3="0" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#...
k3 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › k3
the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
... = k1*i1*i2 + k2*i1 + k3*i2 + k4 only one element is using this attribute: <fecomposite> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="composite1" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="1" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="10" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#...
k4 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › k4
the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
... = k1*i1*i2 + k2*i1 + k3*i2 + k4 only one element is using this attribute: <fecomposite> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="composite1" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="10" k2="0" k3="0" k4="0.3" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite1);" /> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url...
lighting-color - SVG: Scalable Vector Graphics
the lighting-color attribute defines the color of the light source for lighting filter primitives. ...
...ghting> and <fespecularlighting> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" lighting-color="white"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" lighting-color="blue"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes ...
limitingConeAngle - SVG: Scalable Vector Graphics
source and the point to which it is pointing at) and the spot light cone. so it defines a limiting cone which restricts the region where the light is projected. no light is projected outside the cone. ...
...fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <filter id="spotlight1" x="0" y="0" width="100%" height="100%"> <fediffuselighting diffuseconstant="2"> <fespotlight x="10" y="10" z="50" pointsatx="100" pointsaty="100" limitingconeangle="10" /> </fediffuselighting> </filter> <filter id="spotlight2" x="0" y="0" width="100%" height="100%"> <fediffuselighting diffuseconstant="2"> <fespotlight x="10" y="10" z="50" pointsatx="100" pointsaty="100" limitingconeangle="40" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#spotlight1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#spotlight2); transform: translatex(220px);" /> </s...
markerUnits - SVG: Scalable Vector Graphics
the markerunits attribute defines the coordinate system for the markerwidth and markerunits attributes and the contents of the <marker>. usage notes value userspaceonuse | strokewidth default value strokewidth animatable yes userspaceonuse this value specifies that the markerwidth and markerunits attributes and the contents of the <marker> element represent values in the current user coordinate system in place for the graphic object referencing the marker (i.e., the user coordinate system for the element referencing the <marker> element via a marker, marker-start, marker-mid, or marker-end property). ...
... userspaceonuse this value specifies that the markerwidth and markerunits attributes and the contents of the <marker> element represent values in the current user coordinate system in place for the graphic object referencing the marker (i.e., the user coordinate system for the element referencing the <marker> element via a marker, marker-start, marker-mid, or marker-end property). strokewidth this value specifies that the markerwidth and markerunits attributes and the contents of the <marker> element represent values in a coordinate system which has a single unit equal the size in user units of the current stroke width (see the stroke-width attribute) in place for the graphic object referencing the marker. specifications specification status comment sca...
maskContentUnits - SVG: Scalable Vector Graphics
the maskcontentunits attribute indicates which coordinate system to use for the contents of the <mask> element. ...
...is attribute: <mask> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <mask id="mymask1" maskcontentunits="userspaceonuse"> <rect fill="black" x="0" y="0" width="100%" height="100%" /> <circle fill="white" cx="50" cy="50" r="35" /> </mask> <mask id="mymask2" maskcontentunits="objectboundingbox"> <rect fill="black" x="0" y="0" width="100%" height="100%" /> <circle fill="white" cx=".5" cy=".5" r=".35" /> </mask> <!-- some reference rect to materialized the mask --> <rect id="r1" x="0" y="0" width="45" height="45" /> <rect id="r2" x="0" y="55" width="45" height="45" /> <rect id="r3" x="55" y="55" width="45" height="45" /> <rect id="r4" x="55" y="0" width="45" height="45" /> <!-- the first 3 rect are mas...
orient - SVG: Scalable Vector Graphics
Web › SVG › Attribute › orient
the orient attribute indicates how a marker is rotated when it is placed at its position on the shape. ...
...te: <marker> html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="arrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="auto-start-reverse"> <path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <marker id="dataarrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="-65deg"> <path d="m 0 0 l 10 5 l 0 10 z" fill="red" /> </marker> </defs> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="url(#dataarrow)" marker-mid="url(#dataarrow)"...
pointer-events - SVG: Scalable Vector Graphics
ement may be the target of a mouse event. note: as a presentation attribute pointer-events can be used as a css property. html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- the circle will always intercept the mouse event. ...
... underneath you have to click outside the circle --> <rect x="0" y="0" height="10" width="10" fill="black" /> <circle cx="5" cy="5" r="4" fill="white" pointer-events="visiblepoint" /> <!-- the circle below will never catch a mouse event. ...
pointsAtX - SVG: Scalable Vector Graphics
the pointsatx attribute represents the x location in the coordinate system established by attribute primitiveunits on the <filter> element of the point at which the light source is pointing. ...
...only one element is using this attribute: <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="lighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsatx="0" /> </fediffuselighting> </filter> <filter id="lighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsatx="400" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default valu...
pointsAtY - SVG: Scalable Vector Graphics
the pointsaty attribute represents the y location in the coordinate system established by attribute primitiveunits on the <filter> element of the point at which the light source is pointing. ...
...only one element is using this attribute: <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="lighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsaty="0" /> </fediffuselighting> </filter> <filter id="lighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsaty="400" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default valu...
pointsAtZ - SVG: Scalable Vector Graphics
ing, assuming that, in the initial local coordinate system, the positive z-axis comes out towards the person viewing the content and assuming that one unit along the z-axis equals one unit in x and y. ...
...ly one element is using this attribute: <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="lighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="100" y="100" z="50" pointsatz="0" /> </fediffuselighting> </filter> <filter id="lighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="100" y="100" z="50" pointsatz="80" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default val...
refX - SVG: Scalable Vector Graphics
Web › SVG › Attribute › refX
n on the shape. value <length-percentage> | <number> | left | center | right default value 0 animatable yes <length-percentage> lengths are interpreted as being in the coordinate system of the marker contents, after application of the viewbox and preserveaspectratio attributes. percentage values are interpreted as being a percentage of the viewbox width. <number> numbers are interpreted as being in the coordinate system of the marker contents, after application of the viewbox and preserveaspectratio attributes. left the reference point of the marker is placed at the left edge of the shape. center the reference point of the marker is placed at the horizontal center of the shape. right the reference point of the marker is placed at the ri...
...t specified on a <marker> element. value <length> | left | center | right default value none animatable yes <length-percentage> lengths are interpreted as being in the coordinate system of the marker contents, after application of the viewbox and preserveaspectratio attributes. percentage values are interpreted as being a percentage of the viewbox width. <number> numbers are interpreted as being in the coordinate system of the marker contents, after application of the viewbox and preserveaspectratio attributes. left the reference point of the marker is placed at the left edge of the shape. center the reference point of the marker is placed at the horizontal center of the shape. right the reference point of the marker is placed at the rig...
repeatCount - SVG: Scalable Vector Graphics
the repeatcount attribute indicates the number of times an animation will take place. ...
...it can include partial iterations expressed as fraction values. a frac...
repeatDur - SVG: Scalable Vector Graphics
the repeatdur attribute specifies the total duration for repeating an animation. ...
... indefinite this valu...
restart - SVG: Scalable Vector Graphics
Web › SVG › Attribute › restart
the restart attribute specifies whether or not an animation can restart. ...
...animatetransform>, and <set> html, body, svg { height: 100%; } a { fill: blue; text-decoration: underline; cursor: pointer; } <svg viewbox="0 0 220 200" xmlns="http://www.w3.org/2000/svg"> <rect y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="always" /> </rect> <rect x="120" y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="whennotactive"/> </rect> <a id="restart"><text y="20">restart animation</text></a> </svg> document.getelementbyid("restart").addeventlistener("click", evt => { document.queryselectorall("animate").foreach(element => { element.beginelement(); }); }); ...
rotate - SVG: Scalable Vector Graphics
Web › SVG › Attribute › rotate
o, the element turns to align its right-hand side in the current direction of motion. if the value is auto-reverse, it turns its left-hand side in the current direction of motion. setting rotate's value to a number specifies a constant rotation, in degrees, that does not change with the animation. the default value of 0 keeps the animated element in its original orientation. ...
...on, in degrees, that does not change with the animation. the default value of 0 keeps the animated element in its original orientation. ...
scale - SVG: Scalable Vector Graphics
Web › SVG › Attribute › scale
e factor to be used on a <fedisplacementmap> filter primitive. the amount is expressed in the coordinate system established by the primitiveunits attribute on the <filter> element. ...
... svg { height: 100%; } <svg viewbox="0 0 480 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter" x="-20%" y="-20%" width="140%" height="140%"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="5"/> </filter> <filter id="displacementfilter2" x="-20%" y="-20%" width="140%" height="140%"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50"/> </filter> <circle cx="100" cy="100" r="80" style="filter: url(#displacementfilter);""/> <circle cx="100" cy="100" r="80" style="filter: url(#displacementfilter2); transform: translatex(240px);""/> </svg> ...
specularConstant - SVG: Scalable Vector Graphics
larconstant attribute controls the ratio of reflection of the specular lighting. it represents the ks value in the phong lighting model. the bigger the value the stronger the reflection. ...
...ribute: <fespecularlighting> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="specularlighting1" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularconstant="1.2"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <filter id="specularlighting2" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularconstant="0.8"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#specularlighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#specularlighting2); transform: translatex(220px);" /> </svg> us...
specularExponent - SVG: Scalable Vector Graphics
the specularexponent attribute controls the focus for the light source. the bigger the value the brighter the light. ...
...cularlighting> and <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularexponent="1"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularexponent="5"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> fespec...
surfaceScale - SVG: Scalable Vector Graphics
the surfacescale attribute represents the height of the surface for a light filter primitive. ...
...fuselighting> and <fespecularlighting> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" surfacescale="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" surfacescale="15"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> fespecularlightin...
tableValues - SVG: Scalable Vector Graphics
<svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="0 1"/> <fefuncg type="table" tablevalues="0 1"/> <fefuncb type="table" tablevalues="0 1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="1 0"/> <fefuncg type=...
...="0 1"/> <fefuncb type="table" tablevalues="0 1"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="1 0"/> <fefuncg type="table" tablevalues="1 0"/> <fefuncb type="table" tablevalues="1 0"/> </fecomponenttransfer> </filter> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <list-of-numbers> default value empty list resulting in identity transfer animatable yes ...
visibility - SVG: Scalable Vector Graphics
can be applied to any element but it has effect only on the following nineteen elements: <a>, <altglyph>, <audio>, <canvas>, <circle>, <ellipse>, <foreignobject>, <iframe>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, <tspan>, <video> html, body, svg { height: 100%; } <svg viewbox="0 0 220 120" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="200" height="100" stroke="black" stroke-width="5" fill="transparent" /> <g stroke="seagreen" stroke-width="5" fill="skyblue"> <rect x="20" y="20" width="80" height="80" visibility="visible" /> <rect x="120" y="20" width="80" height="80" visibility="hidden"/> </g> </svg> usage notes value visible | hidden | collapse default value visible ani...
...ents depending on the pointer-events attribute, may receive focus depending on the tabindex attribute, contributes to bounding box calculations and clipping paths, and does affect text layout. collapse this value is equal to hidden. example the following example toggles the css visibility of the svg image path. ...
xChannelSelector - SVG: Scalable Vector Graphics
attribute indicates which color channel from in2 to use to displace the pixels in in along the x-axis. ...
... id="displacementfilter"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" xchannelselector="r"/> </filter> <filter id="displacementfilter2"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" xchannelselector="b"/> </filter> <text x="10" y="60" font-size="50" filter="url(#displacementfilter)">some displaced text</text> <text x="10" y="120" font-size="50" filter="url(#displacementfilter2)">some displaced text</text> </svg> usage notes value r | ...
y1 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › y1
svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the top left corner of the bounding box of the shape it is applied to. ...
... candidate recommendation definition for <line> scalable vector graphics (svg) 2the definition of 'y1' in that specification. ...
y2 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › y2
<svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector end at the top right corner of the bounding box of the shape it is applied to. ...
... candidate recommendation definition for <line> scalable vector graphics (svg) 2the definition of 'y2' in that specification. ...
yChannelSelector - SVG: Scalable Vector Graphics
attribute indicates which color channel from in2 to use to displace the pixels in in along the y-axis. ...
... id="displacementfilter"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" ychannelselector="r"/> </filter> <filter id="displacementfilter2"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" ychannelselector="b"/> </filter> <text x="10" y="60" font-size="50" filter="url(#displacementfilter)">some displaced text</text> <text x="10" y="120" font-size="50" filter="url(#displacementfilter2)">some displaced text</text> </svg> usage notes value r | ...
z - SVG: Scalable Vector Graphics
Web › SVG › Attribute › z
at, in the initial coordinate system, the positive z-axis comes out towards the person viewing the content and assuming that one unit along the z-axis equals one unit in x and y. ...
... using this attribute: <fepointlight> and <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fepointlight x="60" y="60" z="10" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fepointlight x="60" y="60" z="50" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> fepointlight for <fepointlight>, z...
zoomAndPan - SVG: Scalable Vector Graphics
n on the outermost svg document fragment. panning represents a translation (i.e., a shift) transformation on an svg document fragment in response to a user interface action. ...
... recommendation initial defi...
<feConvolveMatrix> - SVG: Scalable Vector Graphics
the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in order kernelmatrix divisor bias targetx targety edgemode kernelunitlength preservealpha dom interface this element implements the svgfeconvolvematrixelement interface. ...
... working draft scalable vector graphics (svg) 1.1 (second edition)the definition of '<feconvolvematrix>' in that specification. ...
<feFlood> - SVG: Scalable Vector Graphics
Web › SVG › Element › feFlood
contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes flood-color flood-opacity dom interface this element implements the svgfefloodelement interface. ...
... core attributes presentation attributes filter primitive attributes class style specific attributes flood-color flood-opacity dom interface this element implements the svgfefloodelement interface. example html content <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"> <defs> <filter id="floodfilter" filterunits="userspaceonuse"> <feflood x="50" y="50" width="100" height="100" flood-color="green" flood-opacity="0.5"/> </filter> </defs> <use style="filter: url(#floodfilter);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feflood>' in that specification. working draft removed <icccolor> value from flood-color property and defined tha...
<feGaussianBlur> - SVG: Scalable Vector Graphics
riesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in stddeviation edgemode dom interface this element implements the svgfegaussianblurelement interface. ...
...="230" height="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="blurme"> <fegaussianblur in="sourcegraphic" stddeviation="5" /> </filter> <circle cx="60" cy="60" r="50" fill="green" /> <circle cx="170" cy="60" r="50" fill="green" filter="url(#blurme)" /> </svg> result screenshotlive sample drop shadow example svg <svg width="120" height="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="dropshadow"> <fegaussianblur in="sourcealpha" stddeviation="3" /> <feoffset dx="2" dy="4" /> <femerge> <femergenode /> <femergenode in="sourcegraphic" /> </femerge> </filter> <circle cx="60" cy="60" r="50" fill="green" filter="url(#drop...
<feMorphology> - SVG: Scalable Vector Graphics
ed contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in operator radius dom interface this element implements the svgfemorphologyelement interface. ...
...operator="dilate" radius="2"/> </filter> <text y="1em">normal text</text> <text id="thin" y="2em">thinned text</text> <text id="thick" y="3em">fattened text</text> </svg> css text { font-family: arial, helvetica, sans-serif; font-size: 3em; } #thin { filter: url(#erode); } #thick { filter: url(#dilate); } filtering html content svg <svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"> <filter id="erode"> <femorphology operator="erode" radius="1"/> </filter> <filter id="dilate"> <femorphology operator="dilate" radius="2"/> </filter> </svg> <p>normal text</p> <p id="thin">thinned text</p> <p id="thick">fattened text</p> css p { margin: 0; font-family: arial, helvetica, sans-serif; font-size: 3em; } #thin { filter: url(#erode); } #thic...
<fePointLight> - SVG: Scalable Vector Graphics
used within a lighting filter primitive: <fediffuselighting> or <fespecularlighting>. usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes x y z dom interface this element implements the svgfepointlightelement interface. ...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<fepointlight>' in that specification. recommendation ...
<feSpotLight> - SVG: Scalable Vector Graphics
ting>. usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes x y z pointsatx pointsaty pointsatz specularexponent limitingconeangle dom interface this element implements the svgfespotlightelement interface. ...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of '<fespotlight>' in that specification. recommendation i...
<filter> - SVG: Scalable Vector Graphics
Web › SVG › Element › filter
tribute on svg elements, or the filter css property for svg/html elements. ...
... in any order:descriptive elementsfilter primitive elements<animate>, <set> attributes global attributes core attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes x y width height filterres filterunits primitiveunits xlink:href dom interface this element implements the svgfilterelement interface. ...
<g> - SVG: Scalable Vector Graphics
Web › SVG › Element › g
formations applied to the <g> element are performed on its child elements, and its attributes are inherited by its children. it can also group multiple elements to be referenced later with the <use> element. ...
...vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<solidcolor> - SVG: Scalable Vector Graphics
-color="gold" solid-opacity="0.8"/> <!-- lineargradient with a single color stop is a less elegant way to achieve the same effect, but it works in current browsers. ...
... <stop offset="0" stop-color="green" /> </lineargradient> </defs> <text x="10" y="20">circles colored with solidcolor</text> <circle cx="150" cy="65" r="35" stroke-width="2" stroke="url(#mycolor)" fill="white"/> <circle cx="50" cy="65" r="35" fill="url(#mycolor)"/> <text x="10" y="120">circles colored with lineargradient</text> <circle cx="150" cy="165" r="35" stroke-width="2" stroke="url(#mygradient)" fill="white"/> <circle cx="50" cy="165" r="35" fill="url(#mygradient)"/> </svg> result ...
<text> - SVG: Scalable Vector Graphics
Web › SVG › Element › text
ult value: none; animatable: yes dy shifts the text position vertically from a previous text element. value type: <length>|<percentage> ; default value: none; animatable: yes rotate rotates orientation of each individual glyph. can rotate glyphs individually. value type: <list-of-number> ; default value: none; animatable: yes lengthadjust how 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. value type: <length>|<percentage> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style, font-family, font-size, font-size-adjust, font-...
...obal event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keysh...
<textPath> - SVG: Scalable Vector Graphics
Web › SVG › Element › textPath
text should be rendered. value type: left|right ; default value: left; animatable: yes spacing how space between glyphs should be handled. value type: auto|exact ; default value: exact; animatable: yes startoffset how far the beginning of the text should be offset from the beginning of the path. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes textlength the width of the space into which the text will render. value type: <length>|<percentage>|<number> ; default value: auto; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation...
...vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<tspan> - SVG: Scalable Vector Graphics
Web › SVG › Element › tspan
ult value: none; animatable: yes dy shifts the text position vertically from a previous text element. value type: <length>|<percentage> ; default value: none; animatable: yes rotate rotates orientation of each individual glyph. can rotate glyphs individually. value type: <list-of-number> ; default value: none; animatable: yes lengthadjust how 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. value type: <length>|<percentage> ; default value: none; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably...
...obal event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keysh...
Getting started - SVG: Scalable Vector Graphics
then open the file in firefox. it will render as shown in the following screenshot. ...
...then open the file in firefox. it will render as shown in the following screenshot. ...
Other content in SVG - SVG: Scalable Vector Graphics
mbed arbitrary raster (and vector) images. the specification requests applications to support at least png, jpeg and svg format files. the embedded picture becomes a normal svg element. this means, that you can use clips, masks, filters, rotations and all other tools of svg on the content: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"> <image x="90" y="-65" width="128" height="146" transform="rotate(45)" xlink:href="https://developer.mozilla.org/static/img/favicon144.png"/> </svg> screenshotlive sample embedding arbitrary xml since svg is an xml application, you can of course always embed arbitrary xml anywhere in an svg document. but then you have no means to define how the surrounding svg should...
...anywhere in an svg document. but then you have no means to define how the surrounding svg should react on the content. actually, in a conforming viewer it will react in no way at all, the data will simply be omitted. therefore the specification adds the <foreignobject> element to svg. its sole purpose is to be a container for other markup and a carrier for svg styling attributes (most prominently width and height to define the space the object will take). the foreignobject element is a good way to embed xhtml in svg. if you have longer texts, the html layout is more suitable and comfortable than the svg text element. another often cited use case is the embedding of formulas with mathml. for scientific applications of svg this is a very good way to join both worlds. note: please keep in mind, ...
Positions - SVG: Scalable Vector Graphics
positive x direction being to the right, and the positive y direction being to the bottom. note that this is slightly different than the way you're taught to graph as a kid (y axis is flipped). however, this is the same way elements in html are positioned (by default, ltr documents are considered not the rtl documents which position x from right-to-left). example: the element <rect x="0" y="0" width="100" height="100" /> defines a rectangle from the upper left corner, that spans from there 100px to the right and to the bottom. what are "pixels"? in the most basic case one pixel in an svg document maps to one pixel on the output device (a.k.a. the screen). but svg wouldn't have the "scalable" in its name, if there weren't several possibilities to change this behaviour. much like absolute ...
...r. much like absolute and relative font sizes in css, svg defines absolute units (ones with a dimensional identifier like "pt" or "cm") and so-called user units, that lack that identifier and are plain numbers. without further specification, one user unit equals one screen unit. to explicitly change this behaviour, there are several possibilities in svg. we start with the svg root element: <svg width="100" height="100"> the above element defines a simple svg canvas with 100x100px. one user unit equals one screen unit. <svg width="200" height="200" viewbox="0 0 100 100"> the whole svg canvas here is 200px by 200px in size. however, the viewbox attribute defines the portion of that canvas to display. these 200x200 pixels display an area that starts at user unit (0,0) and spans 100x100 user...
SVG image element - SVG: Scalable Vector Graphics
« previousnext » the svg <image> element allows for raster images to be rendered within an svg object. in this basic example, a .jpg image referenced by an href attribute will be rendered inside an svg object: <?xml version="1.0" standalone="no"?> <!doctype svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd"> <svg width="5cm" height="4cm" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="firefox.jpg" x="0" y="0" height="50px" width="50px"/> </svg> there are some important things to take note of (referenced from the w3 specs): if you do not set the x or y attributes, they will be set to 0. if you do not set the height or width attributes, they will be set to 0. ...
..."http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="firefox.jpg" x="0" y="0" height="50px" width="50px"/> </svg> there are some important things to take note of (referenced from the w3 specs): if you do not set the x or y attributes, they will be set to 0. if you do not set the height or width attributes, they will be set to 0. having a height or width attribute of 0 will disable rendering of the image. « previousnext » ...
Texts - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Texts
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" 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...
... doesn't meet the one provided here. textpath this element fetches via its xlink:href attribute an arbitrary path and aligns the characters, that it encircles, along this path: <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> 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> « p...
xml:base - XML: Extensible Markup Language
Web › XML › xml:base
t 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. <html> <head> <base href="https://mydomain.com"> <style> .link { stroke: #999; stroke-opacity: .6; } marker#arrow { fill: black; } </style> </head> <body> <svg width="100%" height="100%" xml:base=""> <defs> <marker id="arrow" viewbox="0 -5 10 10" refx="0" refy="0" markerwidth="20" markerheight="20" orient="auto"> <path d="m0,-5l10,0l0,5"></path> </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. <svg xml:...
...wbox="0 -5 10 10" refx="0" refy="0" markerwidth="20" markerheight="20" orient="auto"> <path d="m0,-5l10,0l0,5"></path> </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. ...
Reddit Example - Archive of obsolete content
k's target url. the content script then needs to send the url to the add-on script. ...
Porting the Library Detector - Archive of obsolete content
widgetcontent += buildiconhtml(icons[library.name], library.name + "&lt;br&gt;version: " + library.version); }); widgetcontent += htmlcontentpostamble; return widgetcontent; } function updatewidgetview(tab) { var widgetview = widget.getview(tab.window); if (!tab.libraries) { tab.libraries = []; } widgetview.content = buildwidgetviewcontent(tab.libraries); widgetview.width = tab.libraries.length * icon_width; } main.js will use the tabs module to update the widget's content when necessary (for example, when the user switches between tabs): tabs.on('activate', function(tab) { updatewidgetview(tab); }); tabs.on('ready', function(tab) { tab.libraries = []; }); showing the library detail the xul library detector displayed the detailed information about each ...
ui/frame - Archive of obsolete content
can create a frame hosting it and add the frame to a toolbar like this: var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var frame = new frame({ url: "./city-info.html" }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); the toolbar is positioned between the address bar and the content window. it occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (hidpi) display. this toolbar might look something like: scripting frames to add scripts to frames, include them directly from the frame's html content, as with a normal web page: <script type="text/javascript" src="frame.js"></script> as usual, the path to the script is relativ...
ui/toolbar - Archive of obsolete content
menu. it must be unique. optional options: name type items array adding buttons to toolbars is only supported from firefox 30 onwards. in firefox 29, you can only add frames. an array of items to appear in the toolbar. each item in items must be an action button, a toggle button, or a frame instance. buttons each take up a fixed width. if more than one frame is supplied here, the frames each occupy an equal vertical strip of the toolbar. hidden boolean boolean indicating whether the frame should be hidden initially or not. defaults to false. onattach function assign a listener to the attach event. ondetach function assign a listener to the detach event. ...
Displaying annotations - Archive of obsolete content
his in data/annotation as annotation.html. annotation panel content script the annotation panel has a minimal content script that sets the text: self.on('message', function(message) { $('#annotation').text(message); }); save this in data/annotation as annotation.js. updating main.js finally, update main.js with the code to construct the annotation panel: var annotation = panels.panel({ width: 200, height: 180, contenturl: data.url('annotation/annotation.html'), contentscriptfile: [data.url('jquery-1.4.2.min.js'), data.url('annotation/annotation.js')], onshow: function() { this.postmessage(this.content); } }); execute cfx run one last time. activate the annotator and enter an annotation. you should see a yellow border around the item you annotated:...
Localization - Archive of obsolete content
any previously existing content is just replaced. the string is inserted as...
Dialogs and Prompts - Archive of obsolete content
if (params.out) { // user clicked ok. process changed arguments; e.g. write them to disk or whatever } else { // user clicked cancel. typically, nothing is done here. ...
Forms related code snippets - Archive of obsolete content
round-color: #cccccc; cursor: default; font-family: verdana; font-size: 12px; } table.zdp-calendar th { border: 1px solid #666666; font-weight: bold; background-color: #ff6666; } table.zdp-calendar td { border: 1px solid #666666; text-align: center; } table.zdp-calendar caption { background-color: #333333; padding: 2px; } span.zdp-current-month { display: inline-block; width: auto; height: 16px; padding: 0 2px; line-height: 16px; margin: 0 auto; background-color: #999999; border-radius: 5px; } span.zdp-increase-month, span.zdp-increase-year, span.zdp-decrease-month, span.zdp-decrease-year { display: block; padding: 0 2px; height: 16px; font-weight: bold; background-color: #999999; border-radius: 5px; cursor: pointer; } span.zdp-decrease-mo...
Miscellaneous - Archive of obsolete content
: services.startup.quit(services.startup.eforcequit|services.startup.erestart); mouse and keyboard detecting mouse wheel events when scrolling the mouse wheel on an element, the dommousescroll event fires. event.detail contains the number of lines to scroll. this event is mozilla-only; other browsers may support window.onmousewheel. <div id="scrollarea" style="overflow: scroll; height: 6em; width: 10em;"> this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. </div> <script type="text/jav...
SVG General - Archive of obsolete content
ns_map[attribute], name, value); else elem.setattribute(name, value); } return elem; } attributes are packed in a literal object and the helper script unpacks them and adds them to the element. here are some examples of using it: var circle = makesvg("circle", {id: "circle1", cx: "60", cy: "60", r: "50"}); var img = makesvg("image", {id: "img1", x: "110", y: "110", width: "100", height: "100", svghref: "bubbles.png"}); var text = makesvg("text", {id: "text1", x: "60", y: "60"}); text.textcontent = "hello world"; ...
Scrollbar - Archive of obsolete content
.css on osx. ...
Extension Etiquette - Archive of obsolete content
elf, for future use by the caller. when available, these methods should always be used to prevent conflicts with third-party code. names and metadata naming be creative! don't be redundant and include "extension," "mozilla/firefox/thunderbird," or the version number in the name. be original! descriptions use something that is descriptive, but that would fit in the default add-on manager width. the mozilla extensions (inspector/reporter/talkback) believe starting with a verb is the best way. for example, "does an action in the browser." documentation assume that the vast majority of your users don't have inner working knowledge of mozilla. make sure your extension's homepage states the "obvious," including the purpose of your extension. users also appreciate when your extension is sh...
Adding sidebars - Archive of obsolete content
ery time the sidebar is opened, and unload every time it's closed, so you can use those for initialization and clean up . another, more important difference to take into account is that users can resize the sidebar to their liking, and in most cases, the sidebar is going to be fairly narrow. you should design the content of your sidebar carefully, so that it is usable and appealing regardless of width. there are ways to limit the size boundaries of your sidebar with css or even disable resizing altogether, but none of those are good practices. forcing sidebars to have a fixed size can cause accessibility and usability problems. you can still have plenty of content available in your sidebar, you just need to organize it in a way that doesn't take too much space. for this purpose we'll also loo...
Search Extension Tutorial (Draft) - Archive of obsolete content
all.rdf file. as above, install and uninstall code is only provided for restartless add-ons but can be adapted for traditional add-ons. search.xml <?xml version="1.0" encoding="utf-8"?> <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>example engine</shortname> <description>example search engine</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16" type="image/png">data:image/png;base64, ... </image> <url type="application/x-suggestions+json" template="https://api.example.com/suggestions"> <param name="q" value="{searchterms}"/> </url> <url type="text/html" method="get" template="https://www.example.com/search"> <param name="q" value="{searchterms}"/> <param name="source" valu...
XML data - Archive of obsolete content
0,000</area> <depth>4,000</depth> </ocean> <ocean> <name>indian</name> <area>75,000</area> <depth>3,900</depth> </ocean> <ocean> <name>southern</name> <area>20,000</area> <depth>4,500</depth> </ocean> </planet> make a new css file, style9.css. ...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
iled pluginhostctrl.dll and wish to install it on a machine, you must register it either through an install script or manually: regsvr32 pluginhostctrl.dll you must have administrator privileges to install a new control on operating systems such as windows nt, 2000 & xp. usage insert some html like this into your content: <object classid="clsid:dbb2de32-61f1-4f7f-beb8-a37f5bc24ee2" width="500" height="300"> <param name="type" value="video/quicktime"/> <param name="src" value="http://www.foobar.com/some_movie.mov"/> <!-- custom arguments --> <param name="loop" value="true"/> </object> the classid attribute tells ie to create an instance of the plug-in hosting control, the width and height specify the dimensions in pixels. you may optionally specify a c...
In-Depth - Archive of obsolete content
url("chrome://global/content/bindings/toolbar.xml#toolbar-primary"); to -moz-binding: url("chrome://communicator/skin/toolbar/toolbarbindings.xml#toolbar-primary"); now every toolbar has a spot for an image on the right hand side and we can start adding images, but first we need to make sure we can see the images that we add. also in the communicator.css add this code: .toolbar-primary-icon { width: 100px; background-repeat: no-repeat; background-position: top; } open up \classic\skin\classic\navigator\navigator.css and scroll down to the bottom. to style that image, we first need to get a handle to the toolbar, then the box inside of it, and then to the image that we added with the xml. by hunting around with the dom inspector and looking at the navigation toolbar you can find this in...
Style System Overview - Archive of obsolete content
ur chrome), and require large numbers of allocations to construct. detail: !important declarations cause an extra rule object cssimportantrule to be created since they are in a separate part of the cascade other nsistylerule implementations nshtmlmappedattributes represents stylistic html attributes turned into a style rule (one instance per unique set of attributes) bodyrule handles marginwidth/marginheight mixes on body and on frame. various rules in nshtmlstylesheet.cpp do other things with presentational color-related attributes and with tables. content nodes (instead of stylesheets) also hold onto cssstyleruleimpl objects that represent their style attributes. the cascade stylesetimpl manages the different origins of rules in the cascade (ua, user, author) style set gets the...
Jetpack Snippets - Archive of obsolete content
var firebug=document.createelement('script'); firebug.setattribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'); document.body.appendchild(firebug); (function(){if(window.firebug.version){firebug.init();}else{settimeout(arguments.callee);}})();void(firebug); ]]></script> </body></html>, width: 800, //wide enough to use firebug onselect: function(slide) { slide.slide(800, true); }}); calling into a slidebar from the global jetpack scope jetpack.slidebar.append({ onready: function (slide) { // call out to a global function, passing the slidebar object exinitslidebar(slide); }, ...});function exinitslidebar(aslidebar) { // this variable will now be global ...
Clipboard Test - Archive of obsolete content
name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param:not(:last-child):after{content: ","; padding-right: .5em; } .method>.name>.param>.name:after{content: " as "; font-weight: normal; } .method>.params{display: block; color:#555;} .method>.params>.param{display: block; margin-bottom:5px;} .method>.params>.param>.name{font-weight:bold; margin-right:.5em; min-width:80px; display:inline-block;} .method>.params>.param>.description{display:inline-block; width:300px; vertical-align:top;margin-right:30px} .method>.params>.param>.type{display:inline-block; width:100px; vertical-align:top;font-weight:bold;} .method>.params>.param>.type:before{content: "type "; color: #888; font-weight:normal;} .method>.params>.param>.default{display:inline-block; width:100px; vert...
statusBar - Archive of obsolete content
atusbar contains functions to add and control the statusbar of the browser. you can find the complete sourcecode in the status-bar-panel.js file in your jetpack repository. namespace: jetpack.statusbar methods copybackground embediframe append the append methods adds a new item to the statusbar. many of the options are optional. syntax jetpack.statusbar.append(options); possible options are: url width (string/length) the width of the panel-item html (string) the html code which will be used inside the item onload (event) this event fires when the item was appended. its acutally not implemented in the current version. onready (event) occurs when the item was loaded onunload (event) triggers when the item was removed. example jetpack.statusbar.append({ html: 'hello <i>world</i>!', onready...
HostWindow - Archive of obsolete content
creenshot below). prism can be configured to show or hide several of the ui components. location bar - a readonly textbox that contains the currently displayed url. when not displayed the entire location bar section is hidden. sidebar - section of window area used to display ancillary web content, including web applications. when the sidebar is displayed, the splitter can be used to change the width or quickly collapse it. the splitter itself cannot be hidden as it is the only ui to show a collapsed sidebar. when not displayed the entire sidebar area, including the splitter are hidden. note: the sidebar is currently not supported. we are considering whether to support a sidebar in future versions of prism and welcome input on this subject. status - area of the statusbar that displays the loa...
Table Cellmap - Border Collapse - Archive of obsolete content
nformation storage each cellmap entry stores for tables in the border collapse mode additional information about its top and left edge and its top left corner. as one can see from the following illustration this is enough to cover a whole table. only the right most edge and the bottom most edge of a table need to be stored in a different place. border for the top and left border we store the width and the owner of the border. the width is stored in pixel coordinates. the following owners are possible: etableowner = 0, ecolgroupowner = 1, eajacolgroupowner = 2, // col group to the left ecolowner = 3, eajacolowner = 4, // col to the left erowgroupowner = 5, eajarowgroupowner = 6, // row group above erowowner = 7, eajarowowner =...
Tamarin Acceptance Test Template - Archive of obsolete content
this is the test template for tamarin acceptance tests (placed in test/acceptance/feature_name): /* -*- mode: js; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */ /* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */ /* ***** begin license block ***** * version: mpl 1.1/gpl 2.0/lgpl 2.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under...
The new nsString class implementation (1999) - Archive of obsolete content
e current implementation are: class based -- making it unsuitable for cross-dll usage due to fragility little intrinsic i18n support few efficiencies, notably a lack of support for narrow (1-byte) character strings no support for external memory management policy lack of xpcom interface notable features of the new nsstrimpl implementation are: intrinsic support for 1 and 2 byte character widths provides automatic conversion between strings with different character sizes inviolate base structure eliminates class fragility problem; safe across dll boundaries offers c-style function api to manipulate nsstrimpl offers simple memory allocator api for specialized memory policy shares binary format with bstring coming soon: a new xpcom (nsistring) interface non-templatized; this is a r...
Creating XPI Installer Modules - Archive of obsolete content
first things you will have to create is the actual software you wish to make redistributable. the barley package ui is a single xul window with an accompanying image: <?xml version="1.0"?> <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?> <window title="barley window" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul" width="175" height="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 ...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
to install mozilla are lightweight stubs targeted to be around 200 kb disk footprint. users download the stub installers, choose which packages to install, choose the destination directory for the installation, and select from various other options. subsequently, when users click the "install" button the install wizard downloads and installs only the selected software packages. this saves low-bandwidth users considerable time since they do not need to download software packages they may not be interested in. (the stub installer accomplishes this by downloading the xpinstall engine along with the selected software packages. it then proceeds to extract the xpinstall engine and feed it the downloaded software packages to install.) the stub installer code includes: the logic to display the insta...
align - Archive of obsolete content
this value applies to horizontally oriented boxes only. it causes the child elements to be aligned so that their text labels are lined up. stretch this is the default value. the child elements are stretched to fit the size of the box. for a horizontal box, the children are stretched to be the height of the box. for a vertical box, the children are stretched to be the width of the box. if the size of the box changes, the children stretch to fit. use the flex attribute to create elements that stretch in the opposite direction. left the elements are aligned on their left edges. center the elements are centered horizontally. right the elements are aligned on their right edge...
chromemargin - Archive of obsolete content
if this value turns out to be less than 0, 0 is used. ...
collapse - Archive of obsolete content
etermines which side of the splitter is collapsed when its grippy is clicked. if this attribute is not specified, the splitter will not cause a collapse. you should put a grippy element inside the splitter when it is used for collapsing. none no collapsing occurs. before when the grippy is clicked, the element immediately before the splitter in the same parent is collapsed so that its width or height is 0. after when the grippy is clicked, the element immediately after the splitter in the same parent is collapsed so that its width or height is 0. both either the element immediately before the splitter, or the element immediately after the splitter can be collapsed, if the size of that element would fall below the minimum size due to the position of the splitter. ...
equalsize - Archive of obsolete content
« xul reference home equalsize type: one of the values below this attribute can be used to make the children of the element equal in size. always for a horizontally oriented element, this will make all of its children have the width of the widest child. for a vertically oriented element, this will make its children all have the height of the tallest child. never all of the children are displayed at the size required by the content or as specified by the width and height attributes or the css width and height properties. ...
panel.flip - Archive of obsolete content
when the panel doesn't have room. a sliding panel will have the start (or end) position extended such that the panel can be the requested size, meaning the arrow will no longer be at the start (or end) of the panel - i.e., the arrow will appear to have been slid along the panel to ensure the arrow is still pointing at the anchor. in this image, the panel has flip="slide" and has a width which is greater than the distance from the anchor to the right of the screen (or window), so the panel extends past the left of the anchor, and the arrow slides towards the middle of the panel such that it is still aligned with the anchor. without flip="slide", the panel would have had its width truncated and the panel would not extend to the left of the anchor. ...
src - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › src
« xul reference home src type: uri the uri of the content to appear in the element. ...
Building accessible custom components in XUL - Archive of obsolete content
ble, you need to use a mozilla-specific css property, -moz-user-focus: normal. <code> grid.spreadsheet { border: thin solid; -moz-user-focus: normal; } </code> in html documents, firefox draws a focus rectangle around the currently focused element. in xul, we will need to handle this ourselves, again with css rules. you might initially think of using the css border property, but that will add width and height to the focused cell. a better approach is to use the css outline property, which does maintains the element's dimensions. (technically, it draws the border inside the element instead of outside.) <code> grid.spreadsheet description:focus, grid.spreadsheet label:focus { outline: 1px dotted black; outline-offset: -2px; } </code> however, neither of those are our biggest problem. we w...
findbar - Archive of obsolete content
tring the access key for the "highlight" toolbar button in the findbar. matchcaseaccesskey type: string the access key for the "match case" checkbox in the findbar. 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 browser type: browser element lets you set and get the browser in which the findbar is located. findmode type: integer read only. the find mode in use. possible values are: find_normal (0): normal find find_typea...
MoveResize - Archive of obsolete content
the label. you can see this effect in a xul application by moving a window near the bottom of the screen and clicking a menu or button that has a menu. ...
Sorting and filtering a custom tree view - Archive of obsolete content
ccesskey="f" control="filter">filter</label> <textbox id="filter" oninput="inputfilter(event)" flex="1"/> <button id="clearfilter" oncommand="clearfilter()" label="clear" accesskey="c" disabled="true"/> </hbox> <tree id="tree" flex="1" persist="sortdirection sortresource" sortdirection="ascending" sortresource="description"> <treecols> <treecol id="name" label="name" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator" sortdirection="ascending"/> <splitter class="tree-splitter"/> <treecol id="description" label="description" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator"/> <splitter class="tree-splitter"/> <treecol id="weapon" label="weapon" flex="1" persist="width ordinal hidden" onclick...
tree-splitter - Archive of obsolete content
...
Adding Style Sheets - Archive of obsolete content
ible initially. you could still put this in a separate style sheet if you really wanted to. a class was added to the spacers so that they can be referred to. a style sheet also needs to be created. create a file findfile.css in the same directory as the xul file. (it would normally be put into a separate skin). in this file, we'll add the style declarations, as shown below: #find-text { min-width: 15em; } #progmeter { margin: 4px; } .springspace { width: 10px; } .titlespace { height: 10px; } notice how these styles are equivalent to the styles we had before. however, it is much easier for someone to change the look of the find files dialog now because they could add or modify the style declarations by either modifying the file or by changing the skin. if the user changes the i...
Localization - Archive of obsolete content
td file for all of its text strings. the entire xul file is shown below with the changes shown in red. ...
Modifying a XUL Interface - Archive of obsolete content
ibute() function and append it to the xul document using the appendchild() function. for example, the following will add a button to a xul window: example 1 : source view <script> function addbutton(){ var abox = document.getelementbyid("abox"); var button = document.createelement("button"); button.setattribute("label","a new button"); abox.appendchild(button); } </script> <box id="abox" width="200"> <button label="add" oncommand="addbutton();"/> </box> this example has two parts a box container element in xul. notice that this is not the same as a vbox or an hbox. (this is discussed more in the box model pages.) the box element has two attributes "id" and "width". the box element contains a button element. the bu...
More Event Handlers - Archive of obsolete content
ive to the top left corner of the screen. the second set, clientx and clienty, are relative to the top left corner of the document. here is an example which displays the current mouse coordinates: example 4 : source view <script> function updatemousecoordinates(e){ var text = "x:" + e.clientx + " y:" + e.clienty; document.getelementbyid("xy").value = text; } </script> <label id="xy"/> <hbox width="400" height="400" onmousemove="updatemousecoordinates(event);"/> in this example, the size of the box has been set explicitly so the effect is easier to see. the event handler gets the clientx and clienty properties and creates a string from them. this string is then assigned to the value property of the label. note that the event argument must be passed to the updatemousecoordinates function. ...
RDF Datasources - Archive of obsolete content
match specific types of content. the attributes on the rule element will match if they match the attributes on an rdf description element. you can also create rdf files that are hierarchical. using rdf file example the following is an example of how an rdf file can be used as a datasource. ...
Stacks and Decks - Archive of obsolete content
of each other. the first child of the stack is drawn underneath, the second child is drawn next, followed by the third and so on. any number of elements may be stacked up in a stack. the orient property has little meaning on a stack as children are laid out above each other rather than from side to side. the size of the stack is determined by its largest child, but you can use the css properties width, height, min-width and other related properties on both the stack and its children. the stack element might be used for cases where a status indicator needs to be added over an existing 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 c...
Trees - Archive of obsolete content
Archive › Mozilla › XUL › Tutorial › Trees
<treerow> <treecell label="mel@whereever.com"/> <treecell label="let's do lunch"/> </treerow> </treeitem> </treechildren> </tree> as can be seen in the image, the tree has been created with two rows of data. this tree has two columns, the second of which will take up more space than the first. you will usually make the columns flexible. you can also supply widths with the width attribute. you should include the same number of treecol elements as there are columns in the tree. otherwise strange things might happen. the header row is created automatically. the button in the upper right corner can be used to hide and show the columns. you can place a hidecolumnpicker attribute on the tree and set it to true if you would like to hide this button. if this bu...
XUL Accesskey FAQ and Policies - Archive of obsolete content
le, in the manage bookmarks dialog, don't use f, e, v, t or h (file, edit, view, tasks, help). help wanted: it would be useful to have an automated tool to check for duplicate and missing accesskeys in xul files. make it easy to see use letters at the beginning of the first or second word of the label. use a distinctive consonant or a vowel in the label. use letters with wide widths, such as w, m, and capital letters. avoid: letters with descenders, such as p, g, q, or y. example: p, g, q, y. letters next to a letter with a descender. letters that are only one pixel wide, such as i or l. example: i, l. make it easy to remember do the most important prompts first, so that they get the best accesskeys. see if a similar prompt has...
attribute.align - Archive of obsolete content
xtra space is placed on the left or top side. baseline this value applies to horizontally oriented boxes only. it causes the child elements to be aligned so that their text labels are lined up. stretch the child elements are stretched to fit the size of the box. for a horizontal box, the children are stretched to be the height of the box. for a vertical box, the children are stretched to be the width of the box. if the size of the box changes, the children stretch to fit. use the flex attribute to create elements that stretch in the opposite direction. left: (deprecated) the elements are aligned on their left edges. center: (deprecated) the elements are centered horizontally. right: (deprecated) the elements are aligned on their right edges. ...
content - Archive of obsolete content
...
listbox - Archive of obsolete content
cteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> <listbox id="thelist" rows="10" width="400"> <listhead> <listheader label="1ct gem" width="240"/> <listheader label="price" width="150"/> </listhead> <listcols> <listcol/> <listcol flex="1"/> </listcols> </listbox> var thelist = document.getelementbyid('thelist'); gems = [ {gem: "ruby", price: "$3,500 - $4,600"}, {gem: "emerald", price: "$700 - 4,250"}, {gem: "blue sapphire", price...
menupopup - Archive of obsolete content
ine the actual screen position of the element using the boxobject.screenx and boxobject.screeny properties of the element, and use those as the x and y arguments offset by the desired values. the popuptype should be one of the strings popup, context, or tooltip. each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently. sizeto( width, height ) return type: no return value changes the current size of the popup to the new width and height. related elements menu, menubar, menuitem, menulist, menuseparator interfaces nsiaccessibleprovider, nsidomxulpopupelement ...
notificationbox - Archive of obsolete content
alue, removeallnotifications, removecurrentnotification, removenotification, removetransientnotifications, attributes 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, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties currentnotification type: notification element the currently displayed notification element or nul...
param - Archive of obsolete content
Archive › Mozilla › XUL › param
meter's value integer 32 bit integer int64 64 bit integer double double-precision floating-point number string string literal, the default value 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...
Getting started with XULRunner - Archive of obsolete content
ng preferences are discussed in debugging a xulrunner application step 7: create some xul finally, we need to create a simple xul window, which is described in the file main.xul. nothing fancy here, just the minimum we need to make a window. no menus or anything. main.xul: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="main" title="my app" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://myapp/content/main.js"/> <caption label="hello world"/> <separator/> <button label="more >>" oncommand="showmore();"/> <separator/> <description id="more-text" hidden="true">this is a simple xulrunner application. xul is simple to use and quit...
MacFAQ - Archive of obsolete content
me://myxul/content/hiddenwindow.xul" next take the code below and drop it in, to create the hiddenwindow.xul (note: the debug function and nsicommandline try/catch can be removed, all you need is the window.arguments[0]) <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="myxul_hidden" windowtype="myxul:hiddenwindow" title="" width="0" height="0" persist="screenx screeny width height sizemode" > <!-- load the mozilla helpers --> <script type="application/javascript" src="chrome://global/content/nsusersettings.js" /> <script><![cdata[ function debug(alogstring) { var mconsoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.
Windows and menus in XULRunner - Archive of obsolete content
n user interface: windows and dialogs menus and toolbars os common dialogs controls or widgets windows each window or dialog should be created in its own xul file. the xul file 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...
Mozilla release FAQ - Archive of obsolete content
ol to do so, research how http works, how html works, and think about all the good *and* bad points of reworking things. to start understanding the issues with this example, you should dig up the rfcs for the relevant protocols, any documents written on the subject, etc. for this particular example, you would want to go look at relevant topics stuart cheshire's discussion on latency versus bandwidth internet -- under the covers (by me) the rfc for http the w3's html 4.0 definition building mozilla i get x error when trying to build mozilla - what's wrong? first, make sure that you have the latest release of the mozilla source. secondly, ensure that you have fully read the build instructions for your platform. these instructions are included in the source tree, and are also available o...
2006-10-13 - Archive of obsolete content
ted tab and an unselected tab. it's suggested that its a os problem in the desktop theme, as opposed to problem with firefox. nsapprunner.o compile error: some_const not declared in scope compile error while compiling first build. user was conservative on what libraries they used, but now they have a compile error and can't make sense of it. no responses as of yet. firefox browser problem: width:30ex does not respect font discussion about a font rendering problem with firefox print on the firefox context menu user would like discussion about why the bug https://bugzilla.mozilla.org/show_bug.cgi?id=204519 is a wontfix. (user feels print belongs on the context menu along with back, reload, etc.) questions about programming for firefox a student questions how to create an extension...
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.tech.layout - october 21 - october 27, 2006 announcements none this week. discussions removal of the nn4.6 table border color quirk discussion on removing the nn 4.6 table boarder color quirk, which currently causes a specific markup to produce a green boarder instead of a gray one. help for getting html element width info discussion on retrieving width information on html elements when using the gecko engine. it was determined that the offsetwidth property can be used to get this value. multiple presshells discussion on why current interfaces allow for multiple presshells and how the relationships work for the following objects: docshell, presshell, prescontext, document, domwindow, widget, docshell and contentviewer. boris zbarsky explains in detail the r...
2006-11-03 - Archive of obsolete content
it. firefox table captions discussion on how ie displays captions depending on the size of the content while ff uses a default setting. captions in ff also exceed the table length and become hidden if it's surrounded by a bounding div element. a test case is pending. perf question (reflow branch) a look into bug #352367 and the mention of possibly reducing the number of times nsframe::intrinsicwidthoffsets is called for each cell within a table. meetings none this week. ...
2006-11-10 - Archive of obsolete content
using window.innerheight and window.scrollmaxy should resolve this issue. block images discussion on how where to change source code so that images could be blocked in mozilla. this can be defined within the nsicontentpolicy. ...
NPP_SetWindow - Archive of obsolete content
moved, sized, or destroyed. syntax #include <npapi.h> nperror npp_setwindow(npp instance, npwindow *window); parameters the function has the following parameters: instance pointer to the current plug-in instance. must be embedded or full-screen. window pointer to the window into which the instance draws. the window structure contains a window handle and values for top left corner, width, height, and clipping rectangle (see note on unix below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description the browser calls npp_setwindow after creating the instance to allow drawing to begin. subsequent calls to npp_setwindow indicate changes i...
Adobe Flash - Archive of obsolete content
nctions are named with a concatenation of the name of the embed element, the underscore ("_"), and the string "dofscommand". the following code snippet illustrates the ideas behind the use of fscommands demonstrated in example 3: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="myflash" width="250" height="150" viewastext> <param name="movie" value="js2flash.swf" /> <param name="quality" value="high"></param> <embed src="js2flash.swf" width="250" height="150" swliveconnect="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="myflash"> </embed> </object> ..... function myflash_dofscommand(command, args...
Element - Archive of obsolete content
ubdate> (rss published date element) q r <rating> (rss rating element) <rss> (rss's root "rss" element) s <skipdays> (rss skip days element) <skiphours> (rss skip hours element) <source> (rss source element) t <textinput> (rss text input element) <title> (rss title element) <ttl> (rss ttl element) u <url> (rss url element) v w <webmaster> (rss web master element) <width> (rss width element) x y z ...
Making sure your theme works with RTL locales - Archive of obsolete content
de, so left becomes right and right becomes left. as a result, you almost never want to use left/right rules for paddings, borders, and margins. instead, you should use the following start/end rules instead to ensure rtl compatibility: -moz-padding-start -moz-padding-end -moz-margin-start -moz-margin-end -moz-border-start -moz-border-start-color -moz-border-start-style -moz-border-start-width -moz-border-end -moz-border-end-color -moz-border-end-style -moz-border-end-width #urlbar-search-splitter { min-width: 8px; -moz-margin-start: -4px; border: none; background: transparent; } testing your theme testing your theme for rtl compatibility is easy, and you do not even have to go through the hassle of downloading a rtl locale. the force rtl extension enables you to switch...
Theme changes in Firefox 2 - Archive of obsolete content
this file is new in firefox 2. #enginelist treechi...
Theme changes in Firefox 3.5 - Archive of obsolete content
for the scrollbar thumb button by applying a centered background image to the scrollbar's thumb button. global/checkbox.css, global/radio.css since bug 394892, radio buttons and checkboxes no longer have a minimum size on mac os x. if your theme uses native checkboxes or radiobuttons (-moz-appearance: radio / checkbox), this can result in distorted controls. you might have to set the width and height of .checkbox-check and .radio-check to 16px to avoid that problem. look at the patch to see what was changed for pinstripe. bug 450944 changed the way window shadow is handled on mac os x. before that change, opaque windows always had a shadow and transparent windows never had a shadow. after that change, transparent windows also have a shadow by default. this can result ...
-ms-block-progression - Archive of obsolete content
l. bt bottom-to-top block flow. layout is horizontal. lr left-to-right block flow. layout is vertical. formal syntax tb | rl | bt | lr specifications not part of any specification. remarks in vertical layout, text lines are rotated 90° clockwise. images are not rotated, but tables are. box layout in vertical orientations is exactly analogous to layout in the horizontal orientation: width, height, top, bottom, right, and left do not rotate with the text. only one block progression is active at a time; these values cannot be combined. this property is based on the block-progression property of the css3 text layout module. ...
-ms-overflow-style - Archive of obsolete content
nitial value. same as inherit. none scrollbars are never displayed, although the element can still be scrolled if the element's content overflows. scrollbar "traditional" scrollbars are displayed if the element's content overflows. "traditional" scrollbars don't auto-hide and never overlap the element's content. accordingly, the dimensions of the layout area for the content are reduced by the width (for vertical scrollbars) or height (for horizontal scrollbars) of the scrollbar(s). -ms-autohiding-scrollbar auto-hiding scrollbars are used if the element's content overflows. auto-hiding scrollbars are displayed during scrolling or shortly after the pointer interacts with the page, and are hidden shortly after scrolling and pointer interaction stops. when they are visible, auto-hiding scroll...
-ms-scroll-chaining - Archive of obsolete content
rnet explorer 10 scrolling, panning, and zooming with touch. .imagecontainer { -ms-scroll-chaining: chained; -ms-overflow-style: none; -ms-content-zooming: zoom; -ms-scroll-rails: none; -ms-content-zoom-limit-min: 100%; -ms-content-zoom-limit-max: 500%; -ms-scroll-snap-type: proximity; -ms-scroll-snap-points-x: snaplist(100%, 200%, 300%, 400%, 500%); -ms-overflow-style: none; width: 480px; height: 270px; overflow: auto; } specifications not part of any specification. remarks this property only applies to touch and touchpad input. for keyboard input the scroll does not chain regardless of the –ms-scroll-chaining value, and for mouse input the scroll will always chain up to the nearest scrollable ancestor element. this property has no effect on non-scrollable elem...
-ms-scroll-limit-x-max - Archive of obsolete content
the -ms-scroll-limit-x-max css property is a microsoft extension that specifies the maximum value for the element.scrollleft property. initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values auto the maximum value for the scrollleft property is equal to element.scrollwidth. <length> the maximum value for the scrollleft property. formal syntax auto | <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the specified behavior of the -ms-scroll-limit-x-max property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. this...
::-ms-fill - Archive of obsolete content
ignored. ...
Processing XML with E4X - Archive of obsolete content
</p></body></html>; alert(xhtml.head); // no need to specify a namespace on subelements here either non-default var xhtml = <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>embedded svg demo</title> </head> <body> <h1>embedded svg demo</h1> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 100"> <circle cx="50" cy="50" r="20" stroke="orange" stroke-width="2px" fill="yellow" /> </svg> </body> </html>; alert(xhtml.name().localname); // alerts "html" alert(xhtml.name().uri); // alerts "http://www.w3.org/1999/xhtml" to access elements that are within a non-default namespace, first create a namespace object encapsulating the uri for that namespace: var svgns = new namespace('http://www.w3.org/2000/svg'); this can now be used in e4x querie...
XForms Alert Element - Archive of obsolete content
ntation is used if the alert element has an inline display style. ...
Building up a basic demo with PlayCanvas editor - Game development
...
WebVR — Virtual Reality for the Web - Game development
} for a full explanation and more details of the demo this is taken from, see using the webvr api. tools and techniques the first webvr experiments and demos used three.js as it's probably the most popular 3d engine for the...
Audio for Web games - Game development
arger audio file containing all the smaller audio snippets we need. to play a specific sound from the file, we just use the known start and stop times for each audio sprite. the advantage is that we can prime one piece of audio and have our sprites ready to go. to do this we can just play and instantly pause the larger piece of audio. you'll also reduce the number of server requests and save bandwidth. var myaudio = document.createelement("audio"); myaudio.src = "mysprite.mp3"; myaudio.play(); myaudio.pause(); you'll need to sample the current time to know when to stop. if you space your individual sounds by at least 500ms then using the timeupdate event (which fires every 250ms) should be sufficient. your files may be slightly longer than they strictly need to be, but silence compresses wel...
Desktop gamepad controls - Game development
e function returns true; false otherwise. next, in the draw() function we do two things — execute the gamepadupdatehandler() function to get the current state of pressed buttons on every frame, and use the gamepadbuttonpressedhandler() function to check the buttons we are interested to see whether they are pressed, and do something if they are: function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); // ... gamepadupdatehandler(); if(gamepadbuttonpressedhandler(0)) { playery -= 5; } else if(gamepadbuttonpressedhandler(1)) { playery += 5; } if(gamepadbuttonpressedhandler(2)) { playerx -= 5; } else if(gamepadbuttonpressedhandler(3)) { playerx += 5; } if(gamepadbuttonpressedhandler(11)) { alert...
Collision detection - Game development
the physics engine makes everything a lot easier — we just need to add two simple pieces of code. first, add a new line inside your update() function that checks for collision detection between ball and bricks, as shown below: function update() { game.physics.arcade.collide(ball, paddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.input.x || game.world.width*0.5; } the ball's position is calculated against the positions of all the bricks in the group. the third, optional parameter is the function executed when a collision occurs — ballhitbrick(). create this new function as the bottom of your code, just before the closing </script> tag, as follows: function ballhitbrick(ball, brick) { brick.kill(); } and that's it! reload your code and you...
Initialize the framework - Game development
padding. we also have a <script> element to apply the phaser source code to the page. the body contains a second <script> element, where we will write the javascript code to render the game and control it. the <canvas> element is generated automatically by the framework. we are initializing it by creating a new phaser.game object and assigning it to the game variable. the parameters are: the width and height to set the <canvas> to. the rendering method. the three options are auto, canvas and webgl. we can set one of the latter two explicitly or use auto to let phaser decide which one to use. it usually uses webgl if available in the browser, falling back to canvas 2d if not. the id of the <canvas> to use for rendering if one already exists on the page (we've specified null because we wan...
Scaling - Game development
le the canvas to fill all the available space both vertically and horizontally, without preserving the aspect ratio. show_all — scales the canvas, but keeps the aspect ratio untouched, so images won't be skewed like in the previous mode. there might be black stripes visible on the edges of the screen, but we can live with that. resize — creates the canvas with the same size as the available width and height, so you have to place the objects inside your game dynamically; this is more of an advanced mode. user_scale — allows you to have custom dynamic scaling, calculating the size, scale and ratio on your own; again, this is more of an advanced mode the other two lines of code in the preload() function are responsible for aligning the canvas element horizontally and vertically, so it i...
Selector (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
a css selector is the part of a css rule that describes what elements in a document the rule will match. the matching elements will have the rule's specified style applied to them. consider this css: p { color: green; } div.warning { width: 100%; border: 2px solid yellow; color: white; background-color: darkred; padding: 0.8em 0.8em 0.6em; } #customized { font: 16px lucida grande, arial, helvetica, sans-serif; } the selectors here are "p" (which applies the color green to the text inside any <p> element), "div.warning" (which makes any <div> element with the class "warning" look like a warning box), and "#customized", which sets the base font of the element with the id "customized" to 16-pixel tall lucida grande or one of a few fallback fonts. we can then apply thi...
DoS attack - MDN Web Docs Glossary: Definitions of Web-related terms
network unavailable to legitimate users, or at least make the server perform sluggishly. there are also distributed denial of service (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. ...
Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
network unavailable to legitimate users, or at least make the server perform sluggishly. there are also distributed denial of service (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. ...
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
ting a vulnerability in one computer system and making it the ddos master. the attack master, also known as the botmaster, identifies and infects other vulnerable systems with malware. eventually, the assailant instructs the controlled machines to launch an attack against a specified target. there are two types of ddos attacks: a network-centric attack (which overloads a service by using up bandwidth) and an application-layer attack (which overloads a service or database with application calls). the overflow of data to the target causes saturation in the target machine so that it cannot respond or responds very slowly to legitimate traffic (hence the name "denial of service"). the infected computers' owners normally don't know that their computers have been compromised, and they also suffer l...
Hotlink - MDN Web Docs Glossary: Definitions of Web-related terms
a hotlink (also known as an inline link) is an object (typically an image) directly linked to from another site. for example, an image hosted on site1.com is shown directly on site2.com. the practice is often frowned upon as it can cause unwanted bandwidth usage on the website hosting the linked-to object, and copyright concerns — it is considered stealing when it is done without permission. ...
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
on 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. 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 ap...
Network throttling - MDN Web Docs Glossary: Definitions of Web-related terms
it’s important not to overlook network conditions users experience on mobile. the internet speeds for developers creating web applications in a corporate office building on a powerful computer are generally very fast. as a developer, tech writer, or designer, this is likely your experience. ...
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
nclude a prediction feature completing search text and address bar urls based on browsing history and related searches. for example, as the user types in the address bar, the browser might send the current text in the address bar to the search engine before the user submits the request. although browser page prediction and prediction services enable faster page loads, they consume additional bandwidth. also, pre-loaded websites and embedded content can set and read their cookies as if they were visited even if they weren't. ...
Pixel - MDN Web Docs Glossary: Definitions of Web-related terms
a pixel is the smallest building block of a graphical display like a computer screen. display resolution is expressed in the unit of pixels. eg: a “800 x 600” pixel resolution means that 800 pixels can be displayed in width and 600 pixels in height. learn more technical reference pixel on wikipedia ...
TCP - MDN Web Docs Glossary: Definitions of Web-related terms
connect and exchange data streams. tcp guarantees the delivery of data and packets in the same order as they were sent. vint cerf and bob kahn, who were darpa scientists at the time, designed tcp in the 1970s. tcp role is to ensure the packets are reliably delivered, error free. tcp has concurrence control, which means the initial requests start small, increasing in size to the levels of bandwidth the computers, servers, and network can support. ...
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
it prevents the appearance of network congestion whose capabilities are initially unknown, and slowly increases the volume of information diffused until the network's maximum capacity is found. ...
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
be changed by the white-space css property. they are also used as a separator of an element name and its parameters, class names, and so on. in javascript ecmascript® 2015 language specification specifies several unicode codepoints as white space: u+0009 character tabulation <tab>, u+000b line tabulation <vt>, u+000c form feed <ff>, u+0020 space <sp>, u+00a0 no-break space <nbsp>, u+feff zero width no-break space <zwnbsp> and other category “zs” any other unicode “separator, space” code point <usp>. these characters are usually unnecessary for the functionality of the code. ...
MDN Web Docs Glossary: Definitions of Web-related terms
) adobe flash ajax algorithm alignment container alignment subject alpha (alpha channel) alpn api apple safari application context argument aria arpa arpanet array ascii asynchronous atag attribute b bandwidth base64 baseline beacon bézier curve bidi bigint blink block block (css) block (scripting) block cipher mode of operation boolean boot2gecko bootstrap bounding box breadcrumb brotli browser browsing context buffer ...
Mobile accessibility - Learn web development
gn techniques here, as they are covered in other places around mdn (see above links). specific mobile considerations there are other important issues to consider when making sites more accessible on mobile. we have listed a couple here, but we will add more when we think of them. not disabling zoom using viewport, it is possible to disable zoom. always ensure resizing is enabled, and set the width to the device's width in the <head>: <meta name="viewport" content="width=device-width; user-scalable=yes"> you should never set user-scalable=no if at all possible — many people rely on zoom to be able to see the content of your website, so taking this functionality away is a really bad idea. there are certain situations where zooming might break the ui; in such cases, if you feel that you a...
A cool-looking box - Learn web development
nt 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 your task is to create a cool, fancy box and explore the fun we can have with css. general tasks apply the css to the html. styling the box we'd like you to style the provided <p>, giving it the following: a reasonable width for a large button, say around 200 pixels. a reasonable height for a large button, centering the text vertically in the process. centered text. a slight increase in font size, to around 17-18 pixel computed style. 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 rea...
Fundamental CSS comprehension - Learn web development
ectors, and calculate the specificity for each one. write these down somewhere where they can be found later on, such as in a comment at the top of your css. now it's time to put the right selector on the right rule set! you've got four pairs of selector and ruleset to match in your css resources. do this now, and add them to your css file. you need to: give the main card container a fixed width/height, solid background color, border, and border-radius (rounded corners!), amongst other things. give the header a background gradient that goes from darker to lighter, plus rounded corners that fit in with the rounded corners set on the main card container. give the footer a background gradient that goes from lighter to darker, plus rounded corners that fit in with the rounded corners s...
Test your skills: The Box Model - Learn web development
ractive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. the box model one with the two boxes below, one is using the standard box model, the other the alternate box model. change the width of the second box by adding rules to the .alternate class, so that it matches the visual width of the first box. your final result will look like the image below. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. the box model two in this...
Test your skills: sizing - Learn web development
uld be fixed at 100 pixels tall, so that content will overflow if there is too much. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. task two this task has a box, which contains another box. your task is to make the inner box 60% of the width of the outer box. the value of the box-sizing property is set to border-box, which means that the total width includes any padding and border. you should also give the inner box padding of 10% using the width (or inline size) as the size from which that percentage is calculated. try updating the live code below to recreate the example as displayed in the image: for assessment or further wo...
Test your skills: Writing Modes and Logical Properties - Learn web development
css to change it so it uses a vertical writing mode with right to left text? your example should look like the image below. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. task two in the example below use logical properties to replace width and height in order to maintain the aspect ratio of the box as it is turned vertically. your end result should look like the image below. try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. task three use logical versions o...
Test your skills: Media Queries and Responsive Design - Learn web development
bottom of this page. your task download the starting point. open this in your browser and you will find a wireframed site which will load in a mobile device in a readable manner. you can drag your window smaller or use the responsive design view in firefox devtools to view this as if on a phone. your task is to create a desktop version of this layout which displays when there is enough screen width to accomodate it. you can see the layout you are aiming for in the screenshot below. there are a number of ways that you could create the desktop layout, enjoy experimenting. you could also add a second breakpoint perhaps creating a layout that would work well on a tablet in portrait mode. assessment or further help you can practice these examples in the interactive editors mentioned above. ...
CSS layout - Learn web development
ayout specification gives you a method of laying content out in columns, as you might see in a newspaper. this article explains how to use this feature. responsive design as more diverse screen sizes have appeared on web-enabled devices, the concept of responsive web design (rwd) has appeared: a set of practices that allows web pages to alter their layout and appearance to suit different screen widths, resolutions, etc. it is an idea that changed the way we design for a multi-device web, and in this article we'll help you understand the main techniques you need to know to master it. beginner's guide to media queries the css media query gives you a way to apply css only when the browser and device environment matches a rule that you specify, for example "viewport is wider than 480 pixels". m...
Web fonts - Learn web development
unnecessary downloading. creating custom font stacks with unicode-range by drew mclellan provides some useful ideas on how to make use of this. variable fonts there is a newer font technology available in browsers called variable fonts — these are fonts that allow many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style. they are somewhat advanced for our beginner's course, but if you fancy stretching yourself and looking into them, read our variable fonts guide. test your skills! you've reached the end of this article, and already did some skill testing in our active learning sections, but can you remember the most important information going forward? you can find an assessment to verify tha...
What text editors are available? - Learn web development
ed above (e.g. gedit if you use gnome desktop, kate if you use kde etc.), if not then you should try installing one or more text editors of your choosing. try digging through the settings of your editor and read the manual or documentation to see what its capabilities are. ...
What is accessibility? - Learn web development
visitors can't experience your website the way you hoped. in this article we give general accessibility principles and explain a few rules. active learning there is no active learning available yet. dig deeper accessibility: general principles we might associate accessibility at first with negative limitations. this building has to be accessible, so it must follow these regulations for door width and toilet size and elevator placement. that's a narrow way to think of accessibility. think of it as a wonderful way to empower people and serve more customers. what can the people in brazil do with your english website? can the people with smartphones browse a heavy, cluttered website designed for a large desktop monitor and unlimited bandwidth? they'll go somewhere else. in general, we must t...
Basic native form controls - Learn web development
ered exactly like an <img> element, except that when the user clicks on it, it behaves like a submit button. an image button is created using an <input> element with its type attribute set to the value image. this element supports exactly the same set of attributes as the <img> element, plus all the attributes supported by other form buttons. <input type="image" alt="click me!" src="my-img.png" width="80" height="30"> if the image button is used to submit the form, this control doesn't submit its value — instead, the x and y coordinates of the click on the image are submitted (the coordinates are relative to the image, meaning that the upper-left corner of the image represents the coordinate (0, 0)). the coordinates are sent as two key/value pairs: the x value key is the value of the na...
Other form controls - Learn web development
13 on macos, and edge 18, yandex 14, firefox 71 and chrome 79 on windows 10. note: you can find a slightly more interesting example of text area usage in the example we put together in the first article of the series (see the source code also). controlling multi-line rendering <textarea> accepts three attributes to control its rendering across several lines: cols specifies the visible width (columns) of the text control, measured in average character widths. this is effectively the starting width, as it can be changed by resizing the <textarea>, and overriden using css. the default value if none is specified is 20. rows specifies the number of visible text rows for the control. this is effectively the starting height, as it can be changed by resizing the <textarea>, and overriden ...
The web and web standards - Learn web development
n certain browsers, and then more work to fix those failures. responsive web design is the practice of making your functionality and layouts flexible so they can automatically adapt to different browsers. an obvious example is a website that is laid out one way in a widescreen browser on the desktop, but displays as a more compact, single-column layout on mobile phone browsers. try adjusting the width of your browser window now, and see what happens. performance means getting web sites to load as quickly as possible, but also making them intuitive and easy to use so that users don't get frustrated and go somewhere else. accessibility means making your websites usable by as many different kinds of people as possible (related concepts are diversity and inclusion, and inclusive design). this in...
Using data attributes - Learn web development
e to "5". css access note that, as data attributes are plain html attributes, you can even access them from css. for example to show the parent data on the article you can use generated content in css with the attr() function: article::before { content: attr(data-parent); } you can also use the attribute selectors in css to change styles according to the data: article[data-columns='3'] { width: 400px; } article[data-columns='4'] { width: 600px; } you can see all this working together in this jsbin example. data attributes can also be stored to contain information that is constantly changing, like scores in a game. using the css selectors and javascript access here this allows you to build some nifty effects without having to write your own display routines. see this screencast for ...
Creating hyperlinks - Learn web development
that it will perform less efficiently. linking to non-html resources — leave clear signposts when linking to a resource that will be downloaded (like a pdf or word document), streamed (like video or audio), or has another potentially unexpected effect (opens a popup window, or loads a flash movie), you should add clear wording to reduce any confusion. for example: if you're on a low bandwidth connection, click a link, and then a multiple megabyte download starts unexpectedly. if you don't have the flash player installed, click a link, and then suddenly get taken to a page that requires flash. let's look at some examples, to see what kind of text can be used here: <p><a href="http://www.example.com/large-report.pdf"> download the sales report (pdf, 10mb) </a></p> <p><a href="htt...
Structuring a page of content - Learn web development
fiddle, 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. project brief for this project, your task is to take the content for the homepage of a bird watching website and add structural elements to it so it can have a page layout applied to it. it needs to have: a header spanning the full width of the site containing the main title for the page, the site logo, and the navigation menu. the title and logo appear side by side once styling is applied, and the navigation appears below those two items. a main content area containing two columns — a main block to contain the welcome text, and a sidebar to contain image thumbnails. a footer containing copyright information and credits. yo...
Test your skills: HTML images - Learn web development
embed a simple image of some blueberries into the page. you need to: add the path to the image to an appropriate attribute to embed it on the page. the image is called blueberries.jpg, and it is in a folder inside the current folder called images. add some alternative text to an appropriate attribute to describe the image, for people that cannot see it. give the <img> element an appropriate width and height so that it displays at the correct aspect ratio, and enough space is left on the page to display it. the image's intrinsic size is 615 x 419 pixels. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. html images 2 in this task you already have a full-featured image, but...
Mozilla splash page - Learn web development
h the class of further-info you will find four <a> elements — each one linking to an interesting mozilla-related page. to complete this section you'll need to insert an <img> element inside each one containing appropriate src, alt, srcset and sizes attributes. in each case (except one — which one is inherently responsive?) we want the browser to serve the 120px wide version when the viewport width is 500px wide or less, or the 400px wide version otherwise. make sure you match the correct images with the correct links! note: to properly test the srcset/sizes examples, you'll need to upload your site to a server (using github pages is an easy and free solution), then from there you can test whether they are working properly using browser developer tools such as the firefox network monitor...
Test your skills: Multimedia and embedding - Learn web development
riate fallback text for browsers that don't support <video>. add multiple sources, containing the paths to the video files. the files are called video.mp4 and video.webm, and are in a folder inside the current folder called media. let the browser know in advance what video formats the sources point to, so it can make an informed choice of which one to download ahead of time. give the <video> a width and height equal to its intrinsic size (320 by 240 pixels). make the video muted by default. display the text tracks contained in the media folder, in a file called subtitles_en.vtt, when the video is playing. you must explicitly set the type as subtitles, and the subtitle language to english. try updating the live code below to recreate the finished example: download the starting point f...
Index - Learn web development
css, guide this aim of this task is to get you working with responsive web design with a practical task. everything you need to know to complete this task was covered in the guide to media queries, and the other layout lessons in this section. 157 test your skills: multicol css, example, guide the aim of this task is to get you working with the css column-count, column-width, column-gap, column-span and column-rule properties and values covered in our lesson on multiple-column layout. you will be working through three small tasks which use different elements of the material you have just covered. 158 test your skills: floats beginner, css, example, guide the aim of this task is to get you working with the css float and clear properties covered i...
General asynchronous programming concepts - Learn web development
he rendering of the ui. in this example, we have two buttons: a "fill canvas" button that when clicked fills the available <canvas> with 1 million blue circles. a "click me for alert" button that when clicked shows an alert message. function expensiveoperation() { for(let i = 0; i < 1000000; i++) { ctx.fillstyle = 'rgba(0,0,255, 0.2)'; ctx.beginpath(); ctx.arc(random(0, canvas.width), random(0, canvas.height), 10, degtorad(0), degtorad(360), false); ctx.fill() } } fillbtn.addeventlistener('click', expensiveoperation); alertbtn.addeventlistener('click', () => alert('you clicked me!') ); if you click the first button and then quickly click the second one, you'll see that the alert does not appear until the circles have finished being rendered. the first operation bl...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
us. this example therefore throttles the rate at which the sprite cycles its frames using the following code: if (posx % 13 === 0) { if (sprite === 5) { sprite = 0; } else { sprite++; } } so the code only cycles the sprite once every 13 animation frames. ...actually, it's about every 6.5 frames, as we update posx (character's position on the screen) by two each frame: if (posx > width/2) { newstartpos = -( (width/2) + 102 ); posx = math.ceil(newstartpos / 13) * 13; console.log(posx); } else { posx += 2; } this is the code that calculates how to update the position in each animation frame. the method you use to throttle your animation will depend on your particular code. for instance, in the earlier spinner example, you could make it appear to move slower by only incr...
Build your own function - Learn web development
d chat) from github. save them in a new folder called icons in the same location as your html file. note: the warning and chat icons were originally found on iconfinder.com, and designed by nazarrudin ansyari — thanks! (the actual icon pages were since moved or removed.) next, find the css inside your html file. we'll make a few changes to make way for the icons. first, update the .msgbox width from: width: 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'...
Functions — reusable blocks of code - Learn web development
t of custom functions in the course so far — functions defined in your code, not inside the browser. anytime you saw a custom name with parentheses straight after it, you were using a custom function. in our random-canvas-circles.html example (see also the full source code) from our loops article, we included a custom draw() function that looked like this: function draw() { ctx.clearrect(0,0,width,height); for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } this function draws 100 random circles inside a <canvas> element. every time we want to do that, we can just invoke the function with this: draw(); rather than having to write all that code out aga...
Image gallery - Learn web development
le: it absolutely positions the three elements inside the full-img <div> — the <img> in which the full-sized image is displayed, an empty <div> that is sized to be the same size as the <img> and put right over the top of it (this is used to apply a darkening effect to the image via a semi-transparent background color), and a <button> that is used to control the darkening effect. it sets the width of any images inside the thumb-bar <div> (so-called "thumbnail" images) to 20%, and floats them to the left so they sit next to one another on a line. your javascript needs to: loop through all the images, and for each one insert an <img> element inside the thumb-bar <div> that embeds that image in the page. attach an onclick handler to each <img> inside the thumb-bar <div> so that when the...
Test your skills: Functions - Learn web development
e starting point for this task to work in your own editor or in an online editor. functions 2 for our second functions-related task, you need to create a function that draws a rectangle on the provided <canvas> (reference variable canvas, context available in ctx), based on the five provided input variables: x — the x coordinate of the rectangle. y — the y coordinate of the rectangle. width — the width of the rectangle. height — the height of the rectangle. color — the color of the rectangle. you'll want to clear the canvas before drawing, so that when the code is updated in the case of the live version, you don't get lots of rectangles drawn on top of one another. try updating the live code below to recreate the finished example: download the starting point for this ...
Client-side storage - Learn web development
eo store (see it running live here also). when you first run the example, it downloads all the videos from the network, stores them in an indexeddb database, and then displays the videos in the ui inside <video> elements. the second time you run it, it finds the videos in the database and gets them from there instead before displaying them — this makes subsequent loads much quicker and less bandwidth-hungry. let's walk through the most interesting parts of the example. we won't look at it all — a lot of it is similar to the previous example, and the code is well-commented. for this simple example, we've stored the names of the videos to fetch in an array of objects: const videos = [ { 'name' : 'crystal' }, { 'name' : 'elf' }, { 'name' : 'frog' }, { 'name' : 'monster' }, ...
Fetching data from the server - Learn web development
a new product. the main content will change, but most of the surrounding information, like the header, footer, navigation menu, etc., will stay the same. this is a really good thing because: page updates are a lot quicker and you don't have to wait for the page to refresh, meaning that the site feels faster and more responsive. less data is downloaded on each update, meaning less wasted bandwidth. this may not be such a big issue on a desktop on a broadband connection, but it's a major issue on mobile devices and in developing countries that don't have ubiquitous fast internet service. to speed things up even further, some sites also store assets and data on the user's computer when they are first requested, meaning that on subsequent visits they use the local versions instead of downlo...
A first splash into JavaScript - Learn web development
view the general process of dissecting it into tangible tasks. example — guess the number game in this article we'll show you how to build up the simple game you can see below: top hidden code <!doctype html> <html> <head> <meta charset="utf-8"> <title>number guessing game</title> <style> html { font-family: sans-serif; } body { width: 50%; max-width: 800px; min-width: 480px; margin: 0 auto; } .lastresult { color: white; padding: 3px; } </style> </head> <body> <h1>number guessing game</h1> <p>we have selected a random number between 1 and 100. see if you can guess it in 10 turns or fewer. we'll tell you if your guess was too high ...
Basic math in JavaScript — numbers and operators - Learn web development
note: there are lots of other assignment operators available, but these are the basic ones you should learn now. active learning: sizing a canvas box in this exercise, you will manipulate some numbers and operators to change the size of a box. the box is drawn using a browser api called the canvas api. there is no need to worry about how this works — just concentrate on the math for now. the width and height of the box (in pixels) are defined by the variables x and y, which are initially both given a value of 50. open in new window in the editable code box above, there are two lines marked with a comment that we'd like you to update to make the box grow/shrink to certain sizes, using certain operators and/or values in each case. let's try the following: change the line that calculat...
Storing the information you need — Variables - Learn web development
e corresponding to the position of the value you want returned. you might have noticed that arrays in javascript are zero-indexed: the first element is at index 0. you'll learn a lot more about arrays in a future article. objects in programming, an object is a structure of code that models a real-life object. you can have a simple object that represents a box and contains information about its width, length, and height, or you could have an object that represents a person, and contains data about their name, height, weight, what language they speak, how to say hello to them, and more. try entering the following line into your console: let dog = { name : 'spot', breed : 'dalmatian' }; to retrieve the information stored in the object, you can use the following syntax: dog.name we won't be...
Adding features to our bouncing balls demo - Learn web development
e 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 fillstyle and fill() to strokestyle 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 off the edge of the screen, and stop it from doing so. again, you can mostly just copy the ball.prototype.update definition, but there are a few changes you should make: get rid of the last t...
CSS performance optimization - Learn web development
king 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. <link rel="stylesheet" href="styles.css"> <!-- blocking --> <link rel="stylesheet" href="print.css" media="print"> <!-- not blocking --> <link rel="stylesheet" href="mobile.css" media="screen and (max-width: 480px)"> <!-- not blocking on large screens --> by default the browser assumes that each specified style sheet is render blocking. tell the browser when the style sheet should be applied by adding a media attribute with the media query. when the browser sees a style sheet it knows that it only needs to apply it for a specific scenario, it still downloads the stylesheet, but doesn't render block...
Perceived performance - Learn web development
r scripts that aren’t used or visible on the initial page load. either delay their load, loading them when the page becomes usable, or, loading them when they become necessary. loading additional assets and resources after initial page load improves perceived performance. loading essential data in initial requests and progressively loading features and data only as needed helps mitigate low bandwidth and lower spec hardware. additionally, you should optimize the assets you do load. images and video should be served in the most optimal format, compressed, and in the correct size. prevent jumping content and other reflows images or other assets causing content to be pushed down or jump to a different location, like the loading of third party advertisements, can make the page feel like it is ...
Web performance - Learn web development
to ensure performance is not negatively impacted. fonts and performance a look at whether you need to include external fonts and, if you do, how to include the fonts your design requires with the least impact on your sites performance. mobile performance with web access on mobile devices being so popular, and all mobile platforms having fully-fledged web browsers, but possibly limited bandwidth, cpu and battery life, it is important to consider the performance of your web content on these platforms. this article looks at mobile-specific performance considerations. focusing on performance there are many different things a developer can do to improve performance, but how fast is fast enough? how can you convince powers that be of the importance of these efforts? once optimized, how can ...
Working with Svelte stores - Learn web development
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...
Vue conditional rendering: editing existing todos - Learn web development
this is a useful way to help reinforce everything you've ...
Strategies for carrying out testing - Learn web development
tors emulators are basically programs that run inside your computer and emulate a device or particular device conditions of some kind, allowing you to do some of your testing more conveniently than having to find a particular combination of hardware/software to test. an emulator might be as simple as testing a device condition. for example, if you want to do some quick and dirty testing of your width/height media queries for responsive design, you could use firefox's responsive design mode. safari has a similar mode too, which can be enabled by going to safari > preferences, and checking show develop menu, then choosing develop > enter responsive design mode. chrome also has something similar: device mode (see simulate mobile devices with device mode). more often than not though, you'll hav...
Learn web development
lity is the practice of making web content available to as many people as possible regardless of disability, device, locale, or other differentiating factors. this topic gives you all you need to know. web performance — making websites fast and responsive web performance is the art of making sure web applications download fast and are responsive to user interaction, regardless of a user's bandwidth, screen size, network, or device capabilities. tools and testing this topic covers the tools developers use to facilitate their work, such as cross-browser testing tools, linters, formatters, transformation tools, version control systems, deployment tools, and client-side javascript frameworks. server-side website programming even if you are concentrating on client-side web development, it is...
Embedding API for Accessibility
moz 0.8 focus appearance setboolpref("browser.display.use_focus_colors", usefocuscolors); setcharpref("browser.display.focus_background_color", colorstring); setcharpref("browser.display.focus_text_color", colorstring); setcharpref("browser.display.focus_ring_width", numpixels); /* 0-4 */ moz 0.9.2 text selection appearance setcharpref("browser.selection.background_color", colorstring); setcharpref("browser.selection.foreground_color", colorstring); setcharpref("browser.selection.border", cssborderstylestring); /* is a ...
Mozilla’s UAAG evaluation report
(p1) vg we rely on color alone when showing which links have been recently visited. should implement a pref for dotted underline on visited links, similar to the way opera does it. 10.4 highlight special elements. (p2) g use system colors by default (classic theme) underlines links by default...
Lightweight themes
e no larger than 300 kb in file size tips subtle, soft contrast images and gradients work best; highly detailed images will compete with the browser ui. firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window. the upper right-hand side of the image should have the most important information - as a user increases the width of the browser window, the browser reveals more of the left-hand side of the image. ultrawide monitors can run to 3440px wide, to look good on these monitors, ensure the left of the image fades to a solid color. online image editor resources pixlr — pixlr offers professional and easy-to-use tools for creating and editing images within a browser. photoshop — tweak, rotate and touch up p...
Theme concepts
single image or using multiple images. you could combine the two, but it’s easier to treat them separately. single image themes this is the basic or minimal theming option, where you define: a single image, which is anchored to the top right of the header area. a color for the text in the header. the area your header image needs to fill is a maximum of 200 pixels high. the maximum image width is determined by the resolution of the monitor firefox is displaying on and how much of the monitor firefox is using. practically, this means you would need to allow for a width of up to 5120 pixels wide (for the next generation of 5k monitors). however, rather than creating a very wide image, a better approach is to use a narrower image with a transparent left edge so that it fades to the backgr...
Debugging on Windows
m files\microsoft visual studio .net 2003\common7\packages\debugger\autoexp.dat the file has information about the format in the beginning, and after a little practice you should be well on your way. here are some entries that will make your life easier: ;; mozilla (1.7beta and later) nsautostring=<mdata,su> nsstring=<mdata,su> nscstring=<mdata,s> nscautostring=<mdata,s> nsrect=x=<x,d> y=<y,d> width=<width,d>; height=<height,d> nsstaticatomwrapper=<mstaticatom->mstring,s> nsiatom=<mstring,su> ; the following are not necessary in vc8 nscomptr<*>=<mrawptr,x> nsrefptr=<mrawptr,x> nsautoptr=<mrawptr,x> after you have made the changes and saved the file, you will need to restart visual c++ for the changes to take effect. for xpcom strings (the "external" string api) you can use the following v...
The Firefox codebase: CSS Guidelines
correctly. to determine whether some css is theme-side or content-side, it is useful to know that certain css properties are going to lean one way or the other: color - 99% of the time it will be theme css, overflow - 99% content. 99% theme 70% theme 70% content 99% content font-*, color, *-color, border-*, -moz-appearance [1] line-height, padding, margin cursor, width, max-width, top, bottom [2], etc overflow, direction, display, *-align, align-*, *-box-*, flex-*, order if some css is layout or functionality related, then it is likely content css. if it is esthetics related, then it is likely theme css. when importing your stylesheets, it's best to import the content css before the theme css, that way the theme values get to override the content val...
SVG Guidelines
troducing variants of the same file (color/style variants), and use sprites instead (with class names) default style values there's usually no need to set the default style value unless you're overriding a style. here are some commonly seen examples: style="display: none;" on <defs> elements (a <defs> element is hidden by default) type="text/css" on <style> elements stroke: none or stroke-width: 0 svg grouping style grouping group similarly styled shapes under one <g> tag; this avoids having to set the same class/styles on many shapes. avoid excessive grouping editors can sometimes do excessive grouping while exporting svgs. this is due to the way editors work. nested groups avoid multiple-level nesting of groups, these make the svg less readable. nested transforms some editor...
Firefox UI considerations for web developers
ludes an optimized icon for each of the sites in the list; if the site is on this list, that icon is used. if tippy top doesn't include the site, firefox looks in its places data store for icons specified in the page's <head> element; if an svg icon is available, that icon is selected. otherwise, bitmapped icons which are at least 96 pixels wide are considered. if one is found to have a width of exactly 96 pixels, it is used. otherwise, the smallest image larger than 96 pixels wide is selected. if no high-resolution icon is found, a screenshot is taken of the site; this screenshot is then scaled and cropped to fit in the space allotted to the icon. if the site also has a favicon, it may be overlaid in the corner of the image. the selected image is then presented within the t...
mozbrowsercaretstatechanged
t normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: rect an object that defines information about the bounding rectangle of the current selection. its properties are width: the width of the bounding rectangle, in css pixels. height: the height of the bounding rectangle, in css pixels. top: the top position of the bounding rectangle, in css pixels. bottom: the bottom position of the bounding rectangle, in css pixels. left: the left position of the bounding rectangle, in css pixels. right: the right position of the bounding rectangle, in css pixels. co...
mozbrowserselectionstatechanged
an whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: rect an object that represents the bounding rectangle of the selection. its properties are: width: the width of the selection, in css pixels. height: the height of the selection, in css pixels. top: the y coordinate of the top of the bounding box, in css pixels. bottom: the y coordinate of the bottom of the bounding box, in css pixels. left: the x coordinate of the left of the bounding box, in css pixels. right: the x coordinate of the right of the bounding box, in css pixels. ...
overflow-clip-box-block
ox. content-box this keyword makes the clipping be related to the content box. ...
overflow-clip-box-inline
ox. content-box this keyword makes the clipping be related to the content box. ...
overflow-clip-box
. content-box this keyword makes the clipping be related to the content box. ...
MozBeforePaint
entional, because modern operating systems and hardware won't let the browser display more frames than that anyway. limiting the frame rate avoids wasting work, thereby saving cpu usage and power and improving overall system performance. example this example performs a simple animation, moving a box a short distance after a short period of time. ...
IPDL Tutorial
note that this is not a preprocessor directive, but a part of the ipdl language. the generated c++ code will have proper #include preprocessor directives for the imported protocols. the `manages` statement declares that this protocol manages pplugininstance. the pplugi...
JavaScript Tips
y prefer document.getelementsbytagname(atag).item(0) != null to document.getelementsbytagname(atag).length > 0. prefer to use localname rather than tagname. xul elements have many of the attributes mapped to properties. this was done for a reason, so use them! the properties are: align allowevents contextmenu datasources dir flex height id left maxheight maxwidth minheight minwidth observes orient pack persist ref statustext top tooltip tooltiptext width xul also maps the ordinal attribute but this defaults to "1" if it is not present. xul also maps the class attribute, but unfortunately class is a reserved identifier, so the property is named classname. (the property could have been implemented as ["class"'] but...
AddonScreenshot
a screenshot object for an add-on can have following attributes. attributes attribute type description url string the url of the screenshot. thumbnailurl optional string the url of a thumbnail version of the screenshot. caption optional string the caption of the screenshot. width optional string the width of the screenshot. height optional string the height of the screenshot. thumbnailwidth optional string the thumbnailwidth of the screenshot. thumbnailheight optional string the thumbnailheight of the screenshot. ...
CustomizableUI.jsm
ts. onwidgetinstanceremoved(awidgetid, adocument) fired when a window is unloaded and a widget's instance is destroyed because of this. awidgetid is the widget whose instance is being destroyed, adocument the document in which this is happening. only fired for api-based widgets. onwidgetdrag(awidgetid, aarea) fired both when and after customize mode drag handling system tries to determine the width and height of widget awidgetid when dragged to a different area. aarea will be the area the item is dragged to, or undefined after the measurements have been done and the node has been moved back to its 'regular' area. oncustomizestart(awindow) fired when opening customize mode in awindow. oncustomizeend(awindow) fired when exiting customize mode in awindow. onwidgetoverflow(anode, acontaine...
OS.File for the main thread
st use local file; this is accomplished with os.path.tofileuri, which accepts a string). after image loads it then draws it to canvas, makes it a blob, and uses filereader to turn it into arraybuffer(view), then uses os.file.writeatomic to save to disk. var img = new image(); img.onload = function() { var canvas = document.createelementns('http://www.w3.org/1999/xhtml', 'canvas'); canvas.width = img.naturalwidth; canvas.height = img.naturalheight; var ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); (canvas.toblobhd || canvas.toblob).call(canvas, function(b) { var r = cc['@mozilla.org/files/filereader;1'].createinstance(ci.nsidomfilereader); //new filereader(); r.onloadend = function() { // r.result contains the arraybuffer. ...
Localization: Frequently asked questions
cumentation about localization in general, see our localization page. how do i preserve whitespace in an entity? do you really want to preserve whitespace or are you looking for a no-break space, you can add that via a &ua0; or \ua0 to dtd and properties files, resp. how can i not display a variable in a .properties entry? you can simply format the value to be of zero width, i.e., use %1$0.s ...
Basics
o> <mi>z</mi> <mo>)</mo> </mrow> <mi>&alpha;</mi> </msup> </mrow> <mrow> <msup> <mi>e</mi> <mrow> <mn>2</mn> <mi>&pi;</mi> <mi>z</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow> <mi>d</mi> <mi>z</mi> </mrow> </math> css content [class="background"] { background-image: url(http://www.mozilla.org/images/mozilla-banner.gif); opacity: 0.2; position: absolute; left: 0; width: 100%; height: 58px; } ...
MathML Demo: <mfrac> - fractions
> <mo>)</mo> </mrow> <mi>&alpha;</mi> </msup> </mrow> <mrow> <msup> <mi>e</mi> <mrow> <mn>2</mn> <mi>&pi;</mi> <mi>z</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow> <mi>d</mi> <mi>z</mi> </mrow> </math> css content [class="background"] { background-image: url(http://www.mozilla.org/images/mozilla-banner.gif); opacity: 0.2; position: absolute; left: 0; width: 100%; height: 58px; } ...
Mozilla Web Developer FAQ
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 documents served as text/html. width and height do not apply to non-replaced inline elements such as (by default) <span>. text-align: center; centers inline content within a block. it does not (and should not) center the block box itself. a block is centered by setting its margin-left and margin-right to auto and its width to a value that makes the block narrower than its containing block. it is also possible, although not very l...
Mozilla Style System
ts. the style context has a getter for each struct, and nsiframe, which represents the concept of a css box (or rendering object), also has getters that forward to the frame's style context. thus, typical calling code looks like this: if (aframe->getstyledisplay()->mopacity < 1.0f) return pr_true; or like this: const nsstyleposition *stylepos = aframe->getstyleposition(); if (stylepos->mwidth.getunit() == estyleunit_coord) { nscoord w = stylepos->mwidth.getcoordvalue(); ... } else if (stylepos->mwidth.getunit() == estyleunit_percent) { ... rule tree style data computation css style sheet backend loading parsing data structures cascading html mapped attribute backend css style attribute backend handling of dynamic changes see also mozilla style system documenta...
Preferences system
l="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner applications when calling opendialog() to open a preferences dialog, "toolbar" should be included in the features string. not using "toolbar" will cause the pre...
Patches and pushes
pository. patchify search plugins are found in browser/searchplugins. each plugin is stored as an xml file, with list.txt containing the names of each plugin. here is an example search plugin file using french yahoo. ...
NSS Developer Tutorial
int, as opposed to size_t. unfortunately, this can be a source of integer overflow bugs on 64-bit systems. c features nss requires c99. however, not all features from c99 are equally available. variables can be declared, at the point they are first used. the inline keyword can be used. variadic macro arguments are permitted, but their use should be limited to using __va_args__. the exact-width integer types in nspr should be used, in preference to those declared in <stdint.h> (which will be used by nspr in the future). universal character names are not permitted, as are wide character types (char16_t and char32_t). nss source should only include ascii text. escape non-printing characters (with \x if there is no special escape such as \r, \n, and \t) and avoid defining string literal...
Building the WebLock UI
clicked, the button executes a javascript function called addthissite(), which we've already defined in the weblock.js file in client code overview above. ...
Index
Mozilla › Tech › XPCOM › Index
etactiondescription this method retrieves the description (localized name) of the accessible action at the given zero-based index. 265 getactionname this method retrieves the name of the accessible action at the given zero-based index. 266 getbounds this method returns accessible's (x and y) coordinates relative to the screen and accessible's width and height. 267 getchildat this method returns nth accessible child using zero-based index. 268 getchildatpoint this method returns an accessible child which contains the coordinate at (x, y) in screen pixels. 269 getkeybindings this method provides array of localized string of global keyboard accelerator for the given action index...
imgIRequest
y. mimetype string read only. uri nsiuri the uri the image load was started with. note that this might not be the actual uri for the image (for example if http redirects happened during the load). read only. constants constant value description status_none 0x0 nothing to report. status_size_available 0x1 we received enough image data from the network or filesystem that we know the width and height of the image, and have thus called setsize() on the container. status_load_partial 0x2 used internally by imgrequest to flag that a request is being cancelled as a result of a failure of a proxy holder and not an internal failure. at least i think that's what it does. regardless, there's no reason for this flag to be public, and it should either go away or become a private state flag...
GetBounds
« nsiaccessible page summary this method returns accessible's (x and y) coordinates relative to the screen and accessible's width and height. void getbounds( out long ax, out long ay, out long awidth, out long aheight ) parameters ax[out] accessible's x-coordinate. ay[out] accessible's y-coordinate. awidth[out] accessible's width. aheight[out] accessible's height. ...
nsIAccessible
ated this method returns an accessible related to this one by the given relation type. getrelation this method returns one accessible relation for this object. getrelations this method returns multiple accessible relations for this object. getbounds this method returns accessible's (x and y) coordinates relative to the screen and accessible's width and height. setselected this method adds or remove this accessible to the current selection. extendselection this method extends the current selection from its current accessible anchor node to this accessible. takeselection this method selects this accessible node only. takefocus this method focuses this accessible node. g...
nsIBoxObject
parentbox nsidomelement the parent of the box, in box-ordinal-group order. read only. previoussibling nsidomelement the previous sibling of the box, in box-ordinal-group order. read only. screenx long the x coordinate of the box relative to the screen origin, in device pixels. read only. screeny long the y coordinate of the box relative to the screen origin, in device pixels. read only. width long the width of the box, in css pixels. read only. x long the x coordinate of the box, in css pixels. read only. y long the y coordinate of the box, in css pixels. read only. methods getlookandfeelmetric() obsolete since gecko 1.9 (firefox 3) wstring getlookandfeelmetric( in wstring propertyname ); parameters propertyname return value getproperty() wstrin...
nsIDOMNSHTMLDocument
that is a head element, or null if there is no html or head element. read only. height long the height of the body element. read only. obsolete since gecko 6.0 linkcolor domstring same as body.link plugins nsidomhtmlcollection same as embeds for compatibility with netscape 4.x read only. vlinkcolor domstring same as body.vlink width long the width of the body element. read only. obsolete since gecko 6.0 methods captureevents() provided for compatibility with netscape 4.x, but does not actually do anything. void captureevents( in long eventflags ); parameters eventflags clear() used to reset a document to blank, but deprecated since gecko 1.0 and provided for compatibility with netscape 4.x; use ope...
nsIDOMSimpleGestureEvent
egative values indicate zooming out. read only. note: on mac os x, the units used for magnification gestures by the underlying operating system api are not documented at this time; typical values appear to be in the range 0.0 to 100.0, but currently you can only rely on the value being either positive or negative. on windows, the units indicate the difference between the previous and current width between the two touch points, in pixels. direction unsigned long the direction in which the gesture moved. see direction constants and rotation constants on this page. read only. constants direction constants constant value description direction_up 1 upward swipe. direction_down 2 downward swipe. direction_left 4...
nsIDocShell
load. used for contentviewer eviction. read only. loadtype unsigned long load type for the document. valid states are defined in constants. note that nsidocshell may use other states internally so you should check for the specific state bit. marginheight long the value of the marginheight attribute on the frame element, or negative if it was not set. marginwidth long the value of the marginwidth attribute on the frame element, or negative if it was not set. parentcharset nsiatom indicates the docshell's parent document's character set. note: prior to gecko 12.0, this attribute was part of a separate nsidoccharsetinfo interface. parentcharsetsource print32 indicates the source from which the...
nsIDragSession
where the drag was started, which will be null if the drag originated outside the application. useful for determining if a drop originated in the same document. read only. sourcenode nsidomnode the dom node that was originally dragged to start the session, which will be null if the drag originated outside the application. read only. targetsize nssize sets the current width and height of the drag target area. it will contain the current size of the frame that the drag is currently in. native code only! methods getdata() gets data from a drag and drop operation. can be called while the drag is in process or after the drop has completed. void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); parameters atransferable the tran...
nsIFileView
s filterstring the filter to be applied to the file list. sort() set the method used for sorting. void sort( in short sorttype, in boolean reversesort ); parameters sorttype one of the sort* constants. reversesort true, results will be sorted in ascending order. ...
nsITaskbarWindowPreview
s of the preview are not controlled using this interface. for example, the title and icon for each preview always match the title and icon of the corresponding window. if the enablecustomdrawing attribute is true, the controller you implement will start receiving calls to its nsitaskbarpreviewcontroller.drawpreview() and nsitaskbarpreviewcontroller.drawthumbnail() methods, as well as reads of its width, height, and thumbnailaccessratio attributes. by default, however, windows handles this drawing by itself. in addition, these previews are visible by default. when made invisible, the window disappears from the list of the application's windows in the taskbar. if a window has any visible nsitaskbartabpreview objects, the nsitaskbarwindowpreview for the corresponding window is automatically hidden...
nsITreeColumn
yed order. read only. primary boolean if true the nsitreecolumn is the primary column. if the primary attribute is not set, the column is not the primary column. read only. selectable boolean if true the nsitreecolumn is able to be selected. if the selectable attribute is not set, the column cells are not selectable. read only. type short the type of the column, see constants. read only. width long the width of nsitreecolumn. read only. x long the x position in the tree of the left edge of the nsitreecolumn. read only. constants constant value description type_text 1 text column type. type_checkbox 2 checkbox column type. type_progressmeter 3 progress meter column type. methods native code only!getidconst void getidconst( [shared] out wstring idconst ); parameters ...
nsITreeView
efining an icon for a cell. if the empty string is returned, the ::moz-tree-image pseudoelement will be used. astring getimagesrc( in long row, in nsitreecolumn col ); parameters row the index of the row. col the index of the column. return value the image path of the cell. getlevel() the level is an integer value that represents the level of indentation. it is multiplied by the width specified in the ::moz-tree-indentation pseudoelement to compute the exact indentation. long getlevel( in long index ); parameters index the index of the item. return value the level of indentation. getparentindex() methods used by the tree to draw thread lines in the tree. getparentindex is used to obtain the index of a parent row. if there is no parent row, getparentindex returns ...
nsIWebBrowserChrome
tatus. showasmodal() shows the window as a modal window. void showasmodal(); parameters none. return value note: the function error code returned by this corresponds to the status value specified in exitmodaleventloop. sizebrowserto() tells the chrome to size itself such that the browser will be the specified size. void sizebrowserto( in long acx, in long acy ); parameters acx new width of the browser. acy new height of the browser. ...
nsIWebBrowserPersist
re uris linked to the document are saved or nsnull if no linked uris should be saved. this may be a nsilocalfile object or an nsiuri object with a file scheme. aoutputcontenttype the desired mime type format to save the document and all sub-documents into or nsnull to use the default behavior. aencodingflags flags to pass to the encoder. awrapcolumn for text documents, indicates the desired width to wrap text at. parameter is ignored if wrapping is not specified by the encoding flags. exceptions thrown ns_error_invalid_arg one or more arguments was invalid. saveuri() as of firefox 26, this method should no longer be used from add-on code. please use downloads.createdownload() instead. as of firefox 36, a new parameter areferrerpolicy was added as the fourth argument, changing t...
XUL Overlays
Mozilla › Tech › XUL › Overlays
y 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 that appear in multiple pla...
Index
can use these helper methods. an alternative to these methods is to directly access the element by it's id as in the detect when a folder opens example. 95 access window missing, thunderbird the window object represents the window of the thunderbird application as well as the currently opened tabs. you can do many things with the window object, such as accessing the height or width of the window/tab or setting its title, registering timer events and much more. the window api will give you the complete details. since window is a global variable you can use it directly from your javascript file. 96 access window area needsupdate, missing, thunderbird this page has no content. enrich mdc by contributing. 97 add new tab missing, thunderbird ...
Creating a Custom Column
e user can easily resize and drag our column around. our replyto_col_overlay.xul should now contain something similar to this: <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="threadtree"> <treecols id="threadcols"> <splitter class="tree-splitter" /> <treecol id="colreplyto" persist="hidden ordinal width" currentview="unthreaded" flex="2" label="reply-to" tooltiptext="click to sort by the reply-to header" /> </treecols> </tree> <!-- include our javascript file --> <script type="text/javascript" src="chrome://replyto_col/content/replyto_col.js"/> </overlay> that's it! our new column exists and is ready to be used. unfortunately the new column doesn't have any da...
Access Window
the window api will give you the complete details. since window is a global variable you can use it directly from your javascript file. ...
customDBHeaders Preference
gdbview.addcolumnhandler("colsuperfluous",columnhandler)). javascript code once again, oth...
Preferences System
l="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner applications when calling opendialog() to open a preferences dialog, "toolbar" should be included in the features string. not using "toolbar" will cause the pre...
Browser Console - Firefox Developer Tools
tor('.webconsole-clear-console-button'); clearbtn.addeventlistener('mouseover', function() { hud.jsterm.clearoutput(true); }, false); bonus features available for add-on sdk add-ons, the console api is available automatically. here's an example add-on that just logs an error when the user clicks a widget: widget = require("sdk/widget").widget({ id: "an-error-happened", label: "error!", width: 40, content: "error!", onclick: logerror }); function logerror() { console.error("something went wrong!"); } if you build this as an xpi file, then open the browser console, then open the xpi file in firefox and install it, you'll see a widget labeled "error!" in the add-on bar: click the icon. you'll see output like this in the browser console: for add-on sdk-based add-ons only, the...
Page inspector 3-pane mode - Firefox Developer Tools
le — 3-pane mode. when activated, this allows you to see the following simultaneously: the html pane on the left hand side, as usual. the css rules in the middle in their own separate pane, rather than as a tab. the other css related features — such as computed styles view, animations view, and fonts view — in tabs on the right hand side, as usual. note: at narrower browser window widths, the tabs appear below the css rules pane. having the css rules in their own pane is very useful because it allows you to not only inspect your html and edit the css applied to it, but also see the effect this has on css features such as computed styles and grids in real time. you just need to have the relevant tab open to see the effect. a brief walkthrough the 3-pane inspector is disabled ...
Examine and edit CSS - Firefox Developer Tools
to page the edited rule into your stylesheet. right-click on the changes panel and select copy rule from the context menu. the copy rule command copies the entire element, class, or id definition, including any unchanged rules and the rules that describe your changes. for example, copying the changes in the preceding image, you get the following: .text-content p { box-sizing:border-box; max-width:24rem; text-decoration: underline; color: cadetblue; font-weight: bold; } add rules you can add new rules in the rules view. just right-click to show the context menu and select "add rule". this will add a new css rule whose selector matches the currently selected node. there's also a button that enables you to do the same thing: copy rules to copy rules, and pieces of rules, use one ...
Examine and edit HTML - Firefox Developer Tools
ements because it makes markup more readable. usually this white space seems to have no effect and no visual output, but in fact, when a browser parses html it will automatically generate anonymous text nodes for elements not contained in a node. this includes white space (which is after all a type of text). if these auto generated text nodes are inline level, browsers will give them a non-zero width and height. then you will find strange gaps between elements, even if you haven’t set any margin or padding on them. since firefox 52, the inspector displays these whitespace nodes, so you can see where the gaps in your markup come from. whitespace nodes are represented with a dot: and you get an explanatory tooltip when you hover over them: to see this in action, see the demo at https://m...
Work with animations - Firefox Developer Tools
the browser name "firefox developer edition" and the browser icon. the img#icon animation: animated the filter and transform properties, to scale the icon and color it lasted 750ms, had an enddelay of 100ms used the compositor thread was given an easing value of ease-in: you can see this by the concave shape of the green bar. the span#note animation: animated the width and opacity properties, to make the name gradually appear lasted 500ms, and had a delay of 150ms was given an easing value of ease-out: you can see this by the convex shape of the green bar. animation playback at the top of the animation inspector: there are buttons to play/pause and restart the animation there's a dropdown to change the animation playback rate the current time...
Paint Flashing Tool - Firefox Developer Tools
he element's margin-left, while the second way moves the element using the transform property. ...
Animating CSS properties - Firefox Developer Tools
0 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 handled in composition. transform opacity the css trigge...
Waterfall - Firefox Developer Tools
ooth. for a rate of 60 frames per second, that gives the browser 16.7 milliseconds to execute the complete flow. importantly for responsiveness, the browser doesn't always have to go through every step: css animations update the page without having to run any javascript. not all css property changes cause a reflow. changing properties that can alter an object's geometry and position, such as width, display, font-size, or top, will cause a reflow. however, changing properties that don't alter geometry or position, such as color or opacity, will not. not all css property changes cause a repaint. in particular, if you animate an element using the transform property, the browser will use a separate layer for the transformed element, and doesn't even have to repaint when the element is moved: ...
Responsive Design Mode - Firefox Developer Tools
the device you select when in responsive design mode and the orientation (portrait or landscape) is saved between sessions. information for the selected device is centered over the display. from left to right, the display includes: name of the selected device - a drop-down list that includes whatever devices you have selected from the device settings screen. screen size - you can edit the width and height values to change the device size by editing a number directly or using the up and down keys to increase or decrease the value by 1 pixels on each keypress or hold and shift to change the value by 10. the mouse wheel changes the size values by 1 pixel at a time you can also change the device's screen size by grabbing the bottom-right corner of the viewport and dragging it to th...
View Source - Firefox Developer Tools
r cmd + u on macos the command opens a new tab with the source for the current page. view source features view source has three additional features, which can be accessed from the context menu in the view source tab: go to line scrolls to the specified line. if the number is higher than the lines in a file, you receive an error message. wrap long lines (toggle) wraps long lines to the width of the page. syntax highlighting (toggle) applies syntax highlighting to the code.when syntax highlighting is on, view source also highlights parsing errors in red. hovering your mouse over errors displays a tooltip explaining the error. this feature is useful when you're looking for html errors. to access go to line from the keyboard, press control + option + l on macos, or alt + shift + ...
Web Console remoting - Firefox Developer Tools
:05:27 gmt" }, ... ], "headerssize": 320 } the getresponsecookies packet: { "to": "conn0.netevent15", "type": "getresponsecookies" } { "from": "conn0.netevent15", "cookies": [] } starting with firefox 19: for all of the header and cookie values in the above packets we use longstringactor grips when the value is very long. this helps us avoid using too much of the network bandwidth. the getrequestpostdata packet: { "to": "conn0.netevent15", "type": "getrequestpostdata" } { "from": "conn0.netevent15", "postdata": { text: "foobar" }, "postdatadiscarded": false } the getresponsecontent packet: { "to": "conn0.netevent15", "type": "getresponsecontent" } { "from": "conn0.netevent15", "content": { "mimetype": "text/css", "text": "\n@import \"test.css...
CSSImageValue - Web APIs
yle-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. 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. 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 computedstylemap() const allcomputedstyles = button.computedstylemap(); // ...
CSSPositionValue - Web APIs
of the page. ...
CSSStyleDeclaration.setProperty() - Web APIs
the setproperty() method, for example boxpararule.style.setproperty('border', newborder); html <div class="controls"> <button class="border">border</button> <button class="bgcolor">background</button> <button class="color">text</button> </div> <div class="box"> <p>box</p> </div> css html { background: orange; font-family: sans-serif; height: 100%; } body { height: inherit; width: 80%; min-width: 500px; max-width: 1000px; margin: 0 auto; } .controls { display: flex; justify-content: space-around; align-items: center; } div button { flex: 1; margin: 20px; height: 30px; line-height: 30px; } .box { display: flex; justify-content: center; align-items: center; height: calc(100% - 70px); } .box p { width: 50%; text-align: center; font-weigh...
Using the CSS properties and values API - Web APIs
)); transition: --registered 1s ease-in-out; } .registered:hover, .registered:focus { --registered: #b4d455; } .unregistered { --unregistered: #c0ffee; background-image: linear-gradient(to right, #fff, var(--unregistered)); transition: --unregistered 1s ease-in-out; } .unregistered:hover, .unregistered:focus { --unregistered: #b4d455; } button { height: 40vh; display: block; width: 100%; font-size: 3vw; } window.css.registerproperty({ name: '--registered', syntax: '<color>', inherits: false, initialvalue: 'red', }); while not functionally accurate, a good way to think about the difference between the unregistered property in the above example and the registered property is the difference between a <custom-ident> and a number when trying to animate height. ...
CanvasRenderingContext2D.arc() - Web APIs
make a full circle, the arc begins at an angle of 0 radians (0°), and ends at an angle of 2π radians (360°). const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.arc(100, 75, 50, 0, 2 * math.pi); ctx.stroke(); result different shapes demonstrated this example draws various shapes to show what is possible with arc(). ...
CanvasRenderingContext2D.closePath() - Web APIs
html <canvas id="canvas"></canvas> javascript the first two arcs create the face's eyes. the last arc creates the mouth. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.arc(240, 20, 40, 0, math.pi); ctx.moveto(100, 20); ctx.arc(60, 20, 40, 0, math.pi); ctx.moveto(215, 80); ctx.arc(150, 80, 65, 0, math.pi); ctx.closepath(); ctx.linewidth = 6; ctx.stroke(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.closepath' in that specification. living standard ...
CanvasRenderingContext2D.createRadialGradient() - Web APIs
radial canvasgradient initialized with the two specified circles. examples filling a rectangle with a radial gradient this example initializes a radial gradient using the createradialgradient() method. three color stops between the gradient's two circles are then created. finally, the gradient is assigned to the canvas context, and is rendered to a filled rectangle. ...
CanvasRenderingContext2D.drawWindow() - Web APIs
h fission. if you're using it from an extension, you should switch to tabs.capturetab. if you're writing chrome code, you probably want windowglobalparent.drawsnapshot from the parent process. syntax void ctx.drawwindow(window, x, y, w, h, bgcolor [, flags]); parameters window the window to render. x the x-axis coordinate of the window. y the y-axis coordinate of the window. w the width of the window. h the height of the window. bgcolor a domstring that specifies the color the canvas is filled with before the window is rendered into it. this color may be transparent/translucent. it is given as a css color string (for example, rgb() or rgba()). notes: if "rgba(0,0,0,0)" is used for the background color, the drawing will be transparent wherever the window is transparent. ...
CanvasRenderingContext2D.ellipse() - Web APIs
anticlockwise optional an optional boolean which, if true, draws the ellipse anticlockwise (counter-clockwise). the default value is false (clockwise). examples drawing a full ellipse this example draws an ellipse at an angle of π/4 radians (45°). to make a full ellipse, the arc begins at an angle of 0 radians (0°), and ends at an angle of 2π radians (360°). ...
CanvasRenderingContext2D.fillStyle - Web APIs
ple 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 channels, you can generate all kinds of palettes. ...
CanvasRenderingContext2D.globalAlpha - Web APIs
evel will apply to all of our transparent shapes. after that, we use a for loop to draw a series of circles with increasing radii. with each new circle, 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. ...
CanvasRenderingContext2D.isPointInPath() - Web APIs
living standard ...
CanvasRenderingContext2D.lineDashOffset - Web APIs
ing ants effect is an animation technique often found in selection tools of computer graphics programs. it helps the user to distinguish the selection border from the image background by animating the border. ...
CanvasRenderingContext2D.lineTo() - Web APIs
ent sub-path, which means that all the lines will all be stroked or filled together. this example draws a letter 'm' with a single contiguous line. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.moveto(90, 130); ctx.lineto(95, 25); ctx.lineto(150, 80); ctx.lineto(205, 25); ctx.lineto(210, 130); ctx.linewidth = 15; ctx.stroke(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.lineto' in that specification. living standard ...
CanvasRenderingContext2D.measureText() - Web APIs
the canvasrenderingcontext2d.measuretext() method returns a textmetrics object that contains information about the measured text (such as its width, for example). syntax ctx.measuretext(text); parameters text the text string to measure. return value a textmetrics object. example given this <canvas> element: <canvas id="canvas"></canvas> ... you can get a textmetrics object using the following code: const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let text = ctx.measuretext('hello world'); console.log(text.width); // 56; specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.measuretext' in that specification. living standard ...
CanvasRenderingContext2D.rotate() - Web APIs
first, translate() moves the matrix's origin to the shape's center. rotate() rotates the matrix by the desired amount. finally, translate() moves the matrix's origin back to its starting point. this is done by applying the values of the shape's center coordinates in a negative direction. html <canvas id="canvas"></canvas> javascript the shape is a rectangle with its corner at (80, 60), a width of 140, a height of 30. its horizontal center is at (80 + 140 / 2), or 150. its vertical center is at (60 + 30 / 2), or 75. thus, the center point is at (150, 75). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // non-rotated rectangle ctx.fillstyle = 'gray'; ctx.fillrect(80, 60, 140, 30); // matrix transformation ctx.translate(150, 75); ctx.rotate(math.
CanvasRenderingContext2D.save() - Web APIs
nvasrenderingcontext2d.save() method of the canvas 2d api saves the entire state of the canvas by pushing the current state onto a stack. the drawing state the drawing state that gets saved onto a stack consists of: the current transformation matrix. the current clipping region. the current dash list. the current values of the following attributes: strokestyle, fillstyle, globalalpha, linewidth, linecap, linejoin, miterlimit, linedashoffset, shadowoffsetx, shadowoffsety, shadowblur, shadowcolor, globalcompositeoperation, font, textalign, textbaseline, direction, imagesmoothingenabled. syntax void ctx.save(); examples saving the drawing state this example uses the save() method to save the default state and restore() to restore it later, so that you are able to draw a rect with the...
CanvasRenderingContext2D.scale() - Web APIs
. a value of 1 results in no horizontal scaling. y scaling factor in the vertical direction. a negative value flips pixels across the horizontal axis. a value of 1 results in no vertical scaling. examples scaling a shape this example draws a scaled rectangle. a non-scaled rectangle is then drawn for comparison. html <canvas id="canvas"></canvas> javascript the rectangle has a specified width of 8 and a height of 20. the transformation matrix scales it by 9x horizontally and by 3x vertically. thus, its final size is a width of 72 and a height of 60. notice that its position on the canvas also changes. since its specified corner is (10, 10), its rendered corner becomes (90, 30). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // scaled rectangl...
CanvasRenderingContext2D.strokeStyle - Web APIs
10, 10, 100, 100); result creating multiple stroke colors using loops in this example, we use two for loops and the arc() method to draw a grid of circles, each having a different stroke color. to achieve this, we use the two variables i and j to generate a unique rgb color for each circle, and only modify the green and blue values. ...
CanvasRenderingContext2D.textBaseline - Web APIs
seline. (used by chinese, japanese, and korean scripts.) "bottom" the text baseline is the bottom of the bounding box. this differs from the ideographic baseline in that the ideographic baseline doesn't consider descenders. the default value is "alphabetic". examples comparison of property values this example demonstrates the various textbaseline property values. ...
Compositing and clipping - Web APIs
next, we create the circular clipping path by drawing an arc and calling clip(). clipping paths are also part of the canvas save state. if we wanted to keep the original clipping path we could have saved the canvas state b...
Canvas tutorial - Web APIs
<canvas> has since been implemented in browsers. today, all major browsers support it. before you start using the <canvas> element is not very difficult, but you do need a basic understanding of html and javascript. the <canvas> element is not supported in some older browsers, but is supported in recent versions of all major browsers. the default size of the canvas is 300 pixels × 150 pixels (width × height). but custom sizes can be defined using the html height and width property. in order to draw graphics on the canvas we use a javascript context object, which creates graphics on the fly. in this tutorial basic usage drawing shapes applying styles and colors drawing text using images transformations compositing and clipping basic animations advanced animations pixel manipula...
DOMMatrixReadOnly.flipX() - Web APIs
the result of the original matrix flipped about the x-axis, which is equivalent to multiplying the matrix by dommatrix(-1, 0, 0, 1, 0, 0). the original matrix is not modified. examples this svg contains two paths in the shape of a triangle, both drawn to the same position. note that the x co-ordinate of the viewbox attribute is negative, showing us content from both sides of the x-axis. <svg width="100" height="100" viewbox="-50 0 100 100"> <path fill="red" d="m 0 50 l 50 0 l 50 100 z" /> <path id="flipped" fill="blue" d="m 0 50 l 50 0 l 50 100 z" /> </svg> this javascript first creates an identity matrix, then uses the `flipx()` method to create a new matrix, which is then applied to the blue triangle, inverting it across the x-axis. the red triangle is left in place. const flipped...
DOMMatrixReadOnly.scale() - Web APIs
firefox still supports an older version of the specification that accepts either one or three values. dommatrix.scale(scale[, originx][, originy]) we'll show an example of how you can deal with the cross-browser support implications of this in the examples section, below. examples this svg contains three squares, one red, one blue, and one green, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 25 25"> <rect width="25" height="25" fill="red" /> <rect id="transformed" width="25" height="25" fill="blue" /> <rect id="transformedorigin" width="25" height="25" fill="green" /> </svg> this javascript first creates an identity matrix, then uses the scale() method to create a new matrix with a single parameter. we test if the browser supports a six parame...
DOMMatrixReadOnly.translate() - Web APIs
e resulting matrix will be 3d. return value returns a dommatrix containing a new matrix being the result of the matrix being translated by the given vector. the original matrix is not modified. if a translation is applied about the z-axis, the resulting matrix will be a 4x4 3d matrix. examples this svg contains two squares, one red and one blue, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 50 50"> <rect width="25" height="25" fill="red" /> <rect id="transformed" width="25" height="25" fill="blue" /> </svg> the following javascript first creates an identity matrix, then uses the translate() method to create a new, translated matrix — which is then applied to the blue square as a transform. the red square is left in place. const matrix = new do...
DOMRect.DOMRect() - Web APIs
Web › API › DOMRect › DOMRect
the domrect() constructor creates a new domrect object. syntax var mydomrect = new domrect(x, y, width, height); parameters x the x coordinate of the domrect's origin. y the y coordinate of the domrect's origin. width the width of the domrect. height the height of the domrect. examples to create a new domrect, you could run a line of code like so: mydomrect = new domrect(0,0,100,100); // running 'mydomrect' in the console would then return // domrect { x: 0, y: 0, width: 100, height: 100, top: 0, right: 100, bottom: 100, left: 0 } specifications specification status comment geometry interfaces module level 1the definition of 'domrect()' in that specification. candidate recommendation initial definition. ...
DOMRectReadOnly.fromRect() - Web APIs
e creates a new domrectreadonly object with a given location and dimensions. syntax var domrect = domrectreadonly.fromrect(rectangle) parameters rectangle optional an object specifying the location and dimensions of a rectangle. all properties default to 0. the properties are: x: the coordinate of the left side of the rectangle. y: the coordinate of the top side of the rectangle. width: the width of the rectangle. height: the height of the rectangle. return value an instance of domrect. specifications specification status comment geometry interfaces module level 1the definition of 'fromrect()' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generat...
DOMRectReadOnly.left - Web APIs
the left read-only property of the domrectreadonly interface returns the left coordinate value of the domrect. (has the same value as x, or x + width if width is negative.) syntax var recleft = domrect.left; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'left' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly.right - Web APIs
the right read-only property of the domrectreadonly interface returns the right coordinate value of the domrect. (has the same value as x + width, or x if width is negative.) syntax var recright = domrect.right; value a double. specifications specification status comment geometry interfaces module level 1the definition of 'right' in that specification. candidate recommendation latest spec version is an ed. ...
DOMRectReadOnly - Web APIs
re immutable. constructor domrectreadonly() defined to create a new domrectreadonly object. note that this constructor cannot be called by 3rd party javascript; doing so returns an "illegal constructor" typeerror. properties domrectreadonly.x read only the x coordinate of the domrect's origin. domrectreadonly.y read only the y coordinate of the domrect's origin. domrectreadonly.width read only the width of the domrect. domrectreadonly.height read only the height of the domrect. domrectreadonly.top read only returns the top coordinate value of the domrect (usually the same as y.) domrectreadonly.right read only returns the right coordinate value of the domrect (usually the same as x + width). domrectreadonly.bottom read only returns the bottom coordinate value of...
DataTransfer.getData() - Web APIs
d value. example this example shows the use of the datatransfer object's getdata() and setdata() methods. ...
Document: drag event - Web APIs
event handler property ondrag examples see this code in a jsfiddle demo or interact with it below. html <div class="dropzone"> <div id="draggable" draggable="true" ondragstart="event.datatransfer.setdata('text/plain',null)"> this div is draggable </div> </div> <div class="dropzone"></div> <div class="dropzone"></div> <div class="dropzone"></div> css #draggable { width: 200px; height: 20px; text-align: center; background: white; } .dropzone { 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. on the...
Document.getElementsByClassName() - Web APIs
document.getelementsbyclassname works very similarly to document.queryselector and document.queryselectorall. only elements with all of the classnames specified are selected. ...
Document.hasFocus() - Web APIs
Web › API › Document › hasFocus
living standard initial definition ...
Document: wheel event - Web APIs
olling direction. instead, detect value changes of scrollleft and scrolltop in the scroll event. examples scaling an element via the wheel this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
Element: DOMActivate event - Web APIs
the domactivate event is fired at an element when it becomes active, such as when it is clicked on using the mouse or a keypress is used to navigate to it. ...
Element: MozMousePixelScroll event - Web APIs
operty indicates the scroll distance in terms of lines, with negative values indicating the scrolling movement is either toward the bottom or toward the right, and positive values indicating scrolling to the top or left. if the platform's native mouse wheel events indicate the scroll distance in terms of lines or pages, the value of detail is computed using that value and the line height or page width/height of the nearest ancestor scrollable element that contains the target element. note: on macos, the scroll distance (and therefore the value of detail) is computed based on the accelerated scroll distance. the value of detail is never 0 if the events are legitimate. ...
Element: auxclick event - Web APIs
lled on that event, in order to prevent the context menu from popping up after the color change is applied. html <button><h1>click me!</h1></button> css html { height: 100%; overflow: hidden; } body { height: inherit; display: flex; justify-content: center; align-items: center; margin: 0; } button { border: 0; background-color: white; font-size: 8vw; display: block; width: 100%; height: 100%; } h1 { letter-spacing: 0.5rem; } result note: if you are using a three-button mouse, you'll notice that the onauxclick handler is run when any of the non-left mouse buttons are clicked (usually including any "special" buttons on gaming mice). specification specification status ui eventsthe definition of 'auxclick' in that specification. w...
Element.clientLeft - Web APIs
clientleft does not include the left margin or the left padding. clientleft is read-only. when layout.scrollbar.side preference is set to 1 or to 3 and when the text-direction is set to rtl, then the vertical scrollbar is positioned on the left and this impacts the way clientleft is computed. note: this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). note: when an element has display: inline, clientleft returns 0 regardless of the element's border. ...
Element: error event - Web APIs
event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); const badimg = document.queryselector('.bad-img'); badimg.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: loading image\n`; console.log(event) }); const imgerror = document.queryselector('#img-error'); imgerror.addeventlistener('click', () => { badimg.setat...
Element.innerHTML - Web APIs
Web › API › Element › innerHTML
ogevent); html the html is quite simple for our example. <div class="box"> <div><strong>log:</strong></div> <div class="log"></div> </div> the <div> with the class "box" is just a container for layout purposes, presenting the contents with a box around it. the <div> whose class is "log" is the container for the log text itself. css the following css styles our example content. .box { width: 600px; height: 300px; border: 1px solid black; padding: 2px 4px; overflow-y: scroll; overflow-x: auto; } .log { margin-top: 8px; font-family: monospace; } result the resulting content looks like this. you can see output into the log by moving the mouse in and out of the box, clicking in it, and so forth. specification specification status comment ...
Element.localName - Web APIs
Web › API › Element › localName
qualified names are typically used in xml as part of the namespace(s) of the particular xml documents.
Element: mouseenter event - Web APIs
wing trivial example uses the mouseenter event to change the border on the div when the mouse enters the space alloted to it. it then adds an item to the list with the number of the mouseenter or mouseleave event. html <div id='mousetarget'> <ul id="unorderedlist"> <li>no events yet!</li> </ul> </div> css styling the div to make it more visible. ...
Element: mouseleave event - Web APIs
trivial example uses the mouseenter event to change the border on the <div> when the mouse enters the space alloted to it. it then adds an item to the list with the number of the mouseenter or mouseleave event. html <div id='mousetarget'> <ul id="unorderedlist"> <li>no events yet!</li> </ul> </div> css styling the <div> to make it more visible. ...
Element.msZoomTo() - Web APIs
Web › API › Element › msZoomTo
zooming effect on non-zoomable elements (e.g., elements with "-ms-content-zooming: none"). ...
Element.releasePointerCapture() - Web APIs
ethod returns undefined. exceptions exception explanation invalidpointerid pointerid does not match any of the active pointers. example this example sets pointer capture on a <div> when you press down on it. this lets you slide the element horizontally, even when you pointer moves outside of its boundaries. ...
Element.setPointerCapture() - Web APIs
ethod returns undefined. exceptions exception explanation invalidpointerid pointerid does not match any of the active pointers. example this example sets pointer capture on a <div> when you press down on it. this lets you slide the element horizontally, even when you pointer moves outside of its boundaries. ...
Element.shadowRoot - Web APIs
wroot. from here we use standard dom traversal techniques to find the <style> element inside the shadow dom and then update the css found inside it: function updatestyle(elem) { const shadow = elem.shadowroot; const childnodes = array.from(shadow.childnodes); childnodes.foreach(childnode => { if (childnode.nodename === 'style') { childnode.textcontent = ` div { width: ${elem.getattribute('l')}px; height: ${elem.getattribute('l')}px; background-color: ${elem.getattribute('c')}; } `; } }); } specifications specification status comment domthe definition of 'shadowroot' in that specification. living standard ...
Element: wheel event - Web APIs
on. instead, detect value changes of scrollleft and scrolltop of the target in the scroll event. examples scaling an element via the wheel this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
EventTarget.addEventListener() - Web APIs
middle, capture & none-capture <a class="inner1" href="https://www.mozilla.org" target="_blank"> inner1, passive & preventdefault(which is not allowed) </a> <a class="inner2" href="https://developer.mozilla.org/" target="_blank"> inner2, none-passive & preventdefault(not open new page) </a> </div> </div> css .outer, .middle, .inner1, .inner2 { display: block; width: 520px; padding: 15px; margin: 15px; text-decoration: none; } .outer { border: 1px solid red; color: red; } .middle { border: 1px solid green; color: green; width: 460px; } .inner1, .inner2 { border: 1px solid purple; color: purple; width: 400px; } javascript const outer = document.queryselector('.outer'); const middle = document.queryselector('.middle'); const i...
FileReader: abort event - Web APIs
ut type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js cons...
FileReader: load event - Web APIs
ut type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js cons...
FileReader: loadend event - Web APIs
ut type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js cons...
FileReader: loadstart event - Web APIs
ut type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js cons...
FileReader: progress event - Web APIs
ut type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js cons...
GlobalEventHandlers.oncontextmenu - Web APIs
is it disabled?<p> javascript window.oncontextmenu = (e) => { e.preventdefault(); } result pausing an animation this example pauses a spinning shape whenever you open the context menu. ...
GlobalEventHandlers.onpointerdown - Web APIs
or when they lift the stylus or finger from the screen). in addition, the event's preventdefault() method is called to ensure that the mouseup event isn't triggered unnecessarily. html the html is extremely simple: <div id="target"> tap me, click me, or touch me! </div> css the css simply sets up the appearance of the target, and doesn't affect its functionality at all. #target { width: 400px; height: 30px; text-align: center; font: 16px "open sans", "helvetica", sans-serif; color: white; background-color: blue; border: 2px solid darkblue; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } result the resulting output is shown below. try tapping, clicking, or touching the box and see what happe...
GlobalEventHandlers.onscroll - Web APIs
as its sole argument. only one onscroll handler can be assigned to an object at a time. for greater flexibility, you can pass a scroll event to the eventtarget.addeventlistener() method instead. example this example monitors scrolling on a <textarea>, and logs the element's vertical scroll position accordingly. ...
GlobalEventHandlers.onwheel - Web APIs
functionref is a function name or a function expression. the function receives a wheelevent object as its sole argument. examples this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
HTMLAreaElement.referrerPolicy - Web APIs
be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). this case is unsafe as it can leak path information that has been concealed to third-party by using tls. examples <img usemap="#maparound" width="100" height="100" src="/img/logo@2x.png" /> <map id="mymap" name="maparound" />> var elt = document.createelement("area"); elt.href = "/img2.png"; elt.shape = "rect"; elt.referrerpolicy = "no-referrer"; elt.coords = "0,0,100,100"; var map = document.getelementbyid("mymap"); map.appendchild(elt); // when clicked, the area's link will not send a referrer header. specifications specif...
HTMLBaseFontElement - Web APIs
color using either a named color or a color specified in the hexadecimal #rrggbb format. htmlbasefontelement.face is a domstring representing a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. htmlbasefontelement.size is a domstring representing the font size as either a numeric or relative value. numeric values range from 1 to 7 with 1 being the smallest and 3 the default. relative value starts with a '+' or a '-'. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment ...
HTMLCanvasElement.getContext() - Web APIs
st 8 bits. return value a renderingcontext which is either a canvasrenderingcontext2d for "2d", webglrenderingcontext for "webgl" and "experimental-webgl", webgl2renderingcontext for "webgl2" or imagebitmaprenderingcontext for "bitmaprenderer". if the contexttype doesn't match a possible drawing context, null is returned. examples given this <canvas> element: <canvas id="canvas" width="300" height="300"></canvas> you can get a 2d context of the canvas with the following code: var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); console.log(ctx); // canvasrenderingcontext2d { ... } now you have the 2d rendering context for a canvas and you can draw within it. specifications specification status comment html living sta...
HTMLCanvasElement.mozFetchAsStream() - Web APIs
ating the image format. the default type is image/png. return value none. examples save to disk with mozfetchasstream (chrome context only) this technique also converts it to ico, however it will not work in windows xp as winxp cannot convert from png to ico. it saves to the desktop it uses fileutils.jsm. ...
HTMLCanvasElement.mozGetAsFile() - Web APIs
tions, see our image file type and format guide. return value a file object representing the image contained in the canvas. the file's data is entirely located in memory until such time as it is explicitly written to disk. examples this example creates an image file from the <canvas> element on the page, then uses a filereader to read the image data from the file. html <canvas id="canvas" width="100" height="100"></canvas> <p><a href="#" id="link">click here to try out mozgetasfile()</a>.</p> javascript the following code uses mozgetasfile() to create a file object from the canvas and appends it as an image to the page by loading it as a data url using the readasdataurl() method. then a new <img> element is created using the new data url. function draw() { var canvas = document.get...
HTMLCanvasElement.mozOpaque - Web APIs
no translucency, painting performance can be optimized. this has been standardized as setting the alpha option to false when creating a drawing context with htmlcanvaselement.getcontext(). use of mozopaque should be avoided. firefox will stop supporting it in the future. syntax var opaque = canvas.mozopaque; canvas.mozopaque = true; examples given this <canvas> element: <canvas id="canvas" width="300" height="300" moz-opaque></canvas> you can get or set the mozopaque property. for example, you could conditionally set it to true if mimetype == 'image/jpeg', or similar, to gain performance in your application when translucency is not needed. var canvas = document.getelementbyid('canvas'); console.log(canvas.mozopaque); // true // deactivate it canvas.mozopaque = false; specifications ...
HTMLElement: animationcancel event - Web APIs
.log('animation canceled'); }; animated.style.display = 'none'; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const a...
HTMLElement: animationend event - Web APIs
ed.onanimationend = () => { console.log('animation ended'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { margin-left: 100%; width: 300%; } to { margin-left: 0%; width: 100%; } } js const animation = document.queryselector('p.animation'); const animati...
HTMLElement: animationiteration event - Web APIs
console.log(`animation iteration count: ${iterationcount}`); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const a...
HTMLElement: animationstart event - Web APIs
animationstart = () => { console.log('animation started'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const a...
HTMLElement.hidden - Web APIs
in html: <div id="awesome" class="panel" hidden> <h1>thanks!</h1> <p>thank you <strong>so</strong> much for agreeing to be awesome today! now get out there and do awesome things awesomely to make the world more awesome!</p> </div> css the content is styled using the css below. .panel { font: 16px "open sans", helvetica, arial, sans-serif; border: 1px solid #22d; padding: 12px; width: 500px; text-align: center; } .button { font: 22px "open sans", helvetica, arial, sans-serif; padding: 5px 36px; } h1 { margin-top: 0; font-size: 175%; } result specifications specification status comment html living standardthe definition of 'htmlelement.hidden' in that specification. living standard html 5.1the definition of 'htmlelement...
HTMLElement: transitioncancel event - Web APIs
in this example, to cancel...
HTMLElement: transitionend event - Web APIs
in this example, to cancel...
HTMLElement: transitionrun event - Web APIs
const el = document.queryselector('.transition'); const ...
HTMLElement: transitionstart event - Web APIs
const transition = document.queryselector('.transition')...
HTMLFontElement.face - Web APIs
the obsolete htmlfontelement.face property is a domstring that reflects the face html attribute, containing a comma-separated list of one or more font names. the document text, in the default style, is rendered as the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. the format of the string must follow one of the following html microsyntax: microsyntax description examples list of one or more valid font family names a list of font names, that have to be present on the local system courier,verdana syntax facestring = fontobj.face; fontobj.face = facestring; examples // assumes there is <font id="f"> ...
HTMLFrameSetElement - Web APIs
the htmlframesetelement interface provides special properties (beyond those of the regular htmlelement interface they also inherit) for manipulating <frameset> elements. properties inherits properties from its parent, htmlelement and from windoweventhandlers. htmlframesetelement.cols is a domstring structured as a comma-seperated list specifing the width of each column inside a frameset. htmlframesetelement.rows is a domstring structured as a comma-seperated list specifing the height of each column inside a frameset. methods no specific method; inherits methods from its parent, htmlelement and from windoweventhandlers. event handlers no specific event handler; inherits event handlers from its parent, htmlelement and from windoweventhandlers. windoweventhandlers.onafterpri...
HTMLImageElement.border - Web APIs
ecifies the number of pixels thick the border surrounding the image should be. a value of 0, the default, indicates that no border should be drawn. you should not use this property! instead, you should use css to style the border. the border property or its longhand properties to not only set the thickness of the border but to potentially apply a wide variety of other styling options to it. the width, specifically, is controlled using the writing-mode aware border-block-start-width, border-block-end-width, border-inline-start-width, and border-inline-end-width properties. for compatibility (or perhaps other) reasons, you can use the older properties instead (or in addition): border-top-width, border-right-width, border-bottom-width, and border-left-width. syntax htmlimageelement.border = t...
HTMLImageElement.crossOrigin - Web APIs
age.alt = ""; image.src = url; } loadimage(imageurl); html <div class="container"> <p>here's a paragraph. it's a very interesting paragraph. you are captivated by this paragraph. keep reading this paragraph. okay, now you can stop reading this paragraph. thanks for reading me.</p> </div> css body { font: 1.125rem/1.5, helvetica, sans-serif; } .container { display: flow-root; width: 37.5em; border: 1px solid #d2d2d2; } img { float: left; padding-right: 1.5em; } output { background: rgba(100, 100, 100, 0.1); font-family: courier, monospace; width: 95%; } result specifications specification status comment html living standardthe definition of 'htmlimageelement.crossorigin' in that specification. unknown browser comp...
HTMLImageElement.hspace - Web APIs
the obsolete hspace property of the htmlimageelement interface specifies the number of pixels of empty space to leave empty on the left and right sides of the <img> element when laying out the page. this property reflects the html hspace attribute. syntax htmlimageelement.hspace = marginwidth; marginwidth = htmlimageelement.hspace; value an integer value specifying the width, in pixels, of the horizontal margin to apply to the left and right sides of the image. usage notes the value specified for hspace is mapped to the margin-left and margin-right properties to specify the width of those margins in pixels. important: this property is obsolete. you should instead use the css margin property and its longhand forms to establish margins around an <img>. specifications spec...
HTMLImageElement.src - Web APIs
lly, if you use src along with both sizes (or the corresponding sizes content attribute) and srcset in order to choose an image based on the viewport size, the src attribute is only used as a fallback for browsers that don't support sizes and srcset; otherwise, it's not used at all. examples specifying a single image html <img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg" width="160" alt="slices of grapefruit, looking yummy."> result using src with an image set when using a set of images with the srcset property, the src serves as either a fallback for older browsers, or as the 1x size of the image. html result specifying a fallback for viewport-based selection when using viewport-bases selection of an image from a srcset by also specifying the sizes prop...
HTMLImageElement.x - Web APIs
g that cell. finally, we can look up and display the values of the htmlimageelement's x and y properties. css the css defining the appearance of the table: .group1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } result the resulting table looks like this: specifications specification status comment css object model (cssom) view modulethe definition of 'htmlimageelement.x' in that specification. working draft browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please ...
HTMLImageElement.y - Web APIs
g that cell. finally, we can look up and display the values of the htmlimageelement's x and y properties. css the css defining the appearance of the table: .group1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } result the resulting table looks like this: specifications specification status comment css object model (cssom) view modulethe definition of 'htmlimageelement.y' in that specification. working draft browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please ...
HTMLElement.focus() - Web APIs
living standard html 5.1the definition of 'focus' in that specification. recommendation html5the definition of '...
HTMLTableElement.border - Web APIs
the htmltableelement.border property represents the border width of the <table> element. syntax htmltableelement.border = border; var border = htmltableelement.border; border is a string representing the width of the border in pixels. example // set the width of a table border to 2 pixels var t = document.getelementbyid('tablea'); t.border = '2'; specification w3c dom 2 html specification htmltableelement .border. this attribute is deprecated in html 4.0. ...
HTMLVideoElement.msZoom - Web APIs
and bottom or left and right, to fit the video display. this proprietary property is specific to internet explorer and microsoft edge. syntax htmlvideoelement.mszoom; value boolean value set to true trims the video frame to the display space. set to false the video frame uses letter box or pillarbox to display video. if the native aspect ratio of a video frame, which is defined by the videowidth and videoheight attributes, does not match the aspect ratio of the video tag, which is defined by the width and height attributes, the video is rendered with letterbox or pillarbox format. letterbox and pillarbox are the black bars on either the left and right of the video or the top and bottom of the video. when the mszoom attribute is set to true, the rendered video is trimmed to fit the dimen...
Drag Operations - Web APIs
arguments to the setdragimage() method are offsets where the image should appear relative to the mouse pointer. it is also possible to use images and canvases that are not in a document. this technique is useful when drawing custom drag images using the canvas element, as in the following example: function dragwithcustomimage(event) { const canvas = document.createelement("canvas"); canvas.width = canvas.height = 50; const ctx = canvas.getcontext("2d"); ctx.linewidth = 4; ctx.moveto(0, 0); ctx.lineto(50, 50); ctx.moveto(0, 50); ctx.lineto(50, 0); ctx.stroke(); const dt = event.datatransfer; dt.setdata('text/plain', 'data to drag'); dt.setdragimage(canvas, 25, 25); } in this example, we make one canvas the drag image. as the canvas is 50×50 pixels, we use offsets ...
File drag and drop - Web APIs
r global event handler: <div id="drop_zone" ondrop="drophandler(event);" ondragover="dragoverhandler(event);"> <p>drag one or more files to this drop zone ...</p> </div> lastly, an application may want to style the drop target element to visually indicate the element is a drop zone. in this example, the drop target element uses the following styling: #drop_zone { border: 5px solid blue; width: 200px; height: 100px; } note that dragstart and dragend events are not fired when dragging a file into the browser from the os. process the drop the drop event is fired when the user drops the file(s). in the following drop handler, if the browser supports datatransferitemlist interface, the getasfile() method is used to access each file; otherwise the datatransfer interface's files pro...
ImageBitmap.close() - Web APIs
Web › API › ImageBitmap › close
the imagebitmap.close() method disposes of all graphical resources associated with an imagebitmap. syntax void imagebitmap.close() examples var offscreen = new offscreencanvas(256, 256); var gl = offscreen.getcontext('webgl'); // ... some drawing using the gl context ... var bitmap = offscreen.transfertoimagebitmap(); // imagebitmap { width: 256, height: 256 } bitmap.close(); // imagebitmap { width: 0, height: 0 } -- disposed specifications specification status comment html living standardthe definition of 'close()' in that specification. living standard ...
ImageBitmap - Web APIs
ich can be drawn to a <canvas> without undue latency. it can be created from a variety of source objects using the createimagebitmap() factory method. imagebitmap provides an asynchronous and resource efficient pathway to prepare textures for rendering in webgl. properties imagebitmap.height read only is an unsigned long representing the height, in css pixels, of the imagedata. imagebitmap.width read only is an unsigned long representing the width, in css pixels, of the imagedata. methods imagebitmap.close() disposes of all graphical resources associated with an imagebitmap. specifications specification status comment html living standardthe definition of 'imagebitmap' in that specification. living standard ...
ImageCapture.getPhotoCapabilities() - Web APIs
re; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specification status comment mediastream image capturethe definition of 'getpho...
ImageCapture.grabFrame() - Web APIs
ed frame to a <canvas> element. for simplicy it does not show how to instantiate the imagecapture object. var grabframebutton = document.queryselector('button#grabframe'); var canvas = document.queryselector('canvas'); grabframebutton.onclick = grabframe; function grabframe() { imagecapture.grabframe() .then(function(imagebitmap) { console.log('grabbed frame:', imagebitmap); canvas.width = imagebitmap.width; canvas.height = imagebitmap.height; canvas.getcontext('2d').drawimage(imagebitmap, 0, 0); canvas.classlist.remove('hidden'); }) .catch(function(error) { console.log('grabframe() error: ', error); }); } specifications specification status comment mediastream image capturethe definition of 'grabframe()' in that specification. ...
ImageCapture.takePhoto() - Web APIs
to([photosettings]) parameters photosettings optional an object that sets options for the photo to be taken. the available options are: filllightmode: the flash setting of the capture device, one of "auto", "off", or "flash". imageheight: the desired image height as an integer. the user agent selects the closest height value to this setting if it only supports discrete heights. imagewidth: the desired image width as an integer. the user agent selects the closest width value to this setting if it only supports discrete widths. redeyereduction: a boolean indicating whether the red-eye reduction should be used if it is available. return value a promise that resolves with a blob. example this example is extracted from this simple image capture demo. it shows how to use the ...
ImageData - Web APIs
Web › API › ImageData
way to create such an object in workers as createimagedata() is not available there. properties imagedata.data read only is a uint8clampedarray representing a one-dimensional array containing the data in the rgba order, with integer values between 0 and 255 (inclusive). imagedata.height read only is an unsigned long representing the actual height, in pixels, of the imagedata. imagedata.width read only is an unsigned long representing the actual width, in pixels, of the imagedata. specifications specification status comment html living standardthe definition of 'imagedata' in that specification. living standard ...
Using IndexedDB - Web APIs
em; font-family: sans-serif; } form { background-color: #cccccc; border-radius: 0.3em; display: inline-block; margin-bottom: 0.5em; padding: 1em; } table { border-collapse: collapse; } input { padding: 0.3em; border-color: #cccccc; border-radius: 0.3em; } .required:after { content: "*"; color: red; } .button-pane { margin-top: 1em; } #pub-viewer { float: right; width: 48%; height: 20em; border: solid #d092ff 0.1em; } #pub-viewer iframe { width: 100%; height: 100%; } #pub-list { width: 46%; background-color: #eeeeee; border-radius: 0.3em; } #pub-list li { padding-top: 0.5em; padding-bottom: 0.5em; padding-right: 0.5em; } #msg { margin-bottom: 1em; } .action-success { padding: 0.5em; color: #00d21e; background-color: #eeeeee; bo...
IntersectionObserver.rootMargin - Web APIs
rgin property is a string with syntax similar to that of the css margin property. each side of the rectangle represented by rootmargin is added to the corresponding side in the root element's bounding box before the intersection test is performed. this lets you, for example, adjust the bounds outward so that the target element is considered 100% visible even if a certain number of pixels worth of width or height is clipped away, or treat the target as partially hidden if an edge is too close to the edge of the root's bounding box. see the root element and root margin in intersection observer api for a more in-depth look at the root margin and how it works with the root's bounding box. syntax var marginstring = intersectionobserver.rootmargin; value a string, formatted similarly to the css...
KeyboardEvent.key - Web APIs
Web › API › KeyboardEvent › key
get" id="test-target"></textarea> <button type="button" name="btn-clear-console" id="btn-clear-console">clear console</button> </div> <div class="flex"> <pre id="console-log"></pre> </div> </div> css .fx { -webkit-display: flex; display: flex; margin-left: -20px; margin-right: -20px; } .fx > div { padding-left: 20px; padding-right: 20px; } .fx > div:first-child { width: 30%; } .flex { -webkit-flex: 1; flex: 1; } #test-target { display: block; width: 100%; margin-bottom: 10px; } javascript let textarea = document.getelementbyid('test-target'), consolelog = document.getelementbyid('console-log'), btnclearconsole = document.getelementbyid('btn-clear-console'); function logmessage(message) { document.getelementbyid("console-log").innerhtml += mess...
LargestContentfulPaint - Web APIs
element that is the current largest contentful paint. largestcontentfulpaint.rendertime the time the element was rendered to the screen. may not be available if the element is a cross-origin image loaded without the timing-allow-origin header. largestcontentfulpaint.loadtime the time the element was loaded. largestcontentfulpaint.size the intrinsic size of the element returned as the area (width * height). largestcontentfulpaint.id the id of the element. this property returns an empty string when there is no id. largestcontentfulpaint.url if the element is an image, the request url of the image. methods largestcontentfulpaint.tojson() returns the above properties as json. examples the following example shows how to create a performanceobserver that listens for largest-conten...
Location - Web APIs
Web › API › Location
ef" title="href"><span id="protocol" title="protocol">http:</span>//<span id="host" title="host"><span id="hostname" title="hostname">example.org</span>:<span id="port" title="port">8888</span></span><span id="pathname" title="pathname">/foo/bar</span><span id="search" title="search">?q=baz</span><span id="hash" title="hash">#bang</span></span> css html, body {height:100%;} html {display:table; width:100%;} body {display:table-cell; text-align:center; vertical-align:middle; font-family:georgia; font-size:230%; line-height:1em; white-space:nowrap;} [title] {position:relative; display:inline-block; box-sizing:border-box; /*border-bottom:.5em solid;*/ line-height:2em; cursor:pointer;} [title]:before {content:attr(title); font-family:monospace; position:absolute; top:100%; width:100%; left:50%;...
MediaCapabilities.encodingInfo() - Web APIs
ontenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements. example //create media configuration to be tested const mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8.0", // valid content type width : 1920, // width of the video height : 1080, // height of the video bitrate : 120000, // number of bits used to encode 1s of video framerate : 48 // number of frames making up that 1s. } }; // check support and performance navigator.mediacapabilities.encodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.support...
MediaDecodingConfiguration - Web APIs
back. media-source: represents a configuration that is meant to be used for playback of a mediasource. a media configuration — a videoconfiguration or audioconfiguration dictionary. examples //create media configuration to be tested const mediaconfig = { type : 'file', // or 'media-source' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : ...
MediaDevices - Web APIs
constraints:', constraints); console.log('using video device: ' + videotracks[0].label); stream.onremovetrack = function() { console.log('stream ended'); }; window.stream = stream; // make variable available to browser console video.srcobject = stream; }) .catch(function(error) { if (error.name === 'constraintnotsatisfiederror') { errormsg('the resolution ' + constraints.video.width.exact + 'x' + constraints.video.height.exact + ' px is not supported by your device.'); } else if (error.name === 'permissiondeniederror') { errormsg('permissions have not been granted to use your camera and ' + 'microphone, you need to allow the page access to your devices in ' + 'order for the demo to work.'); } errormsg('getusermedia error: ' + error.name, error);...
MediaEncodingConfiguration - Web APIs
...
MediaList.mediaText - Web APIs
the mediatext property of the medialist interface is a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist. syntax medialistinstance.mediatext; medialistinstance.mediatext = string; value a domstring representing the media queries of a stylesheet. each one is separated by a comma, for example screen and (min-width: 480px), print. if you wish to set new media queries on the document, the string value must have the different queries separated by commas, e.g. screen, print. note that the medialist is a live list; updating the list via mediatext will immediately update the behavior of the document. also note that is you try to set mediatext to null, it will be treated as an empty string, i.e. the value will be set to "". exampl...
MediaQueryList.addListener() - Web APIs
query status changes. in the original implementation, the callback was a non-standard mediaquerylistlistener object. in the new implementation the standard event mechanism is used, the callback is a standard function, and the event object is a mediaquerylistevent, which inherits from event. return value void. ...
MediaQueryList.media - Web APIs
the media read-only property of the mediaquerylist interface is a domstring representing a serialized media query. syntax var media = mediaquerylist.media; value a domstring representing a serialized media query. examples this example runs the media query (max-width: 600px) and displays the value of the resulting mediaquerylist's media property in a <span>. javascript let mql = window.matchmedia('(max-width: 600px)'); document.queryselector(".mq-value").innertext = mql.media; the javascript code simply passes the media query to match into matchmedia() to compile it, then sets the <span>'s innertext to the value of the result's media property. html <span class="mq-value"></span> a simple <span> to receive the output. css .mq-value { font: 18px arial, sans-serif; font-weight...
MediaQueryList.onchange - Web APIs
vent handler property representing a function that is invoked when the change event fires, i.e when the status of media query support changes. the event object is a mediaquerylistevent instance, which is recognised as a medialistquery instance in older browsers, for backwards compatibility purposes. syntax mediaquerylist.onchange = function() { ... ...
MediaQueryList.removeListener() - Web APIs
st.removelistener(func) parameters func a function or function reference representing the callback function you want to remove. in the original implementation, the callback was a non-standard mediaquerylistlistener object. in the new implementation the standard event mechanism is used, and the callback is a standard function. return value void. ...
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
ediaquerylistevent instance. syntax var mymqlevent = new mediaquerylistevent(init); parameters init an init object that defines features of the new object instance. the available properties are: media: a domstring representing a serialized media query. matches: a boolean representing the media query status — true if it matches, false if not. examples var media = '(max-width: 600px)'; var matches = true; var mymediaquerylistevent = new mediaquerylistevent({media, matches}); specifications specification status comment css object model (cssom) view modulethe definition of 'mediaquerylistevent()' in that specification. working draft initial definition ...
MediaQueryListEvent.matches - Web APIs
the matches read-only property of the mediaquerylistevent interface is a boolean that returns true if the document currently matches the media query list, or false if not. syntax var matches = mediaquerylistevent.matches; value a boolean; returns true if the document currently matches the media query list, false if not. ...
MediaQueryListEvent.media - Web APIs
the media read-only property of the mediaquerylistevent interface is a domstring representing a serialized media query. syntax var media = mediaquerylistevent.media; value a domstring representing a serialized media query. ...
MediaQueryListEvent - Web APIs
ent interface, event. mediaquerylistevent.matchesread only a boolean that returns true if the document currently matches the media query list, or false if not. mediaquerylistevent.mediaread only a domstring representing a serialized media query. methods the mediaquerylistevent interface inherits methods from its parent interface, event. ...
Using the MediaStream Recording API - Web APIs
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%; transform: translatex(100%); transition: 0.6s all; background-color: #999; background-image: linear-gradient(to top right, rgba(0,0,0,0), rgba(0,0,0,0.5)); } last, we write a rule to say that when the checkbox is checked (when we click/focus the label), the adjacent <aside> element will have its horizontal translation value changed and transition smoothly int...
MediaTrackConstraints.aspectRatio - Web APIs
by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { aspectratio: constraint }; constraintsobject.aspectratio = constraint; value a constraindouble describing the acceptable or required value(s) for a video track's aspect ratio. the value is the width divided by the height and is rounded to ten decimal places. for example, the standard high-definition video aspect ratio of 16:9 can be computed as 1920/1080, or 1.7777777778. if this value is a number, the user agent will attempt to obtain media whose aspect ratio is as close as possible to this number given the capabilities of the hardware and the other constraints specified. otherwise, the va...
MediaTrackConstraints - Web APIs
ct ratios which are acceptable and/or required. facingmode a constraindomstring object specifying a facing or an array of facings which are acceptable and/or required. framerate a constraindouble specifying the frame rate or range of frame rates which are acceptable and/or required. height a constrainlong specifying the video height or range of heights which are acceptable and/or required. width a constrainlong specifying the video width or range of widths which are acceptable and/or required. resizemode a constraindomstring object specifying a mode or an array of modes the ua can use to derive the resolution of a video track. allowed values are none and crop-and-scale. none means that the user agent uses the resolution provided by the camera, its driver or the os. crop-and-scale mean...
MediaTrackSettings.aspectRatio - Web APIs
turned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var aspectratio = mediatracksettings.aspectratio; value a double-precision floating-point number indicating the current configuration of the track's aspect ratio. the aspect ratio is computed by taking the track's width, dividing by its height, and rounding the result to ten decimal places. for example, the standard 16:9 high-definition aspect ratio can be computed as 1920/1080, or 1.7777777778. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of ...
MediaTrackSettings.sampleRate - Web APIs
tings.samplerate; value an integer value indicating how many samples each second of audio data includes. common values include 44,100 (standard cd audio), 48,000 (standard digital audio), 96,000 (commonly used in audio mastering and post-production), and 192,000 (used for high-resolution audio in professional recording and mastering sessions). however, lower values are often used to reduce bandwidth requirements; 8,000 samples per second is adequate for comprehensible albeit imperfect human speech, and both 11,025 fps and 22,050 fps are often used for low-bandwidth, reduced quality sound and music. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and s...
MediaTrackSettings.sampleSize - Web APIs
unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var samplesize = mediatracksettings.samplesize; value an integer value indicating how many bits each audio sample is represented by. the most commonly used sample size for many years now is 16 bits per sample, which was used for cd audio among others. other common sample sizes are 8 (for reduced bandwidth requirements) and 24 (for high-resolution professional audio). each audio channel on the track requires samplesize bits. that means that a given sample actually uses (samplesize/8)*channelcount bytes of data. for example, 16-bit stereo audio requires (16/8)*2 or 4 bytes per sample. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specificati...
MediaTrackSupportedConstraints - Web APIs
described using an object based on the mediatrackconstraints dictionary. to learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object. autogaincontrol a boolean whose value is true if the autogaincontrol constraint is supported in the current environment. width a boolean value whose value is true if the width constraint is supported in the current environment. height a boolean value whose value is true if the height constraint is supported in the current environment. aspectratio a boolean value whose value is true if the aspectratio constraint is supported in the current environment. framerate a boolean value whose value is true if the framerate ...
MouseEvent.initMouseEvent() - Web APIs
key was depressed during the event. sets the value of mouseevent.shiftkey. metakey whether or not meta key was depressed during the event. sets the value of mouseevent.metakey. button the event's mouse button. relatedtarget the event's related eventtarget. only used with some event types (e.g., mouseover and mouseout). in other cases, pass null. ...
MouseEvent.pageX - Web APIs
Web › API › MouseEvent › pageX
<code>pagey</code>: <span id="y">n/a</span> </p> </div> the html is simple; the box we'll be watching for mouse events on is given the class "box". it has two <span> elements, one with the id "x" and one with the id "y". those will be updated each time an event occurs to contain the latest mouse coordinates relative to the page. css the css used for this example is shown below. .box { width: 400px; height: 250px; border: 2px solid darkblue; background-color: blue; color: white; font: 16px "zilla", "open sans", "helvetica", "arial", sans-serif; } result try this out here: specifications specification status comment css object model (cssom) view modulethe definition of 'pagex' in that specification. working draft redefined from long to do...
MouseEvent.relatedTarget - Web APIs
ll. focusevent.relatedtarget is a similar property for focus events. syntax var target = instanceofmouseevent.relatedtarget return value an eventtarget object or null. example try moving your mouse cursor into and out of the red and blue boxes. ...
msIsBoxed - Web APIs
Web › API › MsIsBoxed
in boxed (letterbox or pillarbox) mode. this proprietary property is specific to internet explorer and microsoft edge. returns true if the video is in letterbox or pillarbox mode. letterbox format displays black bars on the top and bottom of a video to fill in between the wide screen format of a video, and the aspect ratio of the screen. typically the video's left and right edges go to the full width of the screen. pillarbox format displays black bars on the left and right of a video to fill in the difference between a video and a wider screen. with pillarbox format, the top and bottom edges of the video go to the full height of the screen. syntax isboxed = object.msisboxed value boolean value set to true activates boxed mode for the video player. boolean value set to false means the ...
Navigator.connection - Web APIs
this could be used to select high definition content or low definition content based on the user's connection. syntax networkinformation = navigator.connection value a networkinformation object. ...
Online and offline events - Web APIs
ndition = navigator.online ? ...
NetworkInformation - Web APIs
ipts to be notified if the connection type changes. the networkinformation interfaces cannot be instantiated. it is instead accessed through the connection property of the navigator interface. note: this feature is available in web workers. properties this interface also inherits properties of its parent, eventtarget. networkinformation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. networkinformation.downlinkmax read only returns the maximum downlink speed, in megabits per second (mbps), for the underlying connection technology. networkinformation.effectivetype read only returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'. this value is d...
Network Information API - Web APIs
this example would be called soon after page load to check for a connection type where preloading a video may not be desirable. if a cellular connection is found, then the preloadvideo flag is set to false. for simplicity and clarity, this example only tests for one connection type. a real-world use case would likely use a switch statement or some other method to check all of the possi...
Node.isConnected - Web APIs
Web › API › Node › isConnected
child(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 created style element to the shadow dom shadow.appendchild(style); console.log(style.isconnected); // returns true polyfill node.isconnected can be pol...
Node.isEqualNode() - Web APIs
Web › API › Node › isEqualNode
xample in this example, we create three <div> blocks. the first and third have the same contents and attributes, while the second is different. then we run some javascript to compare the nodes using isequalnode() and output the results. ...
Node.isSameNode() - Web APIs
Web › API › Node › isSameNode
example in this example, we create three <div> blocks. the first and third have the same contents and attributes, while the second is different. then we run some javascript to compare the nodes using issamenode() and output the results. ...
Node.localName - Web APIs
Web › API › Node › localName
qualified names are typically used in xml as part of the namespace(s) of the particular xml documents.
OffscreenCanvas() - Web APIs
height the height of the offscreen canvas. examples this example creates a new offscreen canvas using the offscreencanvas() constructor. we then initialize a webgl context on it using the getcontext() method. ...
OffscreenCanvas.transferToImageBitmap() - Web APIs
agebitmap() method creates an imagebitmap object from the most recently rendered image of the offscreencanvas. syntax imagebitmap offscreencanvas.transfertoimagebitmap() return value an imagebitmap. examples var offscreen = new offscreencanvas(256, 256); var gl = offscreen.getcontext("webgl"); // ... some drawing using the gl context ... offscreen.transfertoimagebitmap(); // imagebitmap { width: 256, height: 256 } specifications specification status comment html living standardthe definition of 'offscreencanvas.transfertoimagebitmap()' in that specification. living standard ...
OffscreenCanvas - Web APIs
the offscreencanvas interface provides a canvas that can be rendered off screen. it is available in both the window and worker contexts. constructors offscreencanvas() offscreencanvas constructor. creates a new offscreencanvas object. properties offscreencanvas.height the height of the offscreen canvas. offscreencanvas.width the width of the offscreen canvas. methods offscreencanvas.getcontext() returns a rendering context for the offscreen canvas. offscreencanvas.converttoblob() creates a blob object representing the image contained in the canvas. offscreencanvas.transfertoimagebitmap() creates an imagebitmap object from the most recently rendered image of the offscreencanvas. examples synchronous display of frames produced by an offscreencanvas one ...
PaintWorklet.registerPaint - Web APIs
aded through css.paintworklet.addmodule() (documented here on the parent class of paintworklet, at worklet.addmodule(). ...
PaintWorklet - Web APIs
ing shows an example worklet module. this should be in a separate js file. note that registerpaint() is called without a reference to paintworklet. ...
ParentNode.replaceChildren() - Web APIs
to do this, we give each of the buttons a click event handler, which collects together the selected options you want to transfer in one constant, and the ...
Path2D - Web APIs
Web › API › Path2D
s, connected to the previous point by a straight line. path2d.ellipse() adds an elliptical arc to the path which is centered at (x, y) position with the radii radiusx and radiusy starting at startangle and ending at endangle going in the given direction by anticlockwise (defaulting to clockwise). path2d.rect() creates a path for a rectangle at position (x, y) with a size that is determined by width and height. specifications specification status comment html living standardthe definition of 'path2d' in that specification. living standard ...
PointerEvent.height - Web APIs
ce (for example a finger), for a given pointer, each event may produce a different value. if the input hardware cannot report the contact geometry to the browser, the height defaults to 1. syntax var contactheight = pointerevent.height; return value contactheight the height of the event's contact area (in css pixels). example an example of this property is included in the pointerevent.width example. specifications specification status comment pointer events – level 2the definition of 'height' in that specification. recommendation non-stable version. pointer eventsthe definition of 'height' in that specification. obsolete initial definition. ...
PointerEvent - Web APIs
lly, this is determined by considering the pointer's location and also the visual layout of elements in a document on screen media. constructors pointerevent() creates a synthetic—and untrusted—pointerevent. properties this interface inherits properties from mouseevent and event. pointerevent.pointerid read only a unique identifier for the pointer causing the event. pointerevent.width read only the width (magnitude on the x axis), in css pixels, of the contact geometry of the pointer. pointerevent.height read only the height (magnitude on the y axis), in css pixels, of the contact geometry of the pointer. pointerevent.pressure read only the normalized pressure of the pointer input in the range 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardwar...
RTCIceCandidatePairStats.availableIncomingBitrate - Web APIs
the rtcicecandidatepairstats property availableincomingbitrate returns a value indicative of the available inbound capacity of the network connection represented by the candidate pair. the higher the value, the more bandwidth you can assume is available for incoming data. you can get the incoming outgoing bitrate from availableoutgoingbitrate. syntax availableincomingbitrate = rtcicecandidatepairstats.availableincomingbitrate; value a floating-point value which approximates the amount of available bandwidth for incoming data on the network connection described by the rtcicecandidatepair. the value is reported in bits per second and is computed over a 1-second interval. the value returned is calculated by adding up the available bit rate for every rtp stream using the connection described...
RTCIceCandidatePairStats.availableOutgoingBitrate - Web APIs
the rtcicecandidatepairstats property availableoutgoingbitrate returns a value indicative of the available outbound capacity of the network connection represented by the candidate pair. the higher the value, the more bandwidth you can assume is available for outgoing data. you can get the incoming available bitrate from availableincomingbitrate. syntax availableoutgoingbitrate = rtcicecandidatepairstats.availableoutgoingbitrate; value a floating-point value which approximates the amount of available bandwidth for outgoing data on the network connection described by the rtcicecandidatepair. the value is reported in bits per second and is computed over a 1-second interval. the returned value is undefined in each of the following situations: the underlying implementation doesn't support ...
RTCInboundRtpStreamStats.firCount - Web APIs
nds a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for the available bandwidth, or that the receiving device is overburdened and is therefore unable to process the incoming data. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.fircount' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.firCount - Web APIs
nds a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for the available bandwidth, or that the receiving device is overburdened and is therefore unable to process the incoming data. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.fircount' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.createOffer() - Web APIs
has not been stopped, and if there isn't one, one will be created. note: you shouldn't use this legacy property. instead, use rtcrtptransceiver to control whether or not to accept incoming video. voiceactivitydetection optional some codecs and hardware are able to detect when audio begins and ends by watching for "silence" (or relatively low sound levels) to occur. this reduces network bandwidth used for audio by only sending audio data when there's actually something to broadcast. however, in some cases, this is unwanted. for example, in the case of music or other non-voice transmission, this can cause loss of important low-volume sounds. also, emergency calls should never cut audio when quiet. this option defaults to true (voice activity detection enabled). deprecated parameters ...
RTCRtpSendParameters - Web APIs
the webrtc api's rtcrtpsendparameters dictionary is used to specify the parameters for an rtcrtpsender when calling its setparameters() method. properties in addition to the properties below, rtcrtpsendparameters inherits the properties from the rtcrtpparameters interface. degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpreference enumerated string type, and the default is balanced. encodings an array of rtcrtpencodingparameters objects, each specifying the parameters for a single codec that could be used to encode the track's media. priority a string from the rtcprioritytype enumerated type which indicates the encoding's priority. the def...
RTCRtpSender.setParameters() - Web APIs
var promise = rtcrtpsender.setparameters(parameters) parameters parameters an object conforming with the rtcrtpsendparameters dictionary, specifying options for the rtcrtpsender; these include potential codecs that could be use for encoding the sender's track. the available options are: degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpreference enumerated string type, and the default is balanced. encodings an array of rtcrtpencodingparameters objects, each specifying the parameters for a single codec that could be used to encode the track's media. priority a string from the rtcprioritytype enumerated type which indicates the encodi...
RTCRtpStreamStats.firCount - Web APIs
nds a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for the available bandwidth, or that the receiving device is overburdened and is therefore unable to process the incoming data. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: fircount' in that specification. candidate recommendation initial definition. identifiers for webrtc's statistics apithe definitio...
Request.cache - Web APIs
Web › API › Request › cache
he correct etag // and date headers and properly handle if-modified-since and // if-none-match request headers, therefore we can rely on the // validation to guarantee a fresh response. fetch("some.json", {cache: "no-cache"}) .then(function(response) { /* consume the response */ }); // download a resource with economics in mind! prefer a cached // albeit stale response to conserve as much bandwidth as possible. fetch("some.json", {cache: "force-cache"}) .then(function(response) { /* consume the response */ }); // naive stale-while-revalidate client-level implementation. // prefer a cached albeit stale response; but update if it's too old. // abortcontroller and signal to allow better memory cleaning. // in reality; this would be a function that takes a path and a // reference to the cont...
ResizeObserver.observe() - Web APIs
xt.html (see source) example: const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.contentboxsize.inlinesize/600) + 'rem'; } else { h1elem.style.fontsize = math.max(1.5, entry.contentrect.width/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.contentrect.width/600) + 'rem'; } } }); resizeobserver.observe(divelem); an observe() call with an options object would look like so: resizeobserver.observe(divelem, { box : 'border-box' }); specifications specification status comment resize observerthe definition of 'observe()' in that specification. ...
ResizeObserver.unobserve() - Web APIs
xt.html (see source) example: const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.contentboxsize.inlinesize/600) + 'rem'; } else { h1elem.style.fontsize = math.max(1.5, entry.contentrect.width/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.contentrect.width/600) + 'rem'; } } }); resizeobserver.observe(divelem); checkbox.addeventlistener('change', () => { if(checkbox.checked) { resizeobserver.observe(divelem); } else { resizeobserver.unobserve(divelem); } }); specifications specification status comment resize observerthe def...
ResizeObserverEntry.contentRect - Web APIs
if not, it uses contentrect. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.contentboxsize.inlinesize/600) + 'rem'; } else { h1elem.style.fontsize = math.max(1.5, entry.contentrect.width/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.contentrect.width/600) + 'rem'; } } }); resizeobserver.observe(divelem); specifications specification status comment resize observerthe definition of 'contentrect' in that specification. editor's draft initial definition. ...
ResizeObserverEntry.target - Web APIs
us. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { entry.target.style.borderradius = math.min(100, (entry.contentboxsize.inlinesize/10) + (entry.contentboxsize.blocksize/10)) + 'px'; } else { entry.target.style.borderradius = math.min(100, (entry.contentrect.width/10) + (entry.contentrect.height/10)) + 'px'; } } }); resizeobserver.observe(document.queryselector('div')); specifications specification status comment resize observerthe definition of 'target' in that specification. editor's draft initial definition. ...
cx - Web APIs
the svgcircleelement interface reflects the cx attribute of a <circle> element and by that defines the x-coordinate of the circleʼs center. if unspecified, the effect is as if the value is set to 0. syntax var xcoordinate = element.cx; value an svganimatedlength representing the x-coordinate of the circleʼs center. example svg <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 100" width="200" height="200"> <circle cx="50" cy="50" r="50" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.cx); specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgcircleelement.cx' in that specification. candidate recommendation no change scalabl...
cy - Web APIs
the svgcircleelement interface reflects the cy attribute of a <circle> element and by that defines the y-coordinate of the circleʼs center. if unspecified, the effect is as if the value is set to 0. syntax var ycoordinate = element.cy; value an svganimatedlength representing the y-coordinate of the circleʼs center. example svg <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 100" width="200" height="200"> <circle cy="50" cy="50" r="50" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.cy); specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgcircleelement.cy' in that specification. candidate recommendation no change scalabl...
r - Web APIs
the r read-only property of the svgcircleelement interface reflects the r attribute of a <circle> element and by that defines the radius of the circle. if unspecified, the effect is as if the value is set to 0. syntax var radius = element.r; value an svganimatedlength representing the radius of the circle. example svg <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 100" width="200" height="200"> <circle r="50" r="50" r="50" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.r); specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgcircleelement.r' in that specification. candidate recommendation no change scalable vector graph...
The 'X' property - Web APIs
te length or percentage animatable yes simple usage a <coordinate> is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for x coordinates, the y-axis for y coordinates). ...
SVGTransformList - Web APIs
e.setrotate(10,0,0); var scale = svgroot.createsvgtransform(); scale.setscale(0.8,0.8); // apply the transformations by appending the svgtranform objects to the svgtransformlist associated with the element tfmlist.appenditem(translate); tfmlist.appenditem(rotate); tfmlist.appenditem(scale); } ]]> </script> <polygon fill="orange" stroke="black" stroke-width="5" points="100,225 100,115 130,115 70,15 70,15 10,115 40,115 40,225" onclick="transformme(evt)"/> <rect x="200" y="100" width="100" height="100" fill="yellow" stroke="black" stroke-width="5" onclick="transformme(evt)"/> <text x="40" y="250" font-family="verdana" font-size="16" fill="green" > click on a shape to transform it </text> </svg> ...
Screen.availTop - Web APIs
Web › API › Screen › availTop
specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features. syntax let availtop = window.screen.availtop; example let setx = window.screen.width - window.screen.availleft; let sety = window.screen.height - window.screen.availtop; window.moveto(setx, sety); notes in most cases, this property returns 0. ...
ShadowRoot - Web APIs
t. from here we use standard dom traversal techniques to find the <style> element inside the shadow dom and then update the css found inside it: function updatestyle(elem) { var shadow = elem.shadowroot; var childnodes = shadow.childnodes; for(var i = 0; i < childnodes.length; i++) { if(childnodes[i].nodename === 'style') { childnodes[i].textcontent = 'div {' + 'width: ' + elem.getattribute('l') + 'px;' + 'height: ' + elem.getattribute('l') + 'px;' + 'background-color: ' + elem.getattribute('c') + ';' + '}'; } } } specifications specification status comment domthe definition of 'interface shadowroot' in that specification. living standard ...
SourceBuffer.changeType() - Web APIs
the changetype() method of the sourcebuffer interface sets the mime type that future calls to appendbuffer() should expect the new media data to conform to. this makes it possible to change codecs or container type mid-stream. one scenario in which this is helpful is to support adapting the media source to changing bandwidth availability, by transitioning from one codec to another as resource constraints change. syntax sourcebuffer.changetype(type); parameters type a domstring specifying the mime type that future buffers will conform to. return value undefined. exceptions typeerror the specified string is empty, rather than indicating a valid mime type. invalidstateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer...
SpeechSynthesisVoice.localService - Web APIs
syntax var amilocal = speechsynthesisvoiceinstance.localservice; value a boolean. examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } conso...
StylePropertyMap.append() - Web APIs
the append() method of the stylepropertymap interface adds a new css declaration to the stylepropertymap with the given property and value. syntax stylepropertymap.append(property,value) parameters property an identifier indicating the stylistic feature (e.g. font, width, background color) to add. value the value the given property should have. return value undefined. example // tbd specifications specification status comment css typed om level 1the definition of 'append()' in that specification. working draft initial definition. ...
StylePropertyMap.delete() - Web APIs
the delete() method of the stylepropertymap interface removes the css declaration with the given property. syntax stylepropertymap.delete(property) parameters property an identifier indicating the stylistic feature (e.g. font, width, background color) to remove. return value undefined example // tbd specifications specification status comment css typed om level 1the definition of 'delete()' in that specification. working draft initial definition. ...
StylePropertyMap.set() - Web APIs
the set() method of the stylepropertymap interface changes the css declaration with the given property. syntax stylepropertymap.set(property,value) parameters property an identifier indicating the stylistic feature (e.g. font, width, background color) to change. value the value the given property should have. return value undefined example // tbd specifications specification status comment css typed om level 1the definition of 'set()' in that specification. working draft initial definition. ...
TextRange - Web APIs
Web › API › TextRange
textrange.boundingleftread only returns the distance between the left edge of the rectangle that binds the textrange object and the left edge that completely contains the textrange object. textrange.boundingtopread only returns the distance between the top edge of the rectangle that binds the textrange object and the top edge that completely contains the textrange object. textrange.boundingwidthread only returns the width of the rectangle bound to the textrange object. textrange.htmltext gets or sets the html content within the textrange. textrange.text gets or sets the plaintext content within the textrange. methods textrange.collapse() move the caret to the beginning or end of the current range. textrange.duplicate() returns a copy of textrange. textrange.execcom...
Multi-touch interaction - Web APIs
it also calls preventdefault() to keep the browser from applying further event handling (for example, mou...
UIEvent.layerX - Web APIs
Web › API › UIEvent › layerX
var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-positioned div so clicking it will return layerx/layery value...
UIEvent.layerY - Web APIs
Web › API › UIEvent › layerY
var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-positioned div so clicking it will return layerx/layery value...
UIEvent.pageY - Web APIs
Web › API › UIEvent › pageY
var parent_id = evt.target.parentnode.id; form.parentid.value = parent_id; form.pagexcoords.value = evt.pagex; form.pageycoords.value = evt.pagey; form.layerxcoords.value = evt.layerx; form.layerycoords.value = evt.layery; } </script> <style type="text/css"> #d1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-positioned div so clicking it will return layerx/layery value...
VTTCue - Web APIs
Web › API › VTTCue
as a percentage of the video size. vttcue.textalign returns an enum representing the alignment of all the lines of text within the cue box. vttcue.text returns a domstring with the contents of the cue. methods getcueashtml() returns the cue text as a documentfragment. ...
VideoPlaybackQuality.totalVideoFrames - Web APIs
a quality indicator to show an increase in frame loss. var videoelem = document.getelementbyid("my_vid"); var quality = videoelem.getvideoplaybackquality(); if ((quality.corruptedvideoframes + quality.droppedvideoframes)/quality.totalvideoframes > 0.1) { lostframesthresholdexceeded(); } a similar algorithm might be used to attempt to switch to a lower-resolution video that requires less bandwidth, in order to avoid dropping frames. specifications specification status comment media playback qualitythe definition of 'videoplaybackquality.totalvideoframes' in that specification. editor's draft initial definition. ...
Visual Viewport API - Web APIs
n: fixed we need to offset it by the // 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. bottombar.style.transform = 'translate(' + offsetleft + 'px,' + offsettop + 'px) ' + 'scale(' + 1/viewport.scale + ')' }) } window.visualviewport.addeventlistener('scroll', viewporthandler); window.visualviewport.addeventlistener('resize', viewporthandler); specifications ...
WEBGL_compressed_texture_pvrtc - Web APIs
e iphone, ipod touch and ipad and supported on certain android devices that use a powervr gpu. this extension is available to both, webgl1 and webgl2 contexts. note: on ios devices, this extension is named webkit_webgl_compressed_texture_pvrtc. constants the compressed texture formats are exposed by four constants and can be used in two functions: compressedteximage2d() (where the height and width parameters must be powers of 2) and compressedtexsubimage2d() (where the the height and width parameters must equal the current values of the existing texture and the xoffset and yoffset parameters must be 0). ext.compressed_rgb_pvrtc_4bppv1_img rgb compression in 4-bit mode. one block for each 4×4 pixels. ext.compressed_rgba_pvrtc_4bppv1_img rgba compression in 4-bit mode. one block for e...
WebGL2RenderingContext.blitFramebuffer() - Web APIs
tion rectangle. mask a glbitfield specifying a bitwise or mask indicating which buffers are to be copied. possible values: gl.color_buffer_bit gl.depth_buffer_bit gl.stencil_buffer_bit filter a glenum specifying the interpolation to be applied if the image is stretched. possible values: gl.nearest gl.linear return value none. examples gl.blitframebuffer(0, 0, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height, gl.color_buffer_bit, gl.nearest); specifications specification status comment webgl 2.0the definition of 'blitframebuffer' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glblitframebuffer' in that specification. ...
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
buffer or 0 if an error occurs. possible enum return values: gl.framebuffer_complete: the framebuffer is ready to display. gl.framebuffer_incomplete_attachment: the attachment types are mismatched or not all framebuffer attachment points are framebuffer attachment complete. gl.framebuffer_incomplete_missing_attachment: there is no attachment. gl.framebuffer_incomplete_dimensions: height and width of the attachment are not the same. gl.framebuffer_unsupported: the format of the attachment is not supported or if depth and stencil attachments are not the same renderbuffer. when using a webgl 2 context, the following values can be returned additionally: gl.framebuffer_incomplete_multisample: the values of gl.renderbuffer_samples are different among attached renderbuffers, or are non-z...
WebGLRenderingContext.hint() - Web APIs
de); parameters target sets which behavior to be controlled. possible values: gl.generate_mipmap_hint: quality of filtering when generating mipmap images with webglrenderingcontext.generatemipmap(). when using the oes_standard_derivatives extension: ext.fragment_shader_derivative_hint_oes: accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth. when using a webgl 2 context, the following values are available additionally: gl.fragment_shader_derivative_hint: same as ext.fragment_shader_derivative_hint_oes mode sets the behavior. the default value is gl.dont_care. the possible values are: gl.fastest: the most efficient behavior should be used. gl.nicest: the most correct or the highest quality option s...
Getting started with WebGL - Web APIs
webgl itself; however, there are a number of frameworks available that encapsulate webgl's capabilities, making it easier to build 3d applications and games, such as three.js and babylon.js. preparing to render in 3d the first thing you need in order to use webgl for rendering is a canvas. the html fragment below declares a canvas that our sample will draw into. <body> <canvas id="glcanvas" width="640" height="480"></canvas> </body> preparing the webgl context the main() function in our javascript code, is called when our script is loaded. its purpose is to set up the webgl context and start rendering content. // // start here // function main() { const canvas = document.queryselector("#glcanvas"); // initialize the gl context const gl = canvas.getcontext("webgl"); // only co...
WebGL types - Web APIs
Web › API › WebGL API › Types
a boolean. glbitfield unsigned long a bit field that stores multiple, logical bits. used for example in webglrenderingcontext.clear(). glbyte byte 8-bit twos complement signed integer. glshort short 16-bit twos complement signed integer. glint long 32-bit twos complement signed integer. glsizei long used for sizes (e.g. width and height of the drawing buffer). glintptr long long special type for pointer arithmetic. glsizeiptr long long special type for pointer arithmetic. glubyte octet 8-bit twos complement unsigned integer. glushort unsigned short 16-bit twos complement unsigned integer. gluint unsigned long 32-bit twos complement unsigned int...
Web audio spatialization basics - Web APIs
they remain static. the pannernode can then calculate its sound position relative to the position of the listener. let's create our context and listener and set the listener's position to emulate a person looking into our room: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); const listener = audioctx.listener; const posx = window.innerwidth/2; const posy = window.innerheight/2; const posz = 300; listener.positionx.value = posx; listener.positiony.value = posy; listener.positionz.value = posz-5; we could move the listener left or right using positionx, up or down using positiony, or in or out of the room using positionz. here we are setting the listener to be in the middle of the viewport and slightly in front of our boombox. we c...
Window: error event - Web APIs
event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); window.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: ${event.message}\n`; console.log(event) }); const scripterror = document.queryselector('#script-error'); scripterror.addeventlistener('click', () => { const badcode = 'const s;'; eval(badcode); }); ...
Window.pageYOffset - Web APIs
o, we set the vertical scrolling position of the frame's document so that it's the same as the top edge of the target element. this will automatically set the scrolling position to the maximum possible value if the attempted scroll would exceed the maximum. this prevents us from falling off the edge of the document. nobody wants to know what's out there. there might be dragons. css iframe { width: 620px; height: 450px; border: 1px solid black; } #info { margin-top: 20px; font: 16px "open sans", "helvetica", "arial"; } result the result follows. note that the frame's contents have been scrolled to show the section named "overview", and that the value of the pageyoffset property is shown with the corresponding value. specification specification status comment ...
Window.resizeTo() - Web APIs
Web › API › Window › resizeTo
the window.resizeto() method dynamically resizes the window. syntax window.resizeto(width, height) parameters width an integer representing the new outerwidth in pixels (including scroll bars, title bars, etc). height an integer value representing the new outerheight in pixels (including scroll bars, title bars, etc). example this function resizes the window so that it takes up one quarter of the available screen. see the screen.availwidth and screen.availheight properties. function quarter() { window.resizeto( window.screen.availwidth / 2, window.screen.availheight / 2 ); } specification specification status comment css object model (cssom) view modulethe definition of 'window.resizeto()' in that specification. working draft ...
Window.scrollMaxX - Web APIs
Web › API › Window › scrollMaxX
the window.scrollmaxx read-only property returns the maximum number of pixels that the document can be scrolled horizontally. syntax xmax = window.scrollmaxx xmax is the number of pixels. example // scroll to right edge of the page let maxx = window.scrollmaxx; window.scrollto(maxx, 0); notes do not use this property to get the total document width, which is not equivalent to window.innerwidth + window.scrollmaxx, because window.innerwidth includes the width of any visible vertical scrollbar, thus the result would exceed the total document width by the width of any visible vertical scrollbar. instead use document.body.scrollwidth. see also window.scrollmaxy. specification this is not part of any specification. ...
Window.scrollMaxY - Web APIs
Web › API › Window › scrollMaxY
pixels that the document can be scrolled vertically. syntax ymax = window.scrollmaxy ymax is the number of pixels. example // scroll to the bottom of the page let maxy = window.scrollmaxy; window.scrollto(0, maxy); notes do not use this property to get the total document height, which is not equivalent to window.innerheight + window.scrollmaxy, because window.innerheight includes the width of any visible horizontal scrollbar, thus the result would exceed the total document height by the width of any visible horizontal scrollbar. instead use document.body.scrollheight. see also window.scrollmaxx and window.scrollto. specification this is not part of any specification. ...
Window.showModalDialog() - Web APIs
more semicolon delimited values: syntax description center: {on | off | yes | no | 1 | 0 } if on, yes, or 1, the dialog window is centered on the desktop; otherwise it's hidden. default is yes. dialogheight: height the height of the dialog box in pixels. dialogleft: left distance of the dialog box from the left edge of the desktop. dialogwidth: width the width of the dialog box in pixels. dialogtop: top distance of the dialog box from the top edge of the desktop. resizable: {on | off | yes | no | 1 | 0 } if this argument's value is on, yes, or 1, the dialog window can be resized by the user; otherwise its size is fixed. the default value is no. scroll: {on | off | yes | no | 1 | 0 } if on, yes, or...
WindowOrWorkerGlobalScope - Web APIs
doworworkerglobalscope.setinterval(). windoworworkerglobalscope.cleartimeout() cancels the delayed execution set using windoworworkerglobalscope.settimeout(). windoworworkerglobalscope.createimagebitmap() accepts a variety of different image sources, and returns a promise which resolves to an imagebitmap. optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh. windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network. windoworworkerglobalscope.queuemicrotask() enqueues a microtask—a short function to be executed after execution of the javascript code completes and control isn't being returned to a javascript caller, but before handling callbacks and other tasks. this lets your code run without...
WorkerGlobalScope - Web APIs
doworworkerglobalscope.setinterval(). windoworworkerglobalscope.cleartimeout() cancels the delayed execution set using windoworworkerglobalscope.settimeout(). windoworworkerglobalscope.createimagebitmap() accepts a variety of different image sources, and returns a promise which resolves to an imagebitmap. optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh. windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network. windoworworkerglobalscope.setinterval() schedules a function to execute every time a given number of milliseconds elapses. windoworworkerglobalscope.settimeout() schedules a function to execute in a given amount of time. deprecated methods workerglobalscope.close() discards...
WorkerNavigator.connection - Web APIs
this could be used to select high definition content or low definition content based on the user's connection. ...
XMLHttpRequest: abort event - Web APIs
example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function h...
XMLHttpRequest: error event - Web APIs
example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function h...
XMLHttpRequest: load event - Web APIs
example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function h...
XMLHttpRequest: loadend event - Web APIs
example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function h...
XMLHttpRequest: loadstart event - Web APIs
example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function h...
XMLHttpRequest: progress event - Web APIs
example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function h...
XRRigidTransform.inverse - Web APIs
. in other words, its position and orientation both return to their prior configurations. examples in this example, the model view matrix for an object is computed by taking the view matrix and multiplying it by the object's pose matrix. let modelviewmatrix = mat4.create(); for (let view of pose.view) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); /* ... */ mat4.multiply(modelviewmatrix, view.transform.inverse.matrix, objectmatrix); gl.uniformmatrix4fv(programinfo.uniformlocations.modelviewmatrix, false, modelviewmatrix); /* ... */ } this outline of a renderer's core code shows how the pose's view gets represented by taking its transform's inverse's matrix as the model view matrix used ...
XRSession.requestAnimationFrame() - Web APIs
} }) }) the following example was taken directly from the spec draft. this example demonstrates a design pattern that ensures seamless transition between non-immersive animations created via window.requestanimationframe and immersive xr animations. let xrsession = null function onwindowanima...
XRSession - Web APIs
Web › API › XRSession
working draft initial definition. ...
XRView.eye - Web APIs
Web › API › XRView › eye
l.depth_buffer_bit); for (let view of xrpose.views) { let skipview = false; if (view.eye == "left" && body.lefteye.injured) || skipview = updateinjury(body.lefteye); } else if (view.eye == "right" && body.righteye.injured) { skipview = updateinjury(body.righteye); } if (!skipview) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); renderscene(gl, view); } } for each of the views, the value of eye is checked and if it's either left or right, we check to see if the body.lefteye.injured or body.righteye.injured property is true; if so, we call a function updateinjury() on that eye to do things such as allow a bit of healing to occur, track the progress of a poison effect, or the like, as appropriate...
XRView.transform - Web APIs
Web › API › XRView › transform
's movement through space. in this example, we see an outline of a code fragment used while rendering an xrframe, which makes use of the view transform to place objects in the world during rendering. ...
XRView - Web APIs
Web › API › XRView
e api, so it's safe for now to assume that all views will render into the same layer. examples preparing to render every view for a pose to draw eerything the user sees each frame requires iterating over the list of views returned by the xrviewerpose object's views list: for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); // draw the scene; the eye being drawn is identified // by view.eye. } special view transforms there are a few special transforms that are used on the view while rendering and lighting a scene. model view matrix the model view matrix is a matrix which defines the position of an object relative to the space in which it's located: if objectmatrix is a transform applied ...
XRViewerPose.views - Web APIs
this code is derived from drawing a frame in movement, orientation, and motion: a webxr example. you can ...
XRViewerPose - Web APIs
this code is derived from drawing a frame in movement, orientation, and motion: a webxr example. you can ...
XRViewport.height - Web APIs
Web › API › XRViewport › height
syntax height = xrviewport.height; value the viewport's height in pixels. examples see the main xrviewport page for examples. ...
XRViewport.x - Web APIs
Web › API › XRViewport › x
the read-only xrviewport interface's x property indicates the offset from the left edge of the destination surface (typically a xrwebgllayer to the left edge of the viewport within the surface into which webxr content is to be rendered. the viewport's y property identifies the y component of the origin, and its is given by the width and height properties. syntax x = xrviewport.x; value the offset from the left edge of the rendering surface to the left edge of the viewport, in pixels. examples see the main xrviewport page for examples. specifications specification status comment webxr device apithe definition of 'xrviewport.x' in that specification. working draft initial definition. ...
XRViewport.y - Web APIs
Web › API › XRViewport › y
the read-only xrviewport interface's y property indicates the offset from the bottom edge of the destination surface (typically a xrwebgllayer to the bottom edge of the viewport within the surface into which webxr content is to be rendered. the viewport's x property identifies the x component of the origin, and its is given by the width and height properties. syntax y = xrviewport.y; value the offset from the bottom edge of the rendering surface to the bottom edge of the viewport, in pixels. note: although other web apis typically consider the y axis to begin at the top and grow larger progressing downward, webgl reverses this, with y growing larger as it goes upward on the screen. examples see the main xrviewport page for examples. specifications specification status ...
XRWebGLLayer.getViewport() - Web APIs
working draft initial definition. ...
XRWebGLLayer.ignoreDepthValues - Web APIs
e unless explicitly set otherwise when creating the xrwebgllayer using its constructor, xrwebgllayer(). usage notes when the ignoredepthvalues property is false, the xr compositor uses the values found in the depth buffer, which should be accurate for the scene, in order to potentially improve the quality or the output as well as the comfort level for the viewer. the depth buffer is framebufferwidth entires wide and framebuffer entries tall. each entry in the buffer specifies the depth at which the corresponding pixel is located, and has a value between 0.0 and 1.0. a depth buffer pixel value of 0.0 corresponds to the depth given by the session's depthnear and a value of 1.0 corresponds to the depth given by depthfar. the depth, in tandem with the coordinates of each point being rendered, ...
ARIA: switch role - Accessibility
e); }); function handleclickevent(evt) { let el = evt.target; if (el.getattribute("aria-checked") == "true") { el.setattribute("aria-checked", "false"); } else { el.setattribute("aria-checked", "true"); } } css the purpose of the css is to establish a look and feel for the switch that's reminiscent of the power switch paradigm. ...
Web Accessibility: Understanding Colors and Luminance - Accessibility
ball, where the red and green cones tend to cluster. there is software that actually takes advantage of that fact. because we do not perceive the color "blue" as well as other colors, for example, some algorithms for compressing image sizes remove the parts of the image with "blue" in them more heavily than other parts of an image. this fact is also used by televsion signals to allocate less bandwidth to the yellow-blue part of their signal, thus saving bandwidth. another important point to consider is the ambience of light surrounding the color. the color will appear differently if the background lighting is dark, or light. one of the greatest gifts to accessibility now in development is the css media queries level 5. these queries will allow users to choose contrast levels that is right f...
Operable - Accessibility
ures detected by device sensors (including a camera) that both of the following are true: 1) motion actuation can be disabled, and 2) the functionality can be operated without using device motion or user gestures. exceptions exist. understanding motion actuation 2.5.5 target size (aaa) added in 2.1 the size of an actionable item's touch target must be at least 44 css pixels in both width and height. exceptions exist. understanding target size 2.5.6 concurrent input mechanisms (aaa) added in 2.1 make sure people can use and switch between different modes of input when interacting with digital content including touchscreen, keyboard, mouse, voice commands, or alternative input devices. an essential exception exists. understanding concurrent input mechanism ...
Text labels and names - Accessibility
me's title attribute. (this assumes that the enclosed document is under your control; if not, try to match the frame's title attribute to the document's title.) some screen readers replace the contents of the title attribute with the contents of the enclosed document's <title>. it's safest and most accessible to provide the same title in both places. example <iframe title="mdn web docs" width="300" height="200" src="https://developer.mozilla.org"> </iframe> use alt attribute to label mglyph elements when writing equations with mathml, give each <mglyph> element an alt attribute containing a name that describes the symbol. since mglyph elements are used for non-standard symbols without unicode definitions, screen readers won't automatically be able to name them. alternativ...
-moz-force-broken-image-icon - CSS: Cascading Style Sheets
ribute. note: even if the value is set to 1 the alt attribute will still be displayed, alongside the broken image icon. formal definition initial value0applies toimagesinheritednocomputed valueas specifiedanimation typediscrete formal syntax <integer> examples html <img src='/broken/image/link.png' alt='broken image link'> css img { -moz-force-broken-image-icon: 1; height: 100px; width: 100px; } result screenshotlive sample note: unless the image has a specified height and width the broken image icon will not be displayed but the alt attribute will also be hidden if -moz-force-broken-image-icon is set to 1. notes this property will only work in gecko-based browsers. the use of this property is not recommended. a proper alt attribute should be used instead. specificati...
-moz-orient - CSS: Cascading Style Sheets
though submitted to the w3c, with positive initial feedback, this property is not yet part of any specification; currently, this is a mozilla-specific extension (that is, -moz-orient). ...
-webkit-line-clamp - CSS: Cascading Style Sheets
eapplies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax none | <integer> examples truncating a paragraph html <p> in this example the <code>-webkit-line-clamp</code> property is set to <code>3</code>, which means the text is clamped after three lines. an ellipsis will be shown at the point where the text is clamped. </p> css p { width: 300px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; } result specifications specification status comment css overflow module level 3the definition of '-webkit-line-clamp' in that specification. working draft initial definition ...
-webkit-mask-box-image - CSS: Cascading Style Sheets
the location of the image resource to be used as a mask image. <gradient> a -webkit-gradient function to be used as a mask image. none used to specify that a border box is to have no mask image. <length> the size of the mask image's offset. see <length> for possible units. <percentage> the mask image's offset has a percentage value relative to the border box's corresponding dimension (width or height). repeat the mask image is repeated as many times as is necessary to span the border box. may include a partial image if the mask image does not divide evenly into the border box. stretch the mask image is stretched to contain the border box exactly. round the mask image is stretched somewhat and repeated such that there is no partial mask image at the end of the border box. spac...
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
can be displayed without clipping. the only case where clipping happens using space is when there isn't enough room to display one image. round as the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. formal definition initial valuerepeatapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax repeat | no-repeat | space | round examples using a repeating or non-repeating mask image .exampleone {...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
l gesture was. also creates a new stacking context. formal definition initial valueautoapplies toscrolling boxesinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | touch examples html <div class="scroll-touch"> <p> this paragraph has momentum scrolling </p> </div> <div class="scroll-auto"> <p> this paragraph does not. </p> </div> css div { width: 100%; overflow: auto; } p { width: 200%; background: #f5f9fa; border: 2px solid #eaf2f4; padding: 10px; } .scroll-touch { -webkit-overflow-scrolling: touch; /* lets it scroll lazy */ } .scroll-auto { -webkit-overflow-scrolling: auto; /* stops scrolling immediately */ } results specifications not part of any standard. apple has a description in the safari css reference. ...
-webkit-text-stroke-color - CSS: Cascading Style Sheets
<percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
:-moz-drag-over - CSS: Cascading Style Sheets
the :-moz-drag-over css pseudo-class is a mozilla extension that matches an element when a dragover event is called on it. syntax :-moz-drag-over examples html <table border="1"> <tr> <td width="100px" height="100px">drag over</td> </tr> </table> css td:-moz-drag-over { color: red; } result specifications not part of any standard. ...
:-moz-only-whitespace - CSS: Cascading Style Sheets
was changed to act like :-moz-only-whitespace, but no browser currently supports this yet. the :-moz-only-whitespace css pseudo-class matches elements that only contains text nodes that only contain whitespace. ...
:-moz-window-inactive - CSS: Cascading Style Sheets
was achieved by setting an attribute (active="true") on the top-level xul chrome window. this attribute is no longer used. syntax :-moz-window-inactive examples this example alters the appearance of a box's background depending on whether its window is active or not. html <div id="mybox"> <p>this is a box!</p> </div> css #mybox { background: linear-gradient(to bottom, yellow, cyan); width: 200px; height: 200px; } #mybox:-moz-window-inactive { background: cyan; } result the result of this code is shown below. you can view this as a separate page as well. specifications not part of any standard. ...
::after (:after) - CSS: Cascading Style Sheets
Web › CSS › ::after
of words and punctuation">text</span> with a few <span tabindex="0" data-descr="small popups that appear when hovering">tooltips</span>. </p> css span[data-descr] { position: relative; text-decoration: underline; color: #00f; cursor: help; } span[data-descr]:hover::after, span[data-descr]:focus::after { content: attr(data-descr); position: absolute; left: 0; top: 24px; min-width: 200px; border: 1px #aaaaaa solid; border-radius: 10px; background-color: #ffffcc; padding: 12px; color: #000000; font-size: 14px; z-index: 1; } result specifications specification status comment css pseudo-elements level 4the definition of '::after' in that specification. working draft no significant changes to the previous specification. ...
::cue-region - CSS: Cascading Style Sheets
candidate recommendati...
::cue - CSS: Cascading Style Sheets
Web › CSS › ::cue
::cue { color: #fff; background-color: rgba(0...
::first-line (:first-line) - CSS: Cascading Style Sheets
/* 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. ...
::slotted() - CSS: Cascading Style Sheets
Web › CSS › ::slotted
ustomelements.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; } '; shadowroot.appendchild(style); shadowroot.appendchild(templatecontent.clonenode(true)); } }) you'll see that whe...
:empty - CSS: Cascading Style Sheets
Web › CSS › :empty
i will be pink.</div> <div class="box"> <!-- i will be pink in older browsers because of the whitespace around this comment. --> </div> <div class="box"> <p><!-- i will be pink in all browsers because of the non-collapsible whitespace and elements around this comment. --></p> </div> css body { display: flex; justify-content: space-around; } .box { background: pink; height: 80px; width: 80px; } .box:empty { background: lime; } result accessibility concerns assistive technology such as screen readers cannot parse interactive content that is empty. all interactive content must have an accessible name, which is created by providing a text value for the interactive control's parent element (anchors, buttons, etc.). accessible names expose the interactive control to the acce...
:invalid - CSS: Cascading Style Sheets
Web › CSS › :invalid
people who have certain types of color blindness will be unable to determine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning. typically, descriptive text and/or an icon are use...
unicode-range - CSS: Cascading Style Sheets
the font resources to be segmented so that a browser only needs to download the font resource needed for the text content of a particular page. for example, a site with many localizations could provide separate font resources for english, greek and japanese. for users viewing the english version of a page, the font resources for greek and japanese fonts wouldn't need to be downloaded, saving bandwidth. formal definition related at-rule@font-faceinitial valueu+0-10ffffcomputed valueas specified formal syntax <unicode-range># examples using a different font for a single character in this example we create a simple html containing a single <div> element, including an ampersand, that we want to style with a different font. to make it obvious, we will use a sans-serif font, helvetica, for th...
device-aspect-ratio - CSS: Cascading Style Sheets
syntax the device-aspect-ratio feature is specified as a <ratio>. it is a range feature, meaning that you can also use the prefixed min-device-aspect-ratio and max-device-aspect-ratio variants to query minimum and maximum values, respectively. examples article { padding: 1rem; } @media screen and (min-device-aspect-ratio: 16/9) { article { padding: 1rem 5vw; } } specifications specification status comment media queries level 4the definition of 'device-aspect-ratio' in that specification. candidate recommendation deprecated in media queries level 4. ...
orientation - CSS: Cascading Style Sheets
soft keyboard on many devices in portrait orientation will cause the viewport to become wider than it is tall, thereby causing the browser to use landscape styles instead of portrait. syntax the orientation feature is specified as a keyword value chosen from the list below. keyword values portrait the viewport is in a portrait orientation, i.e., the height is greater than or equal to the width. landscape the viewport is in a landscape orientation, i.e., the width is greater than the height. examples html <div>box 1</div> <div>box 2</div> <div>box 3</div> css body { display: flex; } div { background: yellow; } @media (orientation: landscape) { body { flex-direction: row; } } @media (orientation: portrait) { body { flex-direction: column; } } result sp...
pointer - CSS: Cascading Style Sheets
Web › CSS › @media › pointer
pointers and a large checkbox for users with coarse primary pointers. html <input id="test" type="checkbox" /> <label for="test">look at me!</label> css input[type="checkbox"] { -moz-appearance: none; -webkit-appearance: none; appearance: none; border: solid; margin: 0; } input[type="checkbox"]:checked { background: gray; } @media (pointer: fine) { input[type="checkbox"] { width: 15px; height: 15px; border-width: 1px; border-color: blue; } } @media (pointer: coarse) { input[type="checkbox"] { width: 30px; height: 30px; border-width: 2px; border-color: red; } } result specifications specification status comment media queries level 4the definition of 'pointer' in that specification. candidate recommenda...
prefers-color-scheme - CSS: Cascading Style Sheets
editor's draft initial definition. ...
prefers-contrast - CSS: Cascading Style Sheets
es that user has notified the system that they prefer an interface that has a lower level of contrast. user preferences various operating systems do support such preferences and user agents are likely to rely on the settings provided by the operating system. examples this example has an annoying low contrast by default. html <div class="contrast">low contrast box</div> css .contrast { width: 100px; height: 100px; outline: 2px dashed black; } @media (prefers-contrast: high) { .contrast { outline: 2px solid black; } } result specifications specification status comment media queries level 5the definition of 'prefers-contrast' in that specification. editor's draft initial definition. ...
prefers-reduced-motion - CSS: Cascading Style Sheets
riggers. html <div class="animation">animated box</div> css .animation { animation: pulse 1s linear infinite both; } /* tone down the animation to avoid vestibular motion triggers like scaling or panning large objects. ...
height - CSS: Cascading Style Sheets
Web › CSS › @viewport › height
vided, the first value will set the minimum height and the second value will set the maximum height. syntax /* one value */ height: auto; height: 320px; height: 15em; /* two values */ height: 320px 200px; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. formal definition related at-rule@viewportinitial valueas each of the properties of the shorthand:min-height: automax-height: nonepercentagesas each of the properties of the shorthand:min-height: the percentage is calculated with respect to the height of the generated b...
Using multiple backgrounds - CSS: Cascading Style Sheets
nd properties can be specified as a list, one per background: background, background-attachment, background-clip, background-image, background-origin, background-position, background-repeat, background-size. ...
Using URL values for the cursor property - CSS: Cascading Style Sheets
op left (0,0). limitations all image formats supported by gecko can be used. this means that you can use png, gif, jpg, bmp, cur, etc. images. ani is not supported. an animated png or gif will not create an animated cursor. note: starting with gecko 2.0, gecko also supports the svg image format for cursors. however, the svg image must contain a length-valued (not percentage-valued) height and width on its root svg node. javascript, css animation, and declarative smil inside an svg image are ignored; you can't use svg to create an animated cursor, for example. in gecko (firefox) the limit of the cursor size is 128×128px. larger cursor images are ignored. however, you should limit yourself to the size 32×32 for maximum compatibility with operating systems and platforms. (due to a bug in ...
CSS Basic User Interface - CSS: Cascading Style Sheets
css basic user interface is a css module that lets you define the rendering and functionality of features related to the user interface. reference properties appearance box-sizing cursor ime-mode nav-down nav-left nav-right nav-up outline outline-width outline-style outline-color outline-offset resize text-overflow user-select guides using url values for the cursor property explains how a url can be used with the cursor property to produce custom cursors. specifications specification status comment css basic user interface module level 4 working draft css basic user interface module level 3 recommendation css level 2 (revision 1) recommendation initial definition. ...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
ingle item inside a container a flex item in order to use the alignment properties as specified in flexbox. alignment of blocks horizontally prior to flexbox was typically achieved by way of setting auto margins on the block. a margin of auto will absorb all available space in that dimension, therefore setting a left and right margin of auto, you can push a block into the center: .container { width: 20em; margin-left: auto; margin-right: auto; } in table layout, you have access to the vertical-align property to align the contents of a cell inside that cell. for many use cases, turning the block container into a flex item will give you the alignment capability that you are looking for. in the example below, a container with a single item inside has been turned into a flex container fo...
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
he align-content property applies to the block axis and justify-content to the inline axis. any spacing added to the columns due to use of space distribution will be added to the gap between the columns, therefore making the gap larger than might be specified by the column-gap property. using a value of justify-content other than normal or stretch will cause column boxes to display at the column-width specified on the multicol container, and the remaining space distributed according to the value of justify-content. column-gap the column-gap property was specified in earlier versions of the multiple-column layout specification, and has now been unified with the gap properties for other layout methods in box alignment. while other layout methods treat the initial value of column-gap as 0 multi...
CSS Box Alignment - CSS: Cascading Style Sheets
that the box alignment specification should be referred to as it may add additional capabilities over what is currently in flexbox. basic examples the following examples demonstrate how some of the box alignment properties are applied in grid and flexbox. css grid layout alignment example in this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. this space is distributed using justify-content. on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. the first item overrides the align-items value set on the group by setting align-self to center. flexbox alignment example in this example, three flex items are aligned on the main axis using justify-con...
Styling Columns - CSS: Cascading Style Sheets
ial value for column-gap is 0. if you use the keyword value “normal” the gap will be set to 1em. you 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 wi...
CSS Multi-column Layout - CSS: Cascading Style Sheets
ch column box becomes a fragment, much like a printed page becomes a fragment of an overall document. therefore the properties now defined in the css fragmentation specification are required in order to control how content breaks between columns. reference multiple-column layout properties column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns related css fragmentation properties break-after break-before break-inside orphans widows guides basic concepts of multicol an overview of the multiple-column layout specification styling columns how to use column rules and manage the spacing between columns. spanning and balancing how to make elements span across all columns and controlli...
Using feature queries - CSS: Cascading Style Sheets
, they ignore it. so we could start enhancing our layout by using css grid. browsers that do not support grid will ignore the grid value of the display property. once a floated item becomes a grid item, the float is removed — something you can read more about in supporting older browsers. therefore the grid version should just overwrite the floated one. we have a problem however, caused by the width property we used on our floated items to make them display as three columns. this is now interpreted by grid as being the width of the column track, not the width of the container as it is for the float. what we need is a way to remove the width if display: grid is supported. this is exactly the situation feature queries solve. we can set the width back to auto if grid is supported. in the ...
Ordering Flex Items - CSS: Cascading Style Sheets
want to make one item display first, and leave the order of all other items unchanged, you can give that item an order of -1. as this is lower than 0 the item will always be displayed first. in the live code example below i have items laid out using flexbox. by changing which item has the class active assigned to it in the html, you can change which item displays first and therefore becomes full width at the top of the layout, with the other items displaying below it. the items are displayed in what is described in the specification as order-modified document order. the value of the order property is taken into account before the items are displayed. order also changes the paint order of the items; items with a lower value for order will be painted first and those with a higher value for o...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
container and set the direction at that level, any control over item sizing needs to happen on the items themselves. in some cases you could happily use either layout method, but as you become confident with both you will find each one suiting different layout needs, and you will end up with both methods in your css. there is rarely a right or wrong answer. as a rule of thumb, if you are adding widths to flex items in order to make items in one row of a wrapped flex container line up with the items above them you really want two-dimensional layout. in this case it is likely that the component would be better laid out using css grid layout. it isn't the case that you should use flexbox for small components and grid layout for larger ones; a tiny component can be two dimensional, and a large la...
Block and inline layout in normal flow - CSS: Cascading Style Sheets
dded a border. the default browser stylesheet adds spacing between the paragraphs by way of adding a margin to the top and bottom. if we set margins on the paragraph element to 0 then the borders will touch. by default block elements will consume all of the space in the inline direction, so our paragraphs spread out and get as big as they can inside their containing block. if we give them a width, they will continue to lay out one below the other - even if there would be space for them to be side by side. each will start against the start edge of the containing block, so the place at which sentences would begin in that writing mode. margin collapsing the spec explains that margins between block elements collapse. this means that if you have an element with a top margin immediately aft...
Flow Layout and Overflow - CSS: Cascading Style Sheets
when there is more content than can fit into a container, an overflow situation occurs. understanding how overflow behaves is important in dealing with any element with a constrained size in css. this guide explains how overflow works when working with normal flow. what is overflow? giving an element a fixed height and width, then adding significant content to the box, creates a basic overflow example: the content goes into the box. once it fills the box, it continues to overflow in a visible way, displaying content outside the box, potentially displaying under subsequent content. the property that controls how overflow behaves is the overflow property which has an initial value of visible. this is why we can see the overflow content. controlling overflow there are other values t...
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
nge their orientation based on the writing-mode property. however, replaced elements such as form controls which include text, should match the writing mode in use. logical properties and values once you are working in writing modes other than horizontal-tb many of the properties and values that are mapped to the physical dimensions of the screen seem strange. for example, if you give a box a width of 100px, in horizontal-tb that would control the size in the inline direction. in vertical-lr it controls the size in the block direction because it does not rotate with the text. therefore, we have new properties of block-size and inline-size. if we give our block an inline-size of 100px, it doesn’t matter whether we are in a horizontal or a vertical writing mode, inline-size will always m...
OpenType font features guide - CSS: Cascading Style Sheets
height and designed to have the appearance of ascenders and descenders like other lower case letters. these are designed to be used inline with copy so the numerals visually blend with the surrounding glyphs in a similar fashion to small caps. there is also the notion of spacing. proportional spacing is the normal setting, whereas tabular spacing lines up numerals evenly regardless of character width, making it more appropriate for lining up tables of numbers in financial tables. there are two types of fractions supported through this property: diagonal slashed fractions. vertically stacked fractions. ordinals are also supported (such as '1st' or '3rd'), as is a slashed zero if present in the font. lining and oldstyle figures fractions, ordinals, and slashed zero east asian (fon...
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
phs below. the first uses the default horizontal-tb, and the second uses vertical-rl. in the mode text still runs left to right, however the direction of the text is vertical - inline text now runs down the page, from top to bottom. ...
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
e one value for grid-gap it will apply to both column and row gaps. if you specify two values, the first is used for grid-row-gap and the second for grid-column-gap. .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 100px); grid-gap: 1em 20px; } in terms of line-based positioning of items, the gap acts as if the line has gained extra width. anything starting at that line starts after the gap and you cannot address the gap or place anything into it. if you want gutters that act more like regular tracks you can of course define a track for the purpose instead. using the span keyword in addition to specifying the start and end lines by number, you can specify a start line and then the number of tracks you would like the area to span...
CSS Grid Layout - CSS: Cascading Style Sheets
les. for example, a grid container's child elements could position themselves so they actually overlap and layer, similar to css positioned elements. basic example the example below shows a three-column track grid with new rows created at a minimum of 100 pixels and a maximum of auto. items have been placed onto the grid using line-based placement. ...
Implementing image sprites in CSS - CSS: Cascading Style Sheets
image sprites are used in numerous web apps where multiple images are used. rather than include each image as a separate image file, it is much more memory- and bandwidth-friendly to send them as a single image; using background position as a way to distinguish between individual images in the same image file, so the number of http requests is reduced. note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small requests. implementation suppose an image is given to every item with class toolbtn: .toolbtn { background: url(myfile.png); display: inline-block; height: 20px; width: 20px; } a background position can be added either as two x, y values after the url()() in the background, or as background-position. for example: #btn1 { background-position...
CSS Masking - CSS: Cascading Style Sheets
css masking is a css module that defines means, including masking and clipping, for partially or fully hiding portions of visual elements. reference properties clip clip-path clip-rule mask mask-border mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size mask-type specifications specification status comment css masking module level 1 candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'mask' in that specification. recommendation initial definition ...
CSS Motion Path - CSS: Cascading Style Sheets
owed for simple movements. with offset-path you can define a specific path of any shape you want. you then animate it along that path by animating offset-distance, and can choose to rotate it at any point using offset-rotate. basic example <div id="motion-demo"></div> #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } reference properties offset offset-anchor offset-distance offset-path offset-position offset-rotate specifications specification status comment motion path module level 1 working draft initial definition. ...
Stacking context example 1 - CSS: Cascading Style Sheets
<br /><span class="bold">div #4</span> <br />position: absolute; <br />z-index: 2; </div> </div> </body></html> css .bold { font-weight: bold; font: 12px arial; } #div1, #div3 { height: 80px; position: relative; border: 1px dashed #669966; background-color: #ccffcc; padding-left: 5px; } #div2 { opacity: 0.8; z-index: 1; position: absolute; width: 150px; height: 200px; top: 20px; left: 170px; border: 1px dashed #990000; background-color: #ffdddd; text-align: center; } #div4 { opacity: 0.8; z-index: 2; position: absolute; width: 200px; height: 70px; top: 65px; left: 50px; border: 1px dashed #000099; background-color: #ddddff; text-align: left; padding-left: 10px; } result...
Stacking context example 2 - CSS: Cascading Style Sheets
g/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head><style type="text/css"> div { font: 12px arial; } span.bold { font-weight: bold; } #div2 { z-index: 2; } #div3 { z-index: 1; } #div4 { z-index: 10; } #div1,#div3 { height: 80px; position: relative; border: 1px dashed #669966; background-color: #ccffcc; padding-left: 5px; } #div2 { opacity: 0.8; position: absolute; width: 150px; height: 200px; top: 20px; left: 170px; border: 1px dashed #990000; background-color: #ffdddd; text-align: center; } #div4 { opacity: 0.8; position: absolute; width: 200px; height: 70px; top: 65px; left: 50px; border: 1px dashed #000099; background-color: #ddddff; text-align: left; padding-left: 10px; } </style></head> <body> <br /> ...
Stacking without the z-index property - CSS: Cascading Style Sheets
<div id="abs2" class="absolute"> <b>div #4</b><br />position: absolute;</div> <div id="sta1" class="static"> <b>div #5</b><br />position: static;</div> css b { font-family: sans-serif; } div { padding: 10px; border: 1px dashed; text-align: center; } .static { position: static; height: 80px; background-color: #ffc; border-color: #996; } .absolute { position: absolute; width: 150px; height: 350px; background-color: #fdd; border-color: #900; opacity: 0.7; } .relative { position: relative; height: 80px; background-color: #cfc; border-color: #696; opacity: 0.7; } #abs1 { top: 10px; left: 10px; } #rel1 { top: 30px; margin: 0px 50px 0px 50px; } #rel2 { top: 15px; left: 20px; margin: 0px 50px 0px 50px; } #abs2 { top: 10px; right: 10...
The stacking context - CSS: Cascading Style Sheets
tml { padding: 20px; font: 12px/20px arial, sans-serif; } div { opacity: 0.7; position: relative; } h1 { font: inherit; font-weight: bold; } #div1, #div2 { border: 1px dashed #696; padding: 10px; background-color: #cfc; } #div1 { z-index: 5; margin-bottom: 190px; } #div2 { z-index: 2; } #div3 { z-index: 4; opacity: 1; position: absolute; top: 40px; left: 180px; width: 330px; border: 1px dashed #900; background-color: #fdd; padding: 40px 20px 20px; } #div4, #div5 { border: 1px dashed #996; background-color: #ffc; } #div4 { z-index: 6; margin-bottom: 15px; padding: 25px 10px 5px; } #div5 { z-index: 1; margin-top: 15px; padding: 5px 10px; } #div6 { z-index: 3; position: absolute; top: 20px; left: 180px; width: 150px; height: 125...
Basic Shapes - CSS: Cascading Style Sheets
osition. if omitted this will be set to center. however you can use any valid position here to indicate the position of the centre of the circle. our circle therefore accepts one radius value, which may be a length, a percentage or the closest-side or farthest side keyword then optionally the keyword at followed by a position value. in the below example i have created a circle on an item with a width of 100 pixels, plus a margin of 20 pixels. this gives a total width for the reference box of 140 pixels. i have given a value of 50% for the shape-radius value which means that our radius is 70px. i have then set the position value to 30%. in the live example you can play with increasing or decreasing the size of the circle by changing the size of the radius, moving the circle around with the ...
Overview of CSS Shapes - CSS: Cascading Style Sheets
you can do this with shapes, however you will still need a floated item, which you can then make invisible. that could be a redundant element inserted into the document, an empty <div> or <span> perhaps, but our preference is to use generated content. this means we can keep things used for styling inside the css. in this next example, we use generated content to insert an element with height and width of 150px. we can then use basic shapes, box values or even the alpha channel of an image to create a shape for the text to wrap around. relationship to clip-path the basic shapes and box values used to create shapes are the same as those used as values for clip-path. therefore if you want to create a shape using an image, and also clip away part of that image, you can use the same values. th...
Inline formatting context - CSS: Cascading Style Sheets
used the value top, try changing it to middle, bottom, or baseline. alignment in the inline direction if there is additional space in the inline direction, the text-align property can be used to align the inline boxes within their line box. try changing the value of text-align below to end. effect of floats line boxes usually have the same size in the inline direction, therefore the same width if working in a horizontal writing mode, or height if working in a vertical writing mode. if there is a float within the same block formatting context however, the float will cause the line boxes that wrap the float to become shorter. ...
Value definition syntax - CSS: Cascading Style Sheets
ength> is equivalent to [ bold thin ] && <length>. it describes bold thin <length> or <length> bold thin but not bold <length> thin. double bar separating two or more components by a double bar, ||, means that all entities are options: at least one of them must be present, and they may appear in any order. typically this is used to define the different values of a shorthand property. <'border-width'> || <'border-style'> || <'border-color'> this example matches the following values: 1em solid blue blue 1em solid 1px yellow but not: blue yellow, as a component must appear at most one single time. bold, as it isn't a keyword allowed as value of any of the entity. note: the double ampersand has precedence over the double bar, meaning that bold || thin && <length> is equivalent t...
Actual value - CSS: Cascading Style Sheets
calculating a property's actual value the user agent performs four steps to calculate a property's actual (final) value: first, the specified value is determined based on the result of cascading, inheritance, or using the initial value. ...
align-self - CSS: Cascading Style Sheets
e set of all the boxes in its baseline-sharing group. the fallback alignment for first baseline is start, the one for last baseline is end. stretch if the combined size of the items along the cross axis is less than the size of the alignment container and the item is auto-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. formal d...
attr() - CSS: Cascading Style Sheets
Web › CSS › attr
rameter is sparse. the attr() css function is used to retrieve the value of an attribute of the selected element and use it in the stylesheet. it can also be used on pseudo-elements, in which case the value of the attribute on the pseudo-element's originating element is returned. /* simple usage */ attr(data-count); attr(title); /* with type */ attr(src url); attr(data-count number); attr(data-width px); /* with fallback */ attr(data-count number, 0); attr(src url, ""); attr(data-width px, inherit); attr(data-something, "default"); syntax values attribute-name is the name of an attribute on the html element referenced in the css. <type-or-unit> is a keyword representing either the type of the attribute's value, or its unit, as in html some attributes have implicit units. if the u...
background-blend-mode - CSS: Cascading Style Sheets
lay</option> <option>darken</option> <option>lighten</option> <option>color-dodge</option> <option>color-burn</option> <option>hard-light</option> <option>soft-light</option> <option>difference</option> <option>exclusion</option> <option>hue</option> <option>saturation</option> <option>color</option> <option>luminosity</option> </select> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'),url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: screen; } document.getelementbyid("select").onchange = function(event) { document.getelementbyid("div").style.backgroundblendmode = document.getelementbyid("select").selectedoptions[0].innerhtml; } console.log(docum...
background-position-y - CSS: Cascading Style Sheets
e formal syntax [ center | [ [ top | bottom | y-start | y-end ]? <length-percentage>? ]! ]#where <length-percentage> = <length> | <percentage> examples basic example the following example shows a simple background image implementation, with background-position-x and background-position-y used to define the image's horizontal and vertical positions separately. ...
background - CSS: Cascading Style Sheets
round-repeat: repeatbackground-origin: padding-boxbackground-clip: border-boxbackground-attachment: scrollbackground-color: transparentapplies toall elements. ...
border-block-color - CSS: Cascading Style Sheets
r-inline-end-color. syntax values <'color'> the color of the border. see color. formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typediscrete formal syntax <'border-top-color'>{1,2} examples border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-color: red; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-color' in that specification. editor's draft initial definition ...
border-block-end-color - CSS: Cascading Style Sheets
rder colors of the element. values <'color'> the color of the border. see color. formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-end-color: red; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-end-color' in that specification. editor's draft initial definition ...
border-block-end-style - CSS: Cascading Style Sheets
of the element. values <'border-style'> the line style of the border. see border-style. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border with vertical text 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-block-end-style: dashed; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-end-style' in that specification. editor's draft initial definition ...
border-block-start-color - CSS: Cascading Style Sheets
define the other border colors of the element. values <'color'> see border-color formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-start-color: red; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-start-color' in that specification. editor's draft initial definition ...
border-block-start-style - CSS: Cascading Style Sheets
of the element. values <'border-style'> the line style of the border. see border-style. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border wtih vertical text 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-block-start-style: dashed; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-start-style' in that specification. editor's draft initial definition ...
border-block-style - CSS: Cascading Style Sheets
d-style. syntax values <'border-style'> the line style of the border. see border-style. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border with vertical text 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-block-style: dashed; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-style' in that specification. editor's draft initial definition ...
border-bottom-color - CSS: Cascading Style Sheets
so applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it. note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-bottom-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-color' in that specification. candidate recommendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. ...
border-bottom-style - CSS: Cascading Style Sheets
class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 3px; background-color: #52e385; } tr, td { padding: 3px; } /* border-bottom-style example classes */ .b1 {border-bottom-style: none;} .b2 {border-bottom-style: hidden;} .b3 {border-bottom-style: dotted;} .b4 {border-bottom-style: dashed;} .b5 {border-bottom-style: solid;} .b6 {border-bottom-style: double;} .b7 {border-bottom-style: groove;} .b8 {border-bottom-style: ridge;} .b9 {border-bott...
border-image-repeat - CSS: Cascading Style Sheets
ill be distributed in between tiles to achieve the proper fit. formal definition initial valuestretchapplies toall elements, except internal table elements when border-collapse is collapse. ...
border-inline-color - CSS: Cascading Style Sheets
ck-end-color. syntax values <'color'> the color of the border. see color. formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typediscrete formal syntax <'border-top-color'>{1,2} examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-color: red; } results specifications specification status comment css logical properties and values level 1the definition of 'border-inline-color' in that specification. editor's draft initial definition ...
border-inline-end-color - CSS: Cascading Style Sheets
inheritednocomputed valuecomputed coloranimation typea color values <'color'> the color of the border. see color. formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> 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: 10px solid blue; border-inline-end-color: red; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-end-color' in that specification. editor's draft initial definition ...
border-inline-end-style - CSS: Cascading Style Sheets
ich 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 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-start-color - CSS: Cascading Style Sheets
-color, which define the other border colors of the element. values <'color'> the color of the border. see color. formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> 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: 10px solid blue; border-inline-start-color: red; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-start-color' in that specification. editor's draft initial definition ...
border-inline-start-style - CSS: Cascading Style Sheets
nocomputed valueas specifiedanimation typediscrete values <'border-style'> the line style of the border. see border-style. 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-start-style: dashed; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-start-style' in that specification. editor's draft initial definition ...
border-inline-style - CSS: Cascading Style Sheets
nd border-block-end-style. syntax values <'border-style'> the line style of the border. see border-style. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-style: dashed; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-style' in that specification. editor's draft initial definition ...
border-left-color - CSS: Cascading Style Sheets
hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it. note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-left-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-left-color' in that specification. candidate recommendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. c...
border-right-color - CSS: Cascading Style Sheets
sla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it. note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-right-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-right-color' in that specification. candidate recommendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. ...
border-spacing - CSS: Cascading Style Sheets
n a table's cells. note how, along its outside edges, the table's padding values are added to its border-spacing values. html <table> <tr> <td>1</td><td>2</td><td>3</td> </tr> <tr> <td>4</td><td>5</td><td>6</td> </tr> <tr> <td>7</td><td>8</td><td>9</td> </tr> </table> css table { border-spacing: 1em .5em; padding: 0 2em 1em 0; border: 1px solid orange; } td { width: 1.5em; height: 1.5em; background: #d2d2d2; text-align: center; vertical-align: middle; } result specifications specification status comment css level 2 (revision 1)the definition of 'border-spacing' in that specification. recommendation initial definition. ...
border-top-color - CSS: Cascading Style Sheets
) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it. note which side of the box is <span class="redtext">red</span>.</p> </div> css .mybox { border: solid 0.3em gold; border-top-color: red; width: auto; } .redtext { color: red; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-color' in that specification. candidate recommendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. css ...
border-top-left-radius - CSS: Cascading Style Sheets
second value is a <length> or a <percentage> denoting the vertical semi-major axis of the ellipse to use for the border in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercent...
border-top-right-radius - CSS: Cascading Style Sheets
second value is a <length> or a <percentage> denoting the vertical semi-major axis of the ellipse to use for the border in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercent...
border-top-style - CSS: Cascading Style Sheets
class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding: 3px; } /* border-top-style example classes */ .b1 {border-top-style: none;} .b2 {border-top-style: hidden;} .b3 {border-top-style: dotted;} .b4 {border-top-style: dashed;} .b5 {border-top-style: solid;} .b6 {border-top-style: double;} .b7 {border-top-style: groove;} .b8 {border-top-style: ridge;} .b9 {border-top-style: inset;} .b10 {border...
bottom - CSS: Cascading Style Sheets
Web › CSS › bottom
> | auto examples absolute and fixed positioning this example demonstrates the difference in behavior of the bottom property, when position is absolute versus fixed. html <p>this<br>is<br>some<br>tall,<br>tall,<br>tall,<br>tall,<br>tall<br>content.</p> <div class="fixed"><p>fixed</p></div> <div class="absolute"><p>absolute</p></div> css p { font-size: 30px; line-height: 2em; } div { width: 48%; text-align: center; background: rgba(55,55,55,.2); border: 1px solid blue; } .absolute { position: absolute; bottom: 0; left: 0; } .fixed { position: fixed; bottom: 0; right: 0; } result specifications specification status comment css positioned layout module level 3the definition of 'bottom' in that specification. working draft add...
box-decoration-break - CSS: Cascading Style Sheets
rty is specified as one of the keyword values listed below. values slice the element is initially rendered as if its box were not fragmented, after which the rendering for this hypothetical box is sliced into pieces for each line/column/page. note that the hypothetical box can be different for each fragment since it uses its own height if the break occurs in the inline direction, and its own width if the break occurs in the block direction. see the css specification for details. clone each box fragment is rendered independently with the specified border, padding, and margin wrapping each fragment. the border-radius, border-image, and box-shadow are applied to each fragment independently. the background is also drawn independently for each fragment, which means that a background image wit...
box-flex-group - CSS: Cascading Style Sheets
ontaining box according to the box-pack property. if the box would overflow after the preferred space of the children has been computed, then space is removed from flexible elements in a manner similar to that used when adding extra space. each flex group is examined in turn and space is removed according to the ratio of the flexibility of each element. elements do not shrink below their minimum widths. syntax the box-flex-group property is specified as any positive <integer>. formal definition initial value1applies toin-flow children of box elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <integer> examples simple usage example in the original flexbox spec, box-flex-group could be used to assign flex children to different groups to distribute flexible...
box-flex - CSS: Cascading Style Sheets
Web › CSS › box-flex
s display value of -moz-box or -moz-inline-box or -webkit-box or -webkit-inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax <number> examples setting box-flex <!doctype html> <html> <head> <title>-moz-box-flex example</title> <style> div.example { display: -moz-box; display: -webkit-box; border: 1px solid black; width: 100%; } div.example > p:nth-child(1) { -moz-box-flex: 1; /* mozilla */ -webkit-box-flex: 1; /* webkit */ border: 1px solid black; } div.example > p:nth-child(2) { -moz-box-flex: 0; /* mozilla */ -webkit-box-flex: 0; /* webkit */ border: 1px solid black; } </style> </head> <body> <div class...
box-lines - CSS: Cascading Style Sheets
Web › CSS › box-lines
placed in a single row or column, and any elements that don't fit will simply be considered overflow. if a value of multiple is specified, however, then the box is allowed to expand to multiple lines (that is, multiple rows or columns) in order to accommodate all of its children. the box must attempt to fit its children on as few lines as possible by shrinking all elements down to their minimum widths or heights if necessary. if the children in a horizontal box still do not fit on a line after being reduced to their minimum widths, then children are moved one by one onto a new line, until the elements remaining on the previous line fit. this process can repeat to an arbitrary number of lines. if a line contains only a single element that doesn't fit, then the element should stay on that line...
clip - CSS: Cascading Style Sheets
Web › CSS › clip
solutely positioned elementsinheritednocomputed valueauto if specified as auto, otherwise a rectangle with four values, each of which is auto if specified as auto or the computed length otherwiseanimation typea rectangle formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image css .dotted-border { border: dotted; position: relative; width: 536px; height: 350px; } #top-left, #middle, #bottom-right { position: absolute; top: 0; } #top-left { left: 360px; clip: rect(0 175px 113px 0); } #middle { left: 280px; clip: rect(119px 255px 229px 80px); } #bottom-right { left: 200px; clip: rect(235px 335px 345px 160px); } html <p class="dotted-border"> <img src="https://udn.realityripple.com/samples/8f/15174f3500.jpg...
color-adjust - CSS: Cascading Style Sheets
dient behind medium red text. for whatever reason, this is the desired appearance in any rendering environment, including on paper, so we also use color-adjust: exact to tell the browser not to make color or style adjustments to the box when rendering it. ...
<color> - CSS: Cascading Style Sheets
essage, action, or result. see color and color contrast for more information. examples color value tester in this example we provide a <div> and a text input. entering a valid color into the input causes the <div> to adopt that color, allowing you to test our color values. ...
column-count - CSS: Cascading Style Sheets
tribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword value */ column-count: auto; /* <integer> value */ column-count: 3; /* global values */ column-count: inherit; column-count: initial; column-count: unset; values auto the number of columns is determined by other css properties, such as column-width. <integer> is a strictly positive <integer> describing the ideal number of columns into which the content of the element will be flowed. if the column-width is also set to a non-auto value, it merely indicates the maximum allowed number of columns. formal definition initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valueas specifiedanimation typean int...
Computed value - CSS: Cascading Style Sheets
value typically involves converting relative values (such as those in em units or percentages) to absolute values. for example, if an element has specified values font-size: 16px and padding-top: 2em, then the computed value of padding-top is 32px (double the font size). however, for some properties (those where percentages are relative to something that may require layout to determine, such as width, margin-right, text-indent, and top), percentage-specified values turn into percentage-computed values. additionally, unitless numbers specified on the line-height property become the computed value, as specified. the relative values that remain in the computed value become absolute when the used value is determined. note: the getcomputedstyle() dom api returns the resolved value, which may eit...
cross-fade() - CSS: Cascading Style Sheets
= <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples older syntax for cross-fade html <div class="crossfade"></div> css .crossfade { width: 300px; height: 300px; background-image: -webkit-cross-fade( url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'), 75%); background-image: cross-fade( url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'), 75%); } result spe...
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
create inline flex containers. if you create a flex container using the single value of inline-flex you will have an inline-level box with flex children. the children behave in the same way as the flex children of a block-level container. the only thing that has changed is that the parent is now an inline-level box. it therefore behaves like other inline-level things, and doesn't take up the full width (or size in the inline dimension) that a block-level box does. this means that some following text could come up alongside the flex container. the same is true when working with grid layout. using display: grid will give you a block-level box, which creates a grid formatting context for the direct children. using display: inline-grid will create an inline-level box, which creates a grid format...
<display-inside> - CSS: Cascading Style Sheets
in this example the parent box has been given display: flow-root and so establishes a new bfc and contains the floated item. html <div class="box"> <div class="float">i am a floated box!</div> <p>i am content inside the container.</p> </div> css .box { background-color: rgb(224, 206, 247); border: 5px solid rebeccapurple; display: flow-root; } .float { float: left; width: 200px; height: 150px; background-color: white; border:1px solid black; padding: 10px; } result specifications specification status css display module level 3the definition of 'display-inside' in that specification. candidate recommendation ...
<easing-function> - CSS: Cascading Style Sheets
option>ease-in-out</option> <option>ease-out</option> <option>cubic-bezier(0.1, -0.6, 0.2, 0)</option> <option>cubic-bezier(0, 1.1, 0.8, 4)</option> <option>steps(5, end)</option> <option>steps(3, start)</option> <option>steps(4)</option> </select> </li> </ul> css body > div { position: relative; height: 100px; } div > div { position: absolute; width: 50px; height: 50px; background-color: blue; background-image: radial-gradient(circle at 10px 10px, rgba(25,255,255,0.8),rgba(25,255,255,0.4)); border-radius: 50%; top: 25px; animation: 1.5s infinite alternate; } @keyframes move-right { from { left: 10%; } to { left: 90%; } } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20...
env() - CSS: Cascading Style Sheets
Web › CSS › env
vailable. <p> if the <code>env()</code> function is supported in your browser, this paragraph’s text will have 50px of padding between it and the left border — but not the top, right and bottom. this is because the accompanying css is the equivalent of <code>padding: 0 0 0 50px</code>, because, unlike other css properties, user agent property names are case-sensitive. ...
<filter-function> - CSS: Cascading Style Sheets
ion>contrast</option> <option>drop-shadow</option> <option>grayscale</option> <option>hue-rotate</option> <option>invert</option> <option>opacity</option> <option>saturate</option> <option>sepia</option> </select> </li> <li> <input type="range"><output></output> </li> <li> <p>current value: <code></code></p> </li> </ul> css div { width: 300px; height: 300px; background: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png) no-repeat center; } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } input { width: 60% } output { width: 5%; text-align: center; } select { width: 40%; margin-left: 2px; } javascript...
flex-direction - CSS: Cascading Style Sheets
>a</div> <div class="box" style="background-color:lightblue;">b</div> <div class="box" style="background-color:yellow;">c</div> </div> <h4>this is a row-reverse</h4> <div id="content1"> <div class="box1" style="background-color:red;">a</div> <div class="box1" style="background-color:lightblue;">b</div> <div class="box1" style="background-color:yellow;">c</div> </div> css #content { width: 200px; height: 200px; border: 1px solid #c3c3c3; display: flex; flex-direction: column-reverse; } .box { width: 50px; height: 50px; } #content1 { width: 200px; height: 200px; border: 1px solid #c3c3c3; display: flex; flex-direction: row-reverse; } .box1 { width: 50px; height: 50px; } result specifications specification status comment ...
flex-grow - CSS: Cascading Style Sheets
Web › CSS › flex-grow
ow: 0.6; /* global values */ flex-grow: inherit; flex-grow: initial; flex-grow: unset; the flex-grow property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 0. description this property specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor). the main size is either width or height of the item which is dependent on the flex-direction value. the remaining space is the size of the flex container minus the size of all flex items' sizes together. if all sibling items have the same flex grow factor, then all items will receive the same share of remaining space, otherwise it is distributed according to the ratio defined by the different flex grow factors. flex-grow is...
flex-wrap - CSS: Cascading Style Sheets
Web › CSS › flex-wrap
iv> <h4>this is an example for flex-wrap:wrap-reverse </h4> <div class="content2"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> css /* common styles */ .content, .content1, .content2 { color: #fff; font: 100 24px/100px sans-serif; height: 150px; text-align: center; } .content div, .content1 div, .content2 div { height: 50%; width: 300px; } .red { background: orangered; } .green { background: yellowgreen; } .blue { background: steelblue; } /* flexbox styles */ .content { display: flex; flex-wrap: wrap; } .content1 { display: flex; flex-wrap: nowrap; } .content2 { display: flex; flex-wrap: wrap-reverse; } results specifications specification status comment ...
font-family - CSS: Cascading Style Sheets
rokes, flared or tapering ends, or have actual serifed endings. e.g. lucida bright, lucida fax, palatino, "palatino linotype", palladio, "urw palladio", serif. sans-serif glyphs have stroke endings that are plain. e.g. "open sans", "fira sans", "lucida sans", "lucida sans unicode", "trebuchet ms", "liberation sans", "nimbus sans l", sans-serif. monospace all glyphs have the same fixed width. e.g. "fira mono", "dejavu sans mono", menlo, consolas, "liberation mono", monaco, "lucida console", monospace. cursive glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces. the glyphs are partially or completely connected, and the result looks more like handwritten pen or brush writing than printed letterwork. e.g...
font-style - CSS: Cascading Style Sheets
s://github.com/typenetwork/amstelvar/blob/master/ofl.txt */ @font-face { src: url('https://mdn.mozillademos.org/files/16044/amstelvaralpha-vf.ttf'); font-family:'amstelvaralpha'; font-style: normal; } label { font: 1rem monospace; } .container { max-height: 150px; overflow: scroll; } .sample { font: 2rem 'amstelvaralpha', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascript let slantlabel = document.queryselector('label[for="slant"]'); let slantinput = document.queryselector('#slant'); let sampletext = document.queryselector('.sample'); function...
grid-auto-columns - CSS: Cascading Style Sheets
nt). fit-content(argument) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be streched by the align-content and justify-content properties. formal definition initial valueautoapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valuethe percentage as specified or the absolute lengthanimation typedis...
grid-auto-flow - CSS: Cascading Style Sheets
d="item1"></div> <div id="item2"></div> <div id="item3"></div> <div id="item4"></div> <div id="item5"></div> </div> <select id="direction" onchange="changegridautoflow()"> <option value="column">column</option> <option value="row">row</option> </select> <input id="dense" type="checkbox" onchange="changegridautoflow()"> <label for="dense">dense</label> css #grid { height: 200px; width: 200px; display: grid; grid-gap: 10px; grid-template: repeat(4, 1fr) / repeat(2, 1fr); grid-auto-flow: column; /* or 'row', 'row dense', 'column dense' */ } #item1 { background-color: lime; grid-row-start: 3; } #item2 { background-color: yellow; } #item3 { background-color: blue; } #item4 { grid-column-start: 2; background-color: red; } #item5 { background-color: aqua;...
grid-template-areas - CSS: Cascading Style Sheets
gle, the declaration is invalid. ...
grid-template-rows - CSS: Cascading Style Sheets
es a size range, greater than or equal to min, and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at...
grid-template - CSS: Cascading Style Sheets
fit-content( [ <length> | <percentage> ] )<explicit-track-list> = [ <line-names>? ...
grid - CSS: Cascading Style Sheets
Web › CSS › grid
candidate recommendation initial definition ...
height - CSS: Cascading Style Sheets
Web › CSS › height
auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting height using pixels and percentages html <div id="taller">i'm 50 pixels tall.</div> <div id="shorter">i'm 25 pixels tall.</div> <div id="parent"> <div id="child"> i'm half the height of my parent. </div> </div> css div { width: 250px; margin-bottom: 5px; border: 2px solid blue; } #taller { height: 50px; } #shorter { height: 25px; } #parent { height: 100px; } #child { height: 50%; width: 75%; } result specifications specification status comment css box sizing module level 4the definition of 'height' in that specification. editor's draft css box sizing m...
hyphens - CSS: Cascading Style Sheets
Web › CSS › hyphens
/dt> <dd lang="en" class="none">an extreme&shy;ly long english word</dd> <dt><code>manual</code>: hyphen only at &amp;hyphen; or &amp;shy; (if needed)</dt> <dd lang="en" class="manual">an extreme&shy;ly long english word</dd> <dt><code>auto</code>: hyphens where the algorithm decides (if needed)</dt> <dd lang="en" class="auto">an extreme&shy;ly long english word</dd> </dl> css dd { width: 55px; border: 1px solid black; } dd.none { -webkit-hyphens: none; -ms-hyphens: none; hyphens: none; } dd.manual { -webkit-hyphens: manual; -ms-hyphens: manual; hyphens: manual; } dd.auto { -webkit-hyphens: auto; -ms-hyphens: auto; hyphens: auto; } result specifications specification status comment css text module level 3the definition of '...
image-set() - CSS: Cascading Style Sheets
Web › CSS › image-set
the image-set() function delivers the most appropriate image resolution for a user’s device, providing a set of image options — each with an associated resolution declaration — from which the browser picks the most appropriate for the device and settings. ...
letter-spacing - CSS: Cascading Style Sheets
very large positive value, the letters will be so far apart that the word(s) will appear like a series of individual, unconnected letters. for text styled with a very large negative value, the letters will overlap each other to the point where the word(s) may be unrecognizable. legible letter-spacing must be determined on a case-by-case basis, as different font families have different character widths. there is no one value that can ensure all font families automatically maintain their legibility. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valuean optimum value consisting of eithe...
line-break - CSS: Cascading Style Sheets
なぁと思わずつぶやいた。</p> <p class="wrapbox strict">strict:<br>そこは湖のほとりで木々が輝いていた。<br>その景色に、美しいなぁと思わずつぶやいた。</p> <p class="wrapbox anywhere">anywhere:<br>そこは湖のほとりで木々が輝いていた。<br>その景色に、美しいなぁと思わずつぶやいた。</p> </div> css .wrapbox { width: 10em; margin: 0.5em; white-space: normal; vertical-align: top; display: inline-block; } .auto { line-break: auto; } .loose { line-break: loose; } .normal { line-break: normal; } .strict { line-break: strict; } .anywhere { line-break: anywhere; } result specifications specification status comment css text module level 3the definition of 'line-break' in that speci...
line-height - CSS: Cascading Style Sheets
behavior ... </div> <!-- the first <h1> line-height is calculated from its own font-size (30px × 1.1) = 33px --> <!-- the second <h1> line-height results from the red div's font-size (15px × 1.1) = 16.5px, probably not what you want --> css .green { line-height: 1.1; border: solid limegreen; } .red { line-height: 1.1em; border: solid red; } h1 { font-size: 30px; } .box { width: 18em; display: inline-block; vertical-align: top; font-size: 15px; } result specifications specification status comment css level 2 (revision 1)the definition of 'line-height' in that specification. recommendation no change. css level 1the definition of 'line-height' in that specification. recommendation initial definition. ...
list-style-type - CSS: Cascading Style Sheets
ti-et example hangul -moz-hangul example example example hangul-consonant -moz-hangul-consonant example example example urdu -moz-urdu example accessibility concerns the voiceover screen reader has an issue where unordered lists with a list-style-type value of none applied to them will not be announced as a list. to address this, add a zero-width space as pseudo content before each list item to ensure the list is announced properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ul { list-style: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, guideline 1.3 explanations understanding success c...
list-style - CSS: Cascading Style Sheets
the image is unavailable. values list-style-type see list-style-type. list-style-image see list-style-image. list-style-position see list-style-position. none no list style is used. accessibility concerns safari has an issue whereby unordered lists with a list-style value of none applied to them will not be recognized as a list in the accessibility tree. to address this, add a zero-width space as pseudo-content before each list item to ensure the list is recognized properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ul { list-style: none; } ul li::before { content: "\200b"; } voiceover and list-style-type: none – unfettered thoughts mdn understanding wcag, guideline 1.3 explanations understanding success c...
mask-border-outset - CSS: Cascading Style Sheets
three values are specified, the first outset applies to the top, the second to the left and right, the third to the bottom. when four values are specified, the outsets apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the mask border outset as a dimension. <number> the size of the mask border outset as a multiple of the corresponding border-width. formal definition initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax [ <length> | <number> ]{1,4} examples basic usage this property doesn't appear to be supported anywhere yet.
mask-composite - CSS: Cascading Style Sheets
e combined. ...
mask-image - CSS: Cascading Style Sheets
candidate recommendation ...
mask-mode - CSS: Cascading Style Sheets
Web › CSS › mask-mode
age should be used as the mask values. ...
object-fit - CSS: Cascading Style Sheets
ealityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="scale-down narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> </section> css h2 { font-family: courier new, monospace; font-size: 1em; margin: 1em 0 0.3em; } div { display: flex; flex-direction: column; flex-wrap: wrap; align-items: flex-start; height: 940px; } img { width: 150px; height: 100px; border: 1px solid #000; } .narrow { width: 100px; height: 150px; margin-top: 10px; } .fill { object-fit: fill; } .contain { object-fit: contain; } .cover { object-fit: cover; } .none { object-fit: none; } .scale-down { object-fit: scale-down; } result specifications specification status comment css images module le...
offset-distance - CSS: Cascading Style Sheets
ath typically comes from animating the offset-distance property. if you want to animate an element along its full path, you would define its offset-path and then set up an animation that takes the offset-distance from 0% to 100%. html <div id="motion-demo"></div> css #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the definition of 'offset-distance' in that specification. working draft initial definition ...
offset-position - CSS: Cascading Style Sheets
working draft initial definition ...
offset-rotate - CSS: Cascading Style Sheets
e opposite direction. it is the same as specifying a value of auto 180deg. ...
opacity - CSS: Cascading Style Sheets
Web › CSS › opacity
> css div { background-color: yellow; } .light { opacity: 0.2; /* barely see the text over the background */ } .medium { opacity: 0.5; /* see the text more clearly over the background */ } .heavy { opacity: 0.9; /* see the text very clearly over the background */ } result setting opacity on hover html <img src="//developer.mozilla.org/static/img/opengraph-logo.png" alt="mdn logo" width="128" height="146" class="opacity"> css img.opacity { opacity: 1; filter: alpha(opacity=100); /* ie8 and lower */ zoom: 1; /* triggers "haslayout" in ie 7 and lower */ } img.opacity:hover { opacity: 0.5; filter: alpha(opacity=50); zoom: 1; } result specifications specification status comment css color module level 4the definition of 'opacity' in...
order - CSS: Cascading Style Sheets
Web › CSS › order
ounding a content block. the flexible box layout module automatically creates blocks of equal vertical size and uses as much horizontal space as available. html <header>...</header> <main> <article>article</article> <nav>nav</nav> <aside>aside</aside> </main> <footer>...</footer> css main { display: flex; text-align:center; } main > article { flex:1; order: 2; } main > nav { width: 200px; order: 1; } main > aside { width: 200px; order: 3; } result specifications specification status comment css flexible box layout modulethe definition of 'order' in that specification. candidate recommendation initial definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas sp...
outline-color - CSS: Cascading Style Sheets
recommendation no change. css level 2 (revision 1)the definition of 'outline-color' in that specification. recomme...
outline-offset - CSS: Cascading Style Sheets
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 /* <length> values */ outline-offset: 3px; outline-offset: 0.2em; /* global values */ outline-offset: inherit; outline-offset: initial; outline-offset: unset; values <length> the width of the space between the element and its outline. a negative value places the outline inside the element. a value of 0 places the outline so that there is no space between it and the element. description an outline is a line that is drawn around an element, outside the border edge. the space between an element and its outline is transparent. in other words, it is the same as the parent element...
Guide to scroll anchoring - CSS: Cascading Style Sheets
sion triggers the specification also details some suppression triggers, which will disable scroll anchoring in places where it might be problematic. if any of the triggers happen on the anchor node, or an ancestor of it, anchoring is suppressed. these suppression triggers are changes to the computed value of any of the following properties: top, left, right, or bottom margin or padding any width or height-related properties transform additionally, position changes anywhere inside the scrolling box also disable scroll anchoring. in bug 1584285 the layout.css.scroll-anchoring.suppressions.enabled flag was added to firefox nightly in order to allow the disabling of these triggers further reading explainer document on the wicg site scroll anchoring for web developers on the chromi...
overflow-block - CSS: Cascading Style Sheets
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ...
overflow-inline - CSS: Cascading Style Sheets
working draft ...
overflow-wrap - CSS: Cascading Style Sheets
lake <em class="hyphens">chargoggagoggmanchauggagoggchaubunagungamaugg</em>, though i've never been there myself. (<code>hyphens</code>, english rules)</p> <p class="hyphens" lang="de">they say the fishing is excellent at lake <em class="hyphens">chargoggagoggmanchauggagoggchaubunagungamaugg</em>, though i've never been there myself. (<code>hyphens</code>, german rules)</p> css p { width: 13em; margin: 2px; background: gold; } .ow-anywhere { overflow-wrap: anywhere; } .ow-break-word { overflow-wrap: break-word; } .word-break { word-break: break-all; } .hyphens { hyphens: auto; } result specifications specification status comment css text module level 3the definition of 'overflow-wrap' in that specification. working draft ...
overflow-x - CSS: Cascading Style Sheets
working draft ...
overflow-y - CSS: Cascading Style Sheets
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> </ul> css #div1, #div2, #div3, #div4 { border: 1px solid black; width: 250px; height: 100px; } #div1 { overflow-y: hidden; margin-bottom: 12px;} #div2 { overflow-y: scroll; margin-bottom: 12px;} #div3 { overflow-y: visible; margin-bottom: 120px;} #div4 { overflow-y: auto; margin-bottom: 120px;} result specifications specification status comment css overflow module level 3the definition of 'overflow-y' in that specification. ...
overflow - CSS: Cascading Style Sheets
Web › CSS › overflow
p { overflow: hidden; /* no scrollbars are provided */ } overflow: hidden sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. p { overflo...
paint() - CSS: Cascading Style Sheets
Web › CSS › paint
orklet. syntax paint(workletname, parameters) where: workletname the name of the registered worklet. parameters optional additional parameters to pass to the paintworklet examples you can pass additional arguments via the css paint() function. ...
<ratio> - CSS: Cascading Style Sheets
Web › CSS › ratio
css data type, used for describing aspect ratios in media queries, denotes the proportion between two unitless values. syntax in media queries level 3, the <ratio> data type consisted of a strictly positive <integer> followed by a forward slash ('/', unicode u+002f solidus) and a second strictly positive <integer>. spaces before and after the slash are optional. the first number represents the width, while the second represents the height. in media queries level 4, the <ratio> date type is updated to consist of a strictly positive <number> followed by a forward slash ('/', unicode u+002f solidus) and a second strictly positive <number>. in addition a single <number> as a value is allowable. examples use in a media query @media screen and (min-aspect-ratio: 16/9) { ... } common aspect ra...
resize - CSS: Cascading Style Sheets
Web › CSS › resize
resizable. in the example below, a resizable <div> contains a resizable paragraph (<p> element). html <div class="resizable"> <p class="resizable"> this paragraph is resizable in all directions, because the css `resize` property is set to `both` on this element. </p> </div> css .resizable { resize: both; overflow: scroll; border: 1px solid black; } div { height: 300px; width: 300px; } p { height: 200px; width: 200px; } result specifications specification status comment css logical properties and values level 1the definition of 'resize' in that specification. editor's draft adds the values block and inline. css basic user interface module level 3the definition of 'resize' in that specification. recommendation ...
Resolved value - CSS: Cascading Style Sheets
see the specification link below for more per-property details. ...
rotate - CSS: Cascading Style Sheets
Web › CSS › rotate
definition initial valuenoneapplies totransformable elementsinheritednocomputed valueas specifiedanimation typea transformcreates stacking contextyes formal syntax none | <angle> | [ x | y | z | <number>{3} ] && <angle> examples rotate an element on hover html <div> <p class="rotate">rotation</p> </div> css * { box-sizing: border-box; } html { font-family: sans-serif; } div { width: 150px; margin: 0 auto; } p { padding: 10px 5px; border: 3px solid black; border-radius: 20px; width: 150px; font-size: 1.2rem; text-align: center; } .rotate { transition: rotate 1s; } div:hover .rotate { rotate: 1 -0.5 1 180deg; } result specifications specification status comment css transforms level 2the definition of 'individual transfor...
scroll-behavior - CSS: Cascading Style Sheets
edanimation typediscrete formal syntax auto | smooth examples setting smooth scroll behavior html <nav> <a href="#page-1">1</a> <a href="#page-2">2</a> <a href="#page-3">3</a> </nav> <scroll-container> <scroll-page id="page-1">1</scroll-page> <scroll-page id="page-2">2</scroll-page> <scroll-page id="page-3">3</scroll-page> </scroll-container> css a { display: inline-block; width: 50px; text-decoration: none; } nav, scroll-container { display: block; margin: 0 auto; text-align: center; } nav { width: 339px; padding: 5px; border: 1px solid black; } scroll-container { display: block; width: 350px; height: 200px; overflow-y: scroll; scroll-behavior: smooth; } scroll-page { display: flex; align-items: center; justify-content: center; height: 10...
scroll-snap-coordinate - CSS: Cascading Style Sheets
rollcontainer coordinate25"> <div>1</div> <div>2</div> <div>3</div> </div> </div> <div> <p>at coordinate (50, 0)</p> <div class="scrollcontainer coordinate50"> <div>1</div> <div>2</div> <div>3</div> </div> </div> </div> css #container { display: flex; } #container > div:nth-child(-n+2) { margin-right: 20px; } .scrollcontainer { width: 100px; overflow: auto; white-space: nowrap; scroll-snap-type: mandatory; font-size: 0; } .scrollcontainer > div { width: 100px; height: 100px; display: inline-block; line-height: 100px; text-align: center; font-size: 50px; } .coordinate0 > div { scroll-snap-coordinate: 0 0; } .coordinate25 > div { scroll-snap-coordinate: 25px 0; } .coordinate50 > div { scroll-snap-c...
scroll-snap-destination - CSS: Cascading Style Sheets
llcontainer destination25"> <div>1</div> <div>2</div> <div>3</div> </div> </div> <div> <p>at coordinate (50, 0)</p> <div class="scrollcontainer destination50"> <div>1</div> <div>2</div> <div>3</div> </div> </div> </div> css #container { display: flex; } #container > div:nth-child(-n+2) { margin-right: 20px; } .scrollcontainer { width: 100px; overflow: auto; white-space: nowrap; scroll-snap-points-x: repeat(100%); scroll-snap-type: mandatory; scroll-snap-destination: 20px 0; font-size: 0; } .destination0 { scroll-snap-destination: 0 0; } .destination25 { scroll-snap-destination: 25px 0; } .destination50 { scroll-snap-destination: 50px 0; } .scrollcontainer > div { width: 100px; height: 100px; displa...
scrollbar-color - CSS: Cascading Style Sheets
gumbo beet greens corn soko endive gumbo gourd. parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato...
shape-image-threshold - CSS: Cascading Style Sheets
the same gradient is also used as the image from whi...
text-justify - CSS: Cascading Style Sheets
s eu elementum dui.</p> <p class="char"><code>text-justify: inter-character</code> —<br>lorem ipsum dolor sit amet, consectetur adipiscing elit. nunc ornare maximus vehicula. duis nisi velit, dictum id mauris vitae, lobortis pretium quam. quisque sed nisi pulvinar, consequat justo id, feugiat leo. cras eu elementum dui.</p> p { font-size: 1.5em; border: 1px solid black; padding: 10px; width: 95%; margin: 10px auto; text-align: justify; } .none { text-justify: none; } .auto { text-justify: auto; } .dist { text-justify: distribute; } .word { text-justify: inter-word; } .char { text-justify: inter-character; } specifications specification status comment css text module level 3the definition of 'text-justify' in that specification. w...
touch-action - CSS: Cascading Style Sheets
ntax auto | none | [ [ pan-x | pan-left | pan-right ] | [ pan-y | pan-up | pan-down ] | pinch-zoom ] | manipulation examples disabling all gestures the most common usage is to disable all gestures on an element (and its non-scrollable descendants) that provides its own dragging and zooming behavior – such as a map or game surface. html <div id="map"></div> css #map { height: 400px; width: 400px; background: blue; touch-action: none; } result specifications specification status comment compatibility standardthe definition of 'touch-action' in that specification. living standard added pinch-zoom property value. pointer events – level 3the definition of 'touch-action' in that specification. editor's draft added pan-left, p...
matrix() - CSS: Cascading Style Sheets
working draft initial definition ...
perspective() - CSS: Cascading Style Sheets
</div> </div> <p>with perspective (9cm):</p> <div class="perspective-box-far"> <div class="face front">a</div> <div class="face top">b</div> <div class="face left">c</div> </div> <p>with perspective (4cm):</p> <div class="perspective-box-closer"> <div class="face front">a</div> <div class="face top">b</div> <div class="face left">c</div> </div> css .face { position: absolute; width: 100px; height: 100px; line-height: 100px; font-size: 100px; text-align: center; } p + div { width: 100px; height: 100px; transform-style: preserve-3d; margin-left: 100px; } .no-perspective-box { transform: rotatex(-15deg) rotatey(30deg); } .perspective-box-far { transform: perspective(9cm) rotatex(-15deg) rotatey(30deg); } .perspective-box-closer { transform: perspective...
rotate3d() - CSS: Cascading Style Sheets
3 1+(1-cos(a))(x2-1)z·sin(a)+xy(1-cos(a))-y·sin(a)+xz·(1-cos(a))-z·sin(a)+xy·(1-cos(a))1+(1-cos(a))(y2-1)x·sin(a)+yz·(1-cos(a))ysin(a) + xz(1-cos(a))-xsin(a)+yz(1-cos(a))1+(1-cos(a))(z2-1)t0001 homogeneous coordinates on ℝℙ3 examples rotating on the y-axis html <div>normal</div> <div class="rotated">rotated</div> css body { perspective: 800px; } div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotate3d(0, 1, 0, 60deg); background-color: pink; } result rotating on a custom axis html <div>normal</div> <div class="rotated">rotated</div> css body { perspective: 800px; } div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotate3d(1, 2, -1, 192deg); backgro...
rotateX() - CSS: Cascading Style Sheets
sian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. 1000cos(a)-sin(a)0sin(a)cos(a) 10000cos(a)-sin(a)00sin(a)cos(a)00001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotatex(45deg); background-color: pink; } result specifications specification status comment css transforms level 2the definition of 'rotatex()' in that specification. editor's draft initial definition ...
rotateY() - CSS: Cascading Style Sheets
sian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. cos(a)0sin(a)010-sin(a)0cos(a) cos(a)0sin(a)00100-sin(a)0cos(a)00001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotatey(60deg); background-color: pink; } result specifications specification status comment css transforms level 2the definition of 'rotatey()' in that specification. editor's draft initial definition ...
rotateZ() - CSS: Cascading Style Sheets
ordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. cos(a)-sin(a)0sin(a)cos(a)0001 cos(a)-sin(a)00 sin(a)cos(a)00 0010 0001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotatez(45deg); background-color: pink; } result specifications specification status comment css transforms level 2the definition of 'rotatez()' in that specification. editor's draft initial definition ...
scaleX() - CSS: Cascading Style Sheets
tor to apply on the abscissa of each point of the element. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 s0 01 s00010001 s00010001 s000010000100001 [s 0 0 1 0 0] examples html <div>normal</div> <div class="scaled">scaled</div> css div { width: 80px; height: 80px; background-color: skyblue; } .scaled { transform: scalex(0.6); background-color: pink; } result specifications specification status comment css transforms level 1the definition of 'scalex()' in that specification. working draft initial definition ...
scaleY() - CSS: Cascading Style Sheets
actor to apply on the ordinate of each point of the element. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 10 0s 1000s0001 1000s0001 10000s0000100001 [1 0 0 s 0 0] examples html <div>normal</div> <div class="scaled">scaled</div> css div { width: 80px; height: 80px; background-color: skyblue; } .scaled { transform: scaley(0.6); background-color: pink; } result specifications specification status comment css transforms level 1the definition of 'scaley()' in that specification. working draft initial definition ...
scaleZ() - CSS: Cascading Style Sheets
inates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. ...
skew() - CSS: Cascading Style Sheets
coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 1tan(ax)tan(ay)1 1tan(ax)0tan(ay)10001 1tan(ax)0tan(ay)10001 1tan(ax)00tan(ay)10000100001 [1 tan(ay) tan(ax) 1 0 0] examples using a single x-angle html <div>normal</div> <div class="skewed">skewed</div> css div { width: 80px; height: 80px; background-color: skyblue; } .skewed { transform: skew(10deg); /* equal to skewx(10deg) */ background-color: pink; } result using two angles html <div>normal</div> <div class="skewed">skewed</div> css div { width: 80px; height: 80px; background-color: skyblue; } .skewed { transform: skew(10deg, 10deg); background-color: pink; } result specifi...
skewX() - CSS: Cascading Style Sheets
stort the element along the abscissa. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 1tan(a)01 1tan(a)0010001 1tan(a)0010001 1tan(a)00010000100001 [1 0 tan(a) 1 0 0] examples html <div>normal</div> <div class="skewed">skewed</div> css div { width: 80px; height: 80px; background-color: skyblue; } .skewed { transform: skewx(10deg); /* equal to skew(10deg) */ background-color: pink; } result specifications specification status comment css transforms level 1the definition of 'skewx()' in that specification. working draft initial definition ...
skewY() - CSS: Cascading Style Sheets
stort the element along the ordinate. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 10tan(a)1 100tan(a)10001 100tan(a)10001 1000tan(a)10000100001 [1 tan(a) 0 1 0 0] examples html <div>normal</div> <div class="skewed">skewed</div> css div { width: 80px; height: 80px; background-color: skyblue; } .skewed { transform: skewy(40deg); background-color: pink; } result specifications specification status comment css transforms level 1the definition of 'skewy()' in that specification. working draft initial definition ...
translateY() - CSS: Cascading Style Sheets
geneous coordinates on ℝℙ3 a translation is not a linear transformation in ℝ2 and can't be represented using a cartesian-coordinate matrix. 10001t001 10001t001 1000010t00100001 [1 0 0 1 0 t] formal syntax translatey(<length-percentage>) examples html <div>static</div> <div class="moved">moved</div> <div>static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { transform: translatey(10px); background-color: pink; } result specifications specification status comment css transforms level 1the definition of 'translatey()' in that specification. working draft initial definition ...
translateZ() - CSS: Cascading Style Sheets
can't be represented using a cartesian-coordinate matrix. 10000100001t0001 examples in this example, two boxes are created. one is positioned normally on the page, without being translated at all. the second is altered by applying perspective to create a 3d space, then moved towards the user. html <div>static</div> <div class="moved">moved</div> css div { position: relative; width: 60px; height: 60px; left: 100px; background-color: skyblue; } .moved { transform: perspective(500px) translatez(200px); background-color: pink; } what really matters here is the class "moved"; let's take a look at what it does. first, the perspective() function positions the viewer relative to the plane that lies where z=0 (in essence, the surface of the screen). a value of 500px me...
<transform-function> - CSS: Cascading Style Sheets
00px)</option> <option>translatex(100px)</option> <option>translatey(100px)</option> <option>translatez(100px)</option> <option>translate3d(50px, 50px, 50px)</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; bac...
transform-style - CSS: Cascading Style Sheets
lement"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </section> <div class="checkbox"> <label for="preserve"><code>preserve-3d</code></label> <input type="checkbox" id="preserve" checked> </div> css #example-element { margin: 50px; width: 100px; height: 100px; transform-style: preserve-3d; 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:...
transform - CSS: Cascading Style Sheets
Web › CSS › transform
specifications specification status comment css transforms level 2the definition of 'transform' in that specification. editor's draft adds 3d transform functions. css transforms level 1the definition of 'transform' in that ...
visibility - CSS: Cascading Style Sheets
oups, the row(s) or column(s) are hidden and the space they would have occupied is removed (as if display: none were applied to the column/row of the table). however, the size of other rows and columns is still calculated as though the cells in the collapsed row(s) or column(s) are present. this value allows for the fast removal of a row or column from a table without forcing the recalculation of widths and heights for the entire table. collapsed flex items are hidden, and the space they would have occupied is removed. for xul elements, the computed size of the element is always zero, regardless of other styles that would normally affect the size, although margins still take effect. for other elements, collapse is treated the same as hidden. accessibility concerns using a visibility value...
white-space - CSS: Cascading Style Sheets
ididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ...
word-break - CSS: Cascading Style Sheets
<code>word-break: break-word</code></p> <p class="breakword narrow">this is a long and honorificabilitudinitatibus califragilisticexpialidocious taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu グレートブリテンおよび北アイルランド連合王国という言葉は本当に長い言葉</p> css .narrow { padding: 10px; border: 1px solid; width: 500px; margin: 0 auto; font-size: 20px; line-height: 1.5; letter-spacing: 1px; } .normal { word-break: normal; } .breakall { word-break: break-all; } .keepall { word-break: keep-all; } .breakword { word-break: break-word; } specifications specification status comment css text module level 3the definition of 'word-break' in that specification. ...
writing-mode - CSS: Cascading Style Sheets
></td> <td class="example text5"><span>מלל ארוך לדוגמא</span></td> <td class="example text5"><span>1994年に至っては</span></td> </tr> </table> css some preparatory css just to make things look a little better: table { border-collapse:collapse; } td, th { border: 1px black solid; padding: 3px; } th { background-color: lightgray; } .example { height:75px; width:75px; } the css that adjusts the directionality of the content looks like this: .example.text1 span, .example.text1 { writing-mode: horizontal-tb; -webkit-writing-mode: horizontal-tb; -ms-writing-mode: horizontal-tb; } .example.text2 span, .example.text2 { writing-mode: vertical-lr; -webkit-writing-mode: vertical-lr; -ms-writing-mode: vertical-lr; } .example.text3 span, .example.
zoom - CSS: Cascading Style Sheets
Web › CSS › zoom
this property originated in internet explorer. apple has a ...
Challenge solutions - Developer guides
/* numbered headings */ body {counter-reset: headnum;} h3:before { content: "(" counter(headnum, upper-latin) ") "; counter-increment: headnum; } boxes ocean border challenge add one rule to your stylesheet, making a wide border all around the oceans in a color that reminds you of the sea. solution the following rule achieves this effect: ul { border: 10px solid lightblue; width: 100px; } layout default image position fixed image position challenge change your sample document, doc2.html, adding this tag to it near the end, just before </body>: <img id="fixed-pin" src="yellow-pin.png" alt="yellow map pin"> predict where the image will appear in your document. then refresh your browser to see if you were correct. solution the image appears to the right of t...
Overview of events and handlers - Developer guides
ing page loading, such as discussed partially in this web page or in this stack overflow question. the global object window emits an event called 'load' when the page has finished rendering, meaning that all resources have been downloaded and acted upon, so that the scripts have been run and the images displayed, the global object window emits an event called 'resize' when the height or the width of the browser window is changed by a user, the dom object document representing the html document emits an event called 'domcontentloaded' when the document has finished loading, the dom node objects such as div or button emit an event called 'click' when the user presses the mouse button while the mouse pointer is on top of the dom node in the html page. the event object hierarchy the we...
Mobile-friendliness - Developer guides
o you’re talking to. it can be helpful to think of it in terms of three goals for improving your site’s user experience: presentation, content, and performance. goal #1 (presentation) “make websites that work well on a variety of screen sizes.” these days, users can access the web on devices in a wide range of form factors, including phones, tablets, and ereaders. needless to say, a fixed-width, three-column layout filled with complex javascript animations and mouse-over effects is not going to look or feel quite right on a phone with a 2-inch-wide screen and a diminutive processor. a slimmed-down, linearized page layout with elements sized for a touchscreen would be much more appropriate. that’s why this first goal is all about presenting your content in a way that makes life easy fo...
The Web Open Font Format (WOFF) - Developer guides
Web › Guide › WOFF
ganizations. it uses a compressed version of the same table-based sfnt structure used by truetype, opentype, and open font format, but adds metadata and private-use data structures, including predefined fields allowing foundries and vendors to provide license information if desired. there are three main benefits to using woff: the font data is compressed, so sites using woff will use less bandwidth and will load faster than if they used equivalent uncompressed truetype or opentype files. many font vendors that are unwilling to license their truetype or opentype format fonts for use on the web will license woff format fonts. this improves availability of fonts to site designers. both proprietary and free software browser vendors like the woff format, so it has the potential of becoming a t...
Block-level elements - HTML: Hypertext Markup Language
elements. by default, a block-level element occupies the entire space of its parent element (container), thereby creating a "block." this article helps to explain what this means. browsers typically display the block-level element with a newline both before and after the element. you can visualize them as a stack of boxes. a block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can). the following example demonstrates the block-level element's influence: block-level elements html <p>this paragraph is a block-level element; its background has been colored to display the paragraph's parent element.</p> css p { background-color: #8abb55; } usage block-level elements may appear only within a <body> el...
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
ut the tel: url scheme. using the download attribute to save a <canvas> as a png to save a <canvas> element’s contents as an image, you can create a link with a download attribute and the canvas data as a data: url: example painting app with save link html <p>paint by holding down the mouse button and moving it. ...
<basefont> - HTML: Hypertext Markup Language
Web › HTML › Element › basefont
attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb format. face this attribute contains a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. size this attribute specifies the font size as either a numeric or relative value. numeric values range from 1 to 7 with 1 being the smallest and 3 the default. usage notes do not use this element! though once (imprecisely) normalized in html 3.2, it wasn't supported in all major browsers. further, browsers, and even successive versions of browsers, never implemented it...
<col> - HTML: Hypertext Markup Language
Web › HTML › Element › col
tribute, use the td:nth-child(an+b) css selector where a is the total number of the columns in the table and b is the ordinal position of the column in the table. only after this selector the vertical-align property can be used. if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not trivial. width this attribute specifies a default width for each column in the current column group. in addition to the standard pixel and percentage values, this attribute might take the special form 0*, which means that the width of each column in the group should be the minimum width necessary to hold the column's contents. relative widths such as 0.5* also can be used. examples please see the <table> ...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › del
he presence of the del element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. del::before, del::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } del::before { content: " [deletion start] "; } del::after { content: " [deletion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been deleted would adversely affect understanding. short note...
<div>: The Content Division element - HTML: Hypertext Markup Language
Web › HTML › Element › div
&gt;. you name it!</p> </div> the result looks like this: a styled example this example creates a shadowed box by applying a style to the <div> using css. note the use of the class attribute on the <div> to apply the style named "shadowbox" to the element. html <div class="shadowbox"> <p>here's a very interesting note displayed in a lovely shadowed box.</p> </div> css .shadowbox { width: 15em; border: 1px solid #333; box-shadow: 8px 8px 5px #444; padding: 8px 12px; background-image: linear-gradient(180deg, #fff, #ddd 40%, #ccc); } result specifications specification status comment html living standardthe definition of '<div>' in that specification. living standard no changes since the latest snapshot html5the definition of ...
<font> - HTML: Hypertext Markup Language
Web › HTML › Element › font
he text color using either a named color or a color specified in the hexadecimal #rrggbb format. face this attribute contains a comma-separated list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. size this attribute specifies the font size as either a numeric or relative value. numeric values range from 1 to 7 with 1 being the smallest and 3 the default. it can be defined using a relative value, like +2 or -3, which set it relative to the value of the size attribute of the <basefont> element, or relative to 3, the default value, if none does exist. dom interface ...
<frame> - HTML: Hypertext Markup Language
Web › HTML › Element › frame
resizing of frames by users. scrolling this attribute defines the existence of a scrollbar. if this attribute is not used, the browser adds a scrollbar when necessary. there are two choices: "yes" for forcing a scrollbar even when it is not necessary and "no" for forcing no scrollbar even when it is necessary. marginheight this attribute defines the height of the margin between frames. marginwidth this attribute defines the width of the margin between frames. frameborder this attribute allows you to specify a frame’s border. example <frameset cols="50%,50%"> <frame src="https://udn.realityripple.com/docs/web/html/element/iframe" /> <frame src="https://udn.realityripple.com/docs/web/html/element/frame" /> </frameset> ...
<input type="checkbox"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › checkbox
alue="cooking"> <label for="cooking">cooking</label> </div> <div> <input type="checkbox" id="other" name="interest" value="other"> <label for="other">other</label> <input type="text" id="othervalue" name="other"> </div> <div> <button type="submit">submit form</button> </div> </fieldset> </form> css html { font-family: sans-serif; } form { width: 600px; margin: 0 auto; } div { margin-bottom: 10px; } fieldset { background: cyan; border: 5px solid blue; } legend { padding: 10px; background: blue; color: cyan; } javascript var othercheckbox = document.queryselector('input[value="other"]'); var othertext = document.queryselector('input[id="othervalue"]'); othertext.style.visibility = 'hidden'; othercheckbox.addeventliste...
<input type="email"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › email
de directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. size the size attribute is a numeric value indicating how many characters wide the input field should be. the value must be a number greater than zero, and the default value is 20. since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use). this does not set a limit on how many characters the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit o...
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
e="multipart/form-data"> <div> <label for="image_uploads">choose images to upload (png, jpg)</label> <input type="file" id="image_uploads" name="image_uploads" accept=".jpg, .jpeg, .png" multiple> </div> <div class="preview"> <p>no files 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 labe...
<input type="hidden"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › hidden
ntent">post content:</label> <textarea id="content" name="content" cols="60" rows="5"> this is the content of my excellent blog post. ...
<input type="password"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › password
y sets the value of the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. size the size attribute is a numeric value indicating how many characters wide the input field should be. the value must be a number greater than zero, and the default value is 20. since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use). this does not set a limit on how many characters the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit o...
<input type="radio"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › radio
which help to group the functionality nicely and in a semantic way. ...
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
de directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. size the size attribute is a numeric value indicating how many characters wide the input field should be. the value must be a number greater than zero, and the default value is 20. since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use). this does not set a limit on how many characters the user can enter into the field. it only specifies approximately how many can be seen at a time. to set an upper limit o...
<ins> - HTML: Hypertext Markup Language
Web › HTML › Element › ins
presence of the <ins> element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. ins::before, ins::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } ins::before { content: " [insertion start] "; } ins::after { content: " [insertion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been inserted would adversely affect understanding. short n...
<mark>: The Mark Text element - HTML: Hypertext Markup Language
Web › HTML › Element › mark
presence of the mark element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. mark::before, mark::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } mark::before { content: " [highlight start] "; } mark::after { content: " [highlight end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been highlighted would adversely affect understanding. sh...
<menu> - HTML: Hypertext Markup Language
Web › HTML › Element › menu
t' is likely to change to 'toolbar' according to html5.1. examples context menu html <!-- a <div> element with a context menu --> <div contextmenu="popup-menu"> right-click to see the adjusted context menu </div> <menu type="context" id="popup-menu"> <menuitem>action</menuitem> <menuitem>another action</menuitem> <hr/> <menuitem>separated action</menuitem> </menu> css div { width: 300px; height: 80px; background-color: lightgreen; } result menu button menu buttons haven't been implemented in any known browsers yet. the type attribute on the <menu> element is now obsolete. <menuitem> element is obsolete. html <!-- a button, which displays a menu when clicked. --> <button type="menu" menu="popup-menu"> dropdown </button> <menu type="context" id="popup-me...
<menuitem> - HTML: Hypertext Markup Language
Web › HTML › Element › menuitem
44.png"> commands don't render their contents. </menuitem> <menuitem type="command" label="this command has javascript" onclick="alert('command clicked')"> commands don't render their contents. </menuitem> <hr> <menuitem type="radio" radiogroup="group1">radio button 1</menuitem> <menuitem type="radio" radiogroup="group1">radio button 2</menuitem> </menu> css content div { width: 300px; height: 80px; background-color: lightgreen; } result specifications specification status comment html 5.2the definition of '<menuitem>' in that specification. recommendation snapshot of the html living standard, made obsolete. html 5.1the definition of '<menuitem>' in that specification. recommendation snapshot of the html living ...
<nobr>: The Non-Breaking Text element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › nobr
this element was never standard html and was not widely implemented, so you shouldn't use it. instead, use the css property white-space like this: <span style="white-space: nowrap;">long line with no breaks</span> ...
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › noembed
ment. ...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › pre
ag are mandatory. permitted parents any element that accepts flow content. implicit aria role no corresponding role permitted aria roles any dom interface htmlpreelement attributes this element only includes the global attributes. cols contains the preferred count of characters that a line should have. it was a non-standard synonym of width. to achieve such an effect, use css width instead. width contains the preferred count of characters that a line should have. though technically still implemented, this attribute has no visual effect; to achieve such an effect, use css width instead. wrap is a hint indicating how the overflow must happen. in modern browser this hint is ignored and no visual effect results in its present; t...
<s> - HTML: Hypertext Markup Language
Web › HTML › Element › s
rns the presence of the s element is not announced by most screen reading technology in its default configuration. it can be made to be announced by using the css content property, along with the ::before and ::after pseudo-elements. s::before, s::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } s::before { content: " [start of stricken text] "; } s::after { content: " [end of stricken text] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been struck out would adversely affect understanding...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
Web › HTML › Element › tbody
that heading lists the name of the major contained within the <tbody>. then each remaining row in each major's <tbody> consists of two cells: the first for the student's id and the second for their name. css table { border: 2px solid #555; border-collapse: collapse; font: 16px "lucida grande", "helvetica", "arial", sans-serif; } th, td { border: 1px solid #bbb; paddin...
<tr>: The Table Row element - HTML: Hypertext Markup Language
Web › HTML › Element › tr
ls in the row; this is shorthand for using align on every cell in the row individually. possible values are: left align the content of each cell at its left edge. center center the contents of each cell between their left and right edges. right align the content of each cell at its right edge. justify widen whitespaces within the text of each cell so that the text fills the full width of each cell (full justification). char align each cell in the row on a specific character (such that each row in the column that is configured this way will horizontally align its cells on that character). this uses the char and charoff to establish the alignment character (typically "." or "," when aligning numerical data) and the number of characters that should follow the alignment charac...
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › tt
the terms non-proportional, monotype, and monospace are used interchangeably and have the same general meaning: they describe a typeface whose characters are all the same number of pixels wide. this element is obsolete, however. ...
<wbr> - HTML: Hypertext Markup Language
Web › HTML › Element › wbr
ement; it must have a start tag, but must not have an end tag. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. notes on utf-8 encoded pages, <wbr> behaves like the u+200b zero-width space code point. in particular, it behaves like a unicode bidi bn code point, meaning it has no effect on bidi-ordering: <div dir=rtl>123,<wbr>456</div> displays, when not broken on two lines, 123,456 and not 456,123. for the same reason, the <wbr> element does not introduce a hyphen at the line break point. to make a hyphen appear only at the end of a line, use the soft hyphen character ...
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
e used. <nextid> <nextid> is an obsolete html element that served to enable the next web designing tool to generate automatic name labels for its anchors. <nobr> the non-standard, obsolete html <nobr> element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text. <noembed> the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use. <noframes> the obsolete html no frames or frame fallback element, <noframes>, provides content to be presented in browser...
itemscope - HTML: Hypertext Markup Language
itemtypes, recipe, aggregaterating, and nutritioninformation in the following example are part of the schema.org structured data for a recipe, as specified by the first itemtype, http://schema.org/recipe. <div itemscope itemtype="http://schema.org/recipe"> <h2 itemprop="name">grandma's holiday apple pie</h2> <img itemprop="image" src="https://udn.realityripple.com/samples/60/d063c361c1.jpg" width="50" height="50" /> <p> by <span itemprop="author" itemscope itemtype="http://schema.org/person"> <span itemprop="name">carol smith</span> </span> </p> <p> published: <time datetime="2009-11-05" itemprop="datepublished">november 5, 2009</time> </p> <span itemprop="description">this is my grandmother's apple pie recipe. i like to add a dash of nutmeg.</span> <br> <s...
itemtype - HTML: Hypertext Markup Language
<br> </span> product #: <span itemprop="mpn">925872<br></span> <span itemprop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> rating: <s...
Inline elements - HTML: Hypertext Markup Language
entational characteristic it is nowadays specified by css in the flow layout. inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the content. in this article, we'll examine html inline-level elements and how they differ from block-level elements. an inline element does not start on a new line and only takes up as much width as necessary. inline vs. block-level elements: a demonstration this is most easily demonstrated with a simple example. first, some simple css that we'll be using: .highlight { background-color:#ee3; } inline let's look at the following example which demonstrates an inline element: <div>the following span is an <span class="highlight">inline element</span>; its background has been colored...
Data URLs - HTTP
al this represents an html resource whose contents are: lots of text...<p><a name="bottom">bottom</a>?arg=val syntax the format for data urls is very simple, but it's easy to forget to put a comma before the "data" segment, or to incorrectly encode the data into base64 format. formatting in html a data url provides a file within a file, which can potentially be very wide relative to the width of the enclosing document. as a url, the data should be formatable with whitespace (linefeed, tab, or spaces), but there are practical issues that arise when using base64 encoding. length limitations although firefox supports data urls of essentially unlimited length, browsers are not required to support any particular maximum length of data. for example, the opera 11 browser limited urls to 65...
HTTP caching - HTTP
Web › HTTP › Caching
s stale. eviction algorithms often privilege fresh resources over stale resources. note that a stale resource is not evicted or ignored; when the cache receives a request for a stale resource, it forwards this request with a if-none-match to check if it is in fact still fresh. if so, the server returns a 304 (not modified) header without sending the body of the requested resource, saving some bandwidth. here is an example of this process with a shared cache proxy: the freshness lifetime is calculated based on several headers. if a "cache-control: max-age=n" header is specified, then the freshness lifetime is equal to n. if this header is not present, which is very often the case, it is checked if an expires header is present. if an expires header exists, then its value minus the value of th...
Compression in HTTP - HTTP
over the years, algorithms also got more efficient, and new ones are supported by clients and servers. in practice, web developers don't need to implement compression mechanisms, both browsers and servers have it implemented already, but they have to be sure that the server is configured adequately. ...
Configuring servers for Ogg media - HTTP
you'll need to convert it to seconds only, then serve that as...
Accept-CH-Lifetime - HTTP
aders client should include in subsequent requests. header type response header forbidden header name ? note: client hints are accessible only on secure origins (via tls). accept-ch and accept-ch-lifetime headers should be persisted for all secure requests to ensure client hints are sent reliably. syntax accept-ch-lifetime: <age> examples accept-ch: viewport-width, dpr accept-ch-lifetime: 86400 ...
Accept-CH - HTTP
should include in subsequent requests. header type response header forbidden header name ? note: client hints are accessible only on secure origins (via tls). accept-ch and accept-ch-lifetime headers should be persisted for all secure requests to ensure client hints are sent reliably. syntax accept-ch: <list of client hints> examples accept-ch: dpr, viewport-width accept-ch: width accept-ch-lifetime: 86400 vary: dpr, viewport-width, width note: remember to vary the response based on the accepted client hints. ...
ETag - HTTP
Web › HTTP › Headers › ETag
additionally, etags help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). if the resource at a given url changes, a new etag value must be generated. a comparison of them can determine whether two representations of a resource are the same. etags are therefore similar to fingerprints, and might also be used for tracking purposes by some servers. ...
Index - HTTP
Web › HTTP › Headers › Index
cy rather than personalized content. 57 date general header, http, reference, header the date general http header contains the date and time at which the message was originated. 58 etag http, reference, response, header the etag http response header is an identifier for a specific version of a resource. it allows caches to be more efficient, and saves bandwidth, as a web server does not need to send a full response if the content has not changed. on the other side, if the content has changed, etags are useful to help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). 59 early-data client hints, http, header, request the early-data header is set by an intermediate to indicates that the requ...
X-DNS-Prefetch-Control - HTTP
ns-prefetch-control: on x-dns-prefetch-control: off directives on enables dns prefetching. this is what browsers do, if they support the feature, when this header is not present off disables dns prefetching. this is useful if you don't control the link on the pages, or know that you don't want to leak information to these domains. description dns requests are very small in terms of bandwidth, but latency can be quite high, especially on mobile networks. by speculatively prefetching dns results, latency can be reduced significantly at certain times, such as when the user clicks the link. in some cases, latency can be reduced by a second. the implementation of this prefetching in some browsers allows domain name resolution to occur in parallel with (instead of in serial with) the fetc...
Proxy servers and tunneling - HTTP
ontrol and protect access to a server for load-balancing, authentication, decryption or caching). forward proxies a forward proxy, or gateway, or just "proxy" provides proxy services to a client or a group of clients. there are likely hundreds of thousands of open forward proxies on the internet. they store and forward internet services (like the dns, or web pages) to reduce and control the bandwidth used by the group. forward proxies can also be anonymous proxies and allow users to hide their ip address while browsing the web or using other internet services. tor (the onion router), routes internet traffic through multiple proxies for anonymity. reverse proxies as the name implies, a reverse proxy does the opposite of what a forward proxy does: a forward proxy acts in behalf of clients (o...
JavaScript modules - JavaScript
...
extends - JavaScript
well as built-in objects. the .prototype of the extension must be an object or null. examples using extends the first example creates a class called square from a class called polygon. this example is extracted from this live demo (source). class square extends polygon { constructor(length) { // here, it calls the parent class' constructor with lengths // provided for the polygon's width and height super(length, length); // note: in derived classes, super() must be called before you // can use 'this'. leaving this out will cause a reference error. this.name = 'square'; } get area() { return this.height * this.width; } } using extends with built-in objects this example extends the built-in date object. this example is extracted from this live demo (sou...
SyntaxError: illegal character - JavaScript
var foo = 'bar';​<200b> ...
BigInt - JavaScript
if (0n) { console.log('hello from the if!') } else { console.log('hello from the else!') } // ↪ "hello from the else!" 0n || 12n // ↪ 12n 0n && 12n // ↪ 0n boolean(0n) // ↪ false boolean(12n) // ↪ true !12n // ↪ false !0n // ↪ true constructor bigint() creates a new bigint value. static methods bigint.asintn() wraps a bigint value to a signed integer between -2width-1 and 2width-1 - 1. bigint.asuintn() wraps a bigint value to an unsigned integer between 0 and 2width - 1. instance methods bigint.prototype.tolocalestring() returns a string with a language-sensitive representation of this number. overrides the object.prototype.tolocalestring() method. bigint.prototype.tostring() returns a string representing the specified object in the specified radix...
Intl.Locale.prototype.numberingSystem - JavaScript
balinese digits beng bengali digits bhks bhaiksuki digits brah brahmi digits cakm chakma digits cham cham digits cyrl cyrillic numerals — algorithmic deva devanagari digits ethi ethiopic numerals — algorithmic finance financial numerals — may be algorithmic fullwide full width digits geor georgian numerals — algorithmic gong gunjala gondi digits gonm masaram gondi digits grek greek upper case numerals — algorithmic greklow greek lower case numerals — algorithmic gujr gujarati digits guru gurmukhi digits hanidays han-character day-of-month numbering for lunar/other trad...
JSON.stringify() - JavaScript
above example of using json.stringify() with localstorage in a case where you want to store an object created by your user and allowing it to be restored even after the browser has been closed, the following example is a model for the applicability of json.stringify(): // creating an example of json var session = { 'screens': [], 'state': true }; session.screens.push({ 'name': 'screena', 'width': 450, 'height': 250 }); session.screens.push({ 'name': 'screenb', 'width': 650, 'height': 350 }); session.screens.push({ 'name': 'screenc', 'width': 750, 'height': 120 }); session.screens.push({ 'name': 'screend', 'width': 250, 'height': 60 }); session.screens.push({ 'name': 'screene', 'width': 390, 'height': 120 }); session.screens.push({ 'name': 'screenf', 'width': 1240, 'height': 650 }); // ...
Lexical grammar - JavaScript
comments or white space. ecmascript also defines certain keywords and literals and has rules for automatic insertion of semicolons to end statements. control characters control characters have no visual representation but are used to control the interpretation of the text. unicode format-control characters code point name abbreviation description u+200c zero width non-joiner <zwnj> placed between characters to prevent being connected into ligatures in certain languages (wikipedia). u+200d zero width joiner <zwj> placed between characters that would not normally be connected in order to cause the characters to be rendered using their connected form in certain languages (wikipedia). u+feff byte order mark <bom> used ...
class - JavaScript
ional. class declarations are not hoisted (unlike function declarations). examples a simple class declaration in the following example, we first define a class named polygon, then extend it to create a class named square. note that super(), used in the constructor, can only be used in constructors, and must be called before the this keyword can be used. class polygon { constructor(height, width) { this.name = 'polygon'; this.height = height; this.width = width; } } class square extends polygon { constructor(length) { super(length, length); this.name = 'square'; } } attempting to declare a class twice re-declaring a class using the class declaration throws a syntaxerror. class foo {}; class foo {}; // uncaught syntaxerror: identifier 'foo' has already been d...
Authoring MathML - MathML
tead to integrate these polyfills or others in your own project, you might need the detection scripts to verify the level of mathml support. for example the following function verifies the mathml support by testing the mspace element (you may replace mspace with mpadded): function hasmathmlsupport() { var div = document.createelement("div"), box; div.innerhtml = "<math><mspace height='23px' width='77px'/></math>"; document.body.appendchild(div); box = div.firstchild.firstchild.getboundingclientrect(); document.body.removechild(div); return math.abs(box.height - 23) <= 1 && math.abs(box.width - 77) <= 1; } alternatively, the following ua string sniffing will allow to detect the rendering engines with native mathml support (gecko and webkit). note that ua string sniffing is not th...
<math> - MathML
Web › MathML › Element › math
e displayed inside the current span of text, and cannot be moved out of it without changing the meaning of that text. if not present, its default value is inline. mode deprecated in favor of the display attribute. possible values are: display (which has the same effect as display="block") and inline. overflow specifies how an expression behaves if it is too long to fit in the allowed width. possible values are: linebreak (default), scroll, elide, truncate, scale. examples html5 notation <!doctype html> <html> <head> <title>mathml in html5</title> </head> <body> <math> <mrow> <mrow> <msup> <mi>a</mi> <mn>2</mn> </msup> <mo>+</mo> <msup> <mi>b</mi> <mn>2</mn> </msup> </...
<mglyph> - MathML
Web › MathML › Element › mglyph
mats, or until the image is downloaded. class, id, style provided for use with stylesheets. height the height of the image. href used to set a hyperlink to a specified uri. mathbackground the background color (if the image has transparency). you can use #rgb, #rrggbb and html color names. src the image url. valign specifies the vertical alignment with respect to the current baseline. width the width of the image. examples <math> <mi><mglyph src="my-glyph.png" alt="my glyph"/></mi> </math> specifications specification status comment mathml 3.0the definition of 'mglyph' in that specification. recommendation current specification mathml 2.0the definition of 'mglyph' in that specification. recommendation initial specification ...
<mphantom> - MathML
attributes class, id, style provided for use with stylesheets. mathbackground the background color. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: x + y + z <math> <mrow> <mi> x </mi> <mo> + </mo> <mphantom> <mi> y </mi> <mo> + </mo> </mphantom> <mi> z </mi> </mrow> </math> specifications specification status comment mathml 3.0the definition of 'mphantom' in that specification. ...
<mspace> - MathML
Web › MathML › Element › mspace
d units). height the desired height (above the baseline) of the space (see length for values and units). linebreak indicates a line-break at the space. possible values: auto (default value), newline, nobreak, goodbreak, badbreak. starting with mathml 3, it is preferred to use <mo> to control linebreaking. mathbackground the background color. you can use #rgb, #rrggbb and html color names. width the desired width of the space (see length for values and units). note that some common attributes like mathcolor, mathvariant or dir have no effect on <mspace>. examples <math> <mspace depth="40px" height="20px" /> <mspace width="100px" /> </math> specifications specification status comment mathml 3.0the definition of 'mspace' in that specification. ...
<mstyle> - MathML
Web › MathML › Element › mstyle
in scriptsizemultiplier. scriptminsize specifies a minimum font size allowed due to changes in scriptlevel. the default value is 8pt. scriptsizemultiplier specifies the multiplier to be used to adjust font size due to changes in scriptlevel. the default value is 0.71. the <mstyle> element accepts all attributes of all presentation elements with the following exceptions: height, depth or width do not apply to <mglyph>, <mpadded> or <mtable>. rowalign, columnalign, or groupalign do not apply to <mtr>, <mlabeledtr>, <mtd> or <maligngroup>. lspace or voffset do not apply to <mpadded>. fontfamily does not apply to <mglyph>. align does not apply to <mtable> or <mstack>. index cannot be set on <mstyle>. src and alt on <mglyph> cannot be set on <mstyle>. actiontype on <maction> cannot ...
MathML documentation index - MathML
Web › MathML › Index
mathml reference, mathml:element, mathml:general layout schemata the mathml <mpadded> element is used to add extra padding and to set the general adjustment of position and size of enclosed contents. 24 <mphantom> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mphantom> element is rendered invisibly, but dimensions (such as height, width, and baseline position) are still kept. 25 <mroot> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mroot> element is used to display roots with an explicit index. two arguments are accepted, which leads to the syntax: <mroot> base index </mroot>. 26 <mrow> mathml, mathml reference, mathml:element, mathml:general layout schem...
Codecs used by WebRTC - Web media technologies
h (nb) 8 to 12 kbps wide-band speech (wb) 16 to 20 kbps full-band speech (fb) 28 to 40 kbps full-band monaural music (fb mono) 48 to 64 kbps full-band stereo music (fb stereo) 64 to 128 kbps the bit rate may be adjusted at any time. in order to avoid network congestion, the average audio bit rate should not exceed the available network bandwidth (minus any other known or anticipated added bandwidth requirements). g.711 g.711 defines the format for pulse code modulation (pcm) audio as a series of 8-bit integer samples taken at a sample rate of 8,000 hz, yielding a bit rate of 64 kbps. both µ-law and a-law encodings are allowed. g.711 is defined by the itu and its payload format is defined in rfc 3551: 4.5.14. webrtc requires that g.7...
The "codecs" parameter in common media types - Web media technologies
urces), and each successive bit being numbered one higher. currently, only flags 0 through 2 are used; the other five bits must be zero. the meanings of the flags vary depending on the profile being used. the level is a fixed-point number, so a value of 14 (decimal 20) means level 2.0 while a value of 3d (decimal 61) means level 6.1. generally speaking, the higher the level number, the more bandwidth the stream will use and the higher the maximum video dimensions are supported. avc profiles the following are the avc profiles and their profile numbers for use in the codecs parameter, as well as the value to specify for the constraints component, cc. specifying an avc profiles using the profile id and constraints components of the codecs parameter profile number (hex) cons...
Using images in HTML - Web media technologies
Web › Media › images
these articles provide guidance on selecting and configuring image types. image file type and format guide a guide to the various image file types commonly supported by web browsers including details about their individual use cases, capabilities, and compatibility factors. additionally, this article provides guidance for selecting the best image file type for a given situation. mapping the width and height attributes of media container elements to their aspect-ratio this changes how browsers load images so their aspect ratios are calculated by the browser early on and can later be used to correct the display size of an image before it's loaded. other topics related topics that may be of interest. learn html: responsive images in this article, we'll learn about the concept of r...
Navigation and resource timings - Web Performance
dbodysize / timing.decodedbodysize) but using transfersize includes the overhead bytes. for comparison, we can look at the network tab and see that we transferred 22.04kb for an uncompressed file size of 87.24kb. if we do the math with these numbers, we get the same result: 1 - (22.04 / 87.24) = 0.747. the navigation timings provide us a way to programmatically check transfer sizing and bandwidth savings. note that this is the size for this single document alone: for this resource alone, not for all the resources combined. however, the duration, load events and dom related timings have to do with the entire navigation, not this single asset. client-side web applications may seem faster than this one with ​transfer sizes under 10000 and decoded body sizes under 30000, but that doesn't m...
Understanding latency - Web Performance
y measuring the speed with which the data moves from one network location to another. latency can be measured one way, for example, the amount of time it takes to send a request for resources, or the length of the entire round-trip from the browser’s request for a resource to the moment when the requested resource arrives at the browser. network throttling to emulate the latency of a low bandwidth network, you can use developer tools and switch to a lower end network connection. in the developer tools, under the network table, you can switch the throttling option to 2g, 3g, etc. different browser developer tools have different preset options, the characteristics emulated include download speed, upload speed, and minimum latency, or the minimum amount of type it takes to send a packet of...
Progressive web app structure - Progressive web apps (PWAs)
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to the js13kgames 2017 competition, used as an example for the mdn articles about progressive web apps."> <meta name="author" content="end3r"> <meta name="theme-color" content="#b12a34"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta property="og:image" content="icons/icon-512.png"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="style.css"> <link rel="manifest" href="js13kpwa.webmanifest"> <script src="data/games.js" defer></script> <script src="app.js" defer></script> </head> <body> <header> <p><a class="logo" href="http://js13kgames.com"><img src="img/...
Introduction to progressive web apps - Progressive web apps (PWAs)
by web applications can create a compelling, highly flexible offering for your users and customers. is it worth doing all that? absolutely! with a relatively small amount of effort required to implement the core pwa features, the benefits are huge. for example: a decrease in loading times after the app has been installed, thanks to caching with service workers, along with saving precious bandwidth and time. pwas have near-instantaneous loading (from the second visit). the ability to update only the content that has changed when an app update is available. in contrast, with a native app, even the slightest modification can force the user to download the entire application again. a look and feel that is more integrated with the native platform—app icons on the home screen or app launcher...
Graphic design for responsive sites - Progressive web apps (PWAs)
nt ones dependant on context. for example, if your desktop layout includes a large header graphic and several programmatic graphics (e.g. css3 drop shadows and gradients), you may want to simplify or remove certain assets for the site's mobile layout, or even provide smaller assets to suit the smaller screen better. this is because in general mobile devices will have less processing power and bandwidth available, so you want to reduce the processing and downloads. in addition, mobile devices have smaller screen sizes, so it makes sense to reduce visual clutter on a mobile layout. css media queries allow us to serve different css rules dependant on viewport dimensions, and you should consider using mobile first media queries where possible. this means that the default layout before any media qu...
Structural overview of progressive web apps - Progressive web apps (PWAs)
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to the js13kgames 2017 competition, used as an example for the mdn articles about progressive web apps."> <meta name="author" content="end3r"> <meta name="theme-color" content="#b12a34"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta property="og:image" content="icons/icon-512.png"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="style.css"> <link rel="manifest" href="js13kpwa.webmanifest"> <script src="data/games.js" defer></script> <script src="app.js" defer></script> </head> <body> <header> <p><a class="logo" href="http://js13kgames.com"><img src="img/...
alignment-baseline - SVG: Scalable Vector Graphics
ee with the bottom of the line box. svg 2 introduces some changes to the definition of this property. in particular: the values auto, before-edge, and after-edge have been removed. for backwards compatibility, text-before-edge may be mapped to text-top and text-after-edge to text-bottom. neither text-before-edge nor text-after-edge should be used with the vertical-align property. ...
attributeName - SVG: Scalable Vector Graphics
the attributename attribute indicates the name of the css property or attribute of the target element that is going to be changed during an animation. four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value <name> default value none animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated. specifications specification status com...
attributeType - SVG: Scalable Vector Graphics
the attributetype attribute specifies the namespace in which the target attribute and its associated values are defined. four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value css | xml | auto default value auto animatable no css this value specifies that the value of attributename is the name of a css property defined as animatable. xml this value specifies that the value of attributename is the name of...
baseProfile - SVG: Scalable Vector Graphics
tribute could be used by an authoring tool to warn the user when they are modifying the document beyond the scope of the specified base profile. each svg profile should define the text that is appropriate for this attribute. only one element is using this attribute: <svg> context notes value profile name default value none animatable no example <svg width="120" height="120" version="1.1" xmlns="http://www.w3.org/2000/svg" baseprofile="full"> ... </svg> specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'baseprofile' in that specification. recommendation initial definition ...
by - SVG: Scalable Vector Graphics
Web › SVG › Attribute › by
an animation. the starting value for the attribute is either indicated by specifying it as value for the attribute given in the attributename or the from attribute. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributename="width" fill="freeze" by="50" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated. when a list of values is defined via the values attribute, the by attribute is igno...
calcMode - SVG: Scalable Vector Graphics
n. linear simple linear interpolation between values is used to calculate the animation function. except for <animatemotion>, this is the default value. paced defines interpolation to produce an even pace of change across the animation. this is only supported for values that define a linear numeric range, and for which some notion of "distance" between points can be calculated (e.g. position, width, height, etc.). if paced is specified, any keytimes or keysplines will be ignored. for <animatemotion>, this is the default value. spline interpolates from one value in the values list to the next according to a time function defined by a cubic bézier spline. the points of the spline are defined in the keytimes attribute, and the control points for each interval are defined in the keysplines a...
clip - SVG: Scalable Vector Graphics
Web › SVG › Attribute › clip
efines a clipping path along the bounds of the viewport created by the given element. as a presentation attribute, it can be applied to any element but it has effect only on the following six elements: <svg>, <symbol>, <image>, <foreignobject>, <pattern>, <marker> html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- auto clipping --> <svg x="0" width="10" height="10" clip="auto"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> <!-- rect(top, right, bottom, left) clipping --> <svg x="10" width="10" height="10" clip="rect(1, 9, 8, 2)"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> </svg> usage notes warning: this property is deprecated. use clip-path instead. value auto | rect() ...
color - SVG: Scalable Vector Graphics
Web › SVG › Attribute › color
. as a presentation attribute, it can be applied to any element, but as noted above, it has no direct effect on svg elements. usage notes value <color> | inherit default value depends on user agent animatable yes example html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <g color="green"> <rect width="50" height="50" fill="currentcolor" /> <circle r="25" cx="70" cy="70" stroke="currentcolor" fill="none" stroke-width="5" /> </g> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of 'color' in that specification. candidate recommendation removed the restriction to which elements it applies. scal...
dominant-baseline - SVG: Scalable Vector Graphics
before-edge. the derived baseline-table is constructed from the defined baselines in a baseline-table in the font. the choice of which baseline-table to use from the baseline-tables in the font is browser dependent. the baseline-table font-size is changed to the value of the font-size attribute on this element. text-top this value uses the top of the em box as the baseline. ...
filter - SVG: Scalable Vector Graphics
Web › SVG › Attribute › filter
rther information. as a presentation attribute, it can be applied to any element but it only has effect on container elements without the <defs> element, all graphics elements and the <use> element. html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <filter id="blur"> <fegaussianblur stddeviation="2" /> </filter> <rect x="10" y="10" width="80" height="80" filter="url(#blur)" /> </svg> usage notes value none | <filter-function-list> default value none animatable yes for a description of the values see the css filter property. specifications specification status comment filter effects module level 1the definition of 'filter' in that specification. worki...
filterRes - SVG: Scalable Vector Graphics
take care when assigning a non-default value to this attribute. too small of a value may result in unwanted pixelation in the result. too large of a value may result in slow processing and large memory usage. note that negative values or zero values disable the rendering of the element which referenced the filter. ...
filterUnits - SVG: Scalable Vector Graphics
the filterunits attribute defines the coordinate system for the attributes x, y, width and height. only one element is using this attribute: <filter> usage notes value userspaceonuse | objectboundingbox default value objectboundingbox animatable yes userspaceonuse x, y, width and height represent values in the current coordinate system that results from taking the current user coordinate system in place at the time when the <filter> element is referenced (i.e., the user coordinate system for the element referencing the <filter> element via a filter attribute). objectboundingbox in that case, x, y, width and height represent fractions or percentages of the bounding box on the referencing element. specifications specification s...
font-size-adjust - SVG: Scalable Vector Graphics
irst choice font in a substitute font. note: as a presentation attribute, font-size-adjust can be used as a css property. see the css font-size-adjust property for more information. as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg width="600" height="80" viewbox="0 0 500 80" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="times, serif" font-size="10px"> this text uses the times font (10px), which is hard to read in small sizes. </text> <text y="40" font-family="verdana, sans-serif" font-size="10px"> this text uses the verdana font (10px), which has relatively large lowercase letters. </text> <...
font-variant - SVG: Scalable Vector Graphics
specifications specification status comment css fonts module level 4the definition of 'font-variant' in that specification. working draft no change css fonts module level 3the definitio...
from - SVG: Scalable Vector Graphics
Web › SVG › Attribute › from
with the by attribute, the animation will change the attribute relatively from the from value by the value specified in by. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" height="100"> <animate attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated. when a list of values is defined via the values attribute, the from attribute is ignored. specifications specifica...
glyph-orientation-vertical - SVG: Scalable Vector Graphics
ng-mode. note: as a presentation attribute, glyph-orientation-vertical can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value auto | <angle> default value auto animatable no auto fullwidth ideographic and fullwidth latin text will be set with a glyph orientation of 0 degrees. ideographic punctuation and other ideographic characters having alternate horizontal and vertical forms will use the vertical form of the glyph. text which is not fullwidth will be set with a glyph orientation of 90 degrees. this reorientation rule applies only to the first-level non-ideographic text. all fu...
gradientTransform - SVG: Scalable Vector Graphics
" stop-color="darkblue" /> </radialgradient> <radialgradient id="gradient2" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100" gradienttransform="skewx(20) translate(-35, 0)"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <rect x="0" y="0" width="200" height="200" fill="url(#gradient1)" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient2)" style="transform: translatex(220px);" /> </svg> usage notes default value identity transform value <transform-list> animatable yes <transform-list> a list of transformation functions specifying some additional transformation from the g...
href - SVG: Scalable Vector Graphics
Web › SVG › Attribute › href
default value none animatable yes image for <image>, href defines a url referring to the image to render. value <url> default value none animatable yes example html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <image href="/files/2917/fxlogo.png" x="0" y="0" height="100" width="100"/> </svg> lineargradient for <lineargradient>, href defines url referring to a template gradient element; to be valid, the reference must be to a different <lineargradient> or <radialgradient> element. value <url> default value none animatable yes mpath for <mpath>, href defines a url referring to the <path> element or basic shape which defin...
kerning - SVG: Scalable Vector Graphics
Web › SVG › Attribute › kerning
auto this value indicates that the spacing between glyphs is adjusted based on kerning tables that are included in the font that will be used. <length> if a length is provided, then auto-kerning is disabled. instead, inter-character spacing is set to the given length. if a length is provided without a unit identifier (e.g., an unqualified number such as 128), the length is processed as a width value in the current user coordinate system. if a unit identifier (e.g., 0.25em or 1%) is provided, then the length is converted into a corresponding value in the current user coordinate system. the most common scenario, other than auto, is to set kerning to a value of 0 so that auto-kerning is disabled. the given length is added to the inter-character spacing value specified by the letter-sp...
keyPoints - SVG: Scalable Vector Graphics
simple duration of an animation. ...
lengthAdjust - SVG: Scalable Vector Graphics
</text> <text x="0" y="50" textlength="300" lengthadjust="spacingandglyphs"> stretched using spacing and glyphs. ...
marker-end - SVG: Scalable Vector Graphics
resentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="triangle" viewbox="0 0 10 10" refx="1" refy="5" markerunits="strokewidth" markerwidth="10" markerheight="10" orient="auto"> <path d="m 0 0 l 10 5 l 0 10 z" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20" marker-end="url(#triangle)"/> </svg> usage notes value none | <marker-ref> default value none animatable yes none indica...
marker-mid - SVG: Scalable Vector Graphics
presentation attribute, marker-mid can be used as a css property. ...
marker-start - SVG: Scalable Vector Graphics
resentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="triangle" viewbox="0 0 10 10" refx="1" refy="5" markerunits="strokewidth" markerwidth="10" markerheight="10" orient="auto"> <path d="m 0 0 l 10 5 l 0 10 z" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20" marker-start="url(#triangle)"/> </svg> usage notes value none | <marker-ref> default value none animatable yes none indi...
mask - SVG: Scalable Vector Graphics
Web › SVG › Attribute › mask
the mask attribute is a presentation attribute mainly used to bind a given <mask> element with the element the attribute belongs to. note: as a presentation attribute mask can be used as a css property. ...
media - SVG: Scalable Vector Graphics
Web › SVG › Attribute › media
the media attribute specifies a media query that must be matched for a style sheet to apply. only one element is using this attribute: <style> html, body, svg { height: 100%; } <svg viewbox="0 0 240 220" xmlns="http://www.w3.org/2000/svg"> <style> rect { fill: black; } </style> <style media="all and (min-width: 600px)"> rect { fill: seagreen; } </style> <text y="15">resize the window to see the effect</text> <rect y="20" width="200" height="200" /> </svg> usage notes value <media-query-list> default value all animatable yes <media-query-list> this value holds a media query that needs to match in order for the style sheet to be applied. if not specified, the style sheet is applied unconditionally. specificat...
opacity - SVG: Scalable Vector Graphics
Web › SVG › Attribute › opacity
any values outside the ...
pathLength - SVG: Scalable Vector Graphics
ray, for example, will assume the start of the path being 0 and the end point the value defined in the pathlength attribute. seven elements are using this attribute: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html,body,svg { height:100% } <svg viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <style> path { fill: none; stroke: black; stroke-width: 2; stroke-dasharray: 10; } </style> <!-- no pathlength, the real length of the path is used. in that case, 100 user units --> <path d="m 0,10 h100"/> <!-- compute everything like if the path length was 90 user units long --> <path d="m 0,20 h100" pathlength="90"/> <!-- compute everything like if the path length was 50 user units long --> <path d="m 0,30 h100" pathlength=...
patternTransform - SVG: Scalable Vector Graphics
the patterntransform attribute defines a list of transform definitions that are applied to a pattern tile. only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- apply a transform on the tile --> <pattern id="p1" width=".25" height=".25" patterntransform="rotate(20) skewx(30) scale(1 0.5)"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- apply the transformed pattern tile --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> </svg> pattern for <pattern>, patterntransform defines a list of transform definitions that are applied to a pattern tile. note: as of svg2, it is also allowed...
shape-rendering - SVG: Scalable Vector Graphics
crispedges this value indicates that the user agent shall attempt to emphasize the contrast between clean edges of artwork over rendering speed and geometric precision. to achieve crisp edges, the user agent might turn off anti-aliasing for all lines and curves or possibly just for straight lines which are close to vertical or horizontal. also, the user agent might adjust line positions and line widths to align edges with device pixels. geometricprecision indicates that the user agent shall emphasize geometric precision over speed and crisp edges. specifications specification status comment scalable vector graphics (svg) 2the definition of 'shape-rendering' in that specification. candidate recommendation no change scalable vector graphics (svg) 1...
stdDeviation - SVG: Scalable Vector Graphics
for the blur operation. ...
stemh - SVG: Scalable Vector Graphics
Web › SVG › Attribute › stemh
the stemh attribute indicates the horizontal stem width of the font. the stem width refers to the dominant stem of the font. there may be two or more designed widths. for example, the main vertical stems of roman characters will differ from the thin stems on serifed "m" and "n", plus there may be different widths for uppercase and lowercase characters in the same font. also, either by design or by error, all stems may have slightly different widths. if this attribute is used, the units-per-em must also be used. only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the horizontal stem width of the font. specifications specification status ...
stemv - SVG: Scalable Vector Graphics
Web › SVG › Attribute › stemv
the stemv attribute indicates the vertical stem width of the font. the vertical stem width is the width of vertical (or near-vertical) stems of glyphs. this information is often tied to hinting, and may not be directly accessible in some font formats. the measurement is meant for the dominant vertical stem in the font because there might be different groupings of vertical stems (e.g., one main one, and one lighter weight one as for an uppercase "m" or "n"). if this attribute is used, the units-per-em must also be used. only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the vertical stem width of the font. specifications specification st...
style - SVG: Scalable Vector Graphics
Web › SVG › Attribute › style
the style attribute allows to style an element using css declarations. it functions identically to the style attribute in html. all elements are using this attribute. html,body,svg { height:100% } <svg viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <rect width="80" height="40" x="10" y="10" style="fill: skyblue; stroke: cadetblue; stroke-width: 2;"/> </svg> usage notes value <style> default value none animatable no <style> the syntax of style data depends on the style sheet language. by default, the style sheet language is css. note: in theory, the contentstyletype attribute could be used to specify styling languages other than css, like xsl(t). however, this was never implemented satisfactorily in browsers, so you...
to - SVG: Scalable Vector Graphics
Web › SVG › Attribute › to
nal value of the attribute that will be modified during the animation. the value of the attribute will change between the from attribute value and this value. five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributetype="xml" attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> animate, animatecolor, animatemotion, animatetransform for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>, to specifies the ending value of the animation. value <value> default value none animata...
version - SVG: Scalable Vector Graphics
Web › SVG › Attribute › version
ersion attribute is used to indicate what specification a svg document conforms to. it is only allowed on the root <svg> element. it is purely advisory and has no influence on rendering or processing. while it is specified to accept any number, the only two valid choices are currently 1.0 and 1.1. <svg version="1.1" viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="80" height="80"/> </svg> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'version' in that specification. recommendation initial definition ...
word-spacing - SVG: Scalable Vector Graphics
if a <length> is provided with one of the unit identifiers (e.g. .25em or 1%), then the browser converts the <length> into a corresponding value in the current user coordinate system. note: as a presentation attribute, word-spacing can be used as a css property. see the css word-spacing property for more information. ...
x1 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › x1
ble yes example html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the left bounding limit of the shape it is applied to --> <lineargradient x1="0%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at 80% of the left bounding limit of the shape it is applied to --> <lineargradient x1="80%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specific...
x2 - SVG: Scalable Vector Graphics
Web › SVG › Attribute › x2
le yes example html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector end at the right bounding limit of the shape it is applied to --> <lineargradient x2="100%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at 20% of the left bounding limit of the shape it is applied to --> <lineargradient x2="20%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specific...
Content type - SVG: Scalable Vector Graphics
" | "pc" | "%")? the unit identifiers in such <length> values must be in lower case. note that the non-property <length> definition also allows a percentage unit identifier. the meaning of a percentage length value depends on the attribute for which the percentage length value has been specified. two common cases are: when a percentage length value represents a percentage of the viewport width or height when a percentage length value represents a percentage of the bounding box width or height on a given object. in the svg dom, <length> values are represented using svglength or svganimatedlength objects. list-of-ts <list-of-ts> (where t is some type.) a list consists of a separated sequence of values. unless explicitly described differently, lists within svg's xml attrib...
<a> - SVG: Scalable Vector Graphics
Web › SVG › Element › a
butes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-...
<altGlyph> - SVG: Scalable Vector Graphics
Web › SVG › Element › altGlyph
specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<altglyph>' in that ...
<animate> - SVG: Scalable Vector Graphics
Web › SVG › Element › animate
the svg <animate> element provides a way to animate an attribute of an element over time. ...
<animateColor> - SVG: Scalable Vector Graphics
tributes conditional processing attributes core attributes animation event attributes xlink attributes animation attribute target attributes animation timing attributes animation value attributes animation addition attributes externalresourcesrequired specific attributes by from to dom interface this element implements the svganimatecolorelement interface. ...
<animateTransform> - SVG: Scalable Vector Graphics
the animatetransform element animates a transformation attribute on its target element, thereby allowing animations to control translation, scaling, rotation, and/or skewing. ...
<circle> - SVG: Scalable Vector Graphics
Web › SVG › Element › circle
vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<clipPath> - SVG: Scalable Vector Graphics
Web › SVG › Element › clipPath
candidate recommendation sca...
<defs> - SVG: Scalable Vector Graphics
Web › SVG › Element › defs
butes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer element, structural 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>...
<ellipse> - SVG: Scalable Vector Graphics
Web › SVG › Element › ellipse
vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<feColorMatrix> - SVG: Scalable Vector Graphics
ere. usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in type values dom interface this element implements the svgfecolormatrixelement interface. ...
<feDiffuseLighting> - SVG: Scalable Vector Graphics
butes filter primitive attributes class style specific attributes in surfacescale diffuseconstant kernelunitlength dom interface this element implements the svgfediffuselightingelement interface. example the following example show the effect of the <fediffuselighting> element on a circle with each light source available. each time, the light comes from the upper left corner. ...
<feDisplacementMap> - SVG: Scalable Vector Graphics
lter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in in2 scale xchannelselector ychannelselector dom interface this element implements the svgfedisplacementmapelement interface. ...
<feDropShadow> - SVG: Scalable Vector Graphics
s 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. value type: <number>; default value: 2; animatable: yes global attributes core attributes most notably: id styling attributes class, style filter primitive attributes height, in, result, x, y, width presentation attributes most notably: flood-color, flood-opacity usage notes categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <script>, <set> specifications specification status comment filter effects module level 1the definition of '<fedropshadow>' in that specification. working draft initial...
<feImage> - SVG: Scalable Vector Graphics
Web › SVG › Element › feImage
ecific attributes preserveaspectratio xlink:href dom interface this element implements the svgfeimageelement interface. example svg <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="image"> <feimage xlink:href="/files/6457/mdn_logo_only_color.png"/> </filter> </defs> <rect x="10%" y="10%" width="80%" height="80%" style="filter:url(#image);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feimage>' in that specification. working draft added href attribute and deprecated xlink:href. added crossorigin attribute. scalable vector graphics (svg) 1.1 (second edition)the definition...
<feSpecularLighting> - SVG: Scalable Vector Graphics
ource element first and any number of descriptive elements in any order. attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in surfacescale specularconstant specularexponent kernelunitlength dom interface this element implements the svgfespecularlightingelement interface. ...
<feTurbulence> - SVG: Scalable Vector Graphics
iesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes basefrequency numoctaves seed stitchtiles type dom interface this element implements the svgfeturbulenceelement interface. ...
<font-face> - SVG: Scalable Vector Graphics
Web › SVG › Element › font-face
text categoriesfont elementpermitted contentany number of descriptive elements » and at most one <font-face> element, in any order. attributes global attributes core attributes specific attributes font-family font-style font-variant font-weight font-stretch font-size unicode-range units-per-em panose-1 stemv stemh slope cap-height x-height accent-height ascent descent widths bbox ideographic alphabetic mathematical hanging v-ideographic v-alphabetic v-mathematical v-hanging underline-position underline-thickness strikethrough-position strikethrough-thickness overline-position overline-thickness dom interface this element implements the svgfontfaceelement interface. specifications specification status comment scalable v...
<glyph> - SVG: Scalable Vector Graphics
Web › SVG › Element › glyph
, <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. ...
<hatch> - SVG: Scalable Vector Graphics
Web › SVG › Element › hatch
wing elements, in any order:animation elementsdescriptive elements<hatchpath>, <script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes x y pitch rotate hatchunits hatchcontentunits transform href dom interface this element implements the svghatchelement interface. example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <hatch id="hatch" hatchunits="userspaceonuse" pitch="5" rotate="135"> <hatchpath stroke="#a080ff" stroke-width="2"/> </hatch> </defs> <rect fill="url(#hatch)" stroke="black" stroke-width="2" x="10%" y="10%" width="80%" height="80%" /> </svg> result ...
<hatchpath> - SVG: Scalable Vector Graphics
Web › SVG › Element › hatchpath
age context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elements<script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes d offset dom interface this element implements the svghatchpathelement interface. example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <hatch id="hatch" hatchunits="userspaceonuse" pitch="5" rotate="135"> <hatchpath stroke="#a080ff" stroke-width="2"/> </hatch> </defs> <rect fill="url(#hatch)" stroke="black" stroke-width="2" x="10%" y="10%" width="80%" height="80%" /> </svg> result ...
<line> - SVG: Scalable Vector Graphics
Web › SVG › Element › line
vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<linearGradient> - SVG: Scalable Vector Graphics
tributes global event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<lineargradient>' i...
<path> - SVG: Scalable Vector Graphics
Web › SVG › Element › path
vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<polygon> - SVG: Scalable Vector Graphics
Web › SVG › Element › polygon
vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<polyline> - SVG: Scalable Vector Graphics
Web › SVG › Element › polyline
vent attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria...
<radialGradient> - SVG: Scalable Vector Graphics
tributes global event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<radialgradient>' i...
<set> - SVG: Scalable Vector Graphics
Web › SVG › Element › set
terpolated, the <animate> is usualy prefered. note: the <set> element is non-additive. the additive and accumulate attributes are not allowed, and will be ignored if specified. html,body,svg { height:100%; margin:0; padding:0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <style> rect { cursor: pointer } .round { rx: 5px; fill: green; } </style> <rect id="me" width="10" height="10"> <set attributename="class" to="round" begin="me.click" dur="2s" /> </rect> </svg> attributes to this attribute defines the value to be applied to the target attribute for the duration of the animation. the value must match the requirements of the target attribute. value type: <anything>; default value: none; animatable: no animation attributes animation timin...
<style> - SVG: Scalable Vector Graphics
Web › SVG › Element › style
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...
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
Web › SVG › Element › title
ference that text with an aria-labelledby attribute rather than using the <title> element. note: for backward compatibility with svg 1.1, <title> elements should be the first child element of their parent. ...
<view> - SVG: Scalable Vector Graphics
Web › SVG › Element › view
o view the image, like a zoom level or a detail view. ...
Linking - SVG: Scalable Vector Graphics
Web › SVG › Linking
the target attribute on the svg <a> element doesn't work in mozilla firefox 1.5. when svg documents are embedded within a parent html document using the tag: page1.html: <html> <body> <p>this is a svg button:</p> <object width="100" height="50" type="image/svg+xml" data="button.svg"/> </body> </html> button.svg: <?xml version="1.1" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <a xlink:href="page2.html" target="_top"> <g> <!-- button graphical elements here --> </g> </a> </svg> the specification says that the browser should navigate to the html document page2.html when the button graphics are clicked. however, target does not work with mozilla's implementation of the svg <a> element in firefox 1.5. (the problem will be fixed in firefox 2.0.) ...
Scripting - SVG: Scalable Vector Graphics
Web › SVG › Scripting
tener() are very useful when writing interactive svg. you can pass an object that implements the handleevent interface as the second parameter to these methods. ...
Subresource Integrity - Web security
h 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 enables you to mitigate some risks of attacks such as this, by ensuring that the files your web a...
Using custom elements - Web Components
ent, then attach empty <div> and <style> elements to the shadow root: const shadow = this.attachshadow({mode: 'open'}); const div = document.createelement('div'); const style = document.createelement('style'); shadow.appendchild(style); shadow.appendchild(div); the key function in this example is updatestyle() — this takes an element, gets its shadow root, finds its <style> element, and adds width, height, and background-color to the style. function updatestyle(elem) { const shadow = elem.shadowroot; shadow.queryselector('style').textcontent = ` div { width: ${elem.getattribute('l')}px; height: ${elem.getattribute('l')}px; background-color: ${elem.getattribute('c')}; } `; } the actual updates are all handled by the life cycle callbacks, which are placed in...
Using shadow DOM - Web Components
gurl = '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; position: absolute; bottom: 20px; left: 10px; z-index: 3; } img { width: 1.2rem; } .icon:hover + .info, .icon:focus + .info { opacity: 1; }`; attaching the shadow dom to the shadow root the final step is to attach all the ...