Search completed in 1.35 seconds.
vertical-align - CSS: Cascading Style Sheets
The
vertical-align CSS property sets
vertical alignment of an inline, inline-block or table-cell box. 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-align property can be used in two contexts: To
vertically align an inline element's box inside its containing line box. ...
...x. 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-align property can be used in two contexts: To
vertically align an inline element's box inside its containing line box. ...
...ository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The
vertical-align property can be used in two contexts: To
vertically align an inline element's box inside its containing line box. ...
...And 10 more matches
glyph-orientation-vertical - SVG: Scalable Vector Graphics
The glyph-orientation-
vertical attribute affects the amount that hte current text position advances as each glyph is rendered. When the inline-progression-direction is
vertical and the glyph-orientation-
vertical results in an orientation angle that is a multiple of 180 degrees, then the current text position is incremented according to the
vertical metrics of the glyph. Otherwise, if the angle is not a multiple of 180 degrees, then the current text position is incremented according to the horizontal metrics of the glyph. This attribute is applied only to text written in a
vertical writing-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 ...
... 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 further embedding of writing modes or bidirectional processing will be based on the first-level rotation. Note: Text set in this "rotated" manner may contain ligatures or other glyph c...
...itted values. A value of 0deg indicates that all glyphs are set with the top of the glyphs oriented towards the reference orientation. A value of 90deg indicates an orientation of 90 degrees clockwise from the reference orientation. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'glyph-orientation-
vertical' in that specification. Recommendation Initial definition ...
XRRenderState.inlineVerticalFieldOfView - Web APIs
The inline
VerticalFieldOfView read-only property of the XRRenderState interface defines the angle of the field of view in radians used when computing projection matrices for "inline" XRSession objects. This option must be null for immersive sessions. Syntax var aDouble = XRRenderState.inline
VerticalFieldOfView; Value A Number. Specifications Specification Status Comment UnknownThe definition of 'XRRenderState.inline
VerticalFieldOfView' in that specification. Unknown Initial definition. ...
XRRenderState.inlineVerticalFieldOfView - Web APIs
The read-only inline
VerticalFieldOfView property of the XRRenderState interface returns the default
vertical field of view for "inline" sessions and null for all immersive sessions. Syntax var inline
VerticalFieldOfView = xrRenderState.inline
VerticalFieldOfView; Value A Number for "inline" sessions, which represents the default field of view, and null for immersive sessions. Specifications Specification Status Comment WebXR Device APIThe definition of 'XRRenderState.inline
VerticalFieldOfView' in that specification. Working Draft Initial definition. ...
Index - Web APIs
rimental, Houdini, Property, Reference, x The x property of the CSSPositionValue interface returns returns the item's position along the web page's horizontal axis. 438 CSSPositionValue.y API, CSS Typed Object Model API, CSSPositionValue, Experimental, Houdini, Property, Reference, y The y property of the CSSPositionValue interface returns the item's position along the
vertical axis. 439 CSSPrimitiveValue API, CSSPrimitiveValue, Interface, Reference The CSSPrimitiveValue interface derives from the CSSValue interface and represents the current computed value of a CSS property. 440 CSSPrimitiveValue.getCounterValue() API, CSSPrimitiveValue, Method, NeedsExample, getCounterValue The getCounterValue() method of the CSSPrimitiveValu...
... The CanvasRenderingContext2D.save() method of the Canvas 2D API saves the entire state of the canvas by pushing the current state onto a stack. 595 CanvasRenderingContext2D.scale() API, Canvas, CanvasRenderingContext2D, Method, Reference The CanvasRenderingContext2D.scale() method of the Canvas 2D API adds a scaling transformation to the canvas units horizontally and/or
vertically. 596 CanvasRenderingContext2D.scrollPathIntoView() API, Canvas, CanvasRenderingContext2D, Experimental, Method, Reference The CanvasRenderingContext2D.scrollPathIntoView() method of the Canvas 2D API scrolls the current or given path into view. It is similar to Element.scrollIntoView(). 597 CanvasRenderingContext2D.setLineDash() API, Canvas, CanvasRenderingCo...
...eference The CanvasRenderingContext2D.shadowOffsetX property of the Canvas 2D API specifies the distance that shadows will be offset horizontally. 602 CanvasRenderingContext2D.shadowOffsetY API, Canvas, CanvasRenderingContext2D, Property, Reference The CanvasRenderingContext2D.shadowOffsetY property of the Canvas 2D API specifies the distance that shadows will be offset
vertically. 603 CanvasRenderingContext2D.stroke() API, Canvas, CanvasRenderingContext2D, Method, Reference The CanvasRenderingContext2D.stroke() method of the Canvas 2D API strokes (outlines) the current or given path with the current stroke style. 604 CanvasRenderingContext2D.strokeRect() API, Canvas, CanvasRenderingContext2D, Method, Reference The CanvasRenderin...
...And 21 more matches
writing-mode - CSS: Cascading Style Sheets
When set for an entire document, it should be set on the root element (html element for HTML documents). 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 specifies the block flow direction, which is the direction in which block-level containers are stacked, and the direction in which inline-level content flows within a block container. ...
...//github.com/mdn/interactive-examples and send us a pull request. This property specifies the block flow direction, which is the direction in which block-level containers are stacked, and the direction in which inline-level content flows within a block container. Thus, it also determines the ordering of block-level content. Syntax /* Keyword values */ writing-mode: horizontal-tb; writing-mode:
vertical-rl; writing-mode:
vertical-lr; /* Global values */ writing-mode: inherit; writing-mode: initial; writing-mode: unset; The writing-mode property is specified as one of the values listed below. The flow direction in horizontal scripts is also affected by the directionality of that script, either left-to-right (ltr, like English and most other languages) or right-to-left (rtl, like Hebrew or Arabi...
...ntal scripts is also affected by the directionality of that script, either left-to-right (ltr, like English and most other languages) or right-to-left (rtl, like Hebrew or Arabic). Values horizontal-tb For ltr scripts, content flows horizontally from left to right. For rtl scripts, content flows horizontally from right to left. The next horizontal line is positioned below the previous line. ...
...And 12 more matches
height - SVG: Scalable Vector Graphics
The height attribute defines the
vertical length of an element in the user coordinate system. Twenty five elements are using this attribute: <feBlend>, <feColorMatrix>, <feComponentTransfer>, <feComposite>, <feConvolveMatrix>, <feDiffuseLighting>, <feDisplacementMap>, <feDropShadow>, <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 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- With a height of 0 or less, nothing will be rendered --> <rect y="0" x="0" width="90" height="0"/> <rect y="0" x="100" width="90" height="60"/> <rect y="0" x="200" width="90" height="100%"/> </svg> f...
... Value <length> | <percentage> Default value 100% Animatable Yes feComponentTransfer Fo...
...x="0" width="90" height="0"/> <rect y="0" x="100" width="90" height="60"/> <rect y="0" x="200" width="90" height="100%"/> </svg> feBlend For <feBlend>, 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> Default value 100% Animatable Yes feComponentTransfer For <feComponentTransfer>, height defines the
vertical length for the rendering area of the primitive. Value <length> | <percentage> Default value 100% Animatable Yes feComposite...
...And 12 more matches
SVG documentation index - SVG: Scalable Vector Graphics
cond glyphs in the kerning pair. 93 glyph-name Deprecated, SVG, SVG Attribute The glyph-name attribute specifies the name of a glyph. 94 glyph-orientation-horizontal Deprecated, SVG, SVG Attribute The glyph-orientation-horizontal attribute affects the amount that hte current text position advances as each glyph is rendered. 95 glyph-orientation-
vertical Deprecated, SVG, SVG Attribute The glyph-orientation-
vertical attribute affects the amount that hte current text position advances as each glyph is rendered. 96 glyphRef Deprecated, SVG, SVG Attribute The glyphRef attribute represents the glyph identifier, the format of which is dependent on the format of the given font. 97 gradientTransform SVG, SVG ...
...ientUnits attribute defines the coordinate system used for attributes specified on the gradient elements. 99 hanging Deprecated, SVG, SVG Attribute The hanging attribute indicates the alignment coordinate for glyphs to achieve hanging baseline alignment for horizontally oriented glyph layouts. 100 height SVG, SVG Attribute The height attribute defines the
vertical length of an element in the user coordinate system. 101 horiz-adv-x Deprecated, SVG, SVG Attribute The horiz-adv-x attribute indicates the horizontal advance after rendering a glyph in horizontal orientation. 102 horiz-origin-x Deprecated, SVG, SVG Attribute The horiz-origin-x attribute indicates the x-coordinate in the font coordinate system of the origi...
...the matrix to be used by a <feConvolveMatrix> element. 149 orient SVG, SVG Attr The orient attribute indicates how a marker is rotated when it is placed at its position on the shape. 150 orientation Deprecated, SVG, SVG Attribute The orientation attribute indicates that the given glyph is only to be used for a particular text direction, i.e. horizontal or
vertical. 151 origin SVG, SVG Attribute The origin attribute specifies the origin of motion for an animation. It has no effect in SVG. 152 overflow SVG, SVG Attribute The overflow attribute sets what to do when an element's content is too big to fit in its block formatting context. 153 overline-position Attribute, Reference, Reference(2), SVG, font ...
...And 10 more matches
filter - CSS: Cascading Style Sheets
); 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, 238, 238); text-align: left; font-weight: bold; } table.standard-table td { padding: 5px; border: 1px solid rgb(204, 204, 204); text-align: left;
vertical-align: top; width:25%; height:auto; } #img3 { height:100%; } <svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg"> <filter id="svgBlur" x="-5%" y="-5%" width="110%" height="110%"> <feGaussianBlur in="SourceGraphic" stdDeviation="5"/> </filter> </svg> brightness() The brightness() function applies a linear multiplier to the input image, making it a...
...A value of 0% will create an image that is completely gray. A value of 100% leaves the input unchanged. Values of an amount over 100% are allowed, providing results with more contrast. The lacuna value for interpolation is 1. filter: contrast(200%) ...
...A drop shadow is effectively a blurred, offset version of the input image's alpha mask drawn in a particular color, composited below the image. The function accepts a parameter of type <shadow> (defined in CSS3 Backgrounds), with the ex...
...And 9 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
1:00.000 00:00:30.000 --> 00:00:50.000 Example 12 - Non-overlapping cue timing examples 00:00:00.000 --> 00:00:10.000 00:00:10.000 --> 00:01:00.581 00:01:00.581 --> 00:02:00.100 00:02:01.000 --> 00:02:01.000 Cue settings Cue settings are optional components used to position where the cue payload text will be displayed over the video. This includes whether the text is displayed horizontally or
vertically. There can be zero or more of them, and they can be used in any order so long as each setting is used no more than once. The cue settings are added to the right of the cue timings. There must be one or more spaces between the cue timing and the first setting and between each setting. A setting's name and value are separated by a colon. The settings are case sensitive so use lower case as shown...
...hem, and they can be used in any order so long as each setting is used no more than once. The cue settings are added to the right of the cue timings. There must be one or more spaces between the cue timing and the first setting and between each setting. A setting's name and value are separated by a colon. The settings are case sensitive so use lower case as shown. ...
...ting is used no more than once. The cue settings are added to the right of the cue timings. There must be one or more spaces between the cue timing and the first setting and between each setting. A setting's name and value are separated by a colon. The settings are case sensitive so use lower case as shown. There are five cue settings:
vertical Indicates that the text will be displayed
vertically rather than horizontally, such as in some Asian languages. Table 1 -
vertical values
vertical:rl writing direction is right to left
vertical:lr writing direction is left to right line Specifies where text appears
vertically. If
vertical is set, line specifies where text appears horizontally. Value can b...
...And 8 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
, then I would recommend that you read Jen Simmons excellent article on CSS Writing Modes. This goes into more depth on that specification than we will touch upon here. writing-mode Writing Modes are more than just left to right and right to left text, and the writing-mode property helps us display text running in other directions. The writing-mode property can have values of: horizontal-tb
vertical-rl
vertical-lr sideways-rl sideways-lr The value horizontal-tb is the default for text on the web. It is the direction in which you are reading this guide. The other properties will change the way that text flows in our document, matching the different writing modes found around the world. Again, for full details of these see Jen's article. As a simple example, I have two paragraphs below. T...
...ntal-tb is the default for text on the web. It is the direction in which you are reading this guide. The other properties will change the way that text flows in our document, matching the different writing modes found around the world. Again, for full details of these see Jen's article. As a simple example, I have two paragraphs 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. .wrapper > p { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; margin: 1em; color: #d9480f; max-width: 300px; } <div class="wrapper"> <p style="writing-mode: horizontal-tb...
...line text now runs down the page, from top to bottom. .wrapper > p { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; margin: 1em; color: #d9480f; max-width: 300px; } <div class="wrapper"> <p style="writing-mode: horizontal-tb">I have writing mode set to the default <code>horizontal-tb</code></p> <p style="writing-mode:
vertical-rl">I have writing mode set to <code>
vertical-rl</code></p> </div> Writing modes in grid layouts If we now take a look at a grid layout example, we can see how changing the writing mode means changing our idea of where the Block and Inline Axis are. The grid in my next example has three columns and two row tracks. This means there are three tracks running down the block axis. In default wr...
...And 8 more matches
The Box Model - Archive of obsolete content
<< PreviousNext >> In this section, we'll look at how XUL handles layout. Introduction to Boxes The main form of layout in XUL is called the 'Box Model'. This model allows you to divide a window into a series of boxes. Elements inside of a box will orient themselves horizontally or
vertically. By combining a series of boxes, spacers and elements with flex and pack attributes, you can control the layout of a window. Although a box is the fundamental part of XUL element layout, it follows a few very simple rules. A box can lay out its children in one of two orientations, either horizontally or
vertically. A horizontal box lines up its elements horizontally and a
vertical box orients its elements
vertically. You can think of a box as one row or one column from an HTML table. Various at...
...Added elements will be placed underneath each other in a column. ...
... to some CSS style properties control the exact position and size of the children. Box elements The basic syntax of a box is as follows: <hbox> <!-- horizontal elements --> </hbox> <vbox> <!--
vertical elements --> </vbox> The hbox element is used to create a horizontally oriented box. Each element placed in the hbox will be placed horizontally in a row. The vbox element is used to create a
vertically oriented box. Added elements will be placed underneath each other in a column. There is also a generic box element which defaults to horizontal orientation, meaning that it is equivalent to the hbox. ...
...And 7 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. 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" ...
...See the Example in writing-mode, which shows the different writing modes in action. The source for this interactive example is stored in a GitHub repository. ...
...See the Example in writing-mode, which shows the different writing modes in action. ...
...And 7 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
the theme's standard style sheet. By referring to a special style sheet within chrome://global/skin/, we can make label and button sizes, window background color, etc, match the currently selected theme in Firefox. We can also read in a stylesheet that we had set up ourselves. The XUL box model In principle, XUL lays out all UI components using combinations of two kinds of boxes: horizontal and
vertical. As shown in Listing 3, elements can be laid out horizontally using the hbox (horizontal box) element or
vertically using the vbox (
vertical box) element. When this file is opened in Firefox, it is displayed as shown in Figure 1. <label value="Horizontal layout"/> <hbox> <button label="horizontal1"/> <button label="horizontal2"/> </hbox> <label value="
Vertical layout"/> <vbox> <button labe...
...s shown in Listing 3, elements can be laid out horizontally using the hbox (horizontal box) element or
vertically using the vbox (
vertical box) element. When this file is opened in Firefox, it is displayed as shown in Figure 1. ...
... can be laid out horizontally using the hbox (horizontal box) element or
vertically using the vbox (
vertical box) element. When this file is opened in Firefox, it is displayed as shown in Figure 1. ...
...And 6 more matches
nsIScrollable
erface without concern for the type of content that may be inside. ...
...llOrientation); void getScrollbarVisibility(out boolean
verticalVisible, out boolean horizontalVisible); void getScrollRange(in long scrollOrientation, out long minPos, out long maxPos); Obsolete since Gecko 29.0 void setCurScrollPos(in long scrollOrientation, in long curPos); Obsolete since Gecko 29.0 void setCurScrollPosEx(in long curHorizontalPos, in long cur
VerticalPos); Obsolete since Gecko 29.0 void setDefaultScrollbarPreferences(in long scrollOrientation, in long scrollbarPref); void setScrollRange(in long scrollOrientation, in long minPos, in long maxPos); Obsolete since Gecko 29.0 void setScrollRangeEx(in long minHorizontalPos, in long maxHorizontalPos, in long min
VerticalPos, in long max
VerticalPos); Obsolete since Gecko 29.0...
...When passing this in to a method you are requesting or setting data for the
vertical scrollbar. Scrollbar states Visibility states of a scrollbar. Constant Value Description Scrollbar_Auto 1 Scrollbars visible only when needed. Scrollbar_Never 2 Scrollbars never visible, even when scrolling is still possible. ...
...And 6 more matches
<input type="range"> - HTML: Hypertext Markup Language
. Non Standard Attributes Attribute Description orient Sets the orientation of the range slider. Firefox only. orient Similar to the -moz-orient non-standard CSS property impacting the <progress> and <meter> elements, the orient attribute defines the orientation of the range 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 t...
...arks but doesn't support labels. Version 66 (66.0.3359.181) of Chrome supports labels 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. ...
... 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-standard orient attribute in Firefox, or by changing the text direction for Internet Explorer and Edge. Consider this range control: <input type="range" id="volume" min="0" max="11" value="7" step="1"> ScreenshotLive s...
...And 6 more matches
Index - Archive of obsolete content
assign XUL Elements, XUL Reference For XML templates, specifies an additional variable to assign a value to. 1823 attribute.align The align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children. For boxes that have horizontal orientation, it specifies how its children will be aligned
vertically. For boxes that have
vertical orientation, it is used to specify how its children are algined horizontally. The pack attribute is related to the alignment but is used to specify the position in the opposite direction. You can also specify the value of align using the style property -moz-box-align. 1824 autohide No summary! 1825 bbox XUL Elements, XUL Referen...
... 3/Mozilla 1.9 and later; instead binding elements may be placed directly inside the rule element. 1828 box XUL Elements, XUL Reference A container element which can contain any number of child elements. If the box has an orient attribute that is set to horizontal, the child elements are laid out from left to right in the order that they appear in the box. If orient is set to
vertical, the child elements are laid out from top to bottom. Child elements do not overlap. The default orientation is horizontal. 1829 broadcaster XUL Elements, XUL Reference A broadcaster is used when you want multiple elements to share one or more attribute values, or when you want elements to respond to a state change. Any elements that are observing the broadcaster will share th...
...ribute may be added beside the radio button. 1893 radiogroup XUL Elements, XUL Reference A group of radio buttons. Only one radio button inside the group can be selected at a time. The radio buttons may either direct children of the radiogroup or descendants. Place the radiogroup inside a groupbox if you would like a border or caption for the group. The radiogroup defaults to
vertical orientation. 1894 resizer XUL Elements, XUL Reference An element used for window resizing. If you place a custom resizing button inside the resizer, the user will be able to resize the window by dragging it. The resizer will send a command event after the resize is complete. 1895 richlistbox XUL Elements, XUL Reference This element is used to create a lis...
...And 5 more matches
Handling different text directions - 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 the importance of writing modes to modern CSS. What are writing modes? A writing mode in CSS refers to whether the text is running horizontally or
vertically. The writing-mode property lets us switch from one writing mode to another. You don't need to be working in a language which uses a
vertical writing mode to want to do this -- you could also change the writing mode of parts of your layout for creative purposes. In the example below we have a heading displayed using writing-mode:
vertical-rl. The text now runs
vertically.
Vertical text is commo...
... creative purposes. In the example below we have a heading displayed using writing-mode:
vertical-rl. The text now runs
vertically.
Vertical text is common in graphic design, and can be a way to add a more interesting look and feel to your web design. The three possible values for the writing-mode property are: horizontal-tb: Top-to-bottom block flow direction. Sentences run horizontally.
vertical-rl: Right-to-left block flow direction. Sentences run
vertically.
vertical-lr: Left-to-right block flow direction. Sentences run
vertically. So the writing-mode property is in reality setting the direction in which block-level elements are displayed on the page -- either from top-to-bottom, right-to-left, or left-to-right. This then dictates the direction text flows in sentences. Writing mode...
...to the bottom of the page if you are using a writing mode that displays text horizontally, such as English. If we look at an example this will become clearer. In this next example I have two boxes that contain a heading and a paragraph. The first uses writing-mode: horizontal-tb, a writing mode that is written horizontally and from the top of the page to the bottom. The second uses writing-mode:
vertical-rl; this is a writing mode that is written
vertically and from right to left. When we switch the writing mode, we are changing which direction is block and which is inline. In a horizontal-tb writing mode the block direction runs from top to bottom; in a
vertical-rl writing mode the block direction runs right-to-left horizontally. So the block dimension is always the direction blocks are displ...
...And 5 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
ress-bar-value div{ color: black; -webkit-appearance: progress-bar-value; } <div>Lorem</div> Chrome Safari progressbar div { color: black; -moz-appearance: progressbar; -webkit-appearance: progressbar; } <div>Lorem</div> Firefox The element is styled like a progress bar. ...
...ar-value; } <div>Lorem</div> Chrome Safari progressbar div { color: black; -moz-appearance: progressbar; -webkit-appearance: progressbar; } <div>Lorem</div> Firefox The element is styled like a progress bar. ...
... Chrome Safari progressbar div { color: black; -moz-appearance: progressbar; -webkit-appearance: progressbar; } <div>Lorem</div> Firefox The element is styled like a progress bar. ...
...And 5 more matches
Index - Archive of obsolete content
assign XUL Elements, XUL Reference For XML templates, specifies an additional variable to assign a value to. 1092 attribute.align The align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children. For boxes that have horizontal orientation, it specifies how its children will be aligned
vertically. For boxes that have
vertical orientation, it is used to specify how its children are algined horizontally. The pack attribute is related to the alignment but is used to specify the position in the opposite direction. You can also specify the value of align using the style property -moz-box-align. 1093 autohide No summary! 1094 bbox XUL Elements, XUL Referen...
... 3/Mozilla 1.9 and later; instead binding elements may be placed directly inside the rule element. 1097 box XUL Elements, XUL Reference A container element which can contain any number of child elements. If the box has an orient attribute that is set to horizontal, the child elements are laid out from left to right in the order that they appear in the box. If orient is set to
vertical, the child elements are laid out from top to bottom. Child elements do not overlap. The default orientation is horizontal. 1098 broadcaster XUL Elements, XUL Reference A broadcaster is used when you want multiple elements to share one or more attribute values, or when you want elements to respond to a state change. Any elements that are observing the broadcaster will share th...
...ribute may be added beside the radio button. 1162 radiogroup XUL Elements, XUL Reference A group of radio buttons. Only one radio button inside the group can be selected at a time. The radio buttons may either direct children of the radiogroup or descendants. Place the radiogroup inside a groupbox if you would like a border or caption for the group. The radiogroup defaults to
vertical orientation. 1163 resizer XUL Elements, XUL Reference An element used for window resizing. If you place a custom resizing button inside the resizer, the user will be able to resize the window by dragging it. The resizer will send a command event after the resize is complete. 1164 richlistbox XUL Elements, XUL Reference This element is used to create a lis...
...And 4 more matches
Applying styles and colors - Web APIs
sets the current line thickness. Values must be positive numbers. By default this value is set to 1.0 units. The line width is the thickness of the stroke centered on the given path. In other words, the area that's drawn extends to half the line width on either side of the path. Because canvas coordinates do not directly reference pixels, special care must be taken to obtain crisp horizontal and
vertical lines. In the example below, 10 straight lines are drawn with increasing line widths. The line on the far left is 1.0 units wide. However, the leftmost and all other odd-integer-width thickness lines do not appear crisp, because of the path's positioning. function draw() { var ctx = document.getElementById('canvas').getContext('2d'); for (var i = 0; i < 10; i++) { ctx.lineWidth = 1 + i;...
...l stroke color. This is what happens with the 1.0 width line in the previous example code. To fix this, you have to be very precise in your path creation. ...
...e 1.0 width line in the previous example code. To fix this, you have to be very precise in your path creation. Knowing that a 1.0 width line will extend half a unit to either side of the path, creating the path from (3.5,1) to (3.5,5) results in the situation in the third image--the 1.0 line width ends up completely and precisely filling a single pixel
vertical line. ...
...And 4 more matches
XUL element attributes - Archive of obsolete content
<< XUL Reference home The following attributes are common to all XUL elements: align Type: one of the values below The align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children. For boxes that have horizontal orientation, it specifies how its children will be aligned
vertically. For boxes that have
vertical orientation, it specifies how its children will be aligned horizontally. start Child elements are aligned starting from the left or top edge of the box. If the box is larger than the total size of the children, the extra space is placed on the right or bottom side. center Extra space is s...
...r 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 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 ...
...ise, you cannot add one later. When the XUL document is contained on a remote web site, the datasources may only be loaded from the same domain as the document. dir Type: one of the values below The direction in which the child elements of the element are placed. normal For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for
vertical scales) For other elements, the elements are placed left to right or top to bottom in the order they appear in the XUL code. reverse For scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for
vertical scales). For other elements, they are placed right to left or bottom to top. This is reverse of the order in which they appear in the XUL c...
...And 3 more matches
Unconventional controls - Game development
computer we can proceed with implementing support in our little demo. First, we add a <script> tag with the url pointing at this file, and add <div id="output"></div> just before the closing </body> tag for outputting diagnostic information. ...
...alculating the degrees from radians, two for holding the horizontal and
vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and one for the state of our hand's grab status. ...
...and mouse, but before the draw method: var toDegrees = 1 / (Math.PI / 180); var horizontalDegree = 0; var
verticalDegree = 0; var degreeThreshold = 30; var grabStrength = 0; Right after that we use the Leap's loop method to get the information held in the hand variable on every frame: Leap.loop({ hand: function(hand) { horizontalDegree = Math.round(hand.roll() * toDegrees);
verticalDegree = Math.round(hand.pitch() * toDegrees); grabStrength = hand.grabStrength; output.innerHTML = 'Leap Motion: <br />' + ' roll: ' + horizontalDegree + '? <br />' + ' pitch: ' +
verticalDegree + '? ...
...And 3 more matches
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
In this guide, we look at how flow layout behaves when used with different document writing modes. This is not a comprehensive guide to the use of writing modes in CSS, the aim here is to document the areas where flow layout interacts with writing modes in possibly unanticipated ways. The external resources and see also sections of this document link to more writing modes resources. ...
...the start and end of the inline direction. The start is where sentences start and the end is where a line of text ends before it would begin to wrap onto a new line. The block flow direction is the direction in which boxes, for example paragraphs, stack in that writing mode. The CSS writing-mode property controls the block flow direction. If you want to change your page, or part of your page, to
vertical-lr then you can set writing-mode:
vertical-lr on the element and this will change the direction of the blocks and therefore the inline direction as well. While certain languages will use a particular writing mode or text direction, we can also use these properties for creative effect, such as running a heading
vertically. The writing-mode property and block flow The writing-mode property acc...
...de:
vertical-lr on the element and this will change the direction of the blocks and therefore the inline direction as well. While certain languages will use a particular writing mode or text direction, we can also use these properties for creative effect, such as running a heading
vertically. The writing-mode property and block flow The writing-mode property accepts the values horizontal-tb,
vertical-rl and
vertical-lr. These values control the direction that blocks flow on the page. The initial value is horizontal-tb, which is a top to bottom block flow direction with a horizontal inline direction. Left to right languages, such as English, and Right to left languages. such as Arabic, are all horizontal-tb. The following example shows blocks using horizontal-tb. ...
...And 3 more matches
border-spacing - CSS: Cascading Style Sheets
ample 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. ...
...etween the table's border and the cells in the first/last column or row is the sum of the relevant (horizontal or
vertical) border-spacing and the relevant (top, right, bottom, or left) padding on the table. Note: The border-spacing property is equivalent to the deprecated cellspacing <table> attribute, except that it has an optional second value that can be used to set different horizontal and
vertical spacing. ...
...relevant (horizontal or
vertical) border-spacing and the relevant (top, right, bottom, or left) padding on the table. Note: The border-spacing property is equivalent to the deprecated cellspacing <table> attribute, except that it has an optional second value that can be used to set different horizontal and
vertical spacing. Syntax /* <length> */ border-spacing: 2px; /* horizontal <length> |
vertical <length> */ border-spacing: 1cm 2em; /* Global values */ border-spacing: inherit; border-spacing: initial; border-spacing: unset; The border-spacing property may be specified as either one or two values. When one <length> value is specified, it defines both the horizontal and
vertical spacings between cells. When two <length> values are specified, the first value defines the horizontal spa...
...And 3 more matches
text-combine-upright - CSS: Cascading Style Sheets
in Chinese. ...
... a single upright glyph for layout and decoration. This property only has an effect in
vertical writing modes. This is used to produce an effect that is known as tate-chu-yoko (???) in Japanese, or as ???? in Chinese. /* Keyword values */ text-combine-upright: none; text-combine-upright: all; /* Digits values */ text-combine-upright: digits; /* fits 2 consecutive digits horizontally inside
vertical text */ text-combine-upright: digits 4; /* fits up to 4 consecutive digits horizontally inside
vertical text */ /* Global values */ text-combine-upright: inherit; text-combine-upright: initial; text-combine-upright: unset; Syntax Values none There is no special processing. all Attempts to typeset all consecutive characters within the box horizontally, such that they take up the space ...
...If the integer is omitted, it computes to 2. ...
...And 3 more matches
text-orientation - 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. ...
... 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 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 3 more matches
The Box Model - Archive of obsolete content
y good understanding of its Box Model. This is the system that determines how all elements are laid out visually in a XUL document. It is important to know how it works in order to make interfaces that are easy to localize, skin and use in different types of operating systems, 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 s...
...ll need to install the Remote XUL Manager extension and add developer.mozilla.org to the whitelist. Boxes A XUL box is very similar to an HTML div. It's an invisible rectangular container with no styling at all (divs may have some default styling, though). Their behavior is similar. However, one of the fundamental differences between XUL and HTML has been the fact that XUL boxes can be oriented
vertically or horizontally (this behavior is being introduced into HTML standards). There are 3 basic box elements in XUL: hbox, vbox and box. An hbox is oriented horizontally by default, meaning that its child nodes are displayed next to each other from left to right. A vbox is oriented
vertically by default, its child nodes displayed one below the other from top to bottom. A box is a generic version th...
...l="Parrot" /> <button label="Porcupine" /> </hbox> This is how it looks on Mac OS (the black border was added for illustrative purposes, boxes don't have borders by default): If you use a vbox instead, it looks like this: The orientation of boxes (and most XUL elements) can be controlled using the orient attribute or the -moz-box-orient CSS property. With these you can make an hbox have
vertical orientation and viceversa, although that isn't very useful. The CSS property may be useful on some occasions, but using the orient attribute is not recommended because it mixes content and presentation. Flexibility An HTML div is as big as its contents unless you override its dimensions using CSS. This is similarly the case for XUL, except there are two flexibility directions to consider. An h...
...And 2 more matches
Element Positioning - Archive of obsolete content
We will often need more control over the position and size of elements within the box. For this, we first need to look at how a box works. The position of an element is determined by the layout style of its container. For example, the position of a button in a horizontal box is to the right of the previous button, if any. ...
...hat the buttons stay right aligned in the window. You could accomplish this by placing a spacer inside the box, but that gets messy when you have to do it numerous times. A better way is to use an additional attribute pack on the box. This attribute indicates how to pack the child elements inside the box. For horizontally oriented boxes, it controls the horizonal positioning of the children. For
vertically oriented boxes, it controls the
vertical positioning of the children. You can use the following values: start This positions elements at the left edge for horizontal boxes and at the top edge for
vertical boxes. This is the default value. center This centers the child elements in the box. end This positions elements at the right edge for horizontal boxes and at the bottom edge for verti...
...nts as follows: Example 4: Source View <box flex="1" pack="center"> <button label="Happy"/> <button label="Sad"/> </box> Now, when the window is resized, the buttons center themselves horizontally. Compare this behavior to that of the previous example. Box Alignment If you resize the window in the Happy-Sad example above horizontally, the box will grow in width. If you resize the window
vertically however, you will note that the buttons grow in height. This is because the flexibility is assumed by default in the other direction. You can control this behavior with the align attribute. For horizontal boxes, it controls the position of the children
vertically. For
vertical boxes, it controls the position of the children horizontally. The possible values are similar to those for pack. st...
...And 2 more matches
-ms-scroll-translation - Archive of obsolete content
The -ms-scroll-translation CSS property is a Microsoft extension that specifies whether
vertical-to-horizontal scroll wheel translation occurs on the specified element. Initial valuenoneApplies toall elementsInheritedyesComputed valueas specifiedAnimation typediscrete Syntax Values
vertical-to-horizontal
Vertical to horizontal translation, as described in Remarks, will take place when appropriate. none No scroll wheel translation takes place. inherit The initial value. The value is inherited from the element's parent element. Formal syntax none |
vertical-to-horizontal Specifications Not part of any specification. Remarks This property requires Windows 8 or later. This property has no effect on non-scrollable elements. If your JavaScript is listening f...
.... The value is inherited from the element's parent element. Formal syntax none |
vertical-to-horizontal Specifications Not part of any specification. Remarks This property requires Windows 8 or later. This property has no effect on non-scrollable elements. If your JavaScript is listening for scroll wheel Document Object Model (DOM) events, the events that occur when the user scrolls
vertically will always be
vertical scroll events, not horizontal scroll events. Similarly, the events that occur when the user scrolls horizontally will always be horizontal scroll events. This property enables you to change this behavior for
vertical scroll events. ...
... This property's initial value is inherit on all elements, except the <html> element, where it defaults to none. This property has no effect on keyboard interaction. ...
...And 2 more matches
source-editor.jsm
n ); Parameters aLine The 0-based line number on which to place the caret. aColumn Optional The 0-based column number at which to place the caret; if you don't provide this parameter, the caret is placed at the beginning of the line specified by aLine. aAlign Optional How to position the line with respect to the viewport when scrolling the line into view. This may be one of SourceEditor.
VERTICAL_ALIGN.TOP, SourceEditor.
VERTICAL_ALIGN.CENTER, and SourceEditor.
VERTICAL_ALIGN_BOTTOM. See Alignment constants for details. The default is SourceEditor.
VERTICAL_ALIGN.TOP. setMode() Sets the current syntax highlighting mode for the text being edited. void setMode( String aMode ); Parameters aMode A string indicating the file type being edited. See Editor mode constants for possible va...
...e "ContextMenu" event is sent when the editor's context menu is invoked, and has the following properties. Property Type Description x Number The X-coordinate at which the mouse cursor was located when the context menu was invoked. This value is relative to the document being edited; that is, 0 is the top of the very first line of text in the document, regardless of
vertical scroll position. y Number The Y-coordinate at which the mouse cursor was located when the context menu was invoked. This value is relative to the document being edited; that is, 0 is the left edge of the document, regardless of horizontal scroll position. screenX Number The X-coordinate at which the mouse cursor was located when the context menu was invoked, relative...
...event is sent when the user moves the mouse pointer over a line of text content. It has the following properties: Property Type Description event MouseEvent The DOM "mousemove" event. x Number The X-coordinate of the mouse pointer relative to the document being edited; that is, 0 is the top of the very first line of text in the document, regardless of
vertical scroll position.. y Number The Y-coordinate of the mouse pointer relative to the document being edited; that is, 0 is the left edge of the very first column of text in the document, regardless of horizontal scroll position. MouseOver The "MouseOver" event is sent when the user moves the mouse pointer enters a line of text content. It has the following properties: ...
...And 2 more matches
MathML Accessibility in Mozilla
cross out enclosing x plus y end crossout __________ Not supported. See WebKit's bug 146543. x plus y Enclosed by: a down diagonal strike x + y down diagonal strike enclosed x+y __________ cross out enclosing x plus y end crossout __________ Not supported. See WebKit's bug 146543. x plus y Enclosed by: a
vertical strike x + y up
vertical strike enclosed x+y __________ cross out enclosing x plus y end crossout __________ Not supported. See WebKit's bug 146543. x plus y Enclosed by: a horizontal strike x + y horizontal strike enclosed x+y __________ x plus y __________ Not supported. See WebKit's bug 146543. ...
...tart, ? squared over ? x squared, end of fraction, + fraction start, ? squared over ? y squared, end of fraction, ), | ? ( x + i y ) | squared = 0 left paren fraction start. partial differential. superscript 2. over partial differential x. superscript 2. fraction end. plus fraction start. partial differential. superscript 2. over partial differential y. superscript 2. fraction end. right paren
vertical bar ? left paren x plus i y right paren
vertical bar. superscript 2. equals 0 Torture Test 15: 2 2 2 x __________ 2 raised to the 2 raised to the 2 raised to the x power power __________ 2 to the 2 to the 2, superscript x 2. superscript 2. superscript 2. superscript x. Torture Test 16: ? 1 x dt t ___...
...c sub 1 column 2 c sub 2 column 3 c sub 3 column 4 dot dot dot column 5 c sub n plus 1 end sub row 3 column 1 c sub 2 column 2 c sub 3 column 3 c sub 4 column 4 dot dot dot column 5 c sub n plus 2 end sub row 4 column 1
vertical ellipsis column 2
vertical ellipsis column 3
vertical ellipsis column 4 column 5
vertical ellipsis row 5 column 1 c sub n column 2 c sub n plus 1 end sub column 3 c sub n plus 2 end sub column 4 dot dot dot column 5 c sub 2 n end sub end determ...
...And 2 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
. Moving using the keyboard In order to allow the user to move through the 3D world even if they don't have a WebXR device with the inputs to perform movement through space, our handler for keydown events, handleKeyDown(), responds by updating offsets from the object's origin based on which key was pressed. ...
...rld even if they don't have a WebXR device with the inputs to perform movement through space, our handler for keydown events, handleKeyDown(), responds by updating offsets from the object's origin based on which key was pressed. ...
... The S key slides the viewer backward MOVE_DISTANCE. The A key slides the viewer to the left by MOVE_DISTANCE. The D key slides the viewer to the right by MOVE_DISTANCE. The up arrow key, ?, moves the viewer upward ...
...And 2 more matches
Window - Web APIs
e 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. ...
...roperty 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 the window object. Window.locationbar Read only Returns the locationbar object, whose visibility can be ...
...eturns the message manager object for this window. Window.mozInnerScreenX Read only Returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel in nsIDOMWindowUtils for a conversion factor to adapt to screen pixels if needed. Window.mozInnerScreenY Read only Returns the
vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel for a conversion factor to adapt to screen pixels if needed. Window.name Gets/sets the name of the window. Window.navigator Read only Returns a reference to the navigator object. Window.opener Returns a reference to the window that open...
...And 2 more matches
Logical properties for sizing - CSS: Cascading Style Sheets
plain the flow-relative mappings between physical dimension properties and logical properties used for sizing elements on our pages. When specifying the size of an item, the Logical Properties and Values specification gives you the ability to indicate sizing as it relates to the flow of text (inline and block) rather than physical sizing which relates to the physical dimensions of horizontal and
vertical (e.g. left and right). While these flow relative mappings may well become the 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. These mappings assume that you ar...
...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. 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...
...t 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 the text direction as if the entire block has rotated. Min-width and min-height example There are also mappings for min-width and min-height -- these are min-inline-s...
...And 2 more matches
background-size - CSS: Cascading Style Sheets
ue 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 stretching the image. cover Scales the image as large as possible without stretching the image. If the proportions of the image differ from the element, it is cropped either
vertically or horizontally so that no empty space remains. auto Scales the background image in the corresponding direction such that its intrinsic proportions are maintained. <length> Stretches the image in the corresponding dimension to the specified length. Negative values are not allowed. <percentage> Stretches the image in the corresponding dimension to the specified percentage of the background...
...Intrinsic dimensions and proportions The computation of values depends on the image's intrinsic dimensions (width and height) and intrinsic proportions (width-to-height ratio). These attributes are as follows: A bitmap image (such as JPG) always has intrinsic dimensions and proportions. A vector image (such as SVG) does not necessarily have intrinsic dimensions. If it has both horizontal and
vertical intrinsic dimensions, it also has intrinsic proportions. If it has no dimensions or only one dimension, it may or may not have proportions. CSS <gradient>s have no intrinsic dimensions or intrinsic proportions. Background images created with the element() function use the intrinsic dimensions and proportions of the generating element. Note: The behavior of <gradient>s changed in Gecko 8.0 (F...
...ize. If the background-size is contain or cover: While preserving its intrinsic proportions, the image is rendered at the largest size contained within, or covering, the background positioning area. If the image has no intrinsic proportions, then it's rendered at the size of the background positioning area. If the background-size is auto or auto auto: If the image has both horizontal and
vertical intrinsic dimensions, it's rendered at that size. If the image has no intrinsic dimensions and has no intrinsic proportions, it's rendered at the size of the background positioning area. If the image has no intrinsic dimensions but has intrinsic proportions, it's rendered as if contain had been specified instead. If the image has only one intrinsic dimension and has intrinsic proportions, i...
...And 2 more matches
border-bottom-right-radius - CSS: Cascading Style Sheets
erty is then reset to its initial value by the shorthand property. ...
... With two values: the first value is a <length> or a <percentage> denoting the horizonta...
... With two values: the first value is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner. the second value is a...
...And 2 more matches
Box Model Details - Archive of obsolete content
. The two buttons indicate a minimum width of 100 pixels. The buttons will never be smaller than this size but they may grow larger. Here the window should appear just over 200 pixels wide. That's enough for the two buttons. Because all three elements are flexible, but they don't need any more room, the flexibility adds no extra space. As shown in the image, there are two buttons which expand
vertically to fit their container, which in this case is the hbox. The align attribute controls this behavior on a horizontal box. You can also prevent this stretching by placing a maximum height on the elements or, better, on the box itself. If a box has a maximum height, the elements inside it are constrained by this. However, the problem with this is that you need to know how big the element will be be...
...ms. The box model may be difficult to understand without trying various various things out for yourself. The following is an outline of both types of boxes: Horizontal boxes Lay out their elements next to each other horizontally. Flexible elements are flexed horizontally. Packing controls their horizontal placement of child elements. Alignment controls how the row of elements are aligned
vertically.
Vertical boxes Lay out their elements
vertically in a column. Flexible elements are flexed
vertically. Packing controls the
vertical placement of child elements. Alignment controls how the column of child elements are aligned horizontally. You can put boxes anywhere in a XUL file, including inside an HTML element such as a table. However, the layout will be partly controlled by the ...
...g 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 with two buttons in it, contained inside a flexible box. The box has the pack attribute which is used to center the buttons horizontally. The align attribute aligns the buttons
vertically. The result is that the buttons will be centered in the box in both directions. This example will work with a
vertical box as well, although the second button will be underneath the first one, instead of beside it. A Find Text Dialog Example 5 : Source View <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findtext" title="Find Text" orient="hori...
...The left box has a flexiblity that is 3 times greater than the right one so it will always receive 3 times as much of the extra space when the window size is increased. The right box enforces a minimum width of 150 pixels. The textbox is flexible so it will resize as the window resizes. The textbox also enforces a ...
Tabboxes - Archive of obsolete content
of a tabbox: <tabbox id="tablist"> <tabs> <!-- tab elements go here --> </tabs> <tabpanels> <!-- tabpanel elements go here --> </tabpanels> </tabbox> The tab elements are placed inside a tabs element, which is much like a regular box. The tabs element itself has been placed inside a tabbox. The tabbox also contains a tabpanels element which will appear below the tabs due to the
vertical orientation on the whole tabbox. There is really nothing special about the tab elements that make them different than boxes. Like boxes, tabs can contain any element. The difference is that the tabs render slightly differently and only one tab panel's contents are visible at once, much like a deck. The contents of the individual tab pages should go inside each tabpanel element. They do not go i...
...ttribute at a time. Position of the tabs Finally, you can change the position of the tabs so that they appear on any side of the tab pages. There is no special syntax to do this. You simply set the orient and dir attributes as necessary. Remember that the tab elements are much like regular boxes in terms of layout. Moreover, the tabbox element is much like a regular container box with a default
vertical orientation, whereas the tabs element is much like a container box with a default horizontal orientation. For example, to place the tabs along the left side, change the orientation of the tabs element to
vertical to make the tabs appear
vertically stacked. Next, adjust the tabbox so it has horizontal orientation. This will make the tabs appear to the left of, not above, the tab pages. Note that ...
...demonstrate tabs. The label across the top and the search criteria box will need to go on the first tab. We'll add some options on the second tab. The progress bar and the buttons can stay on the main dialog, outside of the tabs. <vbox flex="1"> <tabbox selectedIndex="1"> <tabs> <tab label="Search"/> <tab label="Options"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="
vertical"> <description> Enter your search criteria below and select the Find button to begin the search. </description> <spacer style="height: 10px"/> <groupbox orient="horizontal"> <caption label="Search Criteria"/> <menulist id="searchtype"> <menupopup> <menuitem label="Name"/> <menuitem label="Size"/> <menuitem label="Date...
...You can see the two tabs, Search and Options. Clicking on each one will bring up the respective tab pages. As shown by the image, the two options appear on t...
XBL Example - Archive of obsolete content
attribute of the deck. In addition, the text widget will need to be updated to display which page is the current one. <property name="page" onget="return parseInt(document.getAnonymousNodes(this)[0].childNodes[0].getAttribute('selectedIndex'));" onset="return this.setPage(val);"/> The page property gets its value by looking at the first element of the anonymous array. This returns the
vertical box, so to get the deck, we need to get the first child node of the box. The anonymous array isn't used as the deck is not anonymous from the box. Finally, the value of the selectedIndex attribute is retrieved. To set the page, a method 'setPage' is called which will be defined later. An oncommand handler will need to be added to the Previous and Next buttons so that the page is changed when the...
...entNode.parentNode.page--;"/> <xul:description flex="1"/> <xul:button xbl:inherits="label=nexttext" oncommand="parentNode.parentNode.parentNode.page++;"/> Because the 'page' property is only on the outer XUL element, we need to to use the parentNode property to get to it. The first parentNode returns the parent of the button which is the horizontal box, the second its parent, the
vertical box, and finally, its parent which is the outer box. The 'page' property is incremented or decremented. This will call the onget script to get the value, increment or decrement the value by one, and then call the onset handler to set the value. setPage method Now let's define the 'setPage' method. It will take one parameter, the page number to set the page to. It will need to make sure the page...
...d inside <![CDATA[ and ]]>. This is the general mechanism in all XML files that can be used to escape all of the text inside it. That way, you don't have to escape every less-than and greater-than sign inside it. Let's break down the code piece by piece. var thedeck=document.getAnonymousNodes(this)[0].childNodes[0]; Get the first element of the anonymous content array, which will be the
vertical box, then get its first child, which will be the deck element. var totalpages=this.childNodes.length; Get the number of children that the bound box has. This will give the total number of pages that there are. if (newidx<0) return 0; If the new index is before the first page, don't change the page and return 0. The page should not change to a value earlier than the first page. i...
...widx); Change the selectedIndex attribute on the deck. This causes the requested page to be displayed. document.getAnonymousNodes(this)[0].childNodes[1].childNodes[1].setAttribute("value",(newidx+1)+" of "+totalpages); This line modifies the label element so that it displays the current page index. The label element can be retrieved by getting the first element of anonymous content (the
vertical box), the second child of that label element (the horizontal box), and then the second element of that box. The value attribute is changed to read '1 of 3' or something similar. Note that one is added to the index because indicies start at 0. Constructor We will also need a constructor to initialize the label element so that it displays correctly when the slideshow is first displayed. We use s...
Backgrounds and borders - Learn web development
ackground image then the image displays on top of the color. Try adding a background-color property to the example above to see that in action. Controlling background-repeat The background-repeat property is used to control the tiling behavior of images. The available values are: no-repeat -- stop the background from repeating altogether. repeat-x -- repeat horizontally. repeat-y -- repeat
vertically. repeat -- the default; repeat in both directions. Try these values out in the example below. We have set the value to no-repeat so you will only see one star. Try out the different values -- repeat-x and repeat-y -- to see what their effects are. Sizing the background image In the example above, we have a large image that has ended up being cropped as it is larger than the element it is...
...maller than the box, you can change the value of background-repeat to repeat the image. Positioning the background image The background-position property allows you to choose the position in which the background image appears on the box it is applied to. This uses a coordinate system in which the top-left-hand corner of the box is (0,0), and the box is positioned along the horizontal (x) and
vertical (y) axes. Note: The default background-position value is (0,0). The most common background-position values take two individual values -- a horizontal value followed by a
vertical value. You can use keywords such as top and right (look up the others on the background-position page): .box { background-image: url(star.png); background-repeat: no-repeat; background-position: top center; }...
...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. ...
...You can play with the values to change the corners. ...
Flexbox - Learn web development
Why Flexbox? For a long time, the only reliable cross browser-compatible tools available for creating CSS layouts were things like floats 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 e...
...n't be covering it any further in this article. The minimum size value we discussed above. This can be specified individually using the flex-basis longhand value. We'd advise against using the longhand flex properties unless you really have to (for example, to override something previously set). They lead to a lot of extra code being written, and they can be somewhat confusing. Horizontal and
vertical alignment You can also use flexbox features to align flex items along the main or cross axis. Let's explore this by looking at a new example -- flex-align0.html (see it live also) -- which we are going to turn into a neat, flexible button/toolbar. At the moment you'll see a horizontal menu bar, with some buttons jammed into the top left hand corner. First, take a local copy of this example. ...
...utton/toolbar. At the moment you'll see a horizontal menu bar, with some buttons jammed into the top left hand corner. First, take a local copy of this example. Now, add the following to the bottom of the example's CSS: div { display: flex; align-items: center; justify-content: space-around; } Refresh the page and you'll see that the buttons are now nicely centered, horizontally and
vertically. We've done this via two new properties. align-items controls where the flex items sit on the cross axis. By default, the value is stretch, which stretches all flex items to fill the parent in the direction of the cross axis. If the parent hasn't got a fixed width in the cross axis direction, then all flex items will become as long as the longest flex items. This is how our first example go...
...f the parent hasn't got a fixed width in the cross axis direction, then all flex items will become as long as the longest flex items. This is how our first example got equal height columns by default. The center value that we used in our above code causes the items to maintain their intrinsic dimensions, but be centered along the cross axis. This is why our current example's buttons are centered
vertically. You can also have values like flex-start and flex-end, which will align all items at the start and end of the cross axis respectively. See align-items for the full details. You can override the align-items behavior for individual flex items by applying the align-self property to them. For example, try adding the following to your CSS: button:first-child { align-self: flex-end; } Have ...
Accessibility API cross-reference
on the same value name attribute Represents the an row in a table ROW n/a n/a row <tr> A structure containing one or more row elements in a tabular container. n/a n/a rowgroup n/a A table row header ROWHEADER ROW_HEADER ROW_HEADER, TABLE_ROW_HEADER rowheader <th scope=row>
vertical or horizontal scrollbar SCROLLBAR SCROLL_BAR SCROLL_BAR scrollbar A landmark region that contains a collection of items and objects that, as a whole, combine to create a search facility. search A type of textbox intended for specifying search criteria. searchbox A renderable struct...
...nts of composite roles behave rather like this. For grayed-out (disabled) vs. available (enabled) items. HTML attribute also removes element from tab sequence and 'grays it out'. ARIA attribute keeps it 'perceivable'. ...
...site roles behave rather like this. For grayed-out (disabled) vs. available (enabled) items. HTML attribute also removes element from tab sequence and 'grays it out'. ARIA attribute keeps it 'perceivable'. ...
...s. For grayed-out (disabled) vs. available (enabled) items. HTML attribute also removes element from tab sequence and 'grays it out'. ARIA attribute keeps it 'perceivable'. ...
MathML Demo: <mtable> - tables and matrices
As a visual aid, the examples deliberately draw attention to the math axis and the baseline: ----------------------- this is the math axis ..................... this is the baseline External
vertical align is center ---... 1 22 333 4444 x 55555 666666 a b c 7777777 11 ...--- , cols arg is "|r|c|l|", \hline's above and below. When align="center" or align="baseline", the middle of the table coincides with the baseline. External
vertical align is axis ---... 1 22 333 4444 x 55555 lim n->? f-1 ? i=1 n Ai rowspan=2 here xn + yn n columnspan=2 here 7777777 11 ...--- , columnlines="solid", rowlines="dashed solid dashed". By default -- when the align attribute is not set, or when align="axis", the m...
... 1 22 333 4444 55555 666666 x 2 a b c 7777777 11 cols arg is "r|cl". ...
... 1 22 333 4444 55555 666666 x 2 a b c 7777777 11 cols arg is "r|cl". ...
...---... [ 1 666666 x 2 c axis ] [ 1 666666 x 2 c center ] + ? 1 55555 x + 1 c bottom ? + ? 1 4444 x c top ? + || 1 4444 4444 4444 x center || post text. Now for a display ---... 1 4444 4444 4444 x 7777777 text after displayed math. Do you see which
vertical alignment is set on that table? Example of \begin{matrix} ---... 0 1 1 0 with 3 \hline's. Example of \begin{smallmatrix} ---... 1 2 3 4 5 obtained with scriptlevel="+1". Example of \begin{pmatrix} ---... ( 0 - i i 0 ) with an \hline after the first row. Example of \begin{bmatrix} ---... [ 1 0 0 - 1 ] Exam...
nsIDOMMouseScrollEvent
Methods initMouseScrollEvent() Initializes the progress event object. void initMouseScrollEvent( in DOMString typeArg, in boolean canBubbleArg, in boolean c...
... Methods initMouseScrollEvent() Initializes the progress event object. ...
...tributes Attribute Type Description axis long Indicates which mouse wheel axis changed; this will be either HORIZONTAL_AXIS or
VERTICAL_AXIS. Read only. Constants Constant Value Description HORIZONTAL_AXIS 1 The horizontal (X) axis.
VERTICAL_AXIS 2 The
vertical (Y) axis. Methods initMouseScrollEvent() Initializes the progress event object. void initMouseScrollEvent( in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in nsIDOMAbstractView viewArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean ...
...n when the event occurred, otherwise false. metaKeyArg true if the meta key was down when the event occurred, otherwise false. buttonArg Indicates which mouse button was pressed when the event occurred, if any. relatedTargetArg The event target related to this event. axis The mouse wheel axis for this event; this is either HORIZONTAL_AXIS or
VERTICAL_AXIS. See also nsIDOMMouseEvent nsIDOMEvent nsIDOMEventTarget ...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
able substitute. Recall that the circumference of a circle is 2??r radians (360?); as such, this is the theoretical maximum FOV. Realistically, though, not only do humans not see anywhere near that much, but viewing devices such as monitors and VR goggles tend to reduce the field of view even further. Human eyes typically have a horizontal field of view of around 135? (about 2.356 radians) and a
vertical FOV of about 180? (? or around 3.142 radians). Making the camera's FOV smaller reduces the arc that will be included in the viewport, thus enlarging that content when rendered to the view. There are differences between this and an optical zoom effect, but the result is generally close enough to get the job done. The following function returns a projection perspective matrix that integrates the ...
... nearClip, farClip); return transform; } After converting the FOV angle, fovDegrees, from degrees to radians and computing the aspect ratio of the XRViewport specified by the viewport parameter, this function uses the glMatrix library's mat4.perspective() function to compute the perspective matrix. The perspective matrix encapsulates the field of view (technically, this is the
vertical field of view), aspect ratio, and the near and far clipping planes within the 4x4 matrix transform, which is then returned to the caller. The near clipping plane is the distance in meters to a plane parallel to the display surface closer than which nothing gets drawn. Any vertices which lie on the same side of that plane as the camera are not drawn. Conversely, the far clipping plane is the dist...
...n multply into that matrix all the other transforms you need to apply in order to result in the frame's desired geometry. For example: const transform = createPerspectiveMatrix(viewport, 130, 1, 100); const translateVec = vec3.fromValues(-trackDistance, -craneDistance, pushDistance); mat4.translate(transform, transform, translateVec); This starts with the perspective matrix representing a 130?
vertical field of view, then applies a translation that moves the camera in a manner that includes track, crane, and push movements. Scaling transforms Unlike a true "zoom", scaling involves multiplying each of the x, y, and z coordinate values in a position or vertex by a scaling factor for that axis. These may or may not necessarily be identical for each axis, though the closest result you can get to ...
... defined by the matrix viewMatrix by panAngle radians: mat4.rotateY(viewMatrix, viewMatrix, panAngle); If panAngle is positive, this transform will pan the camera to the right; a negative value for panAngle will pan to the left. Tilting (Pitching up or down) When you tilt or pitch the camera, you keep it fixed in space at the same coordinates while changing the direction in which it's facing
vertically without altering the horizontal portion of its facing at all. It simply adjusts the direction it's pointing up and down. Tilting is good for capturing the scope of a tall object or scene, such as a forest or a mountain, but is also a popular way to introduce a character or locale of importance or which inspires awe. it's also of course useful for implementing support for a player looking up and...
Window.pageYOffset - Web APIs
The read-only Window property pageYOffset is an alias for scrollY; as such, it returns the number of pixels the document is currently scrolled along the
vertical axis (that is, up or down) with a value of 0.0, indicating that the top edge of the Document is currently aligned with the top edge of the window's content area. There is slightly better support for pageYOffset than for scrollY in older browsers, but if you're not concerned about browsers more than a handful of years old, you can use either one. ...
...older browsers, but if you're not concerned about browsers more than a handful of years old, you can use either one. The corresponding pageXOffset property, which returns the number of pixels scrolled along the horizontal axis (left and right), is an alias for scrollX. Syntax yOffset = window.pageYOffset; Value A floating-point number specifying the number of pixels the Document is scrolled
vertically within its containing Window. This number is subpixel precise, so it may not be an integer. A value of 0.0 indicates that the window is not scrolled
vertically, and that the top of the document is located at the top edge of the window's content area. Since this property is an alias for Window.scrollY, see that article for additional details on this value and its use. Example var contentHTML...
...ra neque nec, facilisis risus. Duis condimentum sapien non felis cursus blandit. Integer euismod lectus a ipsum pellentesque lacinia.</p> `; document.getElementById("frame").contentDocument .body.innerHTML = contentHTML; In this example, an <iframe> is created and filled with content, then a specific element within the document is scrolled into view in the frame. Once that's done, the
vertical scroll position is checked by looking at the value of pageYOffset in the frame's contentWindow. HTML The HTML is extremely simple and has just two elements: an <iframe> that contains the document we're going to scroll, and a <div> into which we'll output the value of pageYOffset when we've finished the scroll. <iframe id="frame"> </iframe> <div id="info"> </div> JavaScript var frame = docum...
...our content as well as the <div> element into which we'll output the result of our scroll position check. It then gets a reference to the element we want to scroll into view calling getElementById() on the frame's HTMLIFrameElement.contentDocument. With the target element in hand, we set the scrollTop of the frame's scrollingElement to the offsetTop of the target element. By doing so, 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...
Block and inline layout in normal flow - CSS: Cascading Style Sheets
We describe block-level boxes as participating in a block formatting context, and inline-level boxes as participating in an inline formatting context. The behaviour of elements which have a block or inline formatting context is also defined in this specification. For elements with a block formatting context, the spec says: "In a block formatting context, boxes are laid out one after the other,
vertically, beginning at the top of a containing block. The
vertical distance between two sibling boxes is determined by the 'margin' properties.
Vertical margins between adjacent block-level boxes in a block formatting context collapse. In a block formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left formatting, right edges touch)." - 9.4.1 F...
...ter edge touches the left edge of the containing block (for right-to-left formatting, right edges touch)." - 9.4.1 For elements with an inline formatting context: "In an inline formatting context, boxes are laid out horizontally, one after the other, beginning at the top of a containing block. Horizontal margins, borders, and padding are respected between these boxes. The boxes may be aligned
vertically in different ways: their bottoms or tops may be aligned, or the baselines of text within them may be aligned. The rectangular area that contains the boxes that form a line is called a line box." - 9.4.2 Note that the CSS 2.1 specification describes documents as being in a horizontal, top to bottom writing mode. For example, by describing
vertical distance between block boxes. The behavior on ...
...ed, or the baselines of text within them may be aligned. The rectangular area that contains the boxes that form a line is called a line box." - 9.4.2 Note that the CSS 2.1 specification describes documents as being in a horizontal, top to bottom writing mode. For example, by describing
vertical distance between block boxes. The behavior on block and inline elements is the same when working in a
vertical writing mode, and we will explore this in a future guide on Flow Layout and Writing Modes. Elements participating in a block formatting context Block elements in a horizontal writing mode such as English, layout
vertically, one below the other. In a
vertical writing mode then would lay out horizontally. In this guide, we will be working in English and therefore a horizontal writing mode. ...
... As defined in the specification, the margins between two block boxes are what creates separation between the elements. We see this with a very simple layout of two paragraphs, to which I have added a border. ...
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
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 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 ...
...ver, 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 horizontal-tb on .grid to see how the different properties change the layout. When working with a site in a writing mode other than a horizontal, top to bottom one, or when using writing modes for creative reasons, being able to relate to the flow of the content makes a lot of sense. Block and inline dimensions A key concept of working with flow relative properties and values is the tw...
... the concepts of block and inline rather than right and left/top and bottom when aligning items. The inline dimension is the dimension along which a line of text runs in the writing mode in use. Therefore, in an English document with the text running horizontally left to right, or an Arabic document with the text running horizontally right to left, the inline dimension is horizontal. Switch to a
vertical writing mode (e.g. a Japanese document) and the inline dimension is now
vertical, as lines in that writing mode run
vertically. The block dimension is the other dimension, and the direction in which blocks -- such as paragraphs -- display one after the other. In English and Arabic these run
vertically, whereas in any
vertical writing mode these run horizontally. The below diagram shows the inli...
...Some of the properties are essentially mappings from the physical versions, for example inline-size for width or margin-inline-start rather than margin-left. ...
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
e given these mapped values assuming that the writing-mode in use is horizontal-tb -- with a left to right direction. The inline direction therefore runs horizontally -- left to right -- and margin-inline-start would be equivalent to margin-left. If you were using a horizontal-tb writing mode with a right-to-left text direction then margin-inline-start would be the same as margin-right, and in a
vertical writing mode it would be the same as using margin-top. Logical property Physical 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 borde...
...the margin more obvious to see. One box uses physical properties and the other logical properties. Try changing the direction property to rtl to cause the boxes to display in a right-to-left direction, the margins on the first box will stay in the same place, while the margins on the inline dimension of the second box will switch. You can also try changing the writing-mode from horizontal-tb to
vertical-rl. Again, notice how the margins stay in the same place for the first box, but switch around to follow the text direction in the second. Margin shorthands As we can now target both sides of a box -- either both inline sides or both block sides -- there are new shorthands available, margin-inline and margin-block, which accept two values. The first value will apply to the start of that dimens...
...cal padding properties. With a writing-mode of horizontal-tb, both boxes should appear the same. Try changing the direction property to rtl to cause the boxes to display in a right-to-left direction. The padding on the first box will stay in the same place, whereas the padding on the inline dimension of the second box will switch. You can also try changing the writing-mode from horizontal-tb to
vertical-rl. Again, notice how the padding stays in the same place for the first box, but switches around to follow the text direction in the second. Padding shorthands As with margin, there are two-value shorthands for padding -- padding-inline and padding-block -- which allow you to set the padding of the two inline, and two block dimensions, respectively. In a horizontal writing-mode this CSS woul...
...ide of a box, along with the shorthand to set all three at once for each side. As with margin and padding we have a mapped version of each physical property. The demo below uses some longhands and three shorthand values. As with the other demos try changing the direction property to rtl to cause the boxes to display in a right-to-left direction, or changing the writing-mode from horizontal-tb to
vertical-rl. New border shorthands There are two-value shorthands to set the width, style and, color of the block or inline dimension, and two-value shorthands to set all three values in the block or inline dimension. The below code, in a horizontal writing mode, would give you a 2px green solid border on the top and bottom of the box, and a 4px dotted purple border on the left and right. .box { bo...
Inline formatting context - CSS: Cascading Style Sheets
This article explains the inline formatting context Core concepts The inline formatting context is part of the visual rendering of a web page. Inline boxes are laid out one after the other, in the direction sentences run in the writing mode in use: In a horizontal writing mode, boxes are laid out horizontally, starting on the left. In a
vertical writing mode they would be laid out
vertically starting at the top. In the example below, the two (<div>) elements with the black borders form a block formatting context, inside which each word participates in an inline formatting context. The boxes in the horizontal writing mode run horizontally, and the
vertical writing mode boxes run
vertically. Boxes forming a line are contained by a rectangular area called a line box. This box will ...
...> breaks at the wrapping point. Margins, borders, and padding in the inline direction are respected. In the example below you can see how the margin, border, and padding on the inline <span> element are added. Note: I am using the logical, flow-relative properties -- padding-inline-start rather than padding-left -- so that they work in the inline dimension whether the text is horizontal or
vertical. Read more about these properties in Logical Properties and Values. Alignment in the block direction Inline boxes may be aligned in the block direction in different ways, using the
vertical-align property, which will align on the block axis in
vertical writing modes (therefore not
vertically at all!). In the example below the large text is making the line box of the first sentence larger, ther...
...I have used the value top, try changing it to middle, bottom, or baseline. ...
...lignment 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. ...
background-position-y - CSS: Cascading Style Sheets
The position is relative to the position layer set by background-origin. 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 value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
... /* Multiple values */ background-position-y: 0px, center; /* Global values */ background-position-y: inherit; background-position-y: initial; background-position-y: unset; The background-position-y property is specified as one or more values, separated by commas. Values top Aligns the top edge of the background image with the top edge of the background position layer. center Aligns the
vertical center of the background image with the
vertical center of the background position layer. bottom Aligns the bottom edge of the background image with the bottom edge of the background position layer. <length> The offset of the given background image's horizontal edge from the corresponding background position layer's top horizontal edge. (Some browsers allow assigning the bottom edge for offse...
...e background position layer. bottom Aligns the bottom edge of the background image with the bottom edge of the background position layer. <length> The offset of the given background image's horizontal edge from the corresponding background position layer's top horizontal edge. (Some browsers allow assigning the bottom edge for offset). <percentage> The offset of the given background image's
vertical position relative to the container. A value of 0% means that the top edge of the background image is aligned with the top edge of the container, and a value of 100% means that the bottom edge of the background image is aligned with the bottom edge of the container, thus a value of 50%
vertically centers the background image. Formal definition Initial valuetopApplies toall elementsInheritednoPe...
... HTML <div></div> CSS div { width: 300px; height: 300px; background-color: skyblue; background-image: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png); background-repeat: no-repeat; background-position-x: center; background-position-y: bottom 10px; } Result Specifications Specific...
background-repeat - 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. By default, the repeated images are clipped to the size of the element, but they can be scaled to fit (using round) or evenly distributed from end to end (using space). ...
...y default, the repeated images are clipped to the size of the element, but they can be scaled to fit (using round) or evenly distributed from end to end (using space). ...
...Here is an explanation of how each option works for either direction: repeat The image is repeated as much as needed to cover the whole background image painting area. The last image will be clipped if it doesn't fit. space The image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, an...
...t item is matched with a different value of background-repeat. Specifications Specification Status Comment CSS Backgrounds and Borders Module Level 3The definition of 'background-repeat' in that specification. Candidate Recommendation Adds support for multiple background images, the two-value syntax allowing distinct repetition behavior for the horizontal and
vertical directions, the space and round keywords, and for backgrounds on inline-level elements by precisely defining the background painting area. CSS Level 2 (Revision 1)The definition of 'background-repeat' in that specification. Recommendation No significant changes. CSS Level 1The definition of 'background-repeat' in that specification. Recommendation Initial definition.
border-bottom-left-radius - CSS: Cascading Style Sheets
tom-left-radius CSS property, the value of this property is then reset to its initial value by the shorthand property. ...
...he 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 is a <length> or a <...
...m; 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 is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner. ...
...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.. ...
box-orient - CSS: Cascading Style Sheets
This is a property of the original CSS Flexible Box Layout Module draft, and has been replaced by a newer standard. See flexbox for information about the current standard. The box-orient CSS property sets whether an element lays out its contents horizontally or
vertically. /* Keyword values */ box-orient: horizontal; box-orient:
vertical; box-orient: inline-axis; box-orient: block-axis; /* Global values */ box-orient: inherit; box-orient: initial; box-orient: unset; Syntax The box-orient property is specified as one of the keyword values listed below. Values horizontal The box lays out its contents horizontally.
vertical The box lays out its contents
vertically. inline-axis (HTML) The box displays its children along the inline axis. block-axis (HTML) The box displays it...
... Description HTML DOM elements lay out their contents along the inline-axis by default. This CSS property will only apply to HTML elements with a CSS display value of box or inline-box. ...
...cription HTML DOM elements lay out their contents along the inline-axis by default. This CSS property will only apply to HTML elements with a CSS display value of box or inline-box. Formal definition Initial valueinline-axis (horizontal in XUL)Applies toelements with a CSS display value of box or inline-boxInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax horizontal |
vertical | inline-axis | block-axis | inherit Examples Setting horizontal box orientation Here, he box-orient property will cause the two <p> sections in the example to display in the same line. HTML <div class="example"> <p>I will be to the left of my sibling.</p> <p>I will be to the right of my sibling.</p> </div> CSS div.example { display: -moz-box; /* Mozilla */ displ...
...o <p> sections in the example to display in the same line. HTML <div class="example"> <p>I will be to the left of my sibling.</p> <p>I will be to the right of my sibling.</p> </div> CSS div.example { display: -moz-box; /* Mozilla */ display: -webkit-box; /* WebKit */ display: box; /* As specified */ /* Children should be oriented
vertically */ -moz-box-orient: horizontal; /* Mozilla */ -webkit-box-orient: horizontal; /* WebKit */ box-orient: horizontal; /* As specified */ } Result Specifications Not part of any standard. ...
<position> - CSS: Cascading Style Sheets
ive <percentage> value or an absolute <length> value. Positive values are offset towards the right or the bottom, whichever is appropriate. Negative values are offset in the opposite directions. If only a single offset value is specified, it defines the x-coordinate, with the value for the other axis defaulting to center. ...
.... ...
...| [...
...| [ [ left | right ] [ <length> | <percentage> ] ] && [ [ top | bottom ] [ <length> | <percenta...
resize - CSS: Cascading Style Sheets
ize CSS property sets whether an element is resizable, and if so, in which directions. 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 */ resize: none; resize: both; resize: horizontal; resize:
vertical; resize: block; resize: inline; /* Global values */ resize: inherit; resize: initial; resize: unset; The resize property is specified as a single keyword value from the list below. Values none The element offers no user-controllable method for resizing it. both The element displays a mechanism for allowing the user to resize it, which may be resized both horizontally and
vertically. h...
... resize property is specified as a single keyword value from the list below. Values none The element offers no user-controllable method for resizing it. both The element displays a mechanism for allowing the user to resize it, which may be resized both horizontally and
vertically. horizontal The element displays a mechanism for allowing the user to resize it in the horizontal direction.
vertical The element displays a mechanism for allowing the user to resize it in the
vertical direction. block The element displays a mechanism for allowing the user to resize it in the block direction (either horizontally or
vertically, depending on the writing-mode and direction value). inline The element displays a mechanism for allowing the user to resize it in the inline direction (either hor...
... displays a mechanism for allowing the user to resize it in the
vertical direction. block The element displays a mechanism for allowing the user to resize it in the block direction (either horizontally or
vertically, depending on the writing-mode and direction value). inline The element displays a mechanism for allowing the user to resize it in the inline direction (either horizontally or
vertically, depending on the writing-mode and direction value). resize does not apply to the following: Inline elements Block elements for which the overflow property is set to visible Formal definition Initial valuenoneApplies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframesInheritednoComputed valueas specifiedAnimation type...
...e). resize does not apply to the following: Inline elements Block elements for which the overflow property is set to visible Formal definition Initial valuenoneApplies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframesInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax none | both | horizontal |
vertical | block | inline Examples Disabling resizability of textareas In many browsers, <textarea> elements are resizable by default. You may override this behavior with the resize property. HTML <textarea>Type some text here.</textarea> CSS textarea { resize: none; /* Disables resizability */ } Result Using resize with arbitrary elements You can use the resize property to make any elemen...
text-underline-position - CSS: Cascading Style Sheets
position, use that value. If the font file doesn't include this information, behave as if auto was set, with the browser choosing an appropriate position. under Forces the line to be set below the alphabetic baseline, at a position where it won't cross any descenders. This is useful for ensuring legibility with chemical and mathematical formulas, which make a large use of subscripts. left In
vertical writing-modes, this keyword forces the line to be placed on the left side of the text. In horizontal writing-modes, it is a synonym of under. right In
vertical writing-modes, this keyword forces the line to be placed on the right side of the text. In horizontal writing-modes, it is a synonym of under. auto-pos A synonym of auto, which should be used instead. above Forces the line to be ...
... auto | from-font | [ under | [ left | right ] ] Examples A simple example Let's take a couple of simple example paragraphs: <p class="horizontal">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam consectetur ac turpis vel laoreet. Nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat quis. Nam eget sodales quam. Aliquam accumsan tellus ac erat posuere.</p> <p class="
vertical">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam consectetur ac turpis vel laoreet. Nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat quis. Nam eget sodales quam. Aliquam accumsan tellus ac erat posuere.</p> Our CSS looks like this: p { font-size: 1.5rem; text-transform: capitalize; text-decoration: underline; text-decoration-thickness: 2px; } .horizontal...
... adipiscing elit. Nullam consectetur ac turpis vel laoreet. Nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat quis. Nam eget sodales quam. ...
...nsectetur ac turpis vel laoreet. Nullam volutpat pharetra lorem, sit amet feugiat tortor volutpat quis. Nam eget sodales quam. Aliquam accumsan tellus ac erat posuere.</p> Our CSS looks like this: p { font-size: 1.5rem; text-transform: capitalize; text-decoration: underline; text-decoration-thickness: 2px; } .horizontal { text-underline-position: under; } .
vertical { writing-mode:
vertical-rl; text-underline-position: left; } In this example we set both the paragraphs to have a thick underline. In the horizontal text we use text-underline-position: under; to put the underline below all the descenders. In the text with a
vertical writing-mode set, we can then use values of left or right to make the underline appear on the left or right of the text as required. The live example ...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
y, so wherever it ends up is where it will be. The space below the baseline is referred to as "descender space" since that's where the descenders in lowercase letters like "j", "y", and "q" are drawn. Figure 4 shows what happens when we add an image to the mix. Note where the image sits by default: its bottom edge is aligned with the baseline of the line box. This placement can be changed with
vertical-align-- we'll talk about that in a bit-- but almost nobody ever changes the value from its default. Let's take away the text, and leave only the image, as was done in Figure 5. So we have an image sitting on the baseline of a line box that contains only the image. Now consider what happens when we put that line in a table cell (Figure 6). And there you have it-- spaces opening up where none...
...st a single image in them, as in Figure 8. Of course, while we have a single-pixel spacer cell in Figure 9, there is still unwanted space underneath the navigation buttons across the top. Getting rid of this space could be as easy as putting each image in its own cell and making them all block-level, but let's leave them all together in a single cell so we can illustrate another approach. Using
vertical alignment The other main choice is leave the image inline and alter the
vertical alignment of the image with respect to the line box. For example, you could try the following: td img {
vertical-align: bottom;} This will cause the bottom edges of the images to be aligned with the bottom of the line box, instead of the baseline. As we can see in Figure 10, this has the intended effect: the space ...
...ode. This will prevent browsers from using standards-based rendering, and thus all the image-layout problems are avoided. If you're using strict markup, or you need for other reasons to be in "standards" rendering, then remember these guidelines: Any image alone in a table cell (e.g., single-pixel spacer images) should be made block-level. Any image in a table cell with other images should be
vertically aligned with the bottom of the line box. Any image in a table cell with other images and text should have its
vertical alignment changed as necessary, if at all. With a judicious mixture of approaches and a reduction of single-pixel image tricks-- which, in a CSS-capable browser, are unnecessary anyway-- it is quite possible to sidestep this strange effect of standards support. The best solu...
In-Depth - Archive of obsolete content
Each colour is one pixel in the border. If you want the border to be 3 pixels wide you define each colour separated by a space. Example: -moz-border-...
...Each colour is one pixel in the border. If you want the border to be 3 pixels wide you define each colour separated by a space. Example: -moz-border-top-colors: ThreeDDarkSha...
...Each colour is one pixel in the border. ...
Space Manager Detailed Design - Archive of obsolete content
st operations BandRect* Next() const {return (BandRect*)PR_NEXT_LINK(this);} BandRect* Prev() const {return (BandRect*)PR_PREV_LINK(this);} void InsertBefore(BandRect* aBandRect) {PR_INSERT_BEFORE(aBandRect, this);} void InsertAfter(BandRect* aBandRect) {PR_INSERT_AFTER(aBandRect, this);} void Remove() {PR_REMOVE_LINK(this);} // Split the band rect into two
vertically, with this band rect becoming // the top part, and a new band rect being allocated and returned for the // bottom part // // Does not insert the new band rect into the linked list BandRect* Split
Vertically(nscoord aBottom); // Split the band rect into two horizontally, with this band rect becoming // the left part, and a new band rect being allocated and returned fo...
... manager, and the world coordinate space is * relative to this frame. * * You can use QueryInterface() on this frame to get any additional * interfaces. */ nsIFrame* GetFrame() const { return mFrame; } Implementation Notes Algorithm 1: GetBandData GetBandData is used to provide information to clients about what space if available and unavailable in a band of space. The client provides a
vertical offset, the yOffset, that corresponds to the band that is of interest. This will be the y offset of the frame that is being reflowed. The caller also provides a collection of BandData objects (an array) and the number of items that the collection can handle. If the collection is too small, then an error is returned and the count is updated to indicate the size required. The algorithm to provide t...
...ds to the band that is of interest. This will be the y offset of the frame that is being reflowed. The caller also provides a collection of BandData objects (an array) and the number of items that the collection can handle. If the collection is too small, then an error is returned and the count is updated to indicate the size required. The algorithm to provide the band data is as follows: Get a
vertical offset in world coordinates (instead of frame-relative coordinates) by adding the y-origin of the SpaceManager to the y offset passed in If the (adjusted) y value passed in is greater than the greatest band being managed, then all space is available so a single trapezoid is returned,marked as available and sized to the maximum size value (passed in). If the (adjusted) y offset intersects a band...
Space Manager High Level Design - Archive of obsolete content
ilable for other elements (GetAvailableSpace in nsBlockReflowState). Additionally, there is a need to manage impacts to lines caused by changes to floated elements. This is referred to as Propagation of Float Damage and is handled by the Block Frame, making use of the Space Manager. When a float is incrementally reflowed, the Space Manager is notified if the float's region has changed. If so, the
vertical space that has been affected (including both the float's old region and the float's new region) is noted in the internal nsIntervalSet as potential float damage (the method is IncludeInDamage). During the incremental reflow of dirty lines the block frame may encounter lines that are NOT dirty. In this case the Space Manager is also asked if there is any float damage, and if there is then the bloc...
...tion of nsBandData that is used by nsBlockReflowState to determine the available space, float impacts, and where floats are cleared. Essentially a CSS-specific wrapper for generic nsBandData. BandRect: Keeps the bounds of a band, along with the frames associated with the band. BandRects are a linked list (provided by PRCListStr super-class) and also provide some geometry-management methods (Split
Vertically, SplitHorizontally) and some methods that query or manipulate the frames associated with the band (IsOccupiedBy, AddFrame, RemoveFrame). BandList: A subclass of BandRect that provides a list interface - Head(), Tail(), IsEmpty(), etc. FrameInfo: A structure that keeps information about the rectangle associated with a specific frame, in a linked list. nsBandTrapezoid: Represents the discrete ...
...The block frame uses a helper method on the nsBlockReflowState class to do the actual computation of available space based on the dat...
Multiple Queries - Archive of obsolete content
The...
...multiple queries with RDF datasources using the simple query syntax. Here is the previous example rewritten using the simple syntax: <hbox id="photosList" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template> <rule dc:title="Canal"> <button uri="rdf:*" image="rdf:*" label="View" orient="
vertical"/> </rule> <rule> <image uri="rdf:*" src="rdf:*"/> </rule> </template> </hbox> The result to the user in this example is the same as the previous example. You can also mix simple and extended queries in one template, although you may prefer to use the same style in all queries for consistency. However, if you are going to be using a number of queries, the template builder is ...
...ve the <rule> element and place the rule's conditions directly on the <template>. There's no performance benefit, but it does save some typing. <hbox id="photosList" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template dc:title="Canal"> <button uri="rdf:*" image="rdf:*" label="View" orient="
vertical"/> </template> </hbox> This example shows only a single photo since a condition is used to filter out the other two photos. Note that in this shorthand, the query conditions are placed directly on the <template> element. << PreviousNext >> ...
Creating a Skin - Archive of obsolete content
ule above (for 'window > box') specifies that the child box of the window has a different color. This probably isn't the best way to do this. We should really change this to use a style class. Let's do this. That way, we can modify the XUL without needing to keep the box as the first child of the window. CSS: .findfilesbox { background-color: #0088CC; } XUL: <vbox class="findfilesbox" orient="
vertical" flex="100%"> <toolbox> Rounding on the Tabs Next, let's modify the tabs. We will make the selected tab bold and change the rounding on the tabs. tab:first-child { -moz-border-radius: 4px 0px 0px 0px; } tab:last-child { -moz-border-radius: 0px 4px 0px 0px; } tab[selected="true"] { color: #000066; font-weight: bold; text-decoration: underline; } Two rules change the normal tab ...
...nds on the menu. We could add some icons to the buttons to make them clearer. Mozilla Composer provides some icons for open and save buttons, which we'll just use here to save time. We can set the image for a button using the list-style-image CSS property. #opensearch { list-style-image: url("chrome://editor/skin/icons/btn1.gif"); -moz-image-region: rect(48px 16px 64px 0); -moz-box-orient:
vertical; } #savesearch { list-style-image: url("chrome://editor/skin/icons/btn1.gif"); -moz-image-region: rect(80px 16px 96px 0); -moz-box-orient:
vertical; } Mozilla provides a custom style property -moz-image-region which can be used to make an element use part of an image. You can think of it as a clip region for the image. You set the property to a position and size within an image and the...
...ns, with states for hover, active and disabled, this saves space that would normally be occupied by mutliple images. In the code above, we use the same image for each button, but set a different image region each one. If you look at this image (btn1.gif), you will notice that it contains a grid of smaller images, each one 16 by 16 pixels. The -moz-box-orient property is used to orient the button
vertically, so that the image appears above the label. This property has the same meaning as the orient attribute. This is convenient because the skin cannot change the XUL. Most of the box attributes have corresponding CSS properties. Other Changes Next, we'll make a couple of changes to the buttons along the bottom, again reusing some icons from Mozilla to save time. If creating your own skin, you wil...
Popup Menus - Archive of obsolete content
nd method is to use a tooltip element containing the content of a tooltip. This requires you to have a separate block of content for each tooltip or to have a script which sets the content. However, it does allow you to use any content besides text in a tooltip. Example 2 : Source View <button label="Save" tooltiptext="Click here to save your stuff"/> <popupset> <tooltip id="moretip" orient="
vertical" style="background-color: #33DD00;"> <description value="Click here to see more information"/> <description value="Really!" style="color: red;"/> </tooltip> </popupset> <button label="More" tooltip="moretip"/> These two buttons each have a tooltip. The first uses the default tooltip style. The second uses a custom tooltip that has a different background color and styled text. The too...
...se pointer position (at_pointer is not currently implemented with respect to the mouse pointer. It currently appears at the top of the anchor). after_pointer The popup appears at the same horizontal position as the mouse pointer but appears below the element. This is how tooltips appear (after_pointer is not currently implemented with respect to the mouse pointer. It currently offsets 21 pixels
vertically from the anchor, see Bug 619887). By adding the position attribute to a popup element, you can specify precisely where the popup appears. You cannot specify an exact pixel position. The position attribute can be used with all three popup types, although you probably would not change the value for tooltips. The example below demonstrates creating a back button with a popup menu: Example 3 : S...
...licity, we'll just replicate the contents of the Edit menu. Let's have the popup appear when clicking over the first tab panel: <popupset> <menupopup id="editpopup"> <menuitem label="Cut" accesskey="t"/> <menuitem label="Copy" accesskey="c"/> <menuitem label="Paste" accesskey="p" disabled="true"/> </menupopup> </popupset> <vbox flex="1"> . . . <tabpanel id="searchpanel" orient="
vertical" context="editpopup"> Here a simple popup that is similar to the edit menu has been added to the first tabpanel. If you right-click (Control-click on the Macintosh) anywhere on the first panel, the popup will appear. However, the popup will not appear if you click anywhere else. Note that the textbox has its own built-in popup menu which will override the one we specified. Our Find files examp...
Templates - Archive of obsolete content
is example, you will need to create a chrome package and load the file from there (you can do this easily, see Manifest Files). You can then enter the chrome URL into the browser URL field. Example 1 : Source <vbox datasources="rdf:bookmarks" ref="NC:BookmarksRoot" flex="1"> <template> <button uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name"/> </template> </vbox> Here, a
vertical box has been created that will contain a column of buttons, one for each top-level bookmark. You can see that the template contains a single button. This single button is used as a basis for all the buttons that need to be created. You can see in the image that the set of buttons has been created, one for each bookmark. Try adding a bookmark in the browser while you have the example window open.
...r all the buttons that need to be created. You can see in the image that the set of buttons has been created, one for each bookmark. Try adding a bookmark in the browser while you have the example window open. You'll notice that the buttons in the example get updated instantly. (You may have to focus the window for it to change.) Container and Datasources The template itself is placed inside a
vertical box. The box has two special attributes that allow it to be used for templates, which are used to specify where the data comes from. The first attribute on the box is the datasources attribute. This is used to declare what RDF datasource will be providing the data to create the elements. In this case, rdf:bookmarks is used. You can probably guess that this means to use the bookmarks datasource. T...
...al RDF references to the attributes on any of the elements. The example below demonstrates this. Example 2 : Source <vbox datasources="rdf:bookmarks" ref="NC:BookmarksRoot" flex="1"> <template> <vbox uri="rdf:*"> <button label="rdf:http://home.netscape.com/NC-rdf#Name"/> <label value="rdf:http://home.netscape.com/NC-rdf#URL"/> </vbox> </template> </vbox> This creates a
vertical box with a button and a label for each bookmark. The button will have the name of the bookmark and the label will have the URL. The new elements that are created are functionally no different from ones that you put directly in the XUL file. The id attribute is added to every element created through a template which is set to a value which identifies the resource. You can use this to identify the...
attribute.align - Archive of obsolete content
The pack attribute is related to the alignment but is used to specify the position in the opposite direction. ...
...The pack attribute is related to the alignment but is used to specify the position in the opposite direction. ...
...s larger than the total size of the children, the extra 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. ...
scale - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] A scale (sometimes referred to as a "slider") allows the user to select a value from a range. A bar displayed either horizontally or
vertically allows the user to select a value by dragging a thumb on the bar. Use the orient attribute to specify the orientation of the scale. The default value is horizontal which displays a horizontal scale. Lower values are to the left and higher values are to the right. Set the orient attribute to
vertical to use a
vertical scale. The user may use the arrow keys to increment and decrement the value by one unit, or the page up and page down keys to increment and decrement the value by one page, as specified by the pageincrement attribute. The home and end keys set the s...
... maximum values, respectively. A scale will fire a change event whenever the scale's value is modified. Attributes dir, disabled, increment, max, min, movetoclick, pageincrement, tabindex, value Properties disabled, max, min, increment, pageIncrement, tabIndex, value, Methods decrease, decreasePage, increase, increasePage, Examples Horizontal Scale: <scale min="1" max="10"/>
Vertical Scale: <scale min="1" max="10" orient="
vertical"/> Attributes dir Type: one of the values below The direction in which the child elements of the element are placed. normal For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for
vertical scales) For other elements, the elements are placed left to right or top to bottom in ...
...For other elements, they are placed right to left or bottom to top. This is reverse of the order in which they appear in the XUL code. disabled Type: boolean Indicates whether the element is disabled or not. ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
ns. Therefore in any grid we have two axes. The block or column axis, and the inline or row axis. 182 Grid Cell CSS Grids In a CSS Grid Layout, a grid cell is the smallest unit you can have on your CSS grid. It is the space between four intersecting grid lines and conceptually much like a table cell. 183 Grid Column CSS, CodingScripting A grid column is a
vertical track in a CSS Grid Layout, and is the space between two
vertical grid lines. It is defined by the grid-template-columns property or in the shorthand grid or grid-template properties. 184 Grid Lines CSS Grids Grid lines are created when you define tracks in the explicit grid using CSS Grid Layout. In the following example there is a grid with three column tracks and two row t...
...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 a data-interchange fo...
...ge data at any time. 502 WebVTT Audio, CodingScripting, Glossary, Video, Web, WebVTT WebVTT (Web Video Text Tracks) is a W3C specification for a file format marking up text track resources in combination with the HTML <track> element. 503 Whitespace Glossary, Lexical Grammar, whitespace Whitespace is a set of characters which is used to show horizontal or
vertical spaces between other characters. They are often used to separate tokens in HTML, CSS, JavaScript, and other computer languages. 504 World Wide Web Glossary, Infrastructure, WWW, World Wide Web The World Wide Web--commonly referred to as WWW, W3, or the Web--is an interconnected system of public webpages accessible through the Internet. The Web is not the same as the Internet:...
Styling lists - Learn web development
ts) have no set defaults for spacing. The <dl> element has a top and bottom margin of 16px (1em), but no padding set. The <dd> elements have margin-left of 40px (2.5em.) The <p> elements we've included for reference have a top and bottom margin of 16px (1em), the same as the different list types. ...
...), but no padding set. The <dd> elements have margin-left of 40px (2.5em.) The <p> elements we've included for reference have a top and bottom margin of 16px (1em), the same as the different list types. ...
...-weight: bold; } The first rule sets a sitewide font and a baseline font size of 10px. These are inherited by everything on the page. Rules 2 and 3 set relative font sizes for the headings, different list types (the children of the list elements inherit these), and paragraphs. This means that each paragraph and list will have the same font size and top and bottom spacing, helping to keep the
vertical rhythm consistent. Rule 4 sets the same line-height on the paragraphs and list items -- so the paragraphs and each individual list item will have the same spacing between lines. This will also help to keep the
vertical rhythm consistent. Rules 5 and 6 apply to the description list -- we set the same line-height on the description list terms and descriptions as we did with the paragraphs and lis...
Example 1 - Learn web development
0em; /* 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 : 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 ...
...0em; /* 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 : 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 ...
...; /* 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 : ellipsis;
vertical-align: top; } .select:after { content : "?"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; 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: ...
How to build custom form controls - Learn web development
kground : #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 { content : "?"; /* We use the unicode character U+25BC; make sure to set a charset meta tag */ position: absolute; z-index : 1; /* This will be important to keep the arrow fro...
... If it can't, the content will be truncated) */ max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2e...
... If it can't, the content will be truncated) */ max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); backgroun...
Object building practice - Learn web development
bject. Let's start by adding the following constructor to the bottom of our code. ...
... 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 radius, in pixels. This handles the properties, but what about the methods? We want to get...
...if ((this.y - this.size) <= 0) { this.velY = -(this.velY); } this.x += this.velX; this.y += this.velY; } The first four parts of the function check whether the ball has reached the edge of the canvas. If it has, we reverse the polarity of the relevant velocity to make the ball travel in the opposite direction. So for example, if the ball was traveling upwards (positive velY), then the
vertical velocity is changed so that it starts to travel downwards instead (negative velY). In the four cases, we are checking to see: if the x coordinate is greater than the width of the canvas (the ball is going off the right edge). if the x coordinate is smaller than 0 (the ball is going off the left edge). if the y coordinate is greater than the height of the canvas (the ball is going off the bo...
MathML Demo: <mo> - operator, fence, separator, or accent
Binary Operators and Relations The following table contains instances of all operators found on the SWP Binary Operations and Binary Relations panels. The symbols occur in the context of a simple expression. In general, the lspace and rspace around the relation should be greater than that around the operation. Operator and relations center
vertically on the math axis. a +- b <= c a ? b ? c a x b ? c a ? b << c a * b ? c a ? b ? c a ? b ? c a ? b ? c a o b ? c a / b ? c a ? b ? c a ? b ? c a ? b ? c a \ b ~ c a \ b ? c a ? b ? c...
... a + b ? c x d a + b ? c / d a + b ? c ? d a + b ? c * d a + b !<= c x d a + b !=> c / d a + b !<=> c ? d a + b !<-> c * d Fences LaTeX fences that begin with \left and \right are stretchy. They grow
vertically to the height and depth of the enclosed math run. This growth is continuous and symmetric. Here are examples of the standard LaTeX fences ( x ) [ y ] { 1 } < T > ? a ? ? . ? | ? | || ? || and / F / \ n \ ? R ? ? 1.0 ? ? x 2 ? ? x a 2 ? ? x ? ? M ? . Here are some examples with a bit more stretching ( k 1 2 2 ) [ k 1 2 2 ] ...
...? k 1 2 2 ? | k 1 2 2 | || k 1 2 2 || and / k 1 2 2 / \ k 1 2 2 \ ? k 1 2 2 ? ? k 1 2 2 ? ? k 1 2 2 ? ? k 1 2 2 ? ? k 1 2 2 ? ? k 1 2 2 ? Generally, it is safest to script all attributes that configure an <mo> as a fence (fence, stretchy, symmetric, lspace, rspace). This is especially important for
vertical arrows used as fences. The default attributes given in the MathML Operator Dictionary don't configure
vertical arrows as fences. In LaTeX, the lspace on a left side fence delimiter and the rspace on a right side fence delimiter is not 0. Here's an example to illustrate spacing around fences M [ M M M ] M ( M M ) M { M M } M < M M > M | M M | M M M [ M ...
nsIDOMWindow
nsIDOMWindow The window's parent window. If there is no parent window, or if the parent is of a different type, this is the current window. The window hierarchy does not cross chrome-content boundaries. Read only. scrollX long The current horizontal (x) scroll position, in pixels. This attribute is "replaceable" in JavaScript. Read only. scrollY long The current
vertical (y) scroll position, in pixels. This attribute is "replaceable" in JavaScript. Read only. scrollbars nsIDOMBarProp The object that controls whether or not scrollbars are shown in the window. This attribute is "replaceable" in JavaScript. Read only. sessionStorage nsIDOMStorage Session storage for the current browsing context. Data stored in session storage may be acc...
...ISelection getSelection(); Parameters None. Return value The nsISelection object for the window. scrollBy() Scrolls the window by a given number of pixels relative to the current scroll position. void scrollBy( in long xScrollDif, in long yScrollDif ); Parameters xScrollDif The number of pixels by which to scroll horizontally. yScrollDif The number of pixels by which to scroll
vertically. scrollByLines() Scrolls the window by the specified number of lines. void scrollByLines( in long numLines ); Parameters numLines The number of lines by which to scroll. scrollByPages() Scrolls the window by the specified number of pages. void scrollByPages( in long numPages ); Parameters numPages The number of pages by which to scroll. scrollTo() Scrolls the window t...
...croll. scrollByPages() Scrolls the window by the specified number of pages. void scrollByPages( in long numPages ); Parameters numPages The number of pages by which to scroll. scrollTo() Scrolls the window to an absolute pixel offset. void scrollTo( in long xScroll, in long yScroll ); Parameters xScroll The horizontal position to which to scroll, in pixels. yScroll The
vertical position to which to scroll, in pixels. sizeToContent() Makes the window's size fit the contents of the window. void sizeToContent(); Parameters None. See also DOM ...
AudioListener - Web APIs
or example, AudioListener.positionX, while setting the same property is done with AudioListener.positionX.value. This is why these values are not marked read only, which is how they appear in the specification's IDL. AudioListener.positionX Represents the horizontal position of the listener in a right-hand cartesian coordinate sytem. The default is 0. AudioListener.positionY Represents the
vertical position of the listener in a right-hand cartesian coordinate sytem. The default is 0. AudioListener.positionZ Represents the longitudinal (back and forth) position of the listener in a right-hand cartesian coordinate sytem. The default is 0. AudioListener.forwardX Represents the horizontal position of the listener's forward direction in the same cartesian coordinate sytem as the position (po...
... of the listener in a right-hand cartesian coordinate sytem. The default is 0. AudioListener.forwardX Represents the horizontal position of the listener's forward direction in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is 0. AudioListener.forwardY Represents the
vertical position of the listener's forward direction in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is 0. AudioListener.forwardZ Represents the longitudinal (back and forth) position of the listener's forward direction in the same cartesian coordinate sytem as the position...
...lues. The forward and up values are linearly independent of each other. The default is -1. AudioListener.upX Represents the horizontal position of the top of the listener's head in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is 0. AudioListener.upY Represents the
vertical position of the top of the listener's head in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is 1. AudioListener.upZ Represents the longitudinal (back and forth) position of the top of the listener's head in the same cartesian coordinate sytem as the position (positio...
CanvasRenderingContext2D.scale() - Web APIs
The CanvasRenderingContext2D.scale() method of the Canvas 2D API adds a scaling transformation to the canvas units horizontally and/or
vertically. By default, one unit on the canvas is exactly one pixel. A scaling transformation modifies this behavior. For instance, a scaling factor of 0.5 results in a unit size of 0.5 pixels; shapes are thus drawn at half the normal size. Similarly, a scaling factor of 2.0 increases the unit size so that one unit becomes two pixels; shapes are thus drawn at twice the normal size. Syntax void ctx.scale(x, y); Parameters x Scaling factor in the horizontal direction. A negative value flips pixels across the
vertical axis. A value of 1 results in no horizontal scaling. y Scaling factor in the
vertical direction. A negative value flips pixels across the ho...
...nit becomes two pixels; shapes are thus drawn at twice the normal size. Syntax void ctx.scale(x, y); Parameters x Scaling factor in the horizontal direction. A negative value flips pixels across the
vertical axis. 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 posit...
...as.getContext('2d'); // Scaled rectangle ctx.scale(9, 3); ctx.fillStyle = 'red'; ctx.fillRect(10, 10, 8, 20); // Reset current transformation matrix to the identity matrix ctx.setTransform(1, 0, 0, 1, 0, 0); // Non-scaled rectangle ctx.fillStyle = 'gray'; ctx.fillRect(10, 10, 8, 20); Result The scaled rectangle is red, and the non-scaled rectangle is gray. Flipping things horizontally or
vertically You can use scale(-1, 1) to flip the context horizontally and scale(1, -1) to flip it
vertically. In this example, the words "Hello world!" are flipped horizontally. Note that the call to fillText() specifies a negative x coordinate. This is to adjust for the negative scaling factor: -280 * -1 becomes 280, and text is drawn leftwards from that point. HTML <canvas id="canvas"></canvas> Jav...
Transformations - Web APIs
and the last rectangle is once again drawn in black. ScreenshotLive sample Translating The first of the transformation methods we'll look at is translate(). This method is used to move the canvas and its origin to a different point in the grid. translate(x, y) Moves the canvas and its origin on the grid. x indicates the horizontal distance to move, and y indicates how far to move the grid
vertically. It's a good idea to save the canvas state before doing any transformations. In most cases, it is just easier to call the restore method than having to do a reverse translation to return to the original state. Also if you're translating inside a loop and don't save and restore the canvas state, you might end up missing part of your drawing, because it was drawn outside the canvas edge. A tra...
...ate the canvas back to 0,0, and then draw the rectangle. <canvas id="canvas" width="300" height="200"></canvas> draw(); ScreenshotLive sample Scaling The next transformation method is scaling. We use it to increase or decrease the units in our canvas grid. This can be used to draw scaled down or enlarged shapes and bitmaps. scale(x, y) Scales the canvas units by x horizontally and by y
vertically. Both parameters are real numbers. Values that are smaller than 1.0 reduce the unit size and values above 1.0 increase the unit size. Values of 1.0 leave the units the same size. Using negative numbers you can do axis mirroring (for example using translate(0,canvas.height); scale(1,-1); you will have the well-known Cartesian coordinate system, with the origin in the bottom left corner). By d...
...ts arguments. The transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] If any of the arguments are Infinity the transformation matrix must be marked as infinite instead of the method throwing an exception. The parameters of this function are: a (m11) Horizontal scaling. b (m12) Horizontal skewing. c (m21)
Vertical skewing. d (m22)
Vertical scaling. e (dx) Horizontal moving. f (dy)
Vertical moving. setTransform(a, b, c, d, e, f) Resets the current transform to the identity matrix, and then invokes the transform() method with the same arguments. This basically undoes the current transformation, then sets the specified transform, all in one step. resetTransform() Resets the current transform to the ...
Element.clientLeft - Web APIs
Note: This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect(). ...
... Note: This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect(). ...
... 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. ...
Screen.availHeight - Web APIs
u 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 value of availHeight is approximately the value of height (the total height of the screen in CSS pixels) minus the heights of the Dock and menu bar, as seen in the diagram below. Example If your web application needs to open a new window, such as a tool palette which can contain...
...ttom of screen (which is the default), the value of availHeight is approximately the value of height (the total height of the screen in CSS pixels) minus the heights of the Dock and menu bar, as seen in the diagram below. Example If your web 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 w...
...indow'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 filling all available
vertical space at the left of the screen. On a Windows system, this would function similarly, by opening the window and sizing it
vertically so it uses all available
vertical space, leaving room for the taskbar and any other interface elements that reserve space. Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'Screen.avail...
Rendering and the WebXR frame animation callback - Web APIs
ou've called the XRSession method requestAnimationFrame() since the last time the screen refreshed, the browser will call your frame renderer callback every time it's ready to repaint your app or site window. In this context, "repaint" simply means the process of ensuring that the screen's displayed content matches what the DOM and the elements within are trying to present at the moment. Hardare
vertical refresh rate When the browser is ready to refresh the <canvas> within which your WebXR content is displayed, it calls your frame rendering callback, which uses the specified timestamp and any other relevant data, such as models and textures, as well as application state, to render the scene--as it should appear at the specified time--into the WebGL backbuffer. When your callback returns, the bro...
...t's changed since the last time the screen was refreshed. Historically, displays have refreshed 60 times per second. This is due to early displays using the AC electrical grid's current flow waveform, which cycles 60 times per second in the United States (50 in Europe), for timing purposes. This figure goes by a number of different names, but they're all equivalent or nearly so: Refresh rate
Vertical refresh rate
Vertical blanking rate (VBL)
Vertical sync rate
Vertical refresh rate There are other similar terms used as well, but regardless of what it's called, the unit of measurement applied is the Hertz, or Hz. A display that refreshes 60 times per second has a 60 Hz refresh rate. That means that the maximum number of frames it can display in a second is 60. No matter how many frames pe...
...thing will be fine. Renderer performance concerns Clearly, you have very little time to render your scene each frame. Not only that, but if your renderer itself runs longer than that amount of time, you can cause not just the frame to get dropped, but that time to be wasted entirely, blocking other code from getting to run at all for that frame. Not only that, but if your rendering crosses the
vertical refresh boundary, you can wind up with a tearing effect. Tearing occurs when the the display hardware starts the next refresh cycle while the previous frame is still being drawn to the screen. As a result, you wind up with the visual effect of the top part of the screen showing the new frame, while the bottom part of the frame shows some combination of the previous frame and possibly even the fra...
Window.open() - Web APIs
g. 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. The height value includes the height of the horizontal scrollbar if present. The height value does not include other UI parts such as location bar, title bar, t...
.... 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, window horizontal scrollbar (if present) and top and bottom window resizing borders. Minimal required value is 100. Toolbar and UI parts features In mode...
...s a status bar. If windowFeatures is non-empty, status detaults to off. resizable If this feature is on, the new secondary window will be resizable. If windowFeatures is non-empty, resizable detaults to on. Tip: For accessibility reasons, it is strongly recommended to set this feature always on scrollbars If this feature is on, the new secondary window will show horizontal and/or
vertical scrollbar(s) if the document doesn't fit into the window's viewport. If windowFeatures is non-empty, scrollbars detaults to off. See note on scrollbars. Tip: For accessibility reasons, it is strongly encouraged to set this feature always on Window functionality features noopener If this feature is set, the newly-opened window will open as normal, except that it will not have ac...
-webkit-mask-position-y - CSS: Cascading Style Sheets
The -webkit-mask-position-y CSS property sets the initial
vertical position of a mask image. /* Keyword values */ -webkit-mask-position-y: top; -webkit-mask-position-y: center; -webkit-mask-position-y: bottom; /* <percentage> values */ -webkit-mask-position-y: 100%; -webkit-mask-position-y: -50%; /* <length> values */ -webkit-mask-position-y: 50px; -webkit-mask-position-y: -1cm; /* Multiple values values */ -webkit-mask-position-y: 50px, 25%, -3em; /* Global values */ -webkit-mask-position-y: inherit; -webkit-mask-position-y: initial; -webkit-mask-position-y: unset; Initial value0%Applies toall elementsInheritednoPercentagesrefer to the size of the box itselfComputed valuefor <length> the absolute value, otherwise a percentageAnimation typediscrete Syntax Values <length-perc...
...webkit-mask-position-y: unset; Initial value0%Applies toall elementsInheritednoPercentagesrefer to the size of the box itselfComputed valuefor <length> the absolute value, otherwise a percentageAnimation typediscrete Syntax Values <length-percentage> A length indicating the position of the top side of the image relative to the box's top padding edge. Percentages are calculated against the
vertical dimension of the box padding area. A value of 0% means the top edge of the image is aligned with the box's top padding edge and a value of 100% means the bottom edge of the image is aligned with the box's bottom padding edge. top Equivalent to 0%. bottom Equivalent to 100%. center Equivalent to 50%. Formal definition Initial value0%Applies toall elementsInheritednoPercentagesrefer to the...
...t to 0%. bottom Equivalent to 100%. center Equivalent to 50%. Formal definition Initial value0%Applies toall elementsInheritednoPercentagesrefer to the size of the box itselfComputed valuefor <length> the absolute value, otherwise a percentageAnimation typediscrete Formal syntax [ <length-percentage> | top | center | bottom ]#where <length-percentage> = <length> | <percentage> Examples
Vertically positioning a mask image .exampleOne { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: bottom; } .exampleTwo { -webkit-mask-image: url(mask.png); -webkit-mask-position-y: 25%; } Specifications Not part of any standard. ...
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
different method to the floated method shown above to layout a set of cards. Using display: inline-block is an alternate method. Once again I can use feature queries to overwrite a layout that uses display: inline-block, and again I don't need to overwrite everything. An item that is set to inline-block becomes a grid item, and so the behaviour of inline-block no longer applies. ...
...er { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; margin: 0 auto; } .wrapper li { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper ul { margin: 0 -10px; padding: 0; list-style: none; } .wrapper li { display: inline-block;
vertical-align: top; width: calc(33.333333% - 20px); margin: 0 10px 20px 10px; } @supports (display: grid) { .wrapper ul { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; margin: 0; } .wrapper li { width: auto; margin: 0; } } <div class="wrapper"> <ul> <li class="card"> <h2>One</h2> ...
...t to display: table-cell, and then in a feature query change the parent to display: grid, this anonymous box creation will not happen. This means you can overwrite display: table based layouts, without having additional anonymous boxes. Floated elements As we have already seen, float and also clear have no effect on a grid item. Therefore you do not need to explicitly set items to float: none.
Vertical alignment The alignment property
vertical-align has no effect on a grid item. In layouts using display: inline-block or display: table, you might use the
vertical-align property to perform basic alignment. In your grid layout you then have the far more powerful box alignment properties. Multiple-column layout You can also use multiple column layout as your legacy browser plan, as the column-* ...
Layout and the containing block - CSS: Cascading Style Sheets
ontaining block (on screens, the viewport). Thus, the paragraph's dimensions change based on the size of the browser window. ...
... <body> <section> <p>This is a paragraph!</p> </section> </body> body { background: beige; } section { ...
... <body> <section> <p>This is a paragraph!</p> </section> </body> body { background: beige; } section { transform: rotate(0deg); width: 400px; height: 160px; b...
background-position - CSS: Cascading Style Sheets
The background-position property is specified as one or more <position> values, separated by commas. Values <position> A <position>. A position defines an x/y coordinate, to place an item relative to the edges of an element's box. It can be defined using one to four values. If two non-keyword values are used, the first value represents the horizontal position and the second represents the
vertical position. If only one value is specified, the second value is assumed to be center. If three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). 1-value syntax: the value may be: The keyword value center, which centers the image. One of the keyword values top, left, bottom, right. This specifies an edge against which to place the item. T...
...round image is aligned with the corresponding left (or top) edge of the container, or the 0% mark of the image will be on the 0% mark of the container. A value of 100% means that the right (or bottom) edge of the background image is aligned with the right (or bottom) edge of the container, or the 100% mark of the image will be on the 100% mark of the container. Thus a value of 50% horizontally or
vertically centers the background image as the 50% of the image will be at the 50% mark of the container. Similarly, background-position: 25% 75% means the spot on the image 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 subtract...
...fect because the "container-image difference" will be zero. You will need to offset using absolute values. Formal definition Initial value0% 0%Applies toall elements. ...
block-size - CSS: Cascading Style Sheets
The block-size CSS property defines the horizontal or
vertical size of an element's block, depending on its writing mode. It corresponds to either the width or the height property, depending on the value of writing-mode. 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. ...
...ub.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(); ...
...tion typea length, percentage or calc(); Syntax Values The block-size property takes the same values as the width and height properties. Formal definition Initial valueautoApplies tosame as width and heightInheritednoPercentagesblock-size of containing blockComputed valuesame as width and heightAnimation typea length, percentage or calc(); Formal syntax <'width'> Examples Block size with
vertical text HTML <p class="exampleText">Example text</p> CSS .exampleText { writing-mode:
vertical-rl; background-color: yellow; block-size: 200px; } Result Specifications Specification Status Comment CSS Logical Properties and Values Level 1The definition of 'block-size' in that specification. Editor's Draft Initial definition ...
border-end-end-radius - CSS: Cascading Style Sheets
ntal-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.InheritednoPercentagesrefer to the corresponding dimension ...
...he behavior on internal table elements is undefined for the moment.. ...
... Editor's Draft Initial definition. ...
border-end-start-radius - CSS: Cascading Style Sheets
izontal-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.InheritednoPercentagesrefer to the corresponding dimension ...
...he behavior on internal table elements is undefined for the moment.. ...
... Editor's Draft Initial definition. ...
border-start-end-radius - CSS: Cascading Style Sheets
ontal-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.InheritednoPercentagesrefer to the corresponding dimension ...
...he behavior on internal table elements is undefined for the moment.. ...
... Editor's Draft Initial definition. ...
border-start-start-radius - CSS: Cascading Style Sheets
rizontal-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.InheritednoPercentagesrefer to the corresponding dimension ...
...he behavior on internal table elements is undefined for the moment.. ...
... Editor's Draft Initial definition. ...
border-top-left-radius - CSS: Cascading Style Sheets
property is not set in a border-radius shorthand property that is applied to the element after the border-top-left-radius CSS property, the value of this property is then reset to its initial value by the shorthand property. Syntax /* the corner is a circle */ /* border-top-left-radius: radius */ border-top-left-radius: 3px; /* the corner is an ellipse */ /* border-top-left-radius: horizontal
vertical */ border-top-left-radius: 0.5em 1em; border-top-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 is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner. the second value is a <lengt...
...1em; border-top-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 is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner. ...
...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.. ...
border-top-right-radius - CSS: Cascading Style Sheets
perty is not set in a border-radius shorthand property that is applied to the element after the border-top-right-radius CSS property, the value of this property is then reset to its initial value by the shorthand property. Syntax /* the corner is a circle */ /* border-top-right-radius: radius */ border-top-right-radius: 3px; /* the corner is an ellipse */ /* border-top-right-radius: horizontal
vertical */ border-top-right-radius: 0.5em 1em; border-top-right-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 is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner. the second value is a <len...
...em; border-top-right-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 is a <length> or a <percentage> denoting the horizontal semi-major axis of the ellipse to use for the border in that corner. ...
...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.. ...
box-align - CSS: Cascading Style Sheets
t of the property is only visible if there is extra space in the box. See flexbox for information about the current standard. /* Keyword values */ box-align: start; box-align: center; box-align: end; box-align: baseline; box-align: stretch; /* Global values */ box-lines: inherit; box-lines: initial; box-lines: unset; The direction of layout depends on the element's orientation: horizontal or
vertical. Syntax The box-align property is specified as one of the keyword values listed below. Values start The box aligns contents at the start, leaving any extra space at the end. center The box aligns contents in the center, dividing any extra space equally between the start and the end. end The box aligns contents at the end, leaving any extra space at the start. baseline The box aligns ...
...ving any extra space at the start. baseline The box aligns the baselines of the contents (lining up the text). This only applies if the box's orientation is horizontal. stretch The box stretches the contents so that there is no extra space in the box. Notes The edge of the box designated the start for alignment purposes depends on the box's orientation: Horizontal top
Vertical left The edge opposite to the start is designated the end. If the alignment is set using the element's align attribute, then the style is ignored. Formal definition Initial valuestretchApplies toelements with a CSS display value of box or inline-boxInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax start | center | end | baseline | stretch Examples Setting ...
...ample { 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; /* WebKit */ /* Pack children to the bottom of...
box-pack - CSS: Cascading Style Sheets
fy how a -moz-box or -webkit-box packs its contents in the direction of its layout. The effect of this is only visible if there is extra space in the box. /* Keyword values */ box-pack: start; box-pack: center; box-pack: end; box-pack: justify; /* Global values */ box-pack: inherit; box-pack: initial; box-pack: unset; The direction of layout depends on the element's orientation: horizontal or
vertical. Syntax The box-pack property is specified as one of the keyword values listed below. Values start The box packs contents at the start, leaving any extra space at the end. center The box packs contents in the center, dividing any extra space equally between the start and the end. end The box packs contents at the end, leaving any extra space at the start. justify The space is divided...
...y The space is divided evenly in-between each child, with none of the extra space placed before the first child or after the last child. If there is only one child, treat the value as if it were start. Notes The edge of the box designated the start for packing purposes depends on the box's orientation and direction: Normal Reverse Horizontal left right
Vertical top bottom The edge opposite to the start is designated the end. If the packing is set using the element's pack attribute, then the style is ignored. Formal definition Initial valuestartApplies toelements with a CSS display value of -moz-box, -moz-inline-box, -webkit-box or -webkit-inline-boxInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax start | center...
...yntax 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-pack: end; /* WebKit */ } div.example p { ...
cursor - CSS: Cascading Style Sheets
, and the user can't interact with the interface (in contrast to progress). Sometimes an image of an hourglass or a watch. Selection cell The table cell or set of cells can be selected. crosshair Cross cursor, often used to indicate selection in a bitmap. text The text can be selected. Typically the shape of an I-beam.
vertical-text The
vertical text can be selected. Typically the shape of a sideways I-beam. Drag & drop alias An alias or shortcut is to be created. copy Something is to be copied. move Something is to be moved. no-drop An item may not be dropped at the current location. bug 275173: On Windows and Mac OS X...
...d to be moved). grabbing Something is being grabbed (dragged to be moved). Resizing & scrolling all-scroll Something can be scrolled in any direction (panned). bug 275174: On Windows, all-scroll is the same as move. col-resize The item/column can be resized horizontally. Often rendered as arrows pointing left and right with a
vertical bar separating them. row-resize The item/row can be resized
vertically. Often rendered as arrows pointing up and down with a horizontal bar separating them. n-resize Some edge is to be moved. For example, the se-resize cursor is used when the movement starts from the south-east corner of the box. In some environments, an equivalent bidirectional resi...
...lly just be ignored. Check the Browser compatibility table for any notes on cursor size limits. ...
inline-size - CSS: Cascading Style Sheets
The inline-size CSS property defines the horizontal or
vertical size of an element's block, depending on its writing mode. It corresponds to either the width or the height property, depending on the value of writing-mode. 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. ...
.../interactive-examples and send us a pull request. Syntax /* <length> values */ inline-size: 300px; inline-size: 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 heightInheritednoPercentagesinli...
...ues 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 Initial definition ...
mask-repeat - CSS: Cascading Style Sheets
The mask-repeat CSS property sets how mask images are repeated. A mask image can be repeated along the horizontal axis, the
vertical axis, both axes, or not repeated at all. ...
... The mask-repeat CSS property sets how mask images are repeated. A mask image can be repeated along the horizontal axis, the
vertical axis, both axes, or not repeated at all. ...
...Here is an explanation of how each option works for either direction: repeat The image is repeated as much as needed to cover the whole mask painting area. The last image will be clipped if it doesn't fit. space The image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace...
min-block-size - CSS: Cascading Style Sheets
It corresponds to either the min-width or the min-height property, depending on the value of writing-mode. 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. ...
...ctive-examples and send us a pull request. Syntax /* <length> values */ 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...
...he 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. Editor's Draft Initial definition ...
min-inline-size - CSS: Cascading Style Sheets
It corresponds to either the min-width or the min-height property, depending on the value of writing-mode. 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. ...
...mples and send us a pull request. Syntax /* <length> values */ min-inline-size: 100px; min-inline-size: 5em; /* <percentage> values */ 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 an...
...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, percentage or calc(); Formal syntax <'min-width'> Examples Setting minimum inline size for
vertical text HTML <p class="exampleText">Example text</p> CSS .exampleText { writing-mode:
vertical-rl; background-color: yellow; block-size: 5%; min-inline-size: 200px; } Result Specifications Specification Status Comment CSS Logical Properties and Values Level 1The definition of 'min-inline-size' in that specification. Editor's Draft Initial definitio...
<col> - HTML: Hypertext Markup Language
character to align the cells in a column on. Typical values for this include a period (.) when attempting to align numbers or monetary values. If align is not set to char, this attribute is ignored. charoff This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute. valign This attribute specifies the
vertical alignment of the text within each cell of the column. Possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the ...
...it on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the cell as it is possible; middle, which will center the text in the cell; and top, which will put the text as close to the top of the cell as it is possible. ...
... 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. ...
<img>: The Image Embed element - HTML: Hypertext Markup Language
for an example. width The intrinsic width of the image in pixels. Must be an integer without a unit. usemap The partial URL (starting with #) of an image map associated with the element. Note: You cannot use this attribute if the <img> element is inside an <a> or <button> element. Deprecated attributes align Aligns the image with its surrounding context. ...
... unit. usemap The partial URL (starting with #) of an image map associated with the element. Note: You cannot use this attribute if the <img> element is inside an <a> or <button> element. Deprecated attributes align Aligns the image with its surrounding context. Use the float and/or
vertical-align CSS properties instead of this attribute. Allowed values: top Equivalent to
vertical-align: top or
vertical-align: text-top middle Equivalent to
vertical-align: -moz-middle-with-baseline bottom The default, equivalent to
vertical-align: unset or
vertical-align: initial left Equivalent to float: left right Equivalent to float: right border The width of a border around the image. Use the border CSS property instead. hspace The number of pixels of white s...
...erty instead. Styling with CSS <img> is a replaced element; it has a display value of inline by default, but its default dimensions are defined by the embedded image's intrinsic values, like it were inline-block. You can set properties like border/border-radius, padding/margin, width, height, etc. on an image. <img> has no baseline, so when images are used in an inline formatting context with
vertical-align: baseline, the bottom of the image will be placed on the text baseline. You can use the object-position property to position the image within the element's box, and the object-fit property to adjust the sizing of the image within the box (for example, whether the image should fit the box or fill it even if clipping is required). Depending on its type, an image may have an intrinsic width ...
<table>: The Table element - HTML: Hypertext Markup Language
e a similar effect, use the CSS border shorthand property. cellpadding This attribute defines the space between the content of a cell and its border, displayed or not. If the cellpadding's length is defined in pixels, this pixel-sized space will be applied to all four sides of the cell's content. If the length is defined using a percentage value, the content will be centered and the total
vertical space (top and bottom) will represent this value. The same is true for the total horizontal space (left and right). To achieve a similar effect, apply the border-collapse property to the <table> element, with its value set to collapse, and the padding property to the <td> elements. cellspacing This attribute defines the size of the space between two cells in a percentage value or pixels...
.... The same is true for the total horizontal space (left and right). To achieve a similar effect, apply the border-collapse property to the <table> element, with its value set to collapse, and the padding property to the <td> elements. cellspacing This attribute defines the size of the space between two cells in a percentage value or pixels. The attribute is applied both horizontally and
vertically, to the space between the top of the table and the cells of the first row, the left of the table and the first column, the right of the table and the last 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 en...
...This is typically indicated by the presence of the colspan and rowspan attributes. Ideally, consider alternate ways to present the table's content, including breaking it apart into a collection of smaller, related tables that don't have to rely on using the colspan and rowspan attributes. In addition to helping people who use assistive technology understand the table's content, this may als...
<tr>: The Table Row element - HTML: Hypertext Markup Language
divided into 100 cents), you would typically specify a value of 2, so that in tandem with char being set to ".", the values in a column would be cleanly aligned on the decimal points, with the number of cents properly displayed to the right of the decimal point. This attribute is obsolete, and was never widely supported anyway. valignObsolete since HTML5 A DOMString specifying the
vertical alignment of the text within each cell in the row. Possible values for this attribute are: baseline Aligns each cell's content text as closely as possible to the bottom of the cell, handling alignment of different fonts and font sizes by aligning the characters along the baseline of the font(s) used in the row. If all of the characters in the row are the same size, the effect is the same a...
... possible to the bottom of the cell, handling alignment of different fonts and font sizes by aligning the characters along the baseline of the font(s) used in the row. If all of the characters in the row are the same size, the effect is the same as bottom. bottom, Draws the text in each of the row's cells as closely as possible to the bottom edge of those cells. middle Each cell's text is
vertically centered. top Each cell's text is drawn as closely as possible to the top edge of the containing cell. Don't use the obsolete valign attribute. Instead, add the CSS
vertical-align property to the row. Examples See <table> for examples on <tr>. Basic example This simple example shows a table listing people's names along with various information about membership in a club or se...
... solid black; font: 16px "Open Sans", Helvetica, Arial, sans-serif; border-spacing: 0; border-collapse: collapse; } Here we've added the border-spacing and border-collapse properties to eliminate spacing between cells and collapse borders that touch one another to be a single border instead of winding up with double borders. th, td { border: 1px solid black; padding:4px 6px; } th {
vertical-align: bottom; } And here are the default styles for all table cells. Now let's customize! The top header: overall We're going to look at the top header in two pieces. First, the overall styling of the header: thead > tr { background-color: rgb(228, 240, 245); } thead > tr:nth-of-type(2) { border-bottom: 2px solid black; } This sets the background color of all <tr> elements in the table...
MathML attribute reference - MathML
h <mpadded> Sets or increments the depth. See length. dir <math>, <mi>, <mo>, <mrow>, <ms>, <mtext> The text direction. Possible values are either ltr (left to right) or rtl (right to left). display <math> Specifies the rendering mode. The values block and inline are allowed. displaystyle <mstyle>, <mtable> 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. Unimplemented edge <malignmark> Unimplemented equalcolumns <mtable> A Boolean value indicating whether to force all columns to have the same total height. Unimplemented equalrows <mtable> A Boolean value indicating whether to force all rows to...
...lignment 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-negative integer value that indicates on how many rows does the cell extend. rspace <mo> The amount of space after the operator. rquote <ms> The closing quote mark (depend...
...hift <mmultiscripts>, <msub>, <msubsup> The minimum space by which to shift the subscript below the baseline of the expression. supscriptshift <mmultiscripts>, <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 ...
<mtable> - MathML
allows you to create tables or matrices. Inside a <mtable> only <mtr> and <mtd> elements may appear. These elements are similar to <table> , <tr> and <td> elements of HTML. Note: The <mtable> element resets the displaystyle attribute to false. If you want to use this element as an inline-block, you might want to set <mtable displaystyle="true">...</mtable>. Attributes align Specifies the
vertical alignment of the table with respect to its environment. Possible values are: axis (default): The
vertical center of the table aligns on the environment's axis (typically the minus sign). baseline: The
vertical center of the table aligns on the environment's baseline. bottom: The bottom of the table aligns on the environments baseline. center: See baseline. top: The top of the table a...
... 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 to have the same total height. false is default. Unimplemented equalrows A Boolean value indicating ...
...d frame. groupalign Unimplemented href Used to set a hyperlink to a specified URI. 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. Unimplemented minlabelspacing A length value specifing the minimum space between a label and the adjacent cell in the row. rowalign Specifies the
vertical alignment of the cells. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowalign="top bottom axis"). Possible values are: axis, baseline (default), bottom, center and top. rowlines Specifies row borders. Multiple values separated by space are allowed and apply to the corresponding rows (e.g. rowlines="none none solid"). Possible values are: none (default...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
shift clip clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering cursor direction display dominant-baseline enable-background fill fill-opacity fill-rule filter flood-color flood-opacity font-family font-size font-size-adjust font-stretch 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 solid-color solid-opacity 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 unicod...
...res. Value: see css font-variant; Animatable: Yes font-weight It specifies the weight (or boldness) of the font. Value: normal|bold|lighter|bolder|100|200|300|400|500|600|700|800|900; Animatable: Yes glyph-orientation-horizontal Deprecated since SVG 2 It controls glyph orientation when the inline-progression-direction is horizontal. Value: <angle>|inherit; Animatable: No glyph-orientation-
vertical Deprecated since SVG 2 It controls glyph orientation when the inline-progression-direction is
vertical. Value: auto|<angle>|inherit; Animatable: No image-rendering It provides a hint to the browser about how to make speed vs. quality tradeoffs as it performs image processing. Value: auto|optimizeQuality|optimizeSpeed; Animatable: Yes kerning Deprecated since SVG 2 It indicates whether the ...
...mit 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; Animatable: Yes text-decoration Sets the appearance of decorative lines on text. Value: none|underline|overline|line-through|blink|inherit; Animatable: Yes text-rendering Hints about what tradeoffs to make as the browser renders text. Value: auto|optimizeSpeed|optimizeLegibility|geometricPrecision|inherit; Animatable: Yes transf...
refY - SVG: Scalable Vector Graphics
tio attributes. Percentage values are interpreted as being a percentage of the viewBox height. <number> Numbers are interpreted as being in the coordinate system of the marker contents, after application of the viewBox and preserveAspectRatio attributes. top The reference point of the marker is placed at the top edge of the shape. center The reference point of the marker is placed at the
vertical center of the shape. bottom The reference point of the marker is placed at the bottom edge of the shape. symbol For <symbol>, refY defines the y coordinate of the symbol, which is defined by the cumulative effect of the y attribute and any transformations on the <symbol> and its host <use> element. Unlike other positioning attributes, refY is interpreted as being in the coordinate system of...
...>, refY defines the y coordinate of the symbol, which is defined by the cumulative effect of the y attribute and any transformations on the <symbol> and its host <use> element. Unlike other positioning attributes, refY is interpreted as being in the coordinate system of the symbol contents, after application of the viewBox and preserveAspectRatio attributes. If the attribute is not specified, no
vertical adjustment is made, and the top side of the symbol's rectangular viewport region (regardless of the viewBox coordinate) is positioned at the y coordinate. For backwards compatibility, the behavior when refY is not specified on a <symbol> element is different from when it is specified with a value of 0, and therefore different from the behavior when an equivalent attribute is not specified on a <...
...tio attributes. Percentage values are interpreted as being a percentage of the viewBox height. <number> Numbers are interpreted as being in the coordinate system of the marker contents, after application of the viewBox and preserveAspectRatio attributes. top The reference point of the marker is placed at the top edge of the shape. center The reference point of the marker is placed at the
vertical center of the shape. bottom The reference point of the marker is placed at the bottom edge of the shape. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'refY' in that specification. Candidate Recommendation Added keywords left, center, and right. Scalable Vector Graphics (SVG) 2The definition of 'refY' ...
panel - Archive of obsolete content
an object which specifies where in the window the panel should be shown. The rest of this section describes this object. The position object has one or more of the following properties: top, right, bottom and left. Their values are expressed in pixels. Any other properties will be ignored. ...
... expressed in pixels. Any other properties will be ignored. ...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
page. I wanted center column content to appear first in browsers that got the un-styled version. With floats, either the left column or the right column 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 f...
...n 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 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 automat...
CSS3 - Archive of obsolete content
w elements should be resized. Support for the CSS text-overflow property defining how text overflows, if needed. At risk: due to insufficient browser support, the 2-value syntax of this property as well as the support for <string> values may be postponed to the next iteration of this module. The ability to define the hotspot of a cursor as well as the new none, context-menu, cell,
vertical-text, alias, copy, no-drop, not-allowed, nesw-resize, nwse-resize, col-resize, row-resize, all-scroll, zoom-in, zoom-out, extending the cursor property. The ability to specify the sequential navigation order (that is the tabbing order ) using the CSS nav-index, nav-up, nav-right, nav-left, nav-down properties. At risk: due to insufficient browser support, standardization of the navigat...
...endation Adds: The initial, unset values for properties. The CSS all property. The scoping mechanism. Clarifies: Interaction of media-dependent @import statements and style sheet loading requirements. CSS Writing Modes Module Level 3 Proposed Recommendation Defines the writing modes of both horizontal and
vertical scripts and clarifies how the CSS direction and unicode-bidi properties interact with the new CSS text-orientation property, and extends them where needed. CSS Counter Styles Level 3 Candidate Recommendation Testing modules CSS Images Module Level 3 Candidate Recommendation Defines the <image> data type. Extends the url() syntax ...
align - Archive of obsolete content
<< XUL Reference home align Type: one of the values below The align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children. For boxes that have horizontal orientation, it specifies how its children will be aligned
vertically. For boxes that have
vertical orientation, it specifies how its children will be aligned horizontally. start Child elements are aligned starting from the left or top edge of the box. If the box is larger than the total size of the children, the extra space is placed on the right or bottom side. center Extra space is split equally along each side of the child elements, resulti...
...r 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 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 ...
pack - Archive of obsolete content
The align attribute is used to specify the position in the opposite direction. ...
...The align attribute is used to specify the position in the opposite direction. ...
Positioning - Archive of obsolete content
be dismissed again just by clicking in the same place. If a context menu was opened via the keyboard only, the menu will appear at the top left corner of the document, or underneath the currently selected item if a list is focused. Context menus will always appear in this location, and not respect any position attribute value. Tooltips will always appear near the current mouse position, offset
vertically by a small amount. The position attribute The position of all types of popups can be controlled in two ways. First, the position can be specified when using the popup's openPopup method. This is used when a popup is opened by a script. Second, the position can be specified using several attributes placed on the menupopup, panel or tooltip element. These attributes are described below and func...
..._after The bottom side of the popup is aligned with the bottom side of the anchor, and the left side of the popup is aligned along the right side of the anchor. Equivalent to bottomright bottomleft overlap The upper left corner of the popup is placed at the upper left corner of the anchor. Equivalent to topleft topleft after_pointer The popup appears
vertically offset a few pixels from the mouse pointer (after_pointer is not currently implemented with respect to the mouse pointer. It currently offsets 21 pixels
vertically from the anchor, see Bug 619887). Roughly equivalent to topleft topleft with the additional consideration of the offset mentioned. If the menupopup did not have a position attribute, the popup would appear at its defa...
Adding more elements - Archive of obsolete content
="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 given an explicit width of 10 pixels each. 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. This is because they are inside horizontal boxes. In might be more appropriate if the Find and Cancel buttons always stayed along the bottom of the window. This is easy to do by adding a spacer in between the two horizontal boxes. <spacer style="height: 10px"/> <hbox> <menulist id="searchtype"> <menupopup> <menuitem label="Name"/> <menuitem la...
...led look, suitable for the current theme. Let us change the box into a groupbox: <groupbox orient="horizontal"> <caption label="Search Criteria"/> <menulist id="searchtype"> . . . <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </groupbox> There are other cosmetic problems as well. We could also have the groupbox grow so that it extends
vertically to the bottom of the box. Also, we could modify some of the margins so that the elements are positioned better. We will see more examples of the box model and some of its features as we continue to add elements throughout the tutorial. Find files example so far Source View Next, we will look at how to create stacks. << PreviousNext >> ...
Anonymous Content - Archive of obsolete content
ome://global/skin/images/dropbox.jpg"/> </menu> includes Attribute In some cases, you may wish to only include specific types of content and not others. Or, you may wish to place different types of content in different places. The includes attribute can be used to allow only certain elements to appear in the content. Its value should be set to a single tag name, or to a list of tags separated by
vertical bars (the | symbol). <children includes="button"/> This line will add all buttons that are children of the bound element in place of the children tag. Other elements will not match this tag. You can place multiple children elements in a binding to place different types of content in different places. If an element in the XUL does not match any of the children elements, that element (and any othe...
...h are the two images. The inner box with the border has one child, the children tag. This is an important distinction when using the DOM with XBL. This also applies to CSS selector rules. Multiple Children Elements You can also use multiple children elements and have certain elements be placed in one location and other elements placed in another. By adding a includes attribute and setting it to a
vertical bar-separated list of tags, you can make only elements in that list be placed at that location. For example, the following XBL will cause text labels and buttons to appear in a different location than other elements: Source <binding id="navbox"> <content> <xul:vbox> <xul:label value="Labels and Buttons"/> <children includes="label|button"/> </xul:vbox> <xul:vbox> <...
Grids - Archive of obsolete content
and keypresses are sent only to the set on top. This is why the columns were declared after the rows in the above example. If the columns has been placed first, the rows would have grabbed the events and you would not be able to type into the fields. Flexibility of grids One advantage that grids have over a set of nested boxes is that you can create cells that are flexible both horizontally and
vertically. You can do this by putting a flex attribute on both a row and a column. The following example demonstrates this: Example 4 : Source View <grid flex="1"> <columns> <column flex="5"/> <column/> <column/> </columns> <rows> <row flex="10"> <button label="Cherry"/> <button label="Lemon"/> <button label="Grape"/> </row> <row flex="1"> <button label="Strawberry"/> ...
...on label="Cherry"/> <button label="Lemon"/> <button label="Grape"/> </row> <row flex="1"> <button label="Strawberry"/> <button label="Raspberry"/> <button label="Peach"/> </row> </rows> </grid> The first column and both rows have been made flexible. This will result in every cell in the first column being flexible horizontally. In addition, every cell will be flexible
vertically because both rows are flexible, although the first row is more so. The cell in the first column and first row (the Cherry button) will be flexible by a factor of 5 horizontally and flexible by a factor of 10
vertically. The next cell, (Lemon) will only be flexible
vertically. The flex attribute has also been added to the grid element so that the entire grid is flexible, otherwise it would only...
Groupboxes - Archive of obsolete content
e groupbox example The example below shows a simple groupbox: Example 1 : Source View <groupbox> <caption label="Answer"/> <description value="Banana"/> <description value="Tangerine"/> <description value="Phone Booth"/> <description value="Kiwi"/> </groupbox> This will cause four pieces of text to be displayed surrounded by a box with the label Answer. Note that the groupbox has a
vertical orientation by default which is necessary to have the text elements stack in a single column. More complex captions You can also add child elements inside the caption element to create a more complex caption. For example, Mozilla's Font preferences panel uses a drop-down menu as a caption. Although any content can be used, usually you would use a checkbox or dropdown menu. Example 2 : Source View...
...xample, a checkbox has been used as a caption. We might use a script to enable and disable the contents of the groupbox when the checkbox is checked and unchecked. The groupbox contains a horizontal box with a label and textbox. Both the textbox and groupbox have been made flexible so the textbox expands when the window is expanded. The additional checkbox appears below the textbox because of the
vertical orientation of the groupbox. We'll add a groupbox to the find files dialog in the next section. Radio Groups You can use the radiogroup element to group radio elements together. The radiogroup is a type of box. You can put any element you want inside it, and apart from its special handling of radio buttons, it works like any other box. Any radio buttons placed inside the radio group will be group...
Localization - Archive of obsolete content
</menupopup> </menu> </menubar> <toolbar id="findfiles-toolbar"> <toolbarbutton id="opensearch" label="&openCmdToolbar.label;"/> <toolbarbutton id="savesearch" label="&saveCmdToolbar.label;"/> </toolbar> </toolbox> <tabbox> <tabs> <tab label="&searchTab;" selected="true"/> <tab label="&optionsTab;"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="
vertical" context="editpopup"> <description> &findDescription; </description> <spacer class="titlespace"/> <groupbox orient="horizontal"> <caption label="&findCriteria;"/> <menulist id="searchtype"> <menupopup> <menuitem label="&type.name;"/> <menuitem label="&type.size;"/> <menuitem label="&type.date;"/> </menupopup> </menulist>...
...t" flex="1" editable="true" datasources="file:///mozilla/recents.rdf" ref="http://www.xulplanet.com/rdf/recent/all"> <template> <menupopup> <menuitem label="rdf:http://www.xulplanet.com/rdf/recent#Label" uri="rdf:*"/> </menupopup> </template> </menulist> </groupbox> </tabpanel> <tabpanel id="optionspanel" orient="
vertical"> <checkbox id="casecheck" label="&casesensitive;"/> <checkbox id="wordscheck" label="&matchfilename;"/> </tabpanel> </tabpanels> </tabbox> <tree id="results" style="display: none;" flex="1"> <treecols> <treecol id="name" label="&results.filename;" flex="1"/> <treecol id="location" label="&results.location;" flex="2"/> <treecol id="size" label="&results.size;...
More Button Features - Archive of obsolete content
attribute to the value reverse, the image will be placed on the right side of the text. By using the value normal, or leaving the attribute out entirely, the image will be placed on the left side of the text. The orient attribute can be used to place the image above or below the text. The default value is horizontal which is used to place the image on the left or right. You can also use the value
vertical to place the image above or below. In this case, the dir attribute controls the placement above or below. The same values are used, where normal means place the image above the text, and reverse means place the image below the text. Example 3 : Source View <button label="Left" image="happy.png"/> <button label="Right" image="happy.png" dir="reverse"/> <button label="Above" image="happy.png" o...
...ce the image above or below. In this case, the dir attribute controls the placement above or below. The same values are used, where normal means place the image above the text, and reverse means place the image below the text. Example 3 : Source View <button label="Left" image="happy.png"/> <button label="Right" image="happy.png" dir="reverse"/> <button label="Above" image="happy.png" orient="
vertical"/> <button label="Below" image="happy.png" orient="
vertical" dir="reverse"/> The example here shows all four types of alignment of buttons. Note that the two attributes are not specified when the default value can be used. Buttons with Extra Content Buttons may have arbitrary markup contained inside them, and it will be rendered inside the button. You probably wouldn't use this very often, but ...
Scrolling Menus - Archive of obsolete content
current theme. This behavior is automatic. You do not have to do anything in order to get scrolling menus. It will apply to menus on menubars, in popups or menulists. It is implemented using an arrowscrollbox element. This element can be used to create a scrolling box with arrows. The arrowscrollbox can be used anywhere a regular box can be used. You don't have to use it in menus. ...
... You don't have to use it in menus. It is always a
vertical box and may contain any elements inside it. You could use it to implement a list when you don't want it to be a drop-down. ...
Simple Menu Bars - Archive of obsolete content
element. Each one represents a single command on the menu popup. You can also create separators on the menus using the menuseparator element. This is used to separate groups of menuitems. menubar element The menubar is a box containing menus. Note that it has been placed inside a flexible toolbox. The menubar has no special attributes but it is a type of box. This means that you could create a
vertical menubar by setting the orient attribute to
vertical. menu element The menu element works much like the button element. It accepts some of the same attributes plus some additional ones: id The unique identifier of the menu title button. label The text to appear on the menu, such as File or Edit. disabled This boolean attribute determines whether the menu is disabled. Although you c...
...lthough the key will still work if it doesn't). The menu element is normally placed on a menubar, although it does not have to be. However, it will be given a different look. The image here shows what the earlier example would look like without the menu bar. menupopup element The menupopup element creates the popup window containing the menu commands. It is a type of box which defaults to a
vertical orientation. You could change it to horizontal if you wanted to and the menuitems would be placed in a row. Normally only menuitems and menuseparators would be placed on a menupopup. You can place any element on a menupopup, however they will be ignored on a Macintosh. menuitem element The menuitem element is much like the menu element and has some of the same attributes. id The unique iden...
Splitters - Archive of obsolete content
n element called a splitter. It creates a skinny bar between two sections which allows these sections to be resized. You can place a splitter anywhere you want and it will allow resizing of the elements that come before it and the elements that come after it in the same box. When a splitter is placed inside a horizontal box, it will allow resizing horizontally. When a splitter is placed inside a
vertical box, it will allow resizing
vertically. The syntax of a splitter is as follows: <splitter id="identifier" state="open" collapse="before" resizebefore="closest" resizeafter="closest"> The attributes are as follows: id The unique identifier of the splitter. state Indicates the state of the splitter. Set this to open, the default, to have the split panel initially op...
...lapsed and the buttons shuffle up. The resizeafter attribute has been set to grow so that the elements after the splitter push themselves down when the splitter is dragged down. This results in the content of the frame growing to any size. It should be noted that the window does not resize itself automatically. You'll also notice that this is a horizontal splitter because it has been placed in a
vertical box. Normal State: Collapsed State: Find files example so far : Source View Next, we'll find out how to create toolbars. << PreviousNext >> ...
Toolbars - Archive of obsolete content
t perform common functions. XUL has a method to create toolbars. Adding a Toolbar Like a number of elements, XUL toolbars are a type of box. Usually, a row of buttons would appear in the toolbar, but any element can be placed in a toolbar. For example, the Mozilla browser window contains a textbox that displays the page URL. Toolbars may be placed on any side of the window, either horizontally or
vertically. Of course you wouldn't normally put a textbox in a
vertical toolbar. Actually, because toolbars are just boxes they can actually go anywhere you want, even in the middle of a window. Typically however, a set of toolbars would appear along the top of a window. When more than one toolbar is placed next to each other, they are typically grouped together in something called a 'toolbox'. A simple t...
...them later. <vbox flex="1"> <toolbox> <toolbar id="findfiles-toolbar"> <toolbarbutton id="opensearch" label="Open"/> <toolbarbutton id="savesearch" label="Save"/> </toolbar> </toolbox> <tabbox> A toolbar with two buttons has been added here. In the image, you can see them appear horizontally along the top. Notice that the toolbar has been placed inside the
vertical box just above the tabbox. This is because we need the
vertical orientation so that the toolbar will appear above everything else. The find files example so far: Source View Next, we'll find out how to add a menu bar to a window. << PreviousNext >> ...
box - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] A container element which can contain any number of child elements. If the box has an orient attribute that is set to horizontal, the child elements are laid out from left to right in the order that they appear in the box. If orient is set to
vertical, the child elements are laid out from top to bottom. Child elements do not overlap. ...
...at is set to horizontal, the child elements are laid out from left to right in the order that they appear in the box. If orient is set to
vertical, the child elements are laid out from top to bottom. Child elements do not overlap. The default orientation is horizontal. More information is available in the XUL tutorial. ...
button - Archive of obsolete content
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. normal For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for
vertical scales) For other elements, the elements are placed left to right or top to bottom in the order they appear in the XUL code. reverse For scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for
vertical scales). For other elements, they are placed right to left or bottom to top. This is reverse of the order in which they appear in the XUL c...
...value of this attribute is copied to the menulist.value property upon user selection of the menuitem. 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. orient Type: one of the values below Used to specify whether the children of the element are oriented horizontally or
vertically. The default value depends on the element. You can also use the -moz-box-orient style property. horizontal Child elements of the element are placed next to each other in a row in the order that they appear in the XUL source.
vertical Child elements of the element are placed under each other in a column in the order that they appear in the XUL source. tabindex Type: integ...
panel - Archive of obsolete content
slowly fades away after a short time.fastThe panels quickly fades away after a short time. flip Type: string Normally, when a popup opens near the edge of the screen, it flips over to open on the opposite side of the anchor, so that it doesn't extend off the screen. For example, if the menu doesn't have room to open downward, it flips to open upward instead; this is a
vertical flip. Horizontal flipping doesn't normally happen, since this would cause menus to open in strange places. For arrow popups, however, being able to flip horizontally makes sense. This attribute, set to both, permits that behavior. You will not normally have to use this attribute, since it's automatically applied to arrow panels. An arrow panel can also specify a value of slide, whi...
...fter_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. For more details, including examples, please see popup positioning titlebar Type: string Set the panel's titlebar attribute to the value normal to display a panel with a titlebar. The noautohide attribute must be set to true. top Type: integer Overrides the
vertical position of the popup specified by the showPopup method. type Type: string The panel type. Should be one of the following: autocomplete Specify this for a panel that provides a tree for an autocomplete element. autocomplete-richlistbox Specify this for a panel that provides a richlistbox for an autocomplete element. arrow Speci...
toolbarbutton - Archive of obsolete content
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. normal For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for
vertical scales) For other elements, the elements are placed left to right or top to bottom in the order they appear in the XUL code. reverse For scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for
vertical scales). For other elements, they are placed right to left or bottom to top. This is reverse of the order in which they appear in the XUL c...
...ed. This occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. 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. orient Type: one of the values below Used to specify whether the children of the element are oriented horizontally or
vertically. The default value depends on the element. You can also use the -moz-box-orient style property. horizontal Child elements of the element are placed next to each other in a row in the order that they appear in the XUL source.
vertical Child elements of the element are placed under each other in a column in the order that they appear in the XUL source. tabindex Type: intege...
Browser Detection and Cross Browser Support - Archive of obsolete content
CompuServe 7 and Opera width = windowRef.innerWidth; } Example 2 - object based feature detection Cross Browser Support This example also illustrates the use of feature detection and shows the complications that can arise from the non standard implementations in other browsers. ...
.... elm.style.left = x + 'px'; elm.style.top = y + 'px'; } } else if (typeof(elm.left) == 'number') { // Navigator 4 elm.left = x; elm.top = y; } } Standards only Consider how simple this function is if you code it according to the W3C standards. function moveElement(id, x, y) { // move the element with id to x,y // where x,y are the horizontal // and
vertical position in pixels var elm = document.getElementById(id); if (elm) { elm.style.left = x + 'px'; elm.style.top = y + 'px'; } } Ask yourself this: "Is supporting non-standard browsers worth the development and maintenance costs?" Example 3 - Detecting specific Gecko branches // return the rv value of a Gecko user agent // as a floating point number. // returns -1 for non-geck...
Browser Feature Detection - Archive of obsolete content
ng true true true paddingtop true true true paddingright 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 ...
...ng', 'supported': false}, {name: 'paddingTop', 'supported': false}, {name: 'paddingRight', 'supported': false}, {name: 'paddingBottom', 'supported': false}, {name: 'paddingLeft', 'supported': false}, {name: 'textAlign', 'supported': false}, {name: 'textDecoration', 'supported': false}, {name: 'textIndent', 'supported': false}, {name: 'textTransform', 'supported': false}, {name: '
verticalAlign', 'supported': false}, {name: 'whiteSpace', 'supported': false}, {name: 'width', 'supported': false}, {name: 'wordSpacing', 'supported': false} ], 'DOMCSS2': [ {name: 'azimuth', 'supported': false}, {name: 'backgroundPosition', 'supported': false}, {name: 'borderCollapse', 'supported': false}, {name: 'borderSpacing', 'supported': false}, {name: 'borderTopColor', 'supporte...
-ms-block-progression - Archive of obsolete content
The -ms-block-progression CSS property is a Microsoft extension that specifies the block progression and layout orientation. Initial valuetbApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete Syntax Values tb Default. Top-to-bottom block flow. Layout is horizontal. rl Right-to-left block flow. Layout is
vertical. bt Bottom-to-top block flow. Layout is horizontal. lr Left-to-right block flow. ...
...osoft extension that specifies the block progression and layout orientation. Initial valuetbApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete Syntax Values tb Default. Top-to-bottom block flow. Layout is horizontal. rl Right-to-left block flow. Layout is
vertical. 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 ac...
-ms-filter - Archive of obsolete content
to bottom, ...)) Set to a non-zero value to make the gradient horizontal (equivalent to linear-gradient(to right, ...)) StartColor The end color, supports only opaque colors in the #RRGGBB notation. StartColorStr The end color, supports both opaque colors (#RRGGBB) and colors with alpha opacity using the #AARRGGBB notation. ...
...div class="gradient
vertical"></div> CSS html, body { overflow-x: hidden; max-width: 100vw; } .gradient { width: 100vw; height: 60px; height: 50vh; } .gradient.horizontal { -ms-filter: 'progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#000000", GradientType=1)'; background-image: linear-gradient(to right, #ffffff 0%, #000000 100%); } .gradient.
vertical { -ms-filter: 'progid:DXImageTransform.Microsoft.Gradient(startColorStr="#ffffff", endColorStr="#000000", GradientType=0)'; background-image: linear-gradient(to bottom, #ffffff 0%, #000000 100%); } Result Specifications Not part of any specification. Initial value"" (the empty string)Applies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete Remarks The followi...
Examples - Game development
ies. The first two sections list playable games, while the second is a catch-all area to list demos that aren't necessarily interactive/games. Free/demo games Beloola WebVR platform to connect passionate people. Experience both available on 2D screens and on VR HMDs (Settings / Switch to VR mode). Tanx A multiplayer tank battle game, created with PlayCanvas. Hyper Vanguard Force A neat
vertically scrolling space shooter. Swooop A plane flying game: control your plane and collect the jewels. Again, created with PlayCanvas. Save the Day Fly your rescue chopper around the disaster area and save the stranded victims (ga.me.) Polycraft A shipwreck 'n survive game. Explore the island and defeat the monsters. HexGL A fast-paced, futuristic racing game. Dead Trigger 2 Classic zombie s...
...d and defeat the monsters. HexGL A fast-paced, futuristic racing game. Dead Trigger 2 Classic zombie splatter action, made with Unity3D. Angry Bots A futuristic Aliens-esque isometric 3rd person shooter demo, made with Unity3D. Nutmeg Cute retro scrolling platforming action. Back to Candyland A match-3 (Candy Crush) style game. Biolab Disaster Side-scrolling platform shooter. X-Type
Vertically scrolling space shooter demo. Xibalba Retro (Doom-style) first person shooter. Gorescript Another retro style first person shooter. The Wizard A turn-based, dungeon puzzle game. Hextris Tetris-like hexagonal puzzle game. 2048 A sliding number tiles puzzle game. BananaBread A multiplayer, 3D first-person shooter game developed using Emscripten, WebGL, and WebRTC. Monster Madness A ...
Physics - Game development
ld method of adding values to x and y from the update() function: function update() { ball.x += 1; ball.y += 1; } we are now handling this properly, with a physics engine. ...
...() { } Try reloading index.html again -- The ball should now be moving constantly in the given direction. At the moment, the physics engine has gravity and friction set to zero. Adding gravity would result in the ball falling down while friction would eventually stop the ball. Fun with physics You can do much more with physics, for example by adding ball.body.gravity.y = 100; you will set the
vertical gravity of the ball. As a result it will be launched upwards, but then fall due to the effects of gravity pulling it down. This kind of functionality is just the tip of the iceberg -- there are various functions and variables that can help you manipulate the physics objects. Check out the official physics documentation and see the huge collection of examples using the Arcade and P2 physics syste...
Scaling - Game development
lly during the preload stage, so we don't have to worry about it later. The Phaser scale object There's a special scale object available in Phaser with a few handy methods and properties available. Update your existing preload() function as follows: function preload() { game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.pageAlignHorizontally = true; game.scale.pageAlign
Vertically = true; } scaleMode has a few different options available for how the Canvas can be scaled: NO_SCALE -- nothing is scaled. EXACT_FIT -- scale 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 ...
... 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 is always centered on screen regardless of size. Adding a custom canvas background colour We can also add a custom background color to our canvas, so it won't stay black. The stage object has a backgroundColor property for this purpose, which we can set using CSS color definition syntax. Add the following line below the other three you added earlier: game.stage.backgroundColor = '#eee...
2D maze game with device orientation - Game development
We're loading two images first that will be used later in the Preload state to show the progress of loading all the other assets. The c...
... labyrinth To make the game harder and more interesting we will add some obstacles between the ball and the exit. We could use a level editor, but for the sake of this tutorial let's create something on our own. To hold the block information we'll use a level data array: for each block we'll store the top and left absolute positions in pixels (x and y) and the type of the block -- horizontal or
vertical (t with the 'w' value meaning width and 'h' meaning height). Then, to load the level we'll parse the data and show the blocks specific for that level. In the initLevels function we have: this.levelData = [ [ { x: 96, y: 224, t: 'w' } ], [ { x: 72, y: 320, t: 'w' }, { x: 200, y: 320, t: 'h' }, { x: 72, y: 150, t: 'w' } ], // ... ]; Every array ...
The box model - Learn web development
respected. Padding, margin and border will cause other elements to be pushed away from the box Unless we decide to change the display type to inline, elements such as headings (e.g. <h1>) and <p> all use block as their outer display type by default. If a box has an outer display type of inline, then: The box will not break onto a new line. The width and height properties will not apply.
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. The <a> element, used for links, <span>, <em> and <strong> are all examples of elements that will display inline by default. The type of box applied to an element is defined by...
... and whatever is inside the element. The box model and inline boxes All of the above applies fully to block boxes. Some of the properties can apply to inline boxes too, such as those created by a <span> element. In the example below, we have a <span> inside a paragraph and have applied a width, height, margin, border, and padding to it. You can see that the width and height are ignored. The
vertical margin, padding, and border are respected but they do not change the relationship of other content to our inline box and so the padding and border overlaps other words in the paragraph. Horizontal padding, margins, and borders are respected and will cause other content to move away from the box. Using display: inline-block There is a special value of display, which provides a middle ground b...
Test your skills: Writing Modes and Logical Properties - 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. Task One The box in the example is displayed with a horizontal writing mode. Can you add a line of 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 t...
... 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 of the margin, border, and padding properties so that the edges of the box relate to t...
Fundamental text and font styling - Learn web development
hadow property. This takes up to four values, as shown in the example below: text-shadow: 4px 4px 5px red; The four properties are as follows: The horizontal offset of the shadow from the original text -- this can take most available CSS length and size units, but you'll most commonly use px; positive values move the shadow right, and negative values left. This value has to be included. The
vertical offset of the shadow from the original text; behaves basically just like the horizontal offset, except that it moves the shadow up/down, not left/right. This value has to be included. The blur radius -- a higher value means the shadow is dispersed more widely. If this value is not included, it defaults to 0, which means no blur. This can take most available CSS length and size units. The base c...
...gthen line breaking for Asian languages. text-align-last: Define how the last line of a block or a line, right before a forced line break, is aligned. text-orientation: Define the orientation of the text in a line. overflow-wrap: Specify whether or not the browser may break lines within words in order to prevent overflow. writing-mode: Define whether lines of text are laid out horizontally or
vertically and the direction in which subsequent lines flow. Font shorthand Many font properties can also be set through the shorthand property font. These are written in the following order: font-style, font-variant, font-weight, font-stretch, font-size, line-height, and font-family. Among all those properties, only font-size and font-family are required when using the font shorthand property. A fo...
Drawing graphics - Learn web development
uld be useful)! OK, our template is done and it's time to move on. 2D canvas basics As we said above, all drawing operations are done by manipulating a CanvasRenderingContext2D object (in our case, ctx). Many operations need to be given coordinates to pinpoint exactly where to draw something -- the top left of the canvas is point (0, 0), the horizontal (x) axis runs from left to right, and the
vertical (y) axis runs from top to bottom. Drawing shapes tends to be done using the rectangle shape primitive, or by tracing a line along a certain path and then filling in the shape. Below we'll show how to do both. Simple rectangles Let's start with some simple rectangles. First of all, take a copy of your newly coded canvas template (or make a local copy of 1_canvas_template.html if you did...
...fore: clearBtn.onclick = function() { ctx.fillStyle = 'rgb(0, 0, 0)'; ctx.fillRect(0, 0, width, height); } The drawing loop is pretty simple this time around -- if pressed is true, we draw a circle with a fill style equal to the value in the color picker, and a radius equal to the value set in the range input. We have to draw the circle 85 pixels above where we measured it from, because the
vertical measurement is taken from the top of the viewport, but we are drawing the circle relative to the top of the canvas, which starts below the 85 pixel-high toolbar. If we drew it with just curY as the y coordinate, it would appear 85 pixels lower than the mouse position. function draw() { if(pressed) { ctx.fillStyle = colorPicker.value; ctx.beginPath(); ctx.arc(curX, curY-85, sizePick...
MathML Demo: <msqrt>, <mroot> - radicals
det ( 1 2 3 4 ) ? . displays MathML has two root objects, an <msqrt> x and an <mroot> x 3 These are pretty simple. ...
...rtically 1 2 3 4 and det ( 1 2 3 4 ) 2 , as well as 2 x y z w , 2 1 2 3 4 , and 2 ? det ( 1 2 3 4 ) ? . displays MathML has two root objects, an <msqrt> x and an <mroot> x 3 These are pretty simple. ...
ui.alertNotificationOrigin
popup notifications invoked by nsIAlertsService are sliding in. ...
...f taskbar or equivalent Exists by default: no Application support: Gecko 1.8.1.2 (Firefox 2.0.0.2 / Thunderbird 2.0.0.4 / SeaMonkey 1.1) Status: Active; last updated 2012-02-22 Introduction: Pushed to Nightly on 2007-01-04 Bugs: bug 133527 Values 0 bottom right corner,
vertical slide-in from the bottom 1 bottom right corner, horizontal slide-in from the right 2 bottom left corner,
vertical slide-in from the bottom 3 bottom left corner, horizontal slide-in from the left 4 top right corner,
vertical slide-in from the top 5 top right corner, horizontal slide-in from the right 6 top left corner,
vertical slide-in from the top 7 top left corner, horizontal slide-in from the left ...
NSS Developer Tutorial
NSS developers, so in nss/lib/ssl, we're gradually removing the use of tabs. Curly braces: both of the following styles are allowed: if (condition) { action1(); } else { action2(); } Or: if (condition) { action1(); } else { action2(); } The former style is more common. When modifying existing code, try to stay consistent. In new code, prefer the former style, as it conserves
vertical space. When a block of code consists of a single statement, NSS doesn't require curly braces, so both of these examples are fine: if (condition) { action(); } Or: if (condition) action(); although the use of curly braces is more common. Multiple-line comments should be formatted as follows: /* * Line1 * Line2 */ or /* ** Line 1 ** Line 2 */ The following styles are...
...ts of a single statement, NSS doesn't require curly braces, so both of these examples are fine: if (condition) { action(); } Or: if (condition) action(); although the use of curly braces is more common. Multiple-line comments should be formatted as follows: /* * Line1 * Line2 */ or /* ** Line 1 ** Line 2 */ The following styles are also common, because they conserve
vertical space: /* Line1 * Line2 */ or /* Line1 ** Line2 */ or /* Line1 * Line2 */ Naming Public functions are named FOO_DoOneAction. Global, but unexported functions, are usually named foo_DoOneAction. Variable, and function parameter names, always start with a lowercase letter. The most common style is fooBarBaz, although foobarbaz and foo_bar_baz are also used. Miscellaneous goto can be u...
Gecko object attributes
se display attribute instead line-number The current line number of the caret, whether simply because the "browse with caret" option is on, or the caret used for editing text. The line number is relative to the top of the currently focused area (the document, a rich text editable area, or an input control). Applied to: any focusable accessible text object margin-bottom Specifies how much
vertical space there will be after the bottom of the last line of content in a text accessible (see the CSS margin-bottom property). margin-left Specifies how much horizontal space there will be before the beginning of each line of content in a text accessible (see the CSS margin-left property). margin-right Specifies how much horizontal space there will be after the end of each line of content in a...
...(see the CSS margin-bottom property). margin-left Specifies how much horizontal space there will be before the beginning of each line of content in a text accessible (see the CSS margin-left property). margin-right Specifies how much horizontal space there will be after the end of each line of content in a text accessible (see the CSS margin-right property). margin-top Specifies how much
vertical space there will be before the top of the first line of content in a text accessible (see the CSS margin-top property). text-align Specifies how lines of text are aligned with each other (see CSS text-align property). text-indent Specifies how much horizontal space should be left before beginning of the first line of the text content of an text accessible (see the CSS text-indent property). ...
Building the WebLock UI
us that divide sets of functionality available there. The parent of the textbox that users enter an URL into is something called an <hbox/>, which is a layout widget - often invisible - that controls the way its child elements are rendered. In this case the <hbox/> centers the textbox and the button children, and it orients them horizontally (in contrast to the <vbox/>, which orients its children
vertically). Notice also that when it's clicked, the button executes a JavaScript function called addThisSite(), which we've already defined in the weblock.js file in Client Code Overview above. weblock.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="weblock_mgg" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="...
...xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="weblock_mgg" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Web Lock Manager" style="width: 30em;" persist="screenX screenY" screenX="24" screenY="24"> <script src="chrome://weblock/content/weblock.js"/> <hbox> <separator orient="
vertical" class="thin"/> <vbox flex="1"> <separator class="thin"/> <hbox align="center"> <textbox id="dialog.input" flex="1"/> <button label="Add this URL" oncommand="addThisSite();"/> </hbox> <hbox align="center"> <radiogroup onchange="toggleLock();"> <radio label="lock"/> <radio label="unlock"/> </radiogroup>...
nsIDOMWindowInternal
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. screenY long The
vertical distance of the top border of the user's browser from the top edge of the screen. pageXOffset long Returns the number of pixels that the document has already been scrolled horizontally. pageYOffset long Returns the number of pixels that the document has already been scrolled
vertically. scrollMaxX long Returns the maximum number of pixels that the docu...
... length unsigned long Readonly: Returns the number of frames in the window. ...
nsISelection2
nchronous, in short aVPercent, in short aHPercent ); Parameters aRegion The region inside the selection to scroll into view (see selection region constants defined in nsISelectionController). aIsSynchronous When true, scrolls the selection into view before returning. If false, posts a request which is processed at some point after the method returns. aVPercent How to align the frame
vertically. A value of 0 means the frame's upper edge is aligned with the top edge of the visible area. A value of 100 means the frame's bottom edge is aligned with the bottom edge of the visible area. For values in between, the point "aVPercent" down the frame is placed at the point "aVPercent" down the visible area. A value of 50 centers the frame
vertically. A value of -1 means move the frame the minim...
... aHPercent How to align the frame horizontally. ...
nsISelectionPrivate
nchronous, in short aVPercent, in short aHPercent ); Parameters aRegion The region inside the selection to scroll into view (see selection region constants defined in nsISelectionController). aIsSynchronous When true, scrolls the selection into view before returning. If false, posts a request which is processed at some point after the method returns. aVPercent How to align the frame
vertically. A value of 0 means the frame's upper edge is aligned with the top edge of the visible area. A value of 100 means the frame's bottom edge is aligned with the bottom edge of the visible area. For values in between, the point "aVPercent" down the frame is placed at the point "aVPercent" down the visible area. A value of 50 centers the frame
vertically. A value of -1 means move the frame the minim...
... aHPercent How to align the frame horizontally. ...
Index - Firefox Developer Tools
n Mode Design, Dev Tools, Firefox, Guide, Responsive Design, Tools, Web Development, l10n:priority Responsive design is the practice of designing a website so it looks and works properly on a range of different devices -- particularly mobile phones and tablets as well as desktops and laptops. 102 Rulers DevTools, Firefox, Rulers, Tools You can overlay horizontal and
vertical rulers on a web page: 103 Settings Beginning with Firefox 62, the icon to open Developer Tools settings has been moved into a menu accessed by clicking/touching ... (the elipsis) on the right of the tab. 104 Shader Editor The Shader Editor enables you to see and edit the vertex and fragment shaders used by WebGL. 105 Storage Inspector Coo...
...ing a way to associate transformed sources, as seen by the browser, with their original sources, as written by the developer. You can sometimes encounter problems working with source maps. This page explains the most common problems and how to fix them. 138 UI Tour This article is a quick tour of the main sections of the JavaScript Debugger's user interface. The UI is split
vertically into three panels 139 Using the Debugger map scopes feature This feature is useful when debugging source-mapped code. It enables you to see the variables from the original source. It's also possible to inspect variables from the generated scopes (e.g., a bundle file with all concatenated module files). 140 The Web Developer Menu Add-ons, Debugging, Tools, We...
CanvasRenderingContext2D.setTransform() - Web APIs
rmation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] Parameters setTransform() has two types of parameter that it can accept. The older type consists of several parameters representing the individual components of the transformation matrix to set: a (m11) Horizontal scaling. A value of 1 results in no scaling. b (m12)
Vertical skewing. c (m21) Horizontal skewing. d (m22)
Vertical scaling. A value of 1 results in no scaling. e (dx) Horizontal translation (moving). f (dy)
Vertical translation (moving). The newer type consists of a single parameter, matrix, representing a 2D transformation matrix to set (technically, a DOMMatrixInit object; any object will do as long as it contains the above components as proper...
...alue of 1 results in no scaling. e (dx) Horizontal translation (moving). f (dy)
Vertical translation (moving). The newer type consists of a single parameter, matrix, representing a 2D transformation matrix to set (technically, a DOMMatrixInit object; any object will do as long as it contains the above components as properties). Examples Skewing a shape This example skews a rectangle both
vertically (.2) and horizontally (.8). Scaling and translation remain unchanged. HTML <canvas id="canvas"></canvas> JavaScript const canvas = document.getElementById('canvas'); const ctx = canvas.getContext('2d'); ctx.setTransform(1, .2, .8, 1, 0, 0); ctx.fillRect(0, 0, 100, 100); Result Retrieving and passing a DOMMatrix object In the following example, we have two <canvas> elements. We apply...
CanvasRenderingContext2D.translate() - Web APIs
The CanvasRenderingContext2D.translate() method of the Canvas 2D API adds a translation transformation to the current matrix. Syntax void ctx.translate(x, y); The translate() method adds a translation transformation to the current matrix by moving the canvas and its origin x units horizontally and y units
vertically on the grid. Parameters x Distance to move in the horizontal direction. Positive values are to the right, and negative to the left. y Distance to move in the
vertical direction. Positive values are down, and negative are up. Examples Moving a shape This example draws a square that is moved from its default position by the translate() method. An unmoved square of the same size is then drawn for comparison. HTML <canvas id="canvas"></canvas> JavaScript The translat...
...The first square is shifted by those amounts from its default position. ...
CanvasRenderingContext2D - Web APIs
ecified by the repetition argument. This method returns a CanvasPattern. Shadows CanvasRenderingContext2D.shadowBlur Specifies the blurring effect. Default: 0 CanvasRenderingContext2D.shadowColor Color of the shadow. Default: fully-transparent black. CanvasRenderingContext2D.shadowOffsetX Horizontal distance the shadow will be offset. Default: 0. CanvasRenderingContext2D.shadowOffsetY
Vertical distance the shadow will be offset. Default: 0. Paths The following methods can be used to manipulate paths of objects. CanvasRenderingContext2D.beginPath() Starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path. CanvasRenderingContext2D.closePath() Causes the point of the pen to move back to the start of the current sub-path. It tries to...
...ect). CanvasRenderingContext2D.getTransform Retrieves the current transformation matrix being applied to the context. CanvasRenderingContext2D.rotate() Adds a rotation to the transformation matrix. The angle argument represents a clockwise rotation angle and is expressed in radians. CanvasRenderingContext2D.scale() Adds a scaling transformation to the canvas units by x horizontally and by y
vertically. CanvasRenderingContext2D.translate() Adds a translation transformation by moving the canvas and its origin x horzontally and y
vertically on the grid. CanvasRenderingContext2D.transform() Multiplies the current transformation matrix with the matrix described by its arguments. CanvasRenderingContext2D.setTransform() Resets the current transform to the identity matrix, and then invokes the...
Element.msZoomTo() - Web APIs
s); Parameters args[in] Type: MSZoomToOptions contentX[in]: The x-coordinate of the content that is the target of the scroll/zoom. If no value is specified, defaults to the current centerpoint of visible content, horizontally. contentY[in]: The y-coordinate of the content that is the target of the scroll/zoom. If no value is specified, defaults to the current centerpoint of visible content,
vertically. viewportX[in]: The alignment point of the viewport. The scroll/zoom operation attempts to align this point with the contentX point. center: Default. Aligns the horizontal center of the viewport to the element's contentX value. left: Aligns the left-most point of the viewport to the element's contentX value. right: Aligns the right-most point of the viewport to the element's contentX valu...
...point of the viewport to the element's contentX value. right: Aligns the right-most point of the viewport to the element's contentX value. integer: Aligns the specified x-coordinate of the viewport to the element's contentX value. viewportY[in]: The alignment point of the viewport. The scroll/zoom operation attempts to align this point with the contentY point. middle: Default. Aligns the
vertical center of the viewport to the element's contentY value. top: Aligns the top-most point of the viewport to the element's contentY value. bottom: Aligns the bottom-most point of the viewport to the element's contentY value. integer: Aligns the specified y-coordinate of the viewport to the element's contentY value. scaleFactor[in]: Floating-point. The scale factor (msContentZoomFactor) to zoo...
Element.scroll() - Web APIs
The scroll() method of the Element interface scrolls the element to a particular set of coordinates inside a given element. Syntax element.scroll(x-coord, y-coord) element.scroll(options) Parameters Calling with coordinates x-coord The pixel along the horizontal axis of the element that you want displayed in the upper left. y-coord The pixel along the
vertical axis of the element that you want displayed in the upper left. ...
... element.scroll(x-coord, y-coord) element.scroll(options) Parameters Calling with coordinates x-coord The pixel along the horizontal axis of the element that you want displayed in the upper left. y-coord The pixel along the
vertical axis of the element that you want displayed in the upper left. Calling with options options A ScrollToOptions dictionary. Examples // Put the 1000th
vertical pixel at the top of the element element.scroll(0, 1000); Using options: element.scroll({ top: 100, left: 100, behavior: 'smooth' }); Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'element.scroll()' in that specification. Working Draft Initial definition. Browser Compatibility The compat...
Element.scrollTop - Web APIs
When scrollTop is used on the root element (the <html> element), the scrollY of the window is returned. This is a special case of scrollTop. On systems using display scaling, scrollTop may give you a decimal value. Syntax // Get the number of pixels scrolled. ...
... When scrollTop is used on the root element (the <html> element), the scrollY of the window is returned. This is a special case of scrollTop. On systems using display scaling, scrollTop may give you a decimal value. Syntax // Get the number of pixels scrolled. ...
Element - Web APIs
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. ...
...nt.scrollHeight Read only Returns a Number representing the scroll view height of an element. Element.scrollLeft Is a Number representing the left scroll offset of the element. Element.scrollLeftMax Read only Returns a Number representing the maximum left scroll offset possible for the element. Element.scrollTop A Number representing number of pixels the top of the document is scrolled
vertically. Element.scrollTopMax Read only Returns a Number representing the maximum top scroll offset possible for the element. Element.scrollWidth Read only Returns a Number representing the scroll view width of the element. Element.shadowRootRead only Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. Element.openOrClosedShadowRoot Read o...
HTMLImageElement.align - Web APIs
The obsolete align property of the HTMLImageElement interface is a string which indicates how to position the image relative to its container. You should instead use the CSS propertiy
vertical-align, which does in fact also work on images despite its name. You can also use the float property to float the image to the left or right margin. The align property reflects the HTML align content attribute. Syntax htmlImageElement.align = alignMode; alignMode = htmlImageElement.align; Value A DOMString specifying one of the following strings which set the alignment mode for the image. Baseline alignment These three values specify the alignment of the element relative to the text baseline. These should be replaced by using the CSS
vertical-align property. bottom The bottom edge of the image ...
...Element.align = alignMode; alignMode = htmlImageElement.align; Value A DOMString specifying one of the following strings which set the alignment mode for the image. Baseline alignment These three values specify the alignment of the element relative to the text baseline. These should be replaced by using the CSS
vertical-align property. bottom The bottom edge of the image is to be aligned
vertically with the current text baseline. Default value. middle The center of the object should be aligned
vertically with the current baseline. top The top edge of the object should be aligned
vertically with the current baseline. It may be worth noting that
vertical-align offers several additional options for its value; you may wish to consider these when changing your code to use it. Floating i...
HTMLImageElement - Web APIs
The HTMLImageElement interface represents an HTML <img> element, providing the properties and methods used to manipulate image elements. ...
... areas in the image. HTMLImageElement.width An integer value that reflects the width HTML attribute, indicating the rendered width of the image in CSS pixels. HTMLImageElement.x Read only An integer indicating the horizontal offset of the left border edge of the image's CSS layout box relative to the origin of the <html> element's containing block. HTMLImageElement.y Read only The integer
vertical offset of the top border edge of the image's CSS layout box relative to the origin of the <html> element's containing block. Obsolete properties HTMLImageElement.align A DOMString indicating the alignment of the image with respect to the surrounding context. The possible values are "left", "right", "justify", and "center". This is obsolete; you should instead use CSS (such as text-align, ...
HTMLMarqueeElement - Web APIs
The HTMLMarqueeElement interface provides methods to manipulate <marquee> elements. It inherits properties and methods from the HTMLElement interface. ...
...Element.scrollDelay 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 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...
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. ...
...ment.height A DOMString containing a length of pixel of the hinted height of the cell. It reflects the obsolete height attribute. HTMLTableCellElement.noWrap A Boolean value reflecting the nowrap attribute and indicating if cell content can be broken in several lines. HTMLTableCellElement.vAlign A DOMString representing an enumerated value indicating how the content of the cell must be
vertically aligned. It reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". Use the CSS
vertical-align property instead. HTMLTableCellElement.width A DOMString specifying the number of pixels wide the cell should be drawn, if possible. This property reflects the also obsolete width attribute. Use the CSS width property instead. Specificat...
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. ...
...resenting the alignment character for cell data. HTMLTableColElement.chOff Is a DOMString representing the offset for the alignment character. HTMLTableColElement.span Is an unsigned long that reflects the span HTML attribute, indicating the number of columns to apply this object's attributes to. Must be a positive integer. HTMLTableColElement.vAlign Is a DOMString that indicates the
vertical alignment of the cell data in the column. HTMLTableColElement.width Is a DOMString representing the default column width. Methods No specific method; inherits methods from its parent, HTMLElement. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLTableColElement' in that specification. Living Standard No change from HTML...
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. ...
...ght", and "center". HTMLTableElement.bgColor Is a DOMString containing the background color of the cells. It reflects the obsolete bgcolor attribute. HTMLTableElement.border Is a DOMString containing the width in pixels of the border of the table. It reflects the obsolete border attribute. HTMLTableElement.cellPadding Is a DOMString containing the width in pixels of the horizontal and
vertical sapce between cell content and cell borders. It reflects the obsolete cellpadding attribute. HTMLTableElement.cellSpacing Is a DOMString containing the width in pixels of the horizontal and
vertical separation between cells. It reflects the obsolete cellspacing attribute. HTMLTableElement.frame Is a DOMString containing the type of the external borders of the table. It reflects the obsole...
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. ...
...ithin the entire table. If the row is not part of a table, returns -1. HTMLTableRowElement.sectionRowIndex Read only Returns a long value which gives the logical position of the row within the table section it belongs to. If the row is not part of a section, returns -1. HTMLTableRowElement.vAlign Is a DOMString representing an enumerated value indicating how the content of the cell must be
vertically aligned. It reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". Methods Inherits methods from its parent, HTMLElement. HTMLTableRowElement.deleteCell() Removes the cell at the given position in the row. If the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than 0, i...
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. ...
...DOMString containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by HTMLTableRowElement.ch. This property was optional and was not very well supported. HTMLTableSectionElement.vAlign Is a DOMString representing an enumerated value indicating how the content of the cell must be
vertically aligned. It reflects the valign attribute and can have one of the following values: "top", "middle", "bottom", or "baseline". Methods Inherits methods from its parent, HTMLElement. HTMLTableSectionElement.deleteRow() Removes the cell at the given position in the section. If the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller...
Intersection Observer API - Web APIs
d a more extensive example showing how to time how long a set of elements (such as ads) are visible to the user and to react to that information by recording statistics or by updating elements.. HTML The HTML for this example is very short, with a primary element which is the box that we'll be targeting (with the creative ID "box") and some contents within the box. <div id="box"> <div class="
vertical"> Welcome to <strong>The Box!</strong> </div> </div> CSS The CSS isn't terribly important for the purposes of this example; it lays out the element and establishes that the background-color and border attributes can participate in CSS transitions, which we'll use to affect the changes to the element as it becomes more or less obscured. #box { background-color: rgba(40, 40, 190, 255); ...
...order attributes can participate in CSS transitions, which we'll use to affect the changes to the element as it becomes more or less obscured. #box { background-color: rgba(40, 40, 190, 255); border: 4px solid rgb(20, 20, 120); transition: background-color 1s, border 1s; width: 350px; height: 350px; display: flex; align-items: center; justify-content: center; padding: 20px; } .
vertical { color: white; font: 32px "Arial"; } .extra { width: 350px; height: 350px; margin-top: 10px; border: 4px solid rgb(20, 20, 120); text-align: center; padding: 20px; } JavaScript Finally, let's take a look at the JavaScript code that uses the Intersection Observer API to make things happen. Setting up First, we need to prepare some variables and install the observer. const nu...
MouseEvent() - Web APIs
eArg Is a DOMString representing the name of the event. mouseEventInit Optional Is a MouseEventInit dictionary, having the following fields: "screenX", optional and defaulting to 0, of type long, that is the horizontal position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer. ...
... "ctrlKey", optional and defaulting to false, of type Boolean, that indicates if the ctrl key was simultaneously pressed. "shiftKey", optional and defaulting to false, of type Boolean, that indicates if the shift key was simultaneously pressed. ...
MouseEvent.clientY - Web APIs
Syntax var y = instanceOfMouseEvent.clientY Return value A double floating point value, as redefined by the CSSOM View Module. Originally, this property was defined as a long integer. See the "Browser compatibility" section for details. Example This example displays your mouse's coordinates whenever you trigger the mousemove event. ...
... Syntax var y = instanceOfMouseEvent.clientY Return value A double floating point value, as redefined by the CSSOM View Module. Originally, this property was defined as a long integer. See the "Browser compatibility" section for details. Example This example displays your mouse's coordinates whenever you trigger the mousemove event. ...
MouseScrollEvent - Web APIs
Methods initMouseScrollEvent() See nsIDOMMouseScrollEvent::initMouseScrollEvent(). ...
... Methods initMouseScrollEvent() See nsIDOMMouseScrollEvent::initMouseScrollEvent(). ...
PannerNode - Web APIs
e between the audio source and the listener, after which the volume is not reduced any further. PannerNode.orientationX Represents the horizontal position of the audio source's vector in a right-hand cartesian coordinate system. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 1. PannerNode.orientationY Represents the
vertical position of the audio source's vector in a right-hand cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0. PannerNode.orientationZ Represents the longitudinal (back and forth) position of the audio source's vector in a right-hand cartesian coordinate system. The default is 0...
...umerated value determining which spatialisation algorithm to use to position the audio in 3D space. PannerNode.positionX Represents the horizontal position of the audio in a right-hand cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0. PannerNode.positionY Represents the
vertical position of the audio in a right-hand cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0. PannerNode.positionZ Represents the longitudinal (back and forth) position of the audio in a right-hand cartesian coordinate system. The default is 0. While this AudioParam cannot be d...
SVGEllipseElement - Web APIs
The SVGEllipseElement interface provides access to the properties of <ellipse> elements. ...
... methods, but inherits methods from its parent interface, SVGGeometryElement. Example SVG content <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="100" cy="100" rx="100" ry="60" id="ellipse" onclick="outputSize();"/> </svg> JavaScript content function outputSize() { var ellipse = document.getElementById("ellipse"); // Outputs "horizontal radius: 100
vertical radius: 60" console.log( 'horizontal radius: ' + ellipse.rx.baseVal.valueAsString, '
vertical radius: ' + ellipse.ry.baseVal.valueAsString ) } Result Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVGEllipseElement' in that specification. Candidate Recommendation No change Scalable Vector Gr...
SVGPathElement - Web APIs
The SVGPathElement interface corresponds to the <path> element. ...
... SVGPathElement.createSVGPathSegArcRel() Returns a stand-alone, parentless SVGPathSegArcRel object. SVGPathElement.createSVGPathSegLinetoHorizontalAbs() Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object. SVGPathElement.createSVGPathSegLinetoHorizontalRel() Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object. SVGPathElement.createSVGPathSegLineto
VerticalAbs() Returns a stand-alone, parentless SVGPathSegLineto
VerticalAbs object. SVGPathElement.createSVGPathSegLineto
VerticalRel() Returns a stand-alone, parentless SVGPathSegLineto
VerticalRel object. SVGPathElement.createSVGPathSegCurvetoCubicSmoothAbs() Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object. SVGPathElement.createSVGPathSegCurvetoCubicSmoothRel() Retu...
SVGPathSeg - Web APIs
4 PATHSEG_LINETO_REL = 5 PATHSEG_CURVETO_CUBIC_ABS = 6 PATHSEG_CURVETO_CUBIC_REL = 7 PATHSEG_CURVETO_QUADRATIC_ABS = 8 PATHSEG_CURVETO_QUADRATIC_REL = 9 PATHSEG_ARC_ABS = 10 PATHSEG_ARC_REL = 11 PATHSEG_LINETO_HORIZONTAL_ABS = 12 PATHSEG_LINETO_HORIZONTAL_REL = 13 PATHSEG_LINETO_
VERTICAL_ABS = 14 PATHSEG_LINETO_
VERTICAL_REL = 15 PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16 PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17 PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18 PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19 Normative document SVG 1.1 (2nd Edition) ...
...onds to a "relative arcto" (a) path data command. PATHSEG_LINETO_HORIZONTAL_ABS 12 Corresponds to an "absolute horizontal lineto" (H) path data command. PATHSEG_LINETO_HORIZONTAL_REL 13 Corresponds to a "relative horizontal lineto" (h) path data command. PATHSEG_LINETO_
VERTICAL_ABS 14 Corresponds to an "absolute
vertical lineto" (V) path data command. PATHSEG_LINETO_
VERTICAL_REL 15 Corresponds to a "relative
vertical lineto" (v) path data command. PATHSEG_CURVETO_CUBIC_SMOOTH_ABS 16 Corresponds to an "absolute smooth cubic curveto" (S) path data comman...
Touch() - Web APIs
on number for the touch point. "target", required, of type EventTarget, the item at which the touch point started when it was first placed on the surface. "clientX", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the client window of user's screen, excluding any scroll offset. "clientY", optional and defaulting to 0, of type double, that is the
vertical position of the touch on the client window of the user's screen, excluding any scroll offset. "screenX", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the user's screen. "screenY", optional and defaulting to 0, of type double, that is the
vertical position of the touch on the user's screen. "pageX", optional and defaulting to 0, of type double...
... "radiusX", optional and defaulting to 0, of type float, that is the radius of the ellipse which most closely circumscribes the touching area (e.g. ...
UIEvent - Web APIs
s 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. ...
...the event has been canceled or not. UIEvent.detailRead only Returns a long with details about the event, depending on the event type. UIEvent.isChar Read only Returns a Boolean indicating whether the event produced a key character or not. UIEvent.layerX Read only Returns the horizontal coordinate of the event relative to the current layer. UIEvent.layerY Read only Returns the
vertical coordinate of the event relative to the current layer. UIEvent.pageX Read only Returns the horizontal coordinate of the event relative to the whole document. UIEvent.pageY Read only Returns the
vertical coordinate of the event relative to the whole document. UIEvent.sourceCapabilities Read only Returns an instance of the InputDeviceCapabilities interface, which provides information...
Raining rectangles - Web APIs
; } // We are using setTimeout for animation. So we reschedule // the timeout to call drawAnimation again in 17ms. // Otherwise we won't get any animation. timer = setTimeout(drawAnimation, 17); } function playerClick (evt) { // We need to transform the position of the click event from // window coordinates to relative position inside the canvas. // In addition we need to remember that
vertical position in // WebGL increases from bottom to top, unlike in the browser // window. var position = [ evt.pageX - evt.target.offsetLeft, gl.drawingBufferHeight - (evt.pageY - evt.target.offsetTop), ]; // if the click falls inside the rectangle, we caught it. // Increment score and create a new rectangle. var diffPos = [ position[0] - rainingRect.position[0], posit...
...score += 1; scoreDisplay.innerHTML = score; rainingRect = new Rectangle(); } } function Rectangle () { // Keeping a reference to the new Rectangle object, rather // than using the confusing this keyword. var rect = 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. var randNums = getRandomVector(); rect.size = [ 5 + 120 * randNums[0], 5 + 120 * randNums[1] ]; rect.position = [ randNums[2]*(gl.drawingBufferWidth - rect.size[0]), gl.drawingBufferHeight ]; rect.velocity = 1.0 + 6.0*Math.random(); rect.color = getRandomVector(); gl.clearColor(rect.color[0], rect.color[1], rec...
Scissor animation - Web APIs
// Variables to hold the WebGL context, and the color and // position of animated squares. var gl, color = getRandomColor(), position; function setupAnimation (evt) { window.removeEventListener(evt.type, setupAnimation, false); if (!(gl = getRenderingContext())) return; gl.enable(gl.SCISSOR_TEST); gl.clearColor(color[0], color[1], color[2], 1.0); // Unlike the browser window,
vertical position in WebGL is // measured from bottom to top. In here we set the initial // position of the square to be at the top left corner of the // drawing buffer. position = [0, gl.drawingBufferHeight]; var button = document.querySelector("button"); var timer; function startAnimation(evt) { button.removeEventListener(evt.type, startAnimation, false); button.addEventListener("...
...ner("click", startAnimation, false); document.querySelector("strong").innerHTML = "start"; clearInterval(timer); } stopAnimation({type: "click"}); } // Variables to hold the size and velocity of the square. var size = [60, 60], velocity = 3.0; function drawAnimation () { gl.scissor(position[0], position[1], size[0] , size[1]); gl.clear(gl.COLOR_BUFFER_BIT); // Every frame the
vertical position of the square is // 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. position = [ Math.
Controlling multiple parameters with ConstantSourceNode - Web APIs
> ? ...
...th: 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;
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 va...
Visualizations with Web Audio API - Web APIs
cycle through each value in the dataArray. ...
...ss the canvas, which is barWidth wide and barHeight/2 tall (we eventually decided to cut each bar in half so they would all fit on the canvas better.) The one value that needs explaining is the
vertical offset position we are drawing each bar at: HEIGHT-barHeight/2. I am doing this because I want each bar to stick up from the bottom of the canvas, not down from the top, as it would if we set the
vertical position to 0. Therefore, we instead set the
vertical position each time to the height of the canvas minus barHeight/2, so therefore each bar will be drawn from partway down the canvas, down to the bottom. for(var i = 0; i < bufferLength; i++) { barHeight = dataArray[i]/2; canvasCtx.fillStyle = 'rgb(' + (barHeight+100) + ',50,50)'; canvasCtx.fillRect(x,HEIGHT-barHe...
WheelEvent - Web APIs
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. ...
.../text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor WheelEvent() Creates a WheelEvent object. Properties This interface inherits properties from its ancestors, MouseEvent, UIEvent, and Event. WheelEvent.deltaXRead only Returns a double representing the horizontal scroll amount. WheelEvent.deltaYRead only Returns a double representing the
vertical scroll amount. WheelEvent.deltaZRead only Returns a double representing the scroll amount for the z-axis. WheelEvent.deltaModeRead only Returns an unsigned long representing the unit of the delta* values' scroll amount. Permitted values are: Constant Value Description WheelEvent.DOM_DELTA_PIXEL 0x00 The delta* values are specified in pixels. ...
XRRenderState - Web APIs
The XRRenderState interface of the WebXR Device API contains configurable values which affect how the imagery generated by an XRSession gets composited. These properties include the range of distances from the viewer within which content should be rendered, the
vertical field of view (for inline presentations), and a reference to the XRWebGLLayer being used as the target for rendering the scene prior to it being presented on the XR device's display or displays. When you apply changes using the XRSession method updateRenderState(), the specified changes take effect after the current animation frame has completed, but before the next one begins. Properties The followiing properties are available on XRRenderState objects. baseLayer Read only The XRWebGLLayer from which the brows...
... beyond which rendering of the scene no longer takes place. This, essentially, specifies the maximum distance the user can see. depthNear Read only The distance, in meters, of the near clip plane from the viewer. The near clip plane is the plane, parallel to the display, at which rendering of the scene begins. Any closer to the viewer than this, and no portions of the scene are drawn. inline
VerticalFieldOfView Read only The default
vertical field of view, defined in radians, to use when the session is in inline mode. null for all immersive sessions. Specifications Specification Status Comment WebXR Device APIThe definition of 'XRRenderState' in that specification. Working Draft Initial definition. ...
XRSession.updateRenderState() - Web APIs
e between the distances specified by depthNear and depthFar. This is 1000 meters (1 kilometer) by default. depthNear Optional A floating-point value indicating the distance in meters from the viewer to a plane parallel to the display surface to be the near clip plane. No part of the scene on the viewer's side of this plane will be rendered. This is 0.1 meters (10 centimeters) by default. inline
VerticalFieldOfView Optional A floating-point value indicating the default field of view, in radians, to be used when computing the projection matrix for an inline XRSession. The projection matrix calculation also takes into account the output canvas's aspect ratio. This property must not be specified for immersive sessions, so the value is null by default for immersive sessions. The default value is oth...
... throw any of the following exceptions. These are true exceptions, since this method does not return a promise. InvalidStateError This may occur for one of the following reasons: The XRSession has already ended, so you cannot change its render state. The baseLayer specified in newState was created by an XRSession other than the one on which updateRenderState() was called. The inline
VerticalFieldOfView property was set, but the session is immersive and therefore does not allow this property to be used. Examples This example creates a WebGL context that is compatible with an immersive XR device and then uses it to create an XRWebGLLayer. updateRenderState() is then called to associate the new XRWebGLLayer. function onXRSessionStarted(xrSession) { let glCanvas = document.crea...
XRView - Web APIs
and rotate an object whose current situation is described by the reference space refSpace to a new position and orientation which is computed using previously recorded mouse and keyboard input data which has generated offsets for yaw, pitch, and position along all three axes. function applyMouseMovement(refSpace) { if (!mouseYaw && !mousePitch && !axialDistance && !transverseDistance && !
verticalDistance) { return refSpace; } // Compute the quaternion used to rotate the image based // on the pitch and yaw. quat.identity(inverseOrientation); quat.rotateX(inverseOrientation, inverseOrientation, -mousePitch); quat.rotateY(inverseOrientation, inverseOrientation, -mouseYaw); // Compute the true "up" vector for our object. vec3.cross(vecX, vecY, cubeOrientation); vec3.
...s(vecX, vecY, cubeOrientation); vec3.cross(vecY, cubeOrientation, vecX); // Now compute the transform that teleports the object to the // specified point and save a copy of it to display to the user // later; otherwise we probably wouldn't need to save mouseMatrix // at all. ...
Using the aria-orientation attribute - Accessibility
The aria-orientation attribute is used to indicate whether an element is oriented horizontally or
vertically. Value Vocabulary
vertical The element is oriented
vertically. horizontal (default) The element is oriented horizontally. Possible effects on user agents and assistive technology Note: Opinions may differ on how assistive technology should handle this technique. The information provided above is one of those opinions and therefore not normative. Examples Example 1: The snippet below shows a simple slider that is oriented
vertically. ...
...e effects on user agents and assistive technology Note: Opinions may differ on how assistive technology should handle this technique. The information provided above is one of those opinions and therefore not normative. Examples Example 1: The snippet below shows a simple slider that is oriented
vertically. ...
ARIA: switch role - Accessibility
tAttribute("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. ...
... Result The result looks like this: Specifications...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
ent or UI in order to implement "say what you see" kinds of features. On Microsoft Windows, these kinds of assistive technology acquire this necessary information via a combination of hacks, MSAA and proprietary DOMs. MSAA is supposed to be the "right way" for accessibility aids to get information, but sometimes the hacks are more effective. For example, screen readers look for screen draws of a
vertical blinking line, to determine the location of the caret. Without doing this, screen readers would not be able to let the user know where there caret has moved to in most programs, because so many applications do not use the system caret (Gecko does not). This is so commonly done, that no one even bothers to support the MSAA caret, after all the hack is general solution works with pretty much all ap...
...ss 4 bytes extra on each object is criticial in your application, just keep the extra pointer around instead of using a hash table. Also, don't implement EVENT_OBJECT_CREATE or EVENT_OBJECT_DESTROY. Vendors have found that watching these events causes crashes. Hacky caret tracking causes problems Problem: Assistive technologies do not use the MSAA caret. They follow screen draws, looking for a
vertical blinking line. Unfortunately, some products can get confused by the
vertical lines on other objects, such as 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 train...
-moz-orient - CSS: Cascading Style Sheets
The -moz-orient CSS property specifies the orientation of the element to which it's applied. Syntax The -moz-orient property is specified as one of the keyword values chosen from the list below. Values inline The element is rendered in the same direction as the axis of the text: horizontally for horizontal writing modes,
vertically for
vertical writing modes. block The element is rendered orthogonally to the axis of the text:
vertically for horizontal writing modes, horizontal for
vertical writing modes. horizontal The element is rendered horizontally.
vertical The element is rendered
vertically. Formal definition Initial valueinlineApplies toany element; it has an effect on progress and meter, but not on <input type="range"> or other elementsInheritednoComputed valueas ...
...des, horizontal for
vertical writing modes. horizontal The element is rendered horizontally.
vertical The element is rendered
vertically. Formal definition Initial valueinlineApplies toany element; it has an effect on progress and meter, but not on <input type="range"> or other elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax inline | block | horizontal |
vertical Examples HTML <p> The following progress meter is horizontal (the default): </p> <progress max="100" value="75"></progress> <p> The following progress meter is
vertical: </p> <progress class="vert" max="100" value="75"></progress> CSS .vert { -moz-orient:
vertical; width: 16px; height: 150px; } Result Specifications Not part of any standard. Though submitted to the W3C, wit...
-webkit-line-clamp - CSS: Cascading Style Sheets
In most cases you will also want to set overflow to hidden, otherwise the contents won't be clipped but an ellipsis will still be shown after the specified number of lines. ...
...Animation 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-repeat-x - CSS: Cascading Style Sheets
space The image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace is distributed evenly bet...
... space The image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images. ...
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
The -webkit-mask-repeat-y property sets whether and how a mask image is repeated (tiled)
vertically. /* Keyword values */ -webkit-mask-repeat-y: repeat; -webkit-mask-repeat-y: no-repeat; -webkit-mask-repeat-y: space; -webkit-mask-repeat-y: round; /* Multiple values */ -webkit-mask-repeat-y: repeat, no-repeat, space; /* Global values */ -webkit-mask-repeat-y: inherit; -webkit-mask-repeat-y: initial; -webkit-mask-repeat-y: unset; Syntax Values repeat The mask image is repeated
vertically. no-repeat The mask image is not repeated
vertically; only one copy of the mask image is drawn in
vertical direction. The
vertical remainder of the masked element's content is not displayed. repeat The mask image is repeated
vertically. space The image is repeated as much as possible witho...
...ted as much as possible without clipping. The first and last images are pinned to the top and bottom edge of the element, and whitespace is distributed evenly between the images. The mask-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
vertical 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 height of 260px, repeated three times, might stretch until each repetition is 300px high, and then another image will be added. They will then compress to a heig...
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
We use justify-content to align the item on the main axis, which in this case the inline axis running horizontally. ...
...We use justify-content to align the item on the main axis, which in this case the inline axis running horizontally. You can take a look at the code of this example below. Change the size of the container or nested element and the nested element always remains centered. ...
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
o longer applies. Remove display: flex to see the fallback behavior. You'll see white space added between the items, which is what happens when using display: inine-block as it prefers white space like other inline items. display: table- The CSS table display properties are potentially very useful as a fallback, due to the fact that they allow design patterns such as full height columns and
vertical centering and work back as far as Internet Explorer 8. If you use display: table-cell on an item in your HTML it takes on the styling of an HTML table cell. CSS creates anonymous boxes to represent these items so that you do not need to wrap each item in a wrapper to represent the HTML table row, and a second one to represent the table element itself, You can't see or style these anonymous boxes...
...ote: Some values of display normally trigger the creation of anonymous boxes around the original box. If such a box is a flex item, it is blockified first, and so anonymous box creation will not happen. For example, two contiguous flex items with display: table-cell will become two separate display: block flex items, instead of being wrapped into a single anonymous table." - 4. Flex Items The
vertical-align property The live example below demonstrates use of the
vertical-align property along with display: inline-block. Both display: table-cell and display: inline-block allow for the use of this property. Use of
vertical-align enables
vertical alignment prior to flexbox. The property is ignored by flexbox and so you can use it in conjunction with display: table-cell or display: inline-block as...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
iting modes The writing modes specification defines the following values of the writing-mode property, which serve to change the direction that blocks are laid out on the page, to match the direction that blocks lay out when content is formatted in that particular writing mode. You can change the live example below to these modes in order to see what happens to the flex layout. horizontal-tb
vertical-rl
vertical-lr sideways-rl sideways-lr Note that sideways-rl and sideways-lr have support only in Firefox currently. There are also some known issues with regard to writing-mode and flexbox. You can see more information on browser support in the MDN documentation for writing-mode. However if you are planning on using writing modes in your layout, carefully testing the results is advisable...
...ner that establishes a containing block. Floats will not intrude, and the containers' margins will not collapse. With regard to flex items, if an item was floated or cleared and then becomes a flex item due to the parent having display: flex applied, the floating and clearing will no longer happen, and the item will not be taken out of normal flow in the way that floats are. If you have used the
vertical-align property, as used with inline-block or table layout for alignment, this will no longer affect the item and you can use the alignment properties of flexbox instead. In this next live example the child elements have been floated, and then their container has had display: flex added. If you remove display: flex, you should see that the .box element collapses as we have no clearing applied. Th...
Flow Layout and Overflow - CSS: Cascading Style Sheets
ains the content in its box and add scrollbars to enable viewing it. Scrollbars will be added even if the content fits in the box. Using a value of auto will display the content with no scrollbars if the content fits inside the box. If it doesn't fit then scrollbars will be added. Comparing the next example with the example for overflow: scroll you should see overflow scroll has horizontal and
vertical scrollbars when it only needs
vertical scrolling. The auto example below only adds the scrollbar in the direct we need to scroll. As we have already learned, using any of these values, other than the default of visible, will create a new Block Formatting Context. Note: In the Working Draft of Overflow Level 3, there is an additional value overflow: clip. This will act like overflow: hidden ho...
...able. In addition it does not create a Block Formatting Context. The overflow property is in reality a shorthand for the overflow-x and overflow-y properties. If you specify only one value for overflow, this value is used for both axes. However, you can specify both values in which case the first is used for overflow-x and therefore the horizontal direction, and the second for overflow-y and the
vertical direction. In the below example, I have only specified overflow-y: scroll so we do not get the unwanted horizontal scrollbar. Flow Relative Properties In the guide to Writing Modes and Flow Layout, we looked at the newer properties of block-size and inline-size which make more sense when working with different writing modes than tying our layout to the physical dimensions of the screen. The L...
Logical properties for floating and positioning - CSS: Cascading Style Sheets
ue. Float and clear example The physical values used with the float and clear properties are left, right and both. The Logical Properties specification defines the values inline-start and inline-end as mappings for left and right. In the example below I have two boxes -- the first has the box floated with float: left, the second with float: inline-start. If you change the writing-mode to
vertical-rl or the direction to rtl you will see that the left-floated box always sticks to the left, whereas the inline-start-floated item follows the direction and writing-mode. Example: Inset properties for positioned layout Positioning generally allows us to position an element in a manner relative to its containing block -- we essentially inset the item relative to where it would fall based on no...
... relate to the flow of text in your writing mode. These are as follows: inset-block-start, inset-block-end, inset-inline-start and inset-inline-end. In the below example I have used the inset-block-start and inset-inline-end properties to position the blue box using absolute positioning inside the area with the grey dotted border, which has position: relative. Change the writing-mode property to
vertical-rl, or add direction: rtl, and see how the flow relative box stays with the text direction. New two- and four-value shorthands As with other properties in the specification we have some new shorthand properties, which give the ability to set two or four values at once. inset -- sets all four sides together with physical mapping. inset-inline -- sets both logical inline insets. inset-bloc...
Center an element - CSS: Cascading Style Sheets
Recipe Download this example Choices made To center one box inside another we make the containing box a flex container. Then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis. ...
... Recipe Download this example Choices made To center one box inside another we make the containing box a flex container. Then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis. ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
z-win-media-toolbox -moz-window-button-box -moz-window-button-box-maximized -moz-window-button-close -moz-window-button-maximize -moz-window-button-minimize -moz-window-button-restore -moz-window-titlebar -moz-window-titlebar-maximized progressbar progresschunk radio radio-container radio-label radiomenuitem resizer resizerpanel scale-horizontal scalethumb-horizontal scalethumb-
vertical scale-
vertical scrollbarbutton-down scrollbarbutton-left scrollbarbutton-right scrollbarbutton-up scrollbar-small scrollbarthumb-horizontal scrollbarthumb-
vertical scrollbartrack-horizontal scrollbartrack-
vertical separator spinner spinner-downbutton spinner-textfield spinner-upbutton statusbar statusbarpanel tab tabpanels tab-scroll-arrow-back tab-scroll-arrow-forward textf...
...moz-hangul-consonant -moz-japanese-formal -moz-japanese-informal -moz-kannada -moz-khmer -moz-lao -moz-malayalam -moz-myanmar -moz-oriya -moz-persian -moz-simp-chinese-formal -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-posi...
Viewport concepts - CSS: Cascading Style Sheets
The Window.outerWidth is the width of the outside of the browser window including all the window chrome. In an experiment with these, the innerWidth and outerWidth was seen to be the same, but the outerHeight was...
... The Window.outerWidth is the width of the outside of the browser window including all the window chrome. ...
background-position-x - CSS: Cascading Style Sheets
rated by commas. Values left Aligns the left edge of the background image with the left edge of the background position layer. center Aligns the center of the background image with the center of the background position layer. right Aligns the right edge of the background image with the right edge of the background position layer. <length> The offset of the given background image's left
vertical edge from the background position layer's left
vertical edge. (Some browsers allow assigning the right edge for offset). <percentage> The offset of the given background image's horizontal position relative to 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 backgroun...
... HTML <div></div> CSS div { width: 300px; height: 300px; background-color: skyblue; background-image: url(https://media.prod.mdn.mozit.cloud/attachments/2020/07/29/17350/3b4892b7e820122ac6dd7678891d4507/firefox.png); background-repeat: no-repeat; background-position-x: center; background-position-y: bottom 10px; } Result Specifications Specific...
border-block-color - CSS: Cascading Style Sheets
border color in the other dimension can be set with border-inline-color which sets border-inline-start-color, and border-inline-end-color. Syntax Values <'color'> The color of the border. See color. ...
...e 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
perties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. Values <'color'> The color of the border. See color. ...
...e 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
border-block-start-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. Values <'border-style'> The line style of the border. See border-style. ...
...he 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-end - CSS: Cascading Style Sheets
ue>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
... Editor's Draft Initial definition ...
border-block-start-style - CSS: Cascading Style Sheets
re border-block-end-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. Values <'border-style'> The line style of the border. See border-style. ...
...he 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-start - CSS: Cascading Style Sheets
ue>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
... Editor's Draft Initial definition ...
border-block-style - CSS: Cascading Style Sheets
in the other dimension can be set with border-inline-style, which sets border-inline-start-style, and border-inline-end-style. Syntax Values <'border-style'> The line style of the border. See border-style. ...
...he 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-block - CSS: Cascading Style Sheets
ue>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
... Editor's Draft Initial definition ...
border-image-slice - CSS: Cascading Style Sheets
dified 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. ...
...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 collapse. It also applies to ::first-letter.InheritednoPercentag...
border-image-width - CSS: Cascading Style Sheets
om/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. ...
... 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 border, specified as a <length> or a <percentage>. Percentages are relative to the width of the border image area for horizontal offsets and the height of the border image area for
vertical offsets. Must not be negative. <number> The width of the border, specified as a multiple of the corresponding border-width. Must not be negative. auto The width of the border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding border-image-slice. If the image does not have the required intrinsic dimension, the corresponding border-width is used instea...
border-inline-color - CSS: Cascading Style Sheets
der color in the other dimension can be set with border-block-color which sets border-block-start-color, and border-block-end-color. Syntax Values <'color'> The color of the border. See color. ...
...er. 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 - CSS: Cascading Style Sheets
ue>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ...
... Editor's Draft Initial definition ...
bottom - CSS: Cascading Style Sheets
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. The effect of bottom depends on how the element is positioned (i.e., the value of the position property): When position is set to absolute or fixed, the bottom property specifies the distance between the element's bottom edge and the bottom edge of its containing block. ...
...oned elements, the distance that the element is moved above its normal position. <percentage> A <percentage> of the containing block's height. auto Specifies that: for absolutely positioned elements, the position of the element is based on the top property, while height: auto is treated as a height based on the content; or if top is also auto, the element is positioned where it should
vertically be positioned if it were a static element. for relatively positioned elements, the distance of the element from its normal position is based on the top property; or if top is also auto, the element is not moved
vertically at all. inherit Specifies that the value is the same as the computed value from its parent element (which might not be its containing block). This computed value is th...
box-lines - CSS: Cascading Style Sheets
This is a property of the original CSS Flexible Box Layout Module draft, and has been replaced by a newer standard. See flexbox for information about the current standard. The box-lines CSS property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for
vertically oriented boxes). /* Keyword values */ box-lines: single; box-lines: multiple; /* Global values */ box-lines: inherit; box-lines: initial; box-lines: unset; By default a horizontal box will lay out its children in a single row, and a
vertical box will lay out its children in a single column. This behavior can be changed using the box-lines property. The default value is single, which means that all elements will be placed in a single row or column, and any elemen...
...normal direction boxes and above in reverse direction boxes. The height of a line is the height of the largest child in that line. No additional space appears between the lines apart from the margins on the largest elements in each line. For calculating the height of a line, margins with a computed value of auto should be treated as having a value of 0. A similar process occurs for children in a
vertical box. Later lines in normal direction boxes are placed to the right of earlier lines and to the left in reverse direction boxes. Once the number of lines has been determined, elements with a computed value for box-flex other than 0 stretch as necessary in an attempt to fill the remaining space on the lines. Each line computes flexes independently, so only elements on that line are considered when...
caret-color - CSS: Cascading Style Sheets
By default, it is black, but its color can be altered with this property. ...
...nd us a pull request. Note that the insertion caret is only one type of caret. For example, many browsers have a "navigation caret," which acts similarly to an insertion caret but can be moved around in non-editable text. On the other hand, the mouse cursor image shown when hovering over text where the cursor property is auto, or when hovering over an element where the cursor property is text or
vertical-text, though it sometimes looks like a caret, is not a caret (it's a cursor). Syntax /* Keyword values */ caret-color: auto; caret-color: transparent; caret-color: currentcolor; /* <color> values */ caret-color: red; caret-color: #5729e9; caret-color: rgb(0, 200, 0); caret-color: hsla(228, 4%, 24%, 0.8); Values auto The user agent selects an appropriate color for the caret. This is gener...
mask-border-slice - CSS: Cascading Style Sheets
The mask-border-slice CSS property divides the image set by mask-border-source into regions. These regions are used to form the components of an element's mask border. Syntax /* All sides */ mask-border-slice: 30%; /*
vertical | horizontal */ mask-border-slice: 10% 30%; /* top | horizontal | bottom */ mask-border-slice: 30 30% 45; /* top | right | bottom | left */ mask-border-slice: 7 12 14 5; /* Using the `fill` keyword */ mask-border-slice: 10% fill 7 12; /* Global values */ mask-border-slice: inherit; mask-border-slice: initial; mask-border-slice: unset; The mask-border-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice. Negative values are invalid; values greater than their corresponding dimension are clamped to ...
...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 the regions. The above diagram illustrates the location of...
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, the...
...op, 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. auto The width of the mask border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding mask-border-slice. If the image does not have the required intrinsic dimension, the corresponding border-width is us...
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. 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 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:
vertical-rl; background-color: yellow; block-size: 100%; max-inline-size: 200px; } Result Specifications Specification Status Comment CSS Logical Properties and Values Level 1The definition of 'max-inline-size' in that specification. Editor's Draft Initial definition ...
overflow-y - CSS: Cascading Style Sheets
initial; overflow-y: unset; The overflow-y property is specified as a single keyword chosen from the list of values below. If overflow-x is hidden, scroll or auto and this property is visible (default) it will implicitly compute to auto. Values visible Content is not clipped and may be rendered outside the padding box's top and bottom edges. hidden Content is clipped if necessary to fit
vertically in the padding box. No scrollbars are provided. clip Like for hidden, the content is clipped to the element's padding box. The difference between clip and hidden is that the clip keyword also forbids all scrolling, including programmatic scrolling. The box is not a scroll container, and does not start a new formatting context. If you wish to start a new formatting context, you can use displ...
...den, the content is clipped to the element's padding box. The difference between clip and hidden is that the clip keyword also forbids all scrolling, including programmatic scrolling. The box is not a scroll container, and does not start a new formatting context. If you wish to start a new formatting context, you can use display: flow-root to do so. scroll Content is clipped if necessary to fit
vertically in the padding box. Browsers display scrollbars whether or not any content is actually clipped. (This prevents scrollbars from appearing or disappearing when the content changes.) Printers may still print overflowing content. auto Depends on the user agent. If content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. Desktop brows...
overscroll-behavior-y - CSS: Cascading Style Sheets
See overscroll-behavior for a full explanation. /* Keyword values */ overscroll-behavior-y: auto; /* default */ overscroll-behavior-y: contain; overscroll-behavior-y: none; /* Global values */ overscroll-behavior-y: inherit; overscroll-behavior-y: initial; overscroll-behavior-y: unset; Initial valueautoApplies tonon-replaced block-level elements and non-replaced inline-block elementsInheritednoComputed valueas specifiedAnimation typediscrete Syntax The overscroll-behavior-y property is specified as a keyword chosen from the list of values below. ...
...roll. none No scroll chaining occurs to neighbouring scrolling areas, and default 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 an underlying element from scrolling
vertically .messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } See overscroll-behavior for a full example and explanation. Specifications Specification Status Comment CSS Overscroll Behavior Module Level 1The definition of 'overscroll-behavior-y' in that specification. Working Draft ...
padding-block-end - CSS: Cascading Style Sheets
, 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. ...
... Editor's Draft Initial definition ...
padding-block-start - CSS: Cascading Style Sheets
de, 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. ...
... Editor's Draft Initial definition ...
padding-block - CSS: Cascading Style Sheets
following CSS properties: padding-block-end padding-block-start Syntax Values The padding-block property takes the same values as the padding-left property. ...
... Editor's Draft Initial definition ...
padding-inline-end - CSS: Cascading Style Sheets
de, 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. ...
... Editor's Draft Initial definition ...
padding-inline-start - CSS: Cascading Style Sheets
de, 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. ...
... Editor's Draft Initial definition ...
padding-inline - CSS: Cascading Style Sheets
o 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. ...
... Editor's Draft Initial definition ...
position - CSS: Cascading Style Sheets
inhibits any "sticky" behavior (see the GitHub issue on W3C CSSWG). Description Types of positioning A positioned element is an element whose computed position value is either relative, absolute, fixed, or sticky. (In other words, it's anything except static.) A relatively positioned element is an element whose computed position value is relative. The top and bottom properties specify the
vertical offset from its normal position; the left and right properties specify the horizontal offset. An absolutely positioned element is an element whose computed position value is absolute or fixed. The top, right, bottom, and left properties specify offsets from the edges of the element's containing block. (The containing block is the ancestor relative to which the element is positioned.) If the elem...
... 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 (of absolutely positioned elements filling the available space): If both top and bottom are specified (technically, not auto), top wins. If both ...
repeating-linear-gradient() - CSS: Cascading Style Sheets
/* A gradient repeating five times, going from the left to right, starting red, turning green, and back to red */ repeating-linear-gradient(to right, red 0%, green 10%, red 20%); Values <side-or-corner> The position of the gradient line's starting point. If specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the
vertical side (top or bottom). The order of the side keywords does not matter. If unspecified, it defaults to to bottom. The values to top, to bottom, to left, and to right are equivalent to the angles 0deg, 180deg, 270deg, and 90deg respectively. The other values are translated into an angle. <angle> The gradient line's angle of direction. A value of 0deg is equivalent to to top; increasing values rot...
... Note: Please see Using CSS gradients for more examples. Specifications Specification Status Comment CSS Images Module Level 3The definition of 'repeating-linear-gradient()' in that specification. Candidate Recommendation Initial definition. ...
scroll-snap-points-y - CSS: Cascading Style Sheets
/* Keyword value */ scroll-snap-points-y: none; /* Repeated snap points */ scroll-snap-points-y: repeat(400px); /* Global values */ scroll-snap-points-y: inherit; scroll-snap-points-y: initial; scroll-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. ...
...of the container. ...
scroll-snap-type-y - CSS: Cascading Style Sheets
The scroll-snap-type-y CSS property defines how strictly snap points are enforced on the
vertical axis of the scroll container in case there is one. Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent. /* Keyword values */ scroll-snap-type-y: none; scroll-snap-type-y: mandatory; scroll-snap-type-y: proximity; /* Global values */ scroll-snap-type-y: inherit; scroll-snap-type-y: initial; scroll-snap-type-y: unset; Syntax Values none When the visual viewport of this scroll container is scrolled
vertically, it must ignore snap points. mandatory The visual viewport of this scroll container will rest on a snap point if it isn't currently scrolled
vertically. That means it snaps on that point w...
...If content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point. ...
text-emphasis-position - CSS: Cascading Style Sheets
ition: left over; text-emphasis-position: right under; text-emphasis-position: left under; /* Global values */ text-emphasis-position: inherit; text-emphasis-position: initial; text-emphasis-position: unset; Syntax Values over Draw marks over the text in horizontal writing mode. under Draw marks under the text in horizontal writing mode. right Draws marks to the right of the text in
vertical writing mode. left Draw marks to the left of the text in
vertical writing mode. Description The preferred position of emphasis marks depends on the language. In Japanese for example, the preferred position is over right. In Chinese, on the other hand, the preferred position is under right. The informative table below summarizes the preferred emphasis mark positions for Chinese, Mongolian and...
...arks depends on the language. In Japanese for example, the preferred position is over right. In Chinese, on the other hand, the preferred position is under right. The informative table below summarizes the preferred emphasis mark positions for Chinese, Mongolian and Japanese: Preferred emphasis mark and ruby position Language Preferred position Illustration Horizontal
Vertical Japanese over right Korean Mongolian Chinese under right Note: The text-emphasis-position cannot be set, and therefore are not reset either, using the text-emphasis shorthand property. Formal definition Initial valueover rightApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax ...
top - CSS: Cascading Style Sheets
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. The effect of top depends on how the element is positioned (i.e., the value of the position property): When position is set to absolute or fixed, the top property specifies the distance between the element's top edge and the top edge of its containing block. ...
...lements, the distance that the element is moved below its normal position. <percentage> A <percentage> of the containing block's height. auto Specifies that: for absolutely positioned elements, the position of the element is based on the bottom property, while height: auto is treated as a height based on the content; or if bottom is also auto, the element is positioned where it should
vertically be positioned if it were a static element. for relatively positioned elements, the distance of the element from its normal position is based on the bottom property; or if bottom is also auto, the element is not moved
vertically at all. inherit Specifies that the value is the same as the computed value from its parent element (which might not be its containing block). This computed value...
translate() - CSS: Cascading Style Sheets
The translate() CSS function repositions an element in the horizontal and/or
vertical directions. Its result is a <transform-function> data type. This transformation is characterized by a two-dimensional vector. Its coordinates define how much the element moves in each direction. ...
...slate(200px); transform: translate(50%); /* Double <length-percentage> values */ transform: translate(100px, 200px); transform: translate(100px, 50%); transform: 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 tra...
<transform-function> - CSS: Cascading Style Sheets
ix3d() Describes a 3D transformation as a 4x4 homogeneous matrix. Perspective perspective() Sets the distance between the user and the z=0 plane. Rotation rotate() Rotates an element around a fixed point on the 2D plane. rotate3d() Rotates an element around a fixed axis in 3D space. rotateX() Rotates an element around the horizontal axis. rotateY() Rotates an element around the
vertical axis. rotateZ() Rotates an element around the z-axis. Scaling (resizing) scale() Scales an element up or down on the 2D plane. scale3d() Scales an element up or down in 3D space. scaleX() Scales an element up or down horizontally. scaleY() Scales an element up or down
vertically. scaleZ() Scales an element up or down along the z-axis. Skewing (distortion) skew() Skews an ele...
...r down on the 2D plane. scale3d() Scales an element up or down in 3D space. scaleX() Scales an element up or down horizontally. scaleY() Scales an element up or down
vertically. scaleZ() Scales an element up or down along the z-axis. Skewing (distortion) skew() Skews an element on the 2D plane. skewX() Skews an element in the horizontal direction. skewY() Skews an element in the
vertical direction. Translation (moving) translate() Translates an element on the 2D plane. translate3d() Translates an element in 3D space. translateX() Translates an element horizontally. translateY() Translates an element
vertically. translateZ() Translates an element along the z-axis. Description Various coordinate models can be used to describe an HTML element's size and shape, as we...
<colgroup> - HTML: Hypertext Markup Language
or monetary values. If align is not set to char, this attribute is ignored, though it will still be used as the default value for the align of the <col> which are members of this column group. charoff This attribute is used to indicate the number of characters to offset the column data from the alignment character specified by the char attribute. valign This attribute specifies the
vertical alignment of the text within each cell of the column. Possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the ...
...t on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the cell as it is possible; middle, which will center the text in the cell; and top, which will put the text as close to the top of the cell as it is possible. Note: Do not try to set the
vertical-align property on a selector giving a <colgroup> element. Because <td> elements are not descendant of the <colgroup> element, they won't inherit it. If the table doesn't use a colspan attribute, use the td:nth-child(an+b) CSS selector per column, 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 vertica...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
aracter to align the cells in a column on. Typical values for this include a period (.) when attempting to align numbers or monetary values. If align is not set to char, this attribute is ignored. charoff This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute. valign This attribute specifies the
vertical alignment of the text within each row of cells of the table header. Possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the ...
...seline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the cell as it is possible; middle, which will center the text in the cell; and top, which will put the text as close to the top of the cell as it is possible. As this attribute is deprecated, use the CSS
vertical-align property instead. Usage notes If the table includes a <thead> block (to semantically identify header rows), the <tbody> block must come after it. If you use <tbody>, you can't also have table rows (<tr> elements) which are direct children of the <table> but not included inside the <tbody>. All non-header and non-footer rows must be inside the <tbody> if one is used. When printing a...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
ies the length of this shift. height This attribute is used to define a recommended cell height. Use the CSS height property instead. scope This enumerated attribute defines the cells that the header (defined in the <th>) element relates to. Only use this attribute with the <th> element to define the row or column for which it is a header. valign This attribute specifies how a text is
vertically aligned inside a cell. Possible values for this attribute are: baseline: Positions the text near the bottom of the cell and 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.
...r the bottom of the cell and 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 specif...
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
mplemented. charoff Deprecated since HTML4Obsolete since HTML5 This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute. Note: Do not use this attribute as it is obsolete (and not supported) in the latest standard. valign Deprecated since HTML4Obsolete since HTML5 This attribute specifies the
vertical alignment of the text within each row of cells of the table header. Possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the ...
... are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the cell as it is possible; middle, which will center the text in the cell; and top, which will put the text as close to the top of the cell as it is possible. Note: Do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the CSS
vertical-align property on it. Examples Please see the <table> page for examples on <tfoot>. Specifications Specification Status Comment HTML Living StandardThe definition of 'tfoot element' in that specification. Living Standard HTML5The definition of 'tfoot element' in that specification. Recommendation ...
<th> - HTML: Hypertext Markup Language
the length of this shift. Note: Do not use this attribute as it is obsolete in the latest standard. height Deprecated since HTML4, Obsolete since HTML5 This attribute is used to define a recommended cell height. Note: Do not use this attribute as it is obsolete in the latest standard: use the CSS height property instead. valign Obsolete since HTML5 This attribute specifies how a text is
vertically aligned inside a cell. Possible values for this attribute are: baseline: Positions the text near the bottom of the cell and 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.
...he 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. 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...
<thead>: The Table Head element - HTML: Hypertext Markup Language
e value of the text-align property Unimplemented. charoff in HTML 4, in HTML5 This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute. Note: Do not use this attribute as it is obsolete (and not supported) in the latest standard. valign in HTML 4, in HTML5 This attribute specifies the
vertical alignment of the text within each row of cells of the table header. Possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the ...
...ters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the cell as it is possible; middle, which will center the text in the cell; top, which will put the text as close to the top of the cell as it is possible. Note: Do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the CSS
vertical-align property on it. Examples See <table> for examples on <thead>. Specifications Specification Status Comment HTML Living StandardThe definition of 'thead element' in that specification. Living Standard HTML5The definition of 'thead element' in that specification. Recommendation ...
Mobile first - Progressive web apps (PWAs)
t of the initial view of the app, covering up the content. There several ways to solve the problem of navigation getting in the way on mobile, a few of which I'll discuss here. The main objective is to put the content first and to hide away the navigation until the user really needs it. First of all, you can consider a different navigation mechanism on mobile. So, if you were planning to have a
vertical navigation menu on desktop, you might replace this on mobile with a select menu containing the options, or even a single button that when pressed brings the navigation options up in an overlay. Second, a popular option is to put the navigation menu down at the bottom of the page rather than up at the top as the expectation would commonly be. This puts the content first at the top of the page and...
... The second one sets the width of the content at 600px and centers it in the space available, then adds in a gradient and a nice background image for the wider layout. This is a key point - the background image is 126KB, and not ideal for narrow layouts. Having it included in the "600 pixels or wider" media query m...
alignment-baseline - SVG: Scalable Vector Graphics
eing aligned is aligned with the "before-edge" baseline of the parent text content element. text-bottom Matches the bottom of the box to the top of the parent's content area. text-before-edge The alignment-point of the object being aligned is aligned with the "text-before-edge" baseline of the parent text content element. Note: This keyword may be mapped to text-top. middle Aligns the
vertical midpoint of the box with the baseline of the parent box plus half the x-height of the parent. central Matches the box's central baseline to the central baseline of its parent. after-edge The alignment-point of the object being aligned is aligned with the "after-edge" baseline of the parent text content element. text-top Matches the top of the box to the top of the parent's content are...
... Aligns the bottom of the aligned subtree 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. Example <svg width="300" height="120" viewBox="0 0 300 120" xmlns="http://www.w3.org/2000/svg"> <!-- Materialisation of anchors --> <path d="M60,10 L60,110 M30,10 L300,10 M30,65 L300,65 M30,110 L300,110 " stroke="grey" /> <!-- Anchors in action --> <text alignment-baseline="hanging" x="60...
baseline-shift - SVG: Scalable Vector Graphics
The baseline-shift attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. The shifted object might be a sub- or superscript. Note: As a presentation attribute baseline-shift can be used as a CSS property. Note: This property is going to be deprecated and authors are advised to use
vertical-align instead. As a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altGlyph>, <textPath>, <tref>, and <tspan> Usage notes Value <length-percentage> | sub | super Default value 0 Animatable Yes sub The dominant-baseline is shifted to the default position for subscripts. super The dominant-baseline is shifted to the default po...
...e raises (positive value) or lowers (negative value) the dominant-baseline of the parent text content element by the specified percentage of the line-height. Specifications Specification Status Comment CSS Inline LayoutThe definition of 'alignment-baseline' in that specification. Working Draft Removed the baseline value, as it is a redundant keyword within the
vertical-align property. Scalable Vector Graphics (SVG) 2The definition of 'alignment-baseline' in that specification. Candidate Recommendation Refers to the definition in CSS Inline Layout and notes that
vertical-align should be preferred. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'alignment-baseline' in that specification. Recommendation Initial d...
d - SVG: Scalable Vector Graphics
= {x, yo} h dx+ Draw a horizontal line from the current point to the end point, which is specified by the current point shifted by dx along the x-axis and the current point's y coordinate. Any subsequent value(s) are interpreted as parameter(s) for implicit relative horizontal LineTo (h) command(s). ...
...dinate. Any subsequent value(s) are interpreted as parameter(s) for implicit relative horizontal LineTo (h) command(s). Formula: Po? = Pn = {xo + dx, yo} V y+ Draw a
vertical line from the current point to the end point, which is specified by the y parameter and the current point's x coordinate. Any subsequent values are interpreted as parameters for implicit absolute
vertical LineTo (V) command(s). Formula: Po? = Pn = {xo, y} v dy+ Draw a
vertical line from the current point to the end point, which is specified by the current point shifted by dy along the y-axis and the current point's x coordinate. Any subsequent value(s) are interpreted as parameter(s) for implicit relative
vertical LineTo (v) command(s). Formula: Po? = Pn = {xo, yo...
dominant-baseline - SVG: Scalable Vector Graphics
ideographic | middle | central | mathematical | hanging | text-top Default value auto Animatable Yes auto If this property occurs on a <text> element, then the computed value depends on the value of the writing-mode attribute. If the writing-mode is horizontal, then the value of the dominant-baseline component is alphabetic. Otherwise, if the writing-mode is
vertical, then the value of the dominant-baseline component is central. If this property occurs on a <tspan>, <tref>, <altGlyph>, or <textPath> element, then the dominant-baseline and the baseline-table components remain the same as those of the parent text content element. If the computed baseline-shift value actually shifts the baseline, then the baseline-table font-size component is set to the val...
...occurs, otherwise the baseline-table font-size remains the same as that of the element. If there is no parent text content element, the scaled-baseline-table value is constructed as above for <text> elements. use-script The dominant-baseline and the baseline-table components are set by determining the predominant script of the character data content. The writing-mode, whether horizontal or
vertical, is used to select the appropriate set of baseline-tables and the dominant baseline is used to select the baseline-table that corresponds to that baseline. The baseline-table font-size component is set to the value of the font-size attribute on the element on which the dominant-baseline attribute occurs. no-change The dominant-baseline, the baseline-table, and the baseline-table font-size rema...
slope - SVG: Scalable Vector Graphics
Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'slope' in that specification. ...
... Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'slope' in that specification. ...
targetY - SVG: Scalable Vector Graphics
Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'targetY' in that specification. ...
...on matrix relative to a given target pixel in the input image. The topmost row of the matrix is row number zero. The value must be such that: 0 <= targetY < orderY. Only one element is using this attribute: <feConvolveMatrix> Usage notes Value <integer> Default value floor(orderY / 2) Animatable Yes <integer> This value indicates the positioning in
vertical direction of the convolution matrix relative to a given target pixel in the input image. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'targetY' in that specification. Working Draft No change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'targetY' in that specification. Recommendat...
text-anchor - SVG: Scalable Vector Graphics
of the text string is at the initial current text position. For an element with a direction property value of ltr (typical for most European languages), the left side of the text is rendered at the initial text position. For an element with a direction property value of rtl (typical for Arabic and Hebrew), the right side of the text is rendered at the initial text position. For an element with a
vertical primary text direction (often typical for Asian text), the top side of the text is rendered at the initial text position. middle The rendered characters are aligned such that the middle of the text string is at the current text position. (For text on a path, conceptually the text string is first laid out in a straight line. The midpoint between the start of the text string and the end of the te...
...xt-anchor property) is at the initial current text position. For an element with a direction property value of ltr (typical for most European languages), the right side of the text is rendered at the initial text position. For an element with a direction property value of rtl (typical for Arabic and Hebrew), the left side of the text is rendered at the initial text position. For an element with a
vertical primary text direction (often typical for Asian text), the bottom of the text is rendered at the initial text position. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'text-anchor' in that specification. Candidate Recommendation No significant change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The ...
transform - SVG: Scalable Vector Graphics
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 translation --> <rect x="5" y="5" width="40" height="40" fill="green" /> <!-- Horizontal translation --> <rect x="5" y="5" width="40" height="40" fill="blue" transform="translate(50)" /> <!--
Vertical translation --> <rect x="5" y="5" width="40" height="40" fill="red" transform="translate(0 50)" /> <!-- Both horizontal and
vertical translation --> <rect x="5" y="5" width="40" height="40" fill="yellow" transform="translate(50,50)" /> </svg> Scale The scale(<x> [<y>]) transform function specifies a scale operation by x and y. If y is not provided, it is assumed to be ...
...nsform="translate(50,50)" /> </svg> Scale The scale(<x> [<y>]) transform function specifies a scale operation by x and y. If y is not provided, it is assumed to be equal to x. Example html,body,svg { height:100% } <svg viewBox="-50 -50 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- uniform scale --> <circle cx="0" cy="0" r="10" fill="red" transform="scale(4)" /> <!--
vertical scale --> <circle cx="0" cy="0" r="10" fill="yellow" transform="scale(1,4)" /> <!-- horizontal scale --> <circle cx="0" cy="0" r="10" fill="pink" transform="scale(4,1)" /> <!-- No scale --> <circle cx="0" cy="0" r="10" fill="black" /> </svg> Rotate The rotate(<a> [<x> <y>]) transform function specifies a rotation by a degrees about a given point. If optional pa...
vert-adv-y - SVG: Scalable Vector Graphics
The vert-adv-y attribute indicates the
vertical advance after rendering a glyph in
vertical orientation. Three elements are using this attribute: <font>, <glyph>, and <missing-glyph> font For <font> elements, vert-adv-y specifies the default
vertical advance for a glyph in
vertical orientation. Value <number> Default value 1 em as of units-per-em Animatable No <number> This value indicates the default
vertical advance of the glyph in
vertical direction glyph, missing-glyph For <glyph> and <missing-glyph> elements, vert-adv-y specifies the
vertical advance for a glyph in
vertical orientation. Value <number> Default value <font>'s vert-adv-y value Animatable No <number> This value indicates the vert...
...dicates the default
vertical advance of the glyph in
vertical direction glyph, missing-glyph For <glyph> and <missing-glyph> elements, vert-adv-y specifies the
vertical advance for a glyph in
vertical orientation. Value <number> Default value <font>'s vert-adv-y value Animatable No <number> This value indicates the
vertical advance of the glyph in
vertical direction Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'vert-adv-y for <glyph> and <missing-glyph>' in that specification. Recommendation Initial definition for <glyph> and <missing-glyph> Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'vert-adv-y for <font>' in ...
writing-mode - SVG: Scalable Vector Graphics
idi.) Note: As a presentation attribute, writing-mode can be used as a CSS property. See the css writing-mode property for more information. As a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altGlyph>, <text>, <textPath>, <tref>, and <tspan> Usage notes Default value horizontal-tb Value horizontal-tb |
vertical-rl |
vertical-lr Animatable Yes horizontal-tb This value defines a top-to-bottom block flow direction. Both the writing mode and the typographic mode are horizontal.
vertical-rl This value defines a right-to-left block flow direction. Both the writing mode and the typographic mode are
vertical.
vertical-lr This value defines a left-to-right block flow direction. Both the...
... Specifications Specification Status Comment CSS Writing Modes Module Level 3The definition of 'writing-mode' in that specification. ...
y - SVG: Scalable Vector Graphics
<length> | <percentage>) Default value 0 Animatable Yes Example html,body,svg { height:100% } <svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal line to materialized the text base line --> <line x1="0" y1="40%" x2="100%" y2="40%" /> <line x1="0" y1="60%" x2="100%" y2="60%" /> <line x1="0" y1="80%" x2="100%" y2="80%" /> <!--
vertical line to materialized the x positioning --> <line x1="5%" y1="0" x2="5%" y2="100%" /> <line x1="55%" y1="0" x2="55%" y2="100%" /> <!-- y with a single value --> <text y="40%" x="5%">SVG</text> <!-- y with multiple values --> <text y="40%,60%,80%" x="55%">SVG</text> </svg> text { font: 40px sans-serif; } line { fill: none; stroke: red; stroke-width: .5px; stroke-dasharra...
...ngth> | <percentage>) Default value none Animatable Yes Example html,body,svg { height:100% } <svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- horizontal line to materialized the text base line --> <line x1="0" y1="40%" x2="100%" y2="40%" /> <line x1="0" y1="60%" x2="100%" y2="60%" /> <line x1="0" y1="80%" x2="100%" y2="80%" /> <!--
vertical line to materialized the x positioning --> <line x1="5%" y1="0" x2="5%" y2="100%" /> <line x1="55%" y1="0" x2="55%" y2="100%" /> <text> <!-- y with a single value --> <tspan y="40%" x="5%">SVG</tspan> <!-- y with multiple values --> <tspan y="40%,60%,80%" x="55%">SVG</tspan> </text </svg> text { font: 40px sans-serif; } line { fill: none; stroke: red; stroke-...
SVG Attribute reference - SVG: Scalable Vector Graphics
eline dur dx dy E edgeMode elevation enable-background end exponent externalResourcesRequired F fill fill-opacity fill-rule filter filterRes filterUnits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight format from fr fx fy G g1 g2 glyph-name glyph-orientation-horizontal glyph-orientation-
vertical glyphRef gradientTransform gradientUnits 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 ...
...shift, clip, clip-path, clip-rule, color, color-interpolation, color-interpolation-filters, color-profile, color-rendering, cursor, direction, display, dominant-baseline, enable-background, fill, fill-opacity, fill-rule, filter, flood-color, flood-opacity, font-family, font-size, font-size-adjust, font-stretch, 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, ve...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
Implemented. polyline Implemented. polygon Implemented. Text Module text Implemented. Various presentation attributes don't work (alignment-baseline, baseline-shift, dominant-baseline, kerning, letter-spacing, word-spacing, writing-mode, glyph-orientation-horizontal, glyph-orientation-
vertical) Recently implemented presentation attributes: direction, unicode-bidi, font-variant, text-decoration SVGTextElement Recently imlemented bindings: selectSubString Recently implemented attributes: textLength, lengthAdjust tspan Implemented. Various presentation attributes don't work (alignment-baseline, baseline-sh...
...ent Recently imlemented bindings: selectSubString Recently implemented attributes: textLength, lengthAdjust tspan Implemented. ...
Patterns - SVG: Scalable Vector Graphics
re is described below. As with the gradientUnits attribute used above, patterns also have an attribute, patternUnits, which specifies the units that these attributes will take. It defaults to "objectBoundingBox" as it did above, so a value of 1 is scaled to the width/height of the object you're applying the pattern to. Since, in this case, we wanted the pattern to repeat 4 times horizontally and
vertically, the height and width are set to 0.25. This means the pattern's width/height is only 0.25 of the total box size. Unlike gradients, patterns have a second attribute, patternContentUnits, which describes the units system used inside the pattern element, on the basic shapes themselves. This attribute defaults to "userSpaceOnUse", the opposite of the patternUnits attribute. What this means is that...
...tentUnits and patternUnits), the shapes you draw inside your pattern are being drawn in a different coordinate system than the pattern element is using, which can make things a bit confusing when you're writing this by hand. To make this work in the example above, we had to consider the size of our box (200 pixels) and the fact that we wanted the pattern to repeat itself 4 times horizontally and
vertically. This means that each pattern unit was a 50x50 square. The two rects and the circle inside the pattern were then sized to fit in a 50x50 box. Anything we had drawn outside that box wouldn't have been shown. The pattern also had to be offset by 10 pixels so that it would start in the upper-left corner of our box, so the x and y attributes of the pattern had to be adjusted to 10/200 = 0.05. The ...
Texts - SVG: Scalable Vector Graphics
example, that the text element can be used to put arbitrary text in SVG documents: <text x="10" y="10">Hello World!</text> The x and y attributes determine, where in the viewport the text will appear. The attribute text-anchor, which can have the values "start", "middle", "end" or "inherit", decides in which direction the text flows from this point. The attribute dominant-baseline decides the
vertical alignment. Like with the shape elements text can be colorized with the fill attribute and given a stroke with the stroke attribute. Both may also refer to gradients or patterns, which makes simple coloring text in SVG very powerful compared to CSS 2.1. Setting font properties An essential part of a text is the font in which it is displayed. SVG offers a set of attributes, many similar to their...
... current text position. The attribute may also contain a list of numbers, that are one by one applied to the single characters of the tspan element. dx Start drawing the text with a horizontal offset dx from the default current position. Here, too, you may provide a list of values that are applied to consecutive characters, hence piling up the offset over time. Likewise, there are y and dy for
vertical displacement. rotate Rotate all characters by this degree. A list of numbers makes each character rotate to its respective value, with remaining characters rotating according to the last value. textLength This is a more obscure attribute giving the calculated length of the string. It is meant to allow the rendering engine to fine-tune the positions of the glyphs when its own measured text l...
ui - Archive of obsolete content
You initialize a sidebar with a URL pointing to an HTML document supplied under your add-on's "data" directory. This document can refer to bundled CSS and JavaScript files, and your main add-on can communicate with a frame script using message passing. var ui = require("sdk/ui"); var sidebar = ui.Sidebar({ id: 'my-sidebar', title: 'My s...
ui/sidebar - Archive of obsolete content
You specify its content using HTML, CSS, and JavaScript, and the user can show or hide it in the same way they can show or hide the built-in sidebars. Usage Creating, showing, and hiding sidebars You construct a Sidebar object using the Sidebar() constructor. Once you've done that, you can show the sidebar by calling the Sidebar's show() method. If a new window is opened from a window that has a sidebar visible, the new window gets a sidebar, too. You can hide the sidebar by calling its hide() method. ...
ui/toolbar - Archive of obsolete content
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. onShow function Assign a listener to the show event. ...
Forms related code snippets - Archive of obsolete content
g: 0 2px; height: 16px; font-weight: bold; background-color: #999999; border-radius: 5px; cursor: pointer; } span.zdp-decrease-month, span.zdp-decrease-year { float: left; margin-right: 2px; } span.zdp-increase-month, span.zdp-increase-year { float: right; margin-left: 2px; } td.zdp-active-cell { padding: 1px 3px; cursor: pointer; color: #000000; text-align: center;
vertical-align: middle; } td.zdp-active-cell:hover { background-color: #999999; cursor: pointer; } td.zdp-empty-cell { cursor: not-allowed; } </style> </head> <body> <form name="myform"> <p> From: <input type="text" readonly class="date-picker" name="date-from" /> To: <input type="text" readonly class="date-picker" name="date-to" /> </p> </form> </body> </html> Note: The current i...
Scrollbar - Archive of obsolete content
e the app/chrome/skin/global/scrollbars.css to test that the css is used. Example xul window: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="sampleWindow" width="320" height="240" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <hbox flex="1"> <browser type="content" src="http://mozilla.org" flex="1"/> <scrollbar orient="
vertical"/> </hbox> </window> ...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
when the user right-clicks on the toolbar. This popup is already part of the main window, so it doesn't need to be implemented again. The defaultset attribute lists the ids of the icons you want to include on your toolbar by default. It's a comma-separated list of ids, and it can also include other special values: spacer, separator and spring. spacer represents an empty button space, separator a
vertical separation line and spring a flexible empty area that stretches. Finally, the insertbefore attribute places our toolbar above the Bookmarks Toolbar. This is a matter of personal preference, but the Mac OS theme seems to be designed so that the Bookmarks Toolbar is always the last one (it has a lighter color than the rest). It also makes sense from a usability perspective, since bookmarks should ...
Adding sidebars - Archive of obsolete content
ndex depending on the purpose of the window. This way you can still use DTD, and the code remains simple. A stack is like a deck, except that all of its children are always on display, one of top of the other. It allows you to decompose complex UI into individual layers, broadening the layout possibilities. One common use for a stack is to have an image background that stretches horizontally and
vertically depending on the size of the foreground object: <stack> <hbox flex="1"> <image src="chrome://xulschoolhello/skin/stack-bg.png" flex="1" /> </hbox> <hbox> <!-- Some content here. --> </hbox> </stack> This workaround is necessary because you can't have an background image stretch using CSS. A less common use for the stack element is to use the left and top attributes on its...
MozOrientation - Archive of obsolete content
e X axis, and approaches 1 as the device is tilted toward the left, and -1 as the device is tilted toward the right. The Y axis represents the amount of front-to-back tilt. The value is 0 if the device is level along the Y axis, and approaches 1 as you tilt the device backward (away from you) and -1 as you tilt the device frontward (toward you). The Z axis represents acceleration
vertically. The value is -1 when the device is undergoing standard Earth gravity (9.8m/sec2) but not moving. Moving the device upward causes the value to increase. The value is 0 if the device is being thrust upward. In free fall (weightless or falling as a result of a drop), the value remains -1. In weightlessness, all values would be zero when the device is not moving, regardless of orientation,...
Block and Line Layout Cheat Sheet - Archive of obsolete content
should create its own space manager. This is required by each block frame that can contain floaters: the space manager is used to reserve space for the floated frames. This is set by default for document frames, area frames, table cell inner frames, absolutely positioned wrapper frames, and floated frames when the frame is created. nsLineBox A block consists of lines and other blocks, stacked
vertically. A block frame has one nsLineBox for each line, and one nsLineBox for each block child. These are stored as a doubly-linked list in the mLines member of nsBlockFrame. nsInlineFrame mFlags NS_INLINE_FRAME_CONTAINS_PERCENT_AWARE_CHILD This flag is set if the inline frame has any children that have a percentage value set (via the style context) for the width or height of the content area, p...
Clipboard Test - Archive of obsolete content
ld):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;
vertical-align:top;font-weight:bold;} .method>.params>.param>.default:before{content: "Default "; color: #888;fon...
Creating XPI Installer Modules - Archive of obsolete content
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 that the stylesheet processing instruction at the top of the XUL file does not ...
dir - Archive of obsolete content
<< XUL Reference home dir Type: one of the values below The direction in which the child elements of the element are placed. normal For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for
vertical scales) For other elements, the elements are placed left to right or top to bottom in the order they appear in the XUL code. reverse For scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for
vertical scales). For other elements, they are placed right to left or bottom to top. This is reverse of the order in which they appear in the XUL code. See also resizer.dir ...
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. ...
orient - Archive of obsolete content
<< XUL Reference home orient Type: one of the values below Used to specify whether the children of the element are oriented horizontally or
vertically. The default value depends on the element. You can also use the -moz-box-orient style property. horizontal Child elements of the element are placed next to each other in a row in the order that they appear in the XUL source.
vertical Child elements of the element are placed under each other in a column in the order that they appear in the XUL source. See also separator.orient ...
separator.orient - Archive of obsolete content
<< XUL Reference home orient Type: one of the values below Used to specify whether the separator is a horizontal or
vertical separator. Note that the values are the reverse of what seems more likely. horizontal The separator separates
vertically placed elements.
vertical The separator separates horizontally placed elements. See also orient ...
insertItem - Archive of obsolete content
alse, the new item is added to the end of the toolbar. The third argument can be used to wrap the new item in another element. Usually, the last argument will be null as it is mainly for the use of the customize dialog. The id should match an element in the toolbar's toolbarpalette. Some special ids may also be used to create special spacing items: separator: A separator, which is drawn as a
vertical bar. spacer: A non-flexible space. spring: A flexible space. The method returns the DOM element for the created item. ...
MoveResize - Archive of obsolete content
Moving and Resizing a Popup Menus and popups have methods which may be used to move and resize them. Moving a Popup Once a popup is open, it can be moved using the popup's moveTo method. void moveTo(in long left, in long top); The left argument is the horizontal screen position and the top argument is the
vertical screen position. This method will change the left and top attributes to match the supplied arguments, so if these attributes are persisted the values will be restored when the window is displayed again. For instance, the following example will move a popup to the upper left corner of the screen: popup.moveTo(0, 0); The position may be shifted so as not to cover user interface elements provided by the operating system, such as the menu bar or the task bar. Resizing a Popup Th...
OpenClose - Archive of obsolete content
ment and just appears at a specific location specified by the x and y arguments to this method. void openPopupAtScreen(in long x, in long y, in boolean isContextMenu); The isContextMenu argument indicates that a context menu is being opened, and functions the same as the corresponding argument for the openPopup method. In the following example, the popup is opened at horizontal positon 100 and
vertical position 200: popup.openPopupAtScreen(100, 200, false); Note that if the supplied coordinates would cause the popup to be partially or completely off screen, the popup will be moved such that it is fully visible, and may be resized if necessary. Closing a Popup with the hidePopup method A popup menu is closed by the user pressing the Escape key or by clicking somewhere outside the popup. Fo...
Multiple Rules - Archive of obsolete content
The query generates a list of the photos and assigns the title of each photo to the variable '?title'. Note that the full query syntax must be used to use conditions within rules. The first rule conta...
Box Objects - Archive of obsolete content
ally, pressing the button labeled Three will increase its ordinal to 2 and it will appear in between the other two buttons. dir attribute The final box ordering attribute is the dir attribute, or the -moz-box-direction CSS property. If this is set to reverse, all of the children in the box are displayed in reverse order. In a horizontal box, the elements will be displayed from right to left; in a
vertical box, the elements will be displayed from bottom to top. Here is an example: Example 5 : Source View <hbox dir="reverse"> <button label="Left"/> <button label="Center"/> <button label="Right"/> </hbox> Navigation through the nodes using the box object ordering will return the elements in the order they are displayed accounting for the ordinal adjustments made. Thus, if you change the ordina...
Creating a Window - Archive of obsolete content
nt. title="Find Files" The title attribute describes the text that would appear on the title bar of the window when it is displayed. In this case the text 'Find Files' will appear. orient="horizontal" The orient attribute specifies the arrangement of the items in the window. The value horizontal indicates that items should be placed horizontally across the window. You may also use the value
vertical, which means that the items are placed in a column. This is the default value, so you may leave the attribute off entirely if you wish to have
vertical orientation. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> This line declares the namespace for XUL, which you should put on the window element to indicate that all of its children are XUL. Note that this URL is never a...
Features of a Window - Archive of obsolete content
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 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 ...
Numeric Controls - Archive of obsolete content
the maximum size of a file. A scale would be used when the actual value isn't important, just that sliding the scale decreases or increases a state. For instance, a volume slider or a zoom level. The default arrangement of a scale is horizontal with lower values to the left and higher values to the right. However, you can change this orientation with the orient and dir attributes. <scale orient="
vertical" dir="reverse"/> This scale will be shown
vertical with lower values at the bottom and higher values at the top. Date and Time Entry Fields The datepicker and timepicker elements may be used to allow the user to enter dates and times. When used, they display a set of numeric textboxes to enter each of the components of the date or time. <datepicker value="2004-03-24"/> <timepicker value="15:30:0...
Scroll Bars - Archive of obsolete content
<scrollbar id="identifier" orient="horizontal" curpos="20" maxpos="100" increment="1" pageincrement="10"/> The attributes are as follows: id The unique identifer of the scroll bar orient This specifies the direction of the scroll bar. The default is horizontal, which creates a scroll bar that extends from left to right. You can also specify
vertical which creates a scroll bar that extends from top to bottom. curpos This indicates the current position of the scroll bar thumb (the box that you can slide back and forth.) The value ranges from 0 to the value of maxpos. This value does not need a unit. The default value is 0. maxpos This indicates the maximum position of the scroll bar thumb. The is a numeric value...
Stack Positioning - Archive of obsolete content
coordinates. For example, if a stack has two buttons as children, one may be placed 20 pixels from the left edge and 50 pixels from the top edge. The second button can be placed at 100 pixels from the left edge and 5 pixels from the top edge. The position of a child element may be specified by placing two attributes on the element. For the horizontal position, use the left attribute and for the
vertical position, use the top attribute. If you don't put these attributes on a child of a stack, the child will stretch to fit the size of the stack. Example 1 : Source View <stack> <button label="Goblins" left="5" top="5"/> <button label="Trolls" left="60" top="20"/> <button label="Vampires" left="10" top="60"/> </stack> The stack here contains three elements, each positioned at the coordin...
Tree Box Objects - Archive of obsolete content
at specific coordinates and vice versa. The getCellAt() function may be used to get the cell at specific pixel location The getRowAt() function may be used to get a row at a specific location. The getRowAt() function takes two arguments, the x and y coordinates to use. tree.boxObject.getRowAt( 50, 100 ); This example will return the index of the row with a horizontal position of 50 and a
vertical position of 100. Naturally, it doesn't really matter what the value of the x coordinate is since rows always take up the entire horizontal space of the tree. One important thing to note is that the coordinates are measured from the upper left corner of the containing document, not the edge of the tree itself. This makes it easy to pass event coordinates directly to these functions, as in the fo...
Using Spacers - Archive of obsolete content
less than the space needed to fit its label. Specifying a flex value of 0 has the same effect as leaving the flex attribute out entirely. It means that the element is not flexible at all. You may also sometimes see a flex value specified as a percentage. This has no special meaning and is treated as if the percent sign was not there. You may have noticed that when you resize the find file dialog
vertically, the buttons resize themselves to fit the height of the window. This is because all of the buttons have an implied
vertical flex given to them by the window. In the next section we'll learn how to change this. Find files example so far Source View Next, we will learn some additional features of buttons. << PreviousNext >> ...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
</tabpanel> </tabpanels> Focusing the tabbox will visually set focus to the selected tab, then you can select different tabs by using the left and right arrow keys. tabbrowser JAWS 7.10 issues Testing with JAWS 7.10, use of a tabbrowser element causes many, unpredictable issues with XUL inside of the iframe. Okay to use HTML inside of tabbrowser. See browser elem...
menupopup - Archive of obsolete content
topright, bottomleft or bottomright. Positions specified as a single word string are shortcuts for the values above. Valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. For more details, including examples, please see popup positioning top Type: integer Overrides the
vertical position of the popup specified by the showPopup method. Properties accessibleType Type: integer A value indicating the type of accessibility object for the element. anchorNode Type: nsIDOMElement This read-only property holds the DOM node that was specified as the anchor when opening the popup. popupBoxObject Type: nsIPopupBoxObject This r...
notificationbox - Archive of obsolete content
o display notifications above an element. Typically the element will be a browser, but any element may be used. The notification element is used for each notification, and will be created automatically for each item. Each notification will slide in and out as needed. This element is used, for example, to implement the yellow information bar in various Firefox windows. The notification box is a
vertical box which may have children. The notifications appear at the top of the box. The notifications may be placed at the bottom by setting the dir attribute to reverse. Finding the current notification box Within a Firefox extension, you can retrieve the current notification box for a specific tab by calling the global function getNotificationBox(): notifyBox = chromeWin.getNotificationBox(notifyWi...
radiogroup - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] A group of radio buttons. Only one radio button inside the group can be selected at a time. The radio buttons may either direct children of the radiogroup or descendants. Place the radiogroup inside a groupbox if you would like a border or caption for the group. The radiogroup defaults to
vertical orientation. More information is available in the XUL tutorial. Attributes disabled, focused, preference, tabindex, value Properties accessibleType, disabled, focusedItem, itemCount, selectedIndex, selectedItem, tabIndex, value Methods appendItem, checkAdjacentElement, getIndexOfItem, getItemAtIndex, insertItemAt, removeItemAt Examples <radiogroup> <radio id="orange" label="Red"/> ...
resizer - Archive of obsolete content
command event after the resize 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. ...
scrollbox - Archive of obsolete content
alue="04 conceived in Liberty, and "/> <label value="05 dedicated to the proposition "/> <label value="06 that 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 father...
scrollcorner - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] This element is used for the small box where the horizontal and
vertical scrollbars meet. 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 Properti...
separator - Archive of obsolete content
arts of a dialog. It doesn't draw a bar visually, but is just a small space. It is functionally equivalent to a spacer except it defaults to a small size (usually 1.5 ems). Attributes orient Style classes groove, groove-thin, thin Examples <separator class="groove-thin"/> Attributes orient Type: one of the values below Used to specify whether the separator is a horizontal or
vertical separator. Note that the values are the reverse of what seems more likely. horizontal The separator separates
vertically placed elements.
vertical The separator separates horizontally placed elements. Inherited from XUL element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, di...
toolbar - Archive of obsolete content
alse, the new item is added to the end of the toolbar. The third argument can be used to wrap the new item in another element. Usually, the last argument will be null as it is mainly for the use of the customize dialog. The id should match an element in the toolbar's toolbarpalette. Some special ids may also be used to create special spacing items: separator: A separator, which is drawn as a
vertical bar. spacer: A non-flexible space. spring: A flexible space. The method returns the DOM element for the created item. Inherited Methods addEventListener(), appendChild(), blur, click, cloneNode(), compareDocumentPosition, dispatchEvent(), doCommand, focus, getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getBoundingClientRect(), getClientRects(),...
toolbox - Archive of obsolete content
If a toolbar is placed inside a toolbox, a grippy is displayed on its left or upper edge. The user may click the grippy to collapse the toolbar. If multiple toolbars are placed in the same toolbox, they will all collapse into the same row. The Firefox browser does not have grippies so toolbars cannot be collapsed and expanded. Note: Gecko 2.0 adds support for external toolbars. These are toolbars that are not children of a toolbox. ...
window - Archive of obsolete content
ents. This affects only on Mac OS X. lightweightthemes Type: boolean true if the window supports lightweight themes, otherwise false. lightweightthemesfooter Type: id Specifies the ID of an element to which a lightweight theme's footer image will be applied. screenX Type: integer The horizontal position at which the window appears on the screen. screenY Type: integer The
vertical position at which the window appears on the screen. sizemode Type: one of the values below The state of the window. It can have one of the following values: maximized The window is maximized, and occupies the full size of the screen. normal The window appears in a normal state at the desired size. This attribute is used to save and restore the state of a window (together...
Windows and menus in XULRunner - Archive of obsolete content
r buttons through the CSS file. We could hard-code the images in the XUL file itself, but CSS is a better practice. Here's the CSS file: /* global skin --------------------------------------------------- */ @import url(chrome://global/skin/); /* toolbar ------------------------------------------------------- */ #open { list-style-image: url(chrome://basicapp/skin/open.png); -moz-box-orient:
vertical; } #save { list-style-image: url(chrome://basicapp/skin/save.png); -moz-box-orient:
vertical; } Of course, you need to make sure the PNG files are included in the application. There are quite a few things XUL offers for application UI. More than I can fit into a single article, so we will continue looking at building UI in XULRunner in the next article. See also XUL:Windows XUL Tutor...
2006-12-24 - Archive of obsolete content
Summary: mozilla.dev.tech.layout November 24 -December 1, 2006 Announcements None this week. Discussions [Reset issue for overflow='hidden' In IE and Opera there is a very modest horizontal shift of the document due to reflow associated with the removal of the
vertical scroll bar (because the document content is using a horizontal centering style). But in Firefox the document is reset (shifted both horizontally and
vertically) to its 0,0 position before being centered horizontally. ...
2006-12- 02 - Archive of obsolete content
Summary: mozilla.dev.tech.layout - November 24 2006 - December 2, 2006 Announcements None this week. Discussions [Reset issue for overflow='hidden' In IE and Opera there is a very modest horizontal shift of the document due to reflow associated with the removal of the
vertical scroll bar (because the document content is using a horizontal centering style). But in Firefox the document is reset (shifted both horizontally and
vertically) to its 0,0 position before being centered horizontally. ...
-ms-overflow-style - Archive of obsolete content
e. 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 scrollbars overlap t...
CSS - Archive of obsolete content
Microsoft extension that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-x properties.-ms-scroll-snap-yThe -ms-scroll-snap-x CSS shorthand property is a Microsoft extension that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-y properties.-ms-scroll-translationThe -ms-scroll-translation CSS property is a Microsoft extension that specifies whether
vertical-to-horizontal scroll wheel translation occurs on the specified element.-ms-scrollbar-3dlight-colorThe -ms-scrollbar-3dlight-color CSS property is a Microsoft extension specifying the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.-ms-scrollbar-arrow-colorThe -ms-scrollbar-arrow-color CSS property is a Microsoft extension that specifies the color of the arrow e...
New in JavaScript 1.3 - Archive of obsolete content
is returned. Changes to String.prototype.replace(). Changes to the Boolean object. Changes to toString(). Non-ECMA-262 features of JavaScript 1.3 The following is a comparison between the June 1998 version of ECMA-262 and JavaScript 1.3. The following features were not part of the standard at that time, but implemented in JavaScript 1.3. Keywords and operators Strict equality operators
vertical tab (\v or \u000B) as an escape sequence. Statements label switch do...while export import Built-in objects RegExp Methods of built-in objects toSource() Object.prototype.watch() Object.prototype.unwatch() Function.arity Function.prototype.apply() Function.prototype.call() Array.prototype.concat() Array.prototype.pop() Array.prototype.push() Array.prototype.shift() Ar...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
f 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 trigger a situation where rounding errors force the two floats to total more than 100% the width of the parent, as could happen if the floats' element boxes were made to total 50%. Unfortunately, a few browsers don't get this right, and end up flowing the cards as a single
vertical column instead of putting the fish side by side. After a bit of fiddling to try to fix this, I decided that trying to overcome this error in document flow wasn't worth the effort. The layout wasn't bad if the fish weren't laid out next to each other, so I moved on. Floating Fish With the cards set up to float, the next step was to place the images appropriately. This involved floating the image...
XForms Repeat Element - Archive of obsolete content
optional 1-based initial value of the repeat index. The default value is 1. number - isn't supported Type restrictions The repeat element can be bound to a nodeset. Representations The repeat element doesn't have a visual representation. However, it can influence the layout of generated controls depending on its appearance attribute. default layout Each generated control set is placed
vertically. compact layout Each generated control set is placed horizontally. Occurs when the repeat element's appearance attribute has a value of compact. Behaviour Focusing a generated control may change the current index of the containing repeat element. The index is equal to the index of the control set that the focused control belongs to. Actions You can use XForms Action Module elements to ...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
f the class value nav are applied to hyperlinks, this will work fine. However, rules of this type are usually seen in conjunction with markup like this: <td class="nav"> <a href="one.html" class="nav">one</a> | <a href="two.html" class="nav">two</a> | <a href="thr.html" class="nav">three</a> | <a href="fou.html" class="nav">four</a> </td> Because the enclosing table cell has a class of nav, the
vertical-bar characters will turn red when the user moves the mouse pointer anywhere within the table cell. The links will also turn red when they are hovered. Gecko Behavior In browsers based on Netscape Gecko builds later than 20020410 (Netscape 6.1+), :hover styles can be applied to any element in a document. Thus authors who have used bare pseudo-classes, or bare class-pseudo-class combinations, are...
Player paddle and controls - Game development
f 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 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 p...
Grid Column - MDN Web Docs Glossary: Definitions of Web-related terms
It is defined by the grid-template-columns property or in the shorthand grid or grid-template properties. In addition, columns may be created in the implicit grid when items are placed outside of columns created in the explicit grid. These columns will be auto-sized by default, or can have a size specified with the grid-auto-columns property. When working with alignment in CSS Grid Layout, the axis down which columns run is known as the block, or column, axis. ...
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
They are often used to separate tokens in HTML, CSS, JavaScript, and other computer languages. Whitespace characters and their usage vary between languages. In HTML HTML Living Standard specifies 5 characters as the ASCII whitespace: U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, and U+0020 SPACE. In the form of text, they are treated as normal space characters and sequential whitespaces are collapsed as a single space in many cases (this behavior can 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. ...
A cool-looking box - Learn web development
her 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 readable using a black text shadow. A fairly subtle border radius. A 1-pixel solid border with a color similar to...
Advanced styling effects - Learn web development
tom, rgba(0,0,0,0), rgba(0,0,0,0.25)); } .simple { box-shadow: 5px 5px 5px rgba(0,0,0,0.7); } This gives us the following result: You'll see that we've got four items in the box-shadow property value: The first length value is the horizontal offset -- the distance to the right the shadow is offset from the original box (or left, if the value is negative). The second length value is the
vertical offset -- the distance downwards that the shadow is offset from the original box (or upwards, if the value is negative). The third length value is the blur radius -- the amount of blurring applied to the shadow. The color value is the base color of the shadow. You can use any length and color units that would make sense to do so to define these values. Multiple box shadows You can also spec...
Images, media, and form elements - Learn web development
ribed as replaced elements. This means that CSS cannot affect the internal layout of these elements -- only their position on the page amongst other elements. As we will see however, there are various things that CSS can do with an image. Certain replaced elements, such as images and video, are also described as having an aspect ratio. This means that it has a size in both the horizontal (x) and
vertical (y) dimensions, and will be displayed using the intrinsic dimensions of the file by default. Sizing images As you already know from following these lessons, everything in CSS generates a box. If you place an image inside a box that is smaller or larger than the intrinsic dimensions of the image file in either direction, it will either appear smaller than the box, or overflow the box. You need t...
CSS values and units - Learn web development
oordinates, used to position an item such as a background image (via background-position). It can take keywords such as top, left, bottom, right, and center to align items with specific bounds of a 2D box, along with lengths, which represent offsets from the top and left-hand edges of the box. A typical position value consists of two values -- the first sets the position horizontally, the second
vertically. If you only specify values for one axis the other will default to center. In the following example we have positioned a background image 40px from the top and to the right of the container using a keyword. Play around with these values to see how you can push the image around. Strings and identifiers Throughout the examples above, we've seen places where keywords are used as a value (fo...
Grids - Learn web development
to know to get started with page layout. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction 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 o...
Introduction to CSS layout - Learn web development
first paragraph, followed by the unordered list, followed by the second paragraph. The elements that appear one below the other are described as block elements, in contrast to inline elements, which appear one beside the other, like the individual words in a paragraph. Note: The direction in which block element contents are laid out is described as the Block Direction. The Block Direction runs
vertically in a language such as English, which has a horizontal writing mode. It would run horizontally in any language with a
Vertical Writing Mode, such as Japanese. The corresponding Inline Direction is the direction in which inline contents (such as a sentence) would run. For many of the elements on your page the normal flow will create exactly the layout you need, however for more complex layouts ...
Normal Flow - Learn web development
aced inside the browser's viewport. By default, block-level elements are laid out in the block flow direction, based on the parent's writing mode (initial: horizontal-tb) -- each one will appear on a new line below the last one, and 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 margi...
Positioning - Learn web development
tioned paragraph is the second paragraph in the source order, and positioned elements later in the source order win over positioned elements earlier in the source order. Can you change the stacking order? Yes, you can, by using the z-index property. "z-index" is a reference to the z-axis. You may recall from previous points in the course where we discussed web pages using horizontal (x-axis) and
vertical (y-axis) coordinates to work out positioning for things like background images and drop shadow offsets. (0,0) is at the top left of the page (or element), and the x- and y-axes run across to the right and down the page (for left to right languages, anyway.) Web pages also have a z-axis: an imaginary line that runs from the surface of your screen, towards your face (or whatever else you like to h...
Styling links - Learn web development
n to the next line. However, we take it back down to 100% using the next rule, which selects only the last <a> in the list, and removes the margin from it. Done! The last three declarations are pretty simple and are mainly just for cosmetic purposes. We center the text inside each link, set the line-height to 3 to give the buttons some height (which also has the advantage of centering the text
vertically), and set the text color to black. Note: You may have noticed that the list items in the HTML are all put on the same line as each other -- this is done because spaces/line breaks in between inline block elements create spaces on the page, just like the spaces in between words, and such spaces would break our horizontal navigation menu layout. So we've removed the spaces. You can find m...
Typesetting a community school homepage - Learn web development
vigation menu: Style your navigation menu so that it has an appropriate look for the look and feel for the page. Hints and tips You don't need to edit the HTML in any way for this exercise. You don't necessarily have to make the nav menu look like buttons, but it needs to be a bit taller so that it doesn't look silly on the side of the page; also remember that you need to make this one a
vertical nav menu. Example The following screenshot shows an example of what the finished design could look like: Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Yo...
What do common web layouts contain? - Learn web development
ike a three-column layout... ...but it's not. B1 and B2 float around the main content. Remember that word "float"--it will ring a bell when you start learning about CSS. Why would you think it's a three-column layout? Because the image on the top-right is L-shaped, because B1 looks like a column supporting the shifted main content, and because the "M" and "I" of the MICA logo create a
vertical line of force. This is a good example of a classic layout supporting some design creativity. Simple layouts are easier to implement, but allow yourself room to express your creativity in this area. A much trickier layout The Opera de Paris. Basically a two-column layout, but you'll notice many tweaks here and there that visually break up the layout. Especially, the header overlaps t...
Advanced form styling - Learn web development
the original check boxes: input[type="checkbox"] { -webkit-appearance: none; appearance: none; } We can use the :checked and :disabled pseudo-classes to change the appearance of our custom checkbox as its state changes: input[type="checkbox"] { position: relative; width: 1em; height: 1em; border: 1px solid gray; /* Adjusts the position of the checkboxes on the text baseline */
vertical-align: -2px; /* Set here so that Windows' High-Contrast Mode can override */ color: green; } input[type="checkbox"]::before { content: "?"; position: absolute; font-size: 1.2em; right: -1px; top: -0.3em; visibility: hidden; } input[type="checkbox"]:checked::before { /* Use `visibility` instead of `display` to avoid recalculating layout */ visibility: visible; } input[type="...
Example 2 - Learn web development
s : 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 : 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 ...
Example 3 - Learn web development
s : 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 : 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 ...
Example 4 - Learn web development
s : 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 : 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 ...
Example 5 - Learn web development
s : 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 : 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 ...
Example - Learn web development
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; } 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 ...
Other form controls - Learn web development
text rendered by the browser is wrapped; hard (the cols attribute must be specified when using this value), which means both the submitted and rendered texts are wrapped, and off, which stops wrapping. Controlling textarea resizability The ability to resize a <textarea> is controlled with the CSS resize property. Its possible values are: both: The default -- allows resizing horizontally and
vertically. horizontal: Allows resizing only horizontally.
vertical: Allows resizing only
vertically. none: Allows no resizing. block and inline: Experimental values that allow resizing in the block or inline direction only (this varies depending on the directionality of your text; read Handling different text directions if you want to find out more.) Play with the interactive example at the top of ...
Test your skills: Advanced styling - Learn web development
used? Another thing that commonly denotes a search box is a magnifying glass icon. We've made one available in the same directory as our HTML files -- see search-24px.png -- plus a <div> element after the search input to help you attach it, should you need it. Can you figure out a sensible way to attach it, and can you use some CSS to get it to sit to the right of the search box, and be lined up
vertically as well? 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. Advanced form 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 ...
Example - Learn web development
/* 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 some text */ height: 5em; /* To allow users to resize any textarea
vertically It works only on Chrome, Firefox and Safari */ resize:
vertical; } .button { /* To position the buttons to the same position of the text fields */ padding-left: 90px; /* same size as the label elements */ } button { /* This extra magin represent the same ...
Your first form - Learn web development
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 elements */ border-color: #000; } textarea { /* Align multiline text fields with their labels */
vertical-align: top; /* Provide space to type some text */ height: 5em; } .button { /* Align buttons with the text fields */ padding-left: 90px; /* same size as the label elements */ } button { /* This extra margin represent roughly the same space as the space between the labels and their text fields */ margin-left: .5em; } Save and reload, and you'll see that your form should look mu...
CSS basics - Learn web development
in: 0;. Next, we set the heading's top and bottom padding to 20 pixels. Following that, we set the heading text to be the same color as the HTML background color. Finally, text-shadow applies a shadow to the text content of the element. Its four values are: The first pixel value sets the horizontal offset of the shadow from the text: how far it moves across. The second pixel value sets the
vertical offset of the shadow from the text: how far it moves down. The third pixel value sets the blur radius of the shadow. A larger value produces a more fuzzy-looking shadow. The fourth value sets the base color of the shadow. Try experimenting with different values to see how it changes the appearance. Centering the image img { display: block; margin: 0 auto; } Next, we center the image to...
The web and web standards - Learn web development
how about young or old people, people from different cultures, people using mobile devices, or people with unreliable or slow network connections? Internationalization means making websites usable by people from different cultures, who speak different languages to your own. There are technical considerations here (such as altering your layout so that it still works OK for right-to-left, or even
vertical languages), and human ones (such as using simple, non-slang language so that people who have your language as their second or third language are more likely to understand your text). Privacy & Security. These two concepts are related but different. Privacy refers to allowing people to go about their business privately and not spying on them or collecting more of their data than you absolutely ne...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
his one). Put an empty <div> element inside the <body>, then add a ? character inside it. This circular arrow character will act as our spinner for this example. Apply the following CSS to the HTML template (in whatever way you prefer). This sets a red background on the page, sets the <body> height to 100% of the <html> height, and centers the <div> inside the <body>, horizontally and
vertically. html { background-color: white; height: 100%; } body { height: inherit; background-color: red; margin: 0; display: flex; justify-content: center; align-items: center; } div { display: inline-block; font-size: 10rem; } Insert a <script> element just above the closing </body> tag. Insert the following JavaScript inside your <script> element. Here, you're stor...
Aprender y obtener ayuda - Learn web development
vigation menu etc. Then you could break it down further, for example, "Implement horizontal navigation menu" could be written out as: Make a list of menu items sit horizontally in a line. Remove unneeded defaults, like list spacing and bullet points. Style hover/focus/active states of menu items appropriately. Make the menu items equally spaced along the line. Give the menu items enough
vertical spacing. Make sure the text is centered inside each menu item etc. Each of these problems doesn't seem nearly as difficult to solve as the one big problem you had initially. Now you've just got to go through and solve them all! Learn and recognise the patterns As we said before, web design/programming is mostly about problem solving and patterns. Once you have written out what you'll need t...
Server-side web frameworks - Learn web development
ent requests. Returning a cached response is much faster than calculating one in the first place. Caching can be implemented in your code or in the server (see reverse proxy). Web frameworks will have different levels of support for defining what content can be cached. Scalability: Once your website is fantastically successful you will exhaust the benefits of caching and even reach the limits of
vertical scaling (running your web application on more powerful hardware). At this point you may need to scale horizontally (share the load by distributing your site across a number of web servers and databases) or scale "geographically" because some of your customers are based a long way away from your server. The web framework you choose can make a big difference on how easy it is to scale your site. W...
The Firefox codebase: CSS Guidelines
asic tips that can optimize reviews if you are changing CSS: Avoid !important but if you have to use it, make sure it's obvious why you're using it (ideally with a comment). The Overriding CSS section contains more information about this. Avoid magic numbers; prefer automatic sizing or alignment methods. Some examples to avoid: absolutely positioned elements hardcoded values such as:
vertical-align: -2px; . The reason you should avoid such "hardcoded" values is that, they don't necessarily work for all font-size configurations. Avoid setting styles in JavaScript. It's generally better to set a class and then specify the styles in CSS. classList is generally better than className. There's less chance of overwriting an existing class. Only use generic selectors such as :last-chi...
HTMLIFrameElement.getScreenshot()
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). ...
mozbrowserscroll
ing 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. details The details property returns an anonymous JavaScript object with the following properties: top A number representing the new
vertical scroll position of the <iframe> viewport -- in CSS pixels -- from the top of the viewport. left A number representing the new horizontal scroll position of the <iframe> viewport -- in CSS pixels -- from the left of the viewport. Example var browser = document.querySelector("iframe"); browser.addEventListener("mozbrowserscroll", function( event ) { console.log("The new scroll position is "...
MathML Demo: <mfrac> - fractions
? M ? the end. Inline double down arrows, display style, thick line ? sin ? M ? the end. Inline double up down arrows, text style, thick line ? sin ? M ? the end. Inline, styles auto, display and text 1 2 - 1 2 + 1.23456 7890 , the rendering should be script-size, normal-size and script-size in this example. Fraction lines should align
vertically with the math axis. The same expression 1 2 - 1 2 + 1.23456 7890 in a display. Inline fenced nested fractions [ || sin ? + 1 11 || - x x 2 a 1 ] + [ 1.0 ] etc. The same expression [ || sin ? + 1 11 || - x x 2 a 1 ] + [ 1.0 ] in a display. LaTeX renders continued fractions 1 2 + 1 3 + 1 4 + 1 ...
Mozilla Web Developer FAQ
other browsers as well (using the above-mentioned exact doctypes) is the best way to get consistent CSS layout results across different browsers. On the other hand, the quirks implemented in the quirks modes of different browsers vary from browser to browser. Why are there gaps between image rows in tables when the layout engine is in the Standards mode? In the CSS2 box layout model the default
vertical sizing of layout boxes and the default
vertical alignment of images is different from the behavior of old browsers. These aspects of the layout can be changed by explicitly setting the display CSS property of the images (and possible surrounding <a> elements) to block. If the table cells that contain only an image are marked with <td class="imgcell">, the required CSS rule is: .imgcell img, .img...
Index
SSL, the data display includes interpreted SSL records and handshaking Options -v Print a version string for the tool. -h Turn on hex/ASCII printing. Instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ASCII characters. The two parts are separated by a
vertical bar. Nonprinting characters are replaced by dots. -f Turn on fancy printing. Output is printed in colored HTML. Data sent from the client to the server is in blue; the server's reply is in red. When used with looping mode, the different connections are separated with horizontal lines. You can use this option to upload the outp...
NSS API Guidelines
ndling NSS 3.0 introduces the concept of an error stack. When something goes wrong, the call stack unwinds, with routines returning an error indication. Each level which flags a problem, adds its own error number to the stack. At the bottom of the stack is the fundamental error, for example: file not found, and on top is an error precisely relating to what you are doing. Note: Error stacks are
vertical, and never horizontal. If multiple things go wrong simultaneously, and you want to report them all, use another mechanism. Errors, though not integers, are done as external constants, instead of preprocessor definitions. This is so any additional error doesn't trigger the entire tree to rebuild. Likewise, the external references to errors are made in the prototypes files, with the functions whi...
NSS tools : ssltab
s TCP connections and displays the data going by. If a connection is SSL, the data display includes interpreted SSL records and handshaking Options -v Print a version string for the tool. -h Turn on hex/ASCII printing. Instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ASCII characters. The two parts are separated by a
vertical bar. Nonprinting characters are replaced by dots. -f Turn on fancy printing. Output is printed in colored HTML. Data sent from the client to the server is in blue; the server's reply is in red. When used with looping mode, the different connections are separated with horizontal lines. You can use this option to upload the output into a browser. -s Turn on SSL parsing and decoding. The tool does n...
NSS tools : ssltap
s TCP connections and displays the data going by. If a connection is SSL, the data display includes interpreted SSL records and handshaking Options -v Print a version string for the tool. -h Turn on hex/ASCII printing. Instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ASCII characters. The two parts are separated by a
vertical bar. Nonprinting characters are replaced by dots. -f Turn on fancy printing. Output is printed in colored HTML. Data sent from the client to the server is in blue; the server's reply is in red. When used with looping mode, the different connections are separated with horizontal lines. You can use this option to upload the output into a browser. -s Turn on SSL parsing and decoding. The tool does n...
NSS Tools ssltap
than hostname:port, but you normally use them to control the connection interception and output. The options for the command are the following: -v Print a version string for the tool. -h Turn on hex/ASCII printing. Instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ASCII characters. The two parts are separated by a
vertical bar. Nonprinting characters are replaced by dots. -f Turn on fancy printing. Output is printed in colored HTML. Data sent from the client to the server is in blue; the server's reply is in red. When used with looping mode, the different connections are separated with horizontal lines. You can use this option to upload the output into a browser. -s Turn on SSL parsing and decoding. The tool do...
NSS tools : ssltap
SSL, the data display includes interpreted SSL records and handshaking Options -v Print a version string for the tool. -h Turn on hex/ASCII printing. Instead of outputting raw data, the command interprets each record as a numbered line of hex values, followed by the same data as ASCII characters. The two parts are separated by a
vertical bar. Nonprinting characters are replaced by dots. -f Turn on fancy printing. Output is printed in colored HTML. Data sent from the client to the server is in blue; the server's reply is in red. When used with looping mode, the different connections are separated with horizontal lines. You can use this option to upload the outp...
Gecko Roles
ve a strongly defined role. ROLE_TITLEBAR Represents a title or caption bar for a window. Used by MSAA only, this is supported automatically by Microsoft Windows. ROLE_MENUBAR Represents the menu bar (positioned beneath the title bar of a window on most platforms or at the top of the screen on Mac OS X) from which menus are selected by the user. ROLE_SCROLLBAR Represents a
vertical or horizontal scroll bar, which is part of the client area or used in a control. ROLE_GRIP Represents a special mouse pointer, which allows a user to manipulate user interface elements such as windows. For example, a user clicks and drags a sizing grip in the lower-right corner of a window to resize it ROLE_SOUND Represents a system sound, which is associated with various system e...
Gecko states
ently the active window EXT_STATE_MODAL Must do something with control before leaving it EXT_STATE_MULTI_LINE Edit control that can take multiple lines EXT_STATE_HORIZONTAL Uses horizontal layout EXT_STATE_OPAQUE Indicates this object paints every pixel within its rectangular region EXT_STATE_SINGLE_LINE This text object can only contain 1 line of text EXT_STATE_TRANSIENT EXT_STATE_
VERTICAL Especially used for sliders and scrollbars EXT_STATE_STALE Object not dead, but not up-to-date either EXT_STATE_ENABLED A widget that is not unavailable EXT_STATE_SENSITIVE Same as ENABLED for now EXT_STATE_EXPANDABLE If COLLAPSED or EXPANDED ...
nsIAccessibleRole
HING 0 Used when accessible has no strong defined role. ROLE_TITLEBAR 1 Represents a title or caption bar for a window. It is used by MSAA only, supported automatically by MS Windows. ROLE_MENUBAR 2 Represents the menu bar (positioned beneath the title bar of a window) from which menus are selected by the user. The role is used by xul:menubar or role="menubar". ROLE_SCROLLBAR 3 Represents a
vertical or horizontal scroll bar, which is part of the client area or used in a control. ROLE_GRIP 4 Represents a special mouse pointer, which allows a user to manipulate user interface elements such as windows. For example, a user clicks and drags a sizing grip in the lower-right corner of a window to resize it. ROLE_SOUND 5 Represents a system sound, which is associated with various system events. ...
nsIAccessibleStates
ith control before leaving it. EXT_STATE_MULTI_LINE 0x00000040 Edit control that can take multiple lines. EXT_STATE_HORIZONTAL 0x00000080 Uses horizontal layout. EXT_STATE_OPAQUE 0x00000100 Indicates this object paints every pixel within its rectangular region. EXT_STATE_SINGLE_LINE 0x00000200 This text object can only contain 1 line of text. EXT_STATE_TRANSIENT 0x00000400 EXT_STATE_
VERTICAL 0x00000800 Especially used for sliders and scrollbars. EXT_STATE_STALE 0x00001000 Object not dead, but not up-to-date either. EXT_STATE_ENABLED 0x00002000 A widget that is not unavailable. EXT_STATE_SENSITIVE 0x00004000 Same as EXT_STATE_ENABLED for now. EXT_STATE_EXPANDABLE 0x00008000 If COLLAPSED or EXPANDED. ...
nsIContentView
id. void scrollTo( in float xPx, in float yPx ); Parameters xPx The X coordinate to scroll to, in CSS pixels. yPx The Y coordinate to scroll to, in CSS pixels. setScale() Sets the content view's scale for each axis. void setScale( in float xScale, in float yScale ); Parameters xScale Horizontal scaling factor; specify 1.0 to use the natural size of the content. yScale
Vertical scaling factor; specify 1.0 to use the natural size of the content. ...
nsIDOMWindowUtils
E). If this values isn't 0, horizontal DOMMouseScroll event will be dispatched with this value. However, this value may be ignored by nsEventStateManager if some prefs are customized or aOptions value includes some flags. aLineOrPageDeltaY Scroll amount around y-axis by lines (if aDeltaMode is DOM_DELTA_PIXEL or DOM_DELTA_LINE) or pages (if aDeltaMode is DOM_DELTA_PAGE). If this values isn't 0,
vertical DOMMouseScroll event will be dispatched with this value. However, this value may be ignored by nsEventStateManager if some prefs are customized or aOptions value includes some flags. aOptions 0 or one or more WHEEL_EVENT_* flags. sendNativeKeyEvent() This method lets you create and send keyboard events to a DOM window from a privileged context; for example, this can be used to automate testi...
nsISelectionController
Constant Value Description SCROLL_SYNCHRONOUS 1<<1 If set scrolls the selection into view before returning. If not set, posts a request which is processed at some point after the method returns. SCROLL_FIRST_ANCESTOR_ONLY 1<<2 If set, only the first ancestor will be scrolled into view. SCROLL_CENTER_
VERTICALLY 1<<4 If set, the specified location will be scrolled to the center of the view. Methods Native code only!characterExtendForBackspace Will extend the selection one character cell backward in the document. This method is used internally for handling backspace key only when we're after UTF-16 surrogates. void characterExtendForBackspace(); Parameters None. Native code only!
XPIDL Syntax
roduction to XPIDL or IDL in general. It is more focused on XPIDL syntax and grammar. See XPIDL Main Page for more links and introductory content. Simplifications, conventions and notation The syntax is specified according to ABNF as defined by RFC 5234, although a few productions use prose for clarity of understanding. Lexically, tokens are delimited by whitespace (defined here as spaces, tabs,
vertical tabs, form feeds, line feeds, and carriage returns, or [ \t\v\f\r\n] in regular expression form). LibIDL only considers a single line feed as a newline, and not carriage returns (although xpidl begs to differ). Additionally, the use of both C-style (/* ... */) and C++-style (// ... end-of-line) comments are permitted between any two tokens. Some productions can only occur at the beginning of line...
UI Tour - Firefox Developer Tools
This article is a quick tour of the main sections of the JavaScript Debugger's user interface. The UI is split
vertically into three panels Source list pane Source pane The contents of the third pane depend on the current state of the debugger and may include the following sections: Toolbar Watch expressions Breakpoints Call stack Scopes XHR Breakpoints Event Listener Breakpoints DOM Mutation Breakpoints Source list pane The source list pane lists all the JavaScript source files loaded into the page, and enables you to select one to debug. At the top level sources are organized by origin, and under that they're organized by the directory structure from which they are served. You can search for a file using Ctrl + P (Cmd + P on a Mac). Web Extensions a...
Performance Analysis - Firefox Developer Tools
ou have only just opened the Network Monitor, so it's not yet populated with the list of requests, you'll get a stopwatch icon in the main window.) The Network Monitor then loads the site twice: once with an empty browser cache, and once with a primed browser cache. This simulates the first time a user visits your site, and subsequent visits. It displays the results for each run side by side, or
vertically if the browser window is narrow: The results for each run are summarised in a table and a pie chart. The tables group resources by type, and show the total size of each resource and the total time it took to load them. The accompanying pie chart shows the relative size of each resource type. To get back to the Network Monitor's list of network requests click the "Back" button on the left. ...
Network request list - Firefox Developer Tools
bled. Timeline The request list also displays a timeline for the different parts of each request. Each timeline is given a horizontal position in its row relative to the other network requests, so you can see the total time taken to load the page. For more details on the color-coding used here, see the section on the Timings page. Starting in Firefox 45, the timeline also contains two
vertical lines: The blue line marks the point at which the page's DOMContentLoaded event is triggered. The red line marks the point at which the page's load event is triggered. Blocking specific URLs If you want to view your page as it would look without a resource (e.g., if it were blocked by the browser or an extension), you can block requests matching patterns you specify. Click the Request B...
Edit Shape Paths in CSS - Firefox Developer Tools
) change as you edit the shape. You can then copy these values back into your stylesheet to create the new, tweaked shape path. ellipse() If the value of shape-outside is ellipse() then you are using the ellipse basic shape. The ellipse() value works in much the same way as circle() in the Shape Path Editor. An ellipse is a squashed circle and therefore has the option to resize horizontally and
vertically when you click on the shapes icon. inset() If the value of shape-outside is inset() then you are using the inset basic shape, which enables the creation of offset values pulling the content in from the margin box. Each side of the rectangle can be targeted after clicking on the shapes icon to activate the Shape Path Editor, and dragging each side will update the values for the top, right, ...
Rulers - Firefox Developer Tools
The dimensions of the viewport are displayed near the top-right corner of the viewport. To be able to toggle rulers for a page, you first need to enable the button by going to the settings page for the Developer Tools and checking "Toggle rulers for the page" under Available Toolbox Buttons. Once enabled, the "Toggle rulers for the page" button appears at the top right of the Toolbox, in the same place as the Settings/Options button. Behavior to keep in mind when using rulers: The rulers command must be reapplied in new tabs and after each page refresh. ...
CSSPositionValue.CSSPositionValue() - Web APIs
The CSSPositionValue constructor creates a new CSSPositionValue object which represents values for properties that take a position, for example object-position. Syntax cvar cssPositionValue = new CSSPositionValue(x, y) Parameters x A position along the web page's horizontal axis. y A position along the web page's
vertical axix. Examples The following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. let someDiv = document.getElementById('container'); let position = new CSSPositionValue(CSS.px(5), CSS.px(10)); someDiv.attributeStyleMap.set('object-position', position); console.log(position.x.value, position.y.value); // 5 10 ...
CSSPositionValue.y - Web APIs
Syntax var y = CSSPositionValue.y Value A CSSNumericValue. Example The following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. ...
CSSPositionValue - Web APIs
PositionValue interface of the the CSS Typed Object Model API represents values for properties that take a position, for example object-position. Constructor CSSPositionValue.CSSPositionValue() Creates a new CSSPositionValue object. Properties CSSPositionValue.x Returns the item's position along the web page's horizontal axis. CSSPositionValue.y Returns the item's position along the
vertical axis. Methods None. Examples The following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page. let replacedEl = document.getElementById( 'image' ); let position = new CSSPositionValue( CSS.px(35), CSS.px(40) ); replacedEl.attributeStyleMap.set( 'object-position', position ); console.log( position.x.value, position.y.value ); console.log( repl...
CSSPrimitiveValue - Web APIs
y 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). ...
CSSValueList - Web APIs
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. ...
CanvasRenderingContext2D.arc() - Web APIs
rcular arc to the current sub-path. Syntax void ctx.arc(x, y, radius, startAngle, endAngle [, anticlockwise]); The arc() method creates a circular arc centered at (x, y) with a radius of radius. The path starts at startAngle, ends at endAngle, and travels in the direction given by anticlockwise (defaulting to clockwise). Parameters x The horizontal coordinate of the arc's center. y The
vertical coordinate of the arc's center. radius The arc's radius. Must be positive. startAngle The angle at which the arc starts in radians, measured from the positive x-axis. endAngle The angle at which the arc ends in radians, measured from the positive x-axis. anticlockwise Optional An optional Boolean. If true, draws the arc counter-clockwise between the start and end angles. The default is fa...
CanvasRenderingContext2D.createImageData() - Web APIs
ringContext2D.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 thrown IndexSizeE...
CanvasRenderingContext2D.createPattern() - Web APIs
rn's image. It can be any of the following: HTMLImageElement (<img>) SVGImageElement (<image>) HTMLVideoElement (<video>, by using the capture of the video) HTMLCanvasElement (<canvas>) ImageBitmap OffscreenCanvas repetition A DOMString indicating how to repeat the pattern's image. Possible values are: "repeat" (both directions) "repeat-x" (horizontal only) "repeat-y" (
vertical only) "no-repeat" (neither direction) If repetition is specified as an empty string ("") or null (but not undefined), a value of "repeat" will be used. Return value CanvasPattern An opaque object describing a pattern. Examples Creating a pattern from an image This example uses the createPattern() method to create a CanvasPattern with a repeating source image. Once created, the patt...
CanvasRenderingContext2D.ellipse() - Web APIs
, radiusX, radiusY, rotation, startAngle, endAngle [, anticlockwise]); The ellipse() method creates an elliptical arc centered at (x, y) with the radii radiusX and radiusY. The path starts at startAngle and ends at endAngle, and travels in the direction given by anticlockwise (defaulting to clockwise). Parameters x The x-axis (horizontal) coordinate of the ellipse's center. y The y-axis (
vertical) coordinate of the ellipse's center. radiusX The ellipse's major-axis radius. Must be non-negative. radiusY The ellipse's minor-axis radius. Must be non-negative. rotation The rotation of the ellipse, expressed in radians. startAngle The angle at which the ellipse starts, measured clockwise from the positive x-axis and expressed in radians. endAngle The angle at which the ellipse ends, ...
CanvasRenderingContext2D.filter - Web APIs
p-shadow() Applies a drop shadow effect to the drawing. A drop shadow is effectively a blurred, offset version of the drawing's alpha mask drawn in a particular color, composited below the drawing. This function takes up to five arguments: <offset-x>: See <length> for possible units. Specifies the horizontal distance of the shadow. <offset-y>: See <length> for possible units. Specifies the
vertical distance of the shadow. <blur-radius>: The larger this value, the bigger the blur, so the shadow becomes bigger and lighter. Negative values are not allowed. <color>: See <color> values for possible keywords and notations. grayscale() A CSS <percentage>. Converts the drawing to grayscale. A value of 100% is completely grayscale. A value of 0% leaves the drawing unchanged. hue-rotate() ...
CanvasRenderingContext2D.moveTo() - Web APIs
Examples Creating multiple sub-paths This example uses moveTo() to create two sub-paths within a single path. Both sub-paths are then rendered with a single stroke() call. ...
CanvasRenderingContext2D.putImageData() - Web APIs
ipulation 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 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 ...
CanvasRenderingContext2D.rotate() - Web APIs
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.PI / 2); ctx.translate(-150, -75); // Rotated rectangle ctx.fillStyle = 'red'; ctx.fillR...
CanvasRenderingContext2D.shadowOffsetY - Web APIs
The CanvasRenderingContext2D.shadowOffsetY property of the Canvas 2D API specifies the distance that shadows will be offset
vertically. Note: Shadows are only drawn if the shadowColor property is set to a non-transparent value. One of the shadowBlur, shadowOffsetX, or shadowOffsetY properties must be non-zero, as well. Syntax ctx.shadowOffsetY = offset; offset A float specifying the distance that shadows will be offset
vertically. Positive values are down, and negative are up. The default value is 0 (no
vertical offset). Infinity and NaN values are ignored. Examples Moving a shadow
vertically This example adds a blurred shadow to a rectangle. The shadowColor property sets its color, shadowOffsetY sets its offset 25 units towards the bottom, and shadowBlur gives it a blur level of 10...
CanvasRenderingContext2D.transform() - Web APIs
See also the setTransform() method, which resets the current transform to the identity matrix and then invokes transform(). Syntax void ctx.transform(a, b, c, d, e, f); The transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] Parameters a (m11) Horizontal scaling. A value of 1 results in no scaling. b (m12)
Vertical skewing. c (m21) Horizontal skewing. d (m22)
Vertical scaling. A value of 1 results in no scaling. e (dx) Horizontal translation (moving). f (dy)
Vertical translation (moving). Examples Skewing a shape This example skews a rectangle both
vertically (.2) and horizontally (.8). Scaling and translation remain unchanged. HTML <canvas id="canvas"></canvas> JavaScript const canvas = do...
A basic ray-caster - Web APIs
utorial will get to that, and I wanted to see if I could do this. So every update, the raycaster looks to see if you've pressed any keys lately, to conserve calculations by not casting if you're idle. If you have, then the canvas is cleared, the ground and sky are drawn, the camera position and/or orientation are updated, and the rays are cast out. As the rays intersect walls, then they render a
vertical sliver of canvas in the color of the wall they've hit, blended with a darker version of the color according to the distance to the wall. The height of the sliver is also modulated by the distance from the camera to the wall, and is drawn centered over the horizon line. The code I ended up with is a regurgitated amalgam of the raycaster chapters from an old Andre LaMotheTricks of the Game Program...
Advanced animations - Web APIs
Second demo <canvas id="canvas" style="border: 1px solid" width="600" height="300"></canvas> var 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(); c...
Basic animations - Web APIs
you could use any image that's larger than the canvas. var img = new Image(); // User Variables - customize these to change the image being scrolled, its // direction, and the speed. ...
CharacterData - Web APIs
Data 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. ...
Comment - Web APIs
s 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. ...
DOMPoint.DOMPoint() - Web APIs
x Optional The x coordinate for the new DOMPoint. y Optional The y coordinate for the new DOMPoint. z Optional The z coordinate for the new DOMPoint. w Optional The perspective value of the new DOMPoint. Examples This example creates a DOMPoint representing the top-left corner of the current window, then creates a second point based on the first, which is then offset by 100 pixels both
vertically and horizontally. var windTopLeft = new DOMPoint(window.screenX, window.screenY); var newTopLeft = DOMPoint.fromPoint(windTopLeft); newTopLeft.x += 100; newTopLeft.y += 100; Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'DOMPoint()' in that specification. Candidate Recommendation Initial definition ...
DOMPoint.y - Web APIs
Unless transforms have been applied to alter the orientation, the value of y increases downward and decreases upward. Syntax var yPos = DOMPoint.y; Value A double-precision floating-point value indicating the y coordinate's value for the point. This value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'y' in that specification. ...
DOMPointInit - Web APIs
return value when calling toJSON(). Properties DOMPointInit.x An unrestricted floating-point value indicating the x-coordinate of the point in space. This is generally the horizontal coordinate, with positive values being to the right and negative values to the left. The default value is 0. DOMPointInit.y An unrestricted floating-point number providing the point's y-coordinate. This is the
vertical coordinate, and barring any transforms applied to the coordinate system, positive values are downward and negative values upward toward the top of the screen. The default is 0. DOMPointInit.z An unrestricted floating-point value which gives the point's z-coordinate, which is (assuming no transformations that alter the situation) the depth coordinate; positive values are closer to the user and n...
DOMPointReadOnly() - Web APIs
The DOMPointReadOnly() constructor returns a new DOMPointReadOnly object representing a point in 2D or 3D space, optionally with perspective, whose values cannot be altered by script code. Syntax point = new DOMPointReadOnly(x, y, z, w); Parameters x Optional The value of the horizontal coordinate, x, as a floating point number. The default value is 0. y Optional The value of the
vertical coordinate, y, as a floating point number. The default value is 0. z Optional The value of the depth coordinate, z, as a floating point number. The default value is 0. w Optional The value of the perspective, w, as a floating point number. The default is 1. Note: Each of these values is what's called an unrestricted number. In addition to any finite floating-point value, you may use special valu...
DOMPointReadOnly.y - Web APIs
If your script needs to be able to change the value of this property, you should instead use the DOMPoint object. In general, positive values of y mean downward, and negative values of y mean upward, assuming no transforms have resulted in a reversal. Syntax const yPos = someDOMPointReadOnly.y; Value A double-precision floating-point value indicating the y coordinate's value for the point. This value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). ...
DOMPointReadOnly - Web APIs
nly.fromPoint({x: 100, y: 100, z: 50; w: 1.0}); Constructor DOMPointReadOnly() Creates a new DOMPointReadOnly object given the values of its coordinates and perspective. To create a point using aDOMPointInit object, you can instead use DOMPointReadOnly.fromPoint(). Properties DOMPointReadOnly.x Read only The point's horizontal coordinate, x. DOMPointReadOnly.y Read only The point's
vertical coordinate, y. DOMPointReadOnly.z Read only The point's depth coordinate, z. DOMPointReadOnly.w Read only The point's perspective value, w. Static methods DOMPointReadOnly.fromPoint() A static method that creates a new DOMPointReadOnly object given the coordinates provided in the specified DOMPointInit object. Methods matrixTransform() Applies a matrix transform specified as a D...
DOMRect - Web APIs
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. ...
DataTransfer.setDragImage() - Web APIs
o 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 bitmap to an image generated from the given element (the exact mechanism for doing so is not currently specified). xOffset A long indicating the horizontal offset within the image. yOffset A long indicating the
vertical offset within the image. Return value 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()<...
DataTransferItem.webkitGetAsEntry() - Web APIs
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. #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 elemen...
Document - Web APIs
ntry 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. ...
DocumentFragment - Web APIs
t 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. ...
DocumentOrShadowRoot.elementFromPoint() - Web APIs
. If the specified point is outside the visible bounds of the document or either coordinate is negative, the result is null. If you need to find the specific position inside the element, use Document.caretPositionFromPoint(). Syntax const element = document.elementFromPoint(x, y) Parameters x The horizontal coordinate of a point, relative to the left edge of the current viewport. y The
vertical coordinate of a point, relative to the top edge of the current viewport. Return value The topmost Element object located at the specified coordinates. Example This example creates two buttons which let you set the current color of the paragraph element located under the coordinates (2, 2). JavaScript function changeColor(newColor) { elem = document.elementFromPoint(2, 2); elem.style.co...
DocumentOrShadowRoot.nodeFromPoint() - Web APIs
The nodeFromPoint() property of the DocumentOrShadowRoot interface returns the topmost node at the specified coordinates (relative to the viewport). Currently this method is only implemented in Firefox, and only available to chrome code. Syntax var node = document.nodeFromPoint(x, y); Parameters x A double representing the horizontal coordinate of a point. y A double representing the
vertical coordinate of a point. Returns A Node object. Examples HTML Content <div> <p>Some text</p> </div> <p>Top node at point 30, 20:</p> <div id="output"></div> JavaScript Content var output = document.getElementById("output"); if (document.nodeFromPoint) { var node = document.nodeFromPoint(30, 20); output.textContent += node.localName; } else { output.innerHTML = "<span style=\"colo...
DocumentOrShadowRoot.nodesFromPoint() - Web APIs
The nodesFromPoint() property of the DocumentOrShadowRoot interface returns an array of all nodes at the specified coordinates (relative to the viewport). Currently this method is only implemented in Firefox, and only available to chrome code. Syntax var nodes = document.nodesFromPoint(x, y); Parameters x The horizontal coordinate of a point. y The
vertical coordinate of a point. Returns An array of Node objects. Example HTML Content <div> <p>Some text</p> </div> <p>Nodes at point 30, 20:</p> <div id="output"></div> JavaScript Content var output = document.getElementById("output"); if (document.nodesFromPoint) { var nodes = document.nodesFromPoint(30, 20); for(var i = 0; i < nodes.length; i++) { output.textContent += nodes[i].localName; if (i < nodes.len...
Document Object Model (DOM) - Web APIs
SVGNumberList SVGPaint SVGPathSeg SVGPathSegClosePath SVGPathSegMovetoAbs SVGPathSegMovetoRel SVGPathSegLinetoAbs SVGPathSegLinetoRel SVGPathSegCurvetoCubicAbs SVGPathSegCurvetoCubicRel SVGPathSegCurvetoQuadraticAbs SVGPathSegCurvetoQuadraticRel SVGPathSegArcAbs SVGPathSegArcRel SVGPathSegLinetoHorizontalAbs SVGPathSegLinetoHorizontalRel SVGPathSegLineto
VerticalAbs SVGPathSegLineto
VerticalRel SVGPathSegCurvetoCubicSmoothAbs SVGPathSegCurvetoCubicSmoothRel SVGPathSegCurvetoQuadraticSmoothAbs SVGPathSegCurvetoQuadraticSmoothRel SVGPathSegList SVGPoint SVGPointList SVGPreserveAspectRatio SVGRect SVGStringList SVGTransform SVGTransformList Animated type SVGAnimatedAngle SVGAnimatedBoolean SVGAnimatedEnumeration SVGA...
EffectTiming.fill - Web APIs
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 applied. JavaScript content Now let's check out the JavaScript. First we'll define the two objects that describe the keyframes and the timing configuration to use, then we'll actually see the code that triggers and runs the animation when the "animateButton" button is clicked. var boxRotationKeyframes = [ { transform: "ro...
Element.clientWidth - Web APIs
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(). ...
Element: mousewheel event - Web APIs
resto) only support wheelDelta attribute and do not support horizontal scroll. The wheelDeltaX attribute value indicates the wheelDelta attribute value along the horizontal axis. When a user operates the device for scrolling to right, the value is negative. Otherwise, i.e., if it's to left, the value is positive. The wheelDeltaY attribute value indicates the wheelDelta attribute value along the
vertical axis. The sign of the value is the same as the wheelDelta attribute value. Internet Explorer The value is the same as the delta value of Windows' WM_MOUSEWHEEL or WM_MOUSEHWHEEL. It means that if the mouse wheel doesn't support high resolution scroll, the value is 120 per notch. The value isn't changed even if the scroll amount of system settings is page scroll. Chrome On Windows, the value i...
Element.scrollHeight - Web APIs
The Element.scrollHeight read-only property is a measurement of the height of an element's content, including content not visible on the screen due to overflow. The scrollHeight value is equal to the minimum height the element would require in order to fit all the content in the viewport without using a
vertical scrollbar. The height is measured in the same way as clientHeight: it includes the element's padding, but not its border, margin or horizontal scrollbar (if present). It can also include the height of pseudo-elements such as ::before or ::after. If the element's content can fit without a need for
vertical scrollbar, its scrollHeight is equal to clientHeight This property will round the value to an integer. If you need a fractional value, use Element.getBoundingClientRect(). Syntax e...
Element.scrollIntoView() - Web APIs
If false, the bottom of the element will be aligned to the bottom of the visible area of the scrollable ancestor. Corresponds to scrollIntoViewOptions: {block: "end", inline: "nearest"}. scrollIntoViewOptions Optional Is an Object with the following properties: behavior Optional Defines the transition animation. One of auto or smooth. Defaults to auto. block Optional Defines
vertical alignment. One of start, center, end, or nearest. Defaults to start. inline Optional Defines horizontal alignment. One of start, center, end, or nearest. Defaults to nearest. Example var element = document.getElementById("box"); element.scrollIntoView(); element.scrollIntoView(false); element.scrollIntoView({block: "end"}); element.scrollIntoView({behavior: "smooth", block: "end",...
Element.scrollWidth - Web APIs
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 xScrollWidth = element.scrollWidth; xScrollWidt...
ErrorEvent - Web APIs
The ErrorEvent interface represents events providing information related to errors in scripts or in files. ...
EventTarget - Web APIs
on 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. ...
ExtendableEvent - Web APIs
o 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. ...
File - Web APIs
fic 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. ...
FileSystemDirectoryReader.readEntries() - Web APIs
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. #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 elemen...
FocusEvent - Web APIs
The FocusEvent interface represents focus-related events, including focus, blur, focusin, and focusout. ...
GlobalEventHandlers.onscroll - Web APIs
= functionRef Value functionRef A function name, or a function expression. The function receives a UIEvent object 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. HTML <textarea>1 2 3 4 5 6 7 8 9</textarea> <p id="log"></p> CSS textarea { width: 4rem; height: 8rem; font-size: 3rem; } JavaScript const textarea = document.querySelector('textarea'); const log = document.getElementById('log'); textarea.onscroll = logScroll; function logScroll(e) { log.textContent = `Scroll position: ${e.target.scrollTop}`; } Result...
HTMLAnchorElement - Web APIs
properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. ...
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. ...
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. ...
HTMLBRElement - Web APIs
The HTMLBRElement interface represents a HTML line break element (<br>). It inherits from HTMLElement. ...
Location - Web APIs
:</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%; margin-left:-50%; font-size:40%; line-height:1.5; background...
MSManipulationEvent - Web APIs
ed to create a manipulation event that can be called from JavaScript. Properties Property Description currentStateRead only Returns the current state of a manipulation event. inertiaDestinationXRead only Represents the predicted horizontal scroll offset after the inertia phase completes. inertiaDestinationYRead only Represents the predicted
vertical scroll offset after the inertia phase completes. lastStateRead only Returns the last state after a manipulation change event. Example interface MSManipulationEvent extends UIEvent { readonly currentState: number; readonly inertiaDestinationX: number; readonly inertiaDestinationY: number; readonly lastState: number; initMSManipulationEvent(typeArg: string, ...
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. ...
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. ...
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. ...
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. ...
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. ...
Using the MediaStream Recording API - Web APIs
one of those useful little utility features that's cropped up in CSS that doesn't look like much initially, but soon starts to make you think "Wow, why didn't we have this before? Why was CSS2 layout so awkward?" It allows you do a calculation to determine the computed value of a CSS unit, mixing different units in the process. For example, in Web Dictaphone we have three main UI areas, stacked
vertically. We wanted to give the first two (the header and the controls) fixed heights: header { height: 70px; } .main-controls { padding-bottom: 0.7rem; height: 170px; } However, we wanted to make the third area (which contains the recorded samples you can play back) take up whatever space is left, regardless of the device height. Flexbox could be the answer here, but it's a bit overkill for su...
MediaTrackSettings - Web APIs
phy. "left" A camera facing toward the environment to the user's left. "right" A camera facing toward the environment to the user's right. frameRate A double-precision floating point value indicating 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 res...
Using the Media Capabilities API - Web APIs
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 video. const videoConfiguration = { type: "file", video: { contentType: "video/webm;codecs=vp8", width: 800, height: 600, bitrat...
MessageEvent - Web APIs
RTC 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. ...
MouseEvent.pageY - Web APIs
Syntax var pos = event.pageY; Originally, this property was defined as a long integer. The CSSOM View Module redefined it as a double float. See the Browser compatibility section for details. Examples var pageY = event.pageY; Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'pageY' in that specification. Working Draft Redefined from long to double. ...
MouseEvent.screenY - Web APIs
Syntax var y = instanceOfMouseEvent.screenY Return value A double floating point value. Early versions of the spec defined this as an integer referring to the number of pixels. See the "Browser compatibility" section for details. Example This example displays your mouse's coordinates whenever you trigger the mousemove event. ...
MouseEvent - Web APIs
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. ...
MouseWheelEvent - Web APIs
browsers only. Instead use the standard WheelEvent. Properties Attribute Type Description wheelDelta Read only long The distance in pixels (defined as so by MSDN, but the actual usage is different, see mousewheel). wheelDeltaX Read only long? The value along horizontal axis of wheelDelta. wheelDeltaY Read only long? The value along
vertical axis of wheelDelta. ...
Node - Web APIs
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. ...
OfflineAudioContext - Web APIs
g 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. ...
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. ...
PannerNode.orientationY - Web APIs
The complete vector is defined by the position of the audio source, given as (positionX, positionY, positionZ), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationX, orientationY, orientationZ). Depending on the directionality of the sound (as specified using the attributes coneInnerAngle, coneOuterAngle, and codeOuterGain), the orientation of the sound may alter the perceived volume of the sound as it's being played. ...
PannerNode.positionY - Web APIs
The complete vector is defined by the position of the audio source, given as (positionX, positionY, positionZ), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationX, orientationY, orientationZ). ...
PerformanceFrameTiming - Web APIs
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. ...
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. ...
PerformanceMeasure - Web APIs
ceMeasure 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. ...
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. ...
PerformancePaintTiming - Web APIs
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. ...
PerformanceResourceTiming - Web APIs
h 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. ...
Point - Web APIs
le, and should not be used. Although it is not directly related to this defunct interface, you are probably looking for DOMPoint, which is part of the Geometry Interfaces Module Level 1 specification. Properties x A floating-point value specifying the point's position with respect to the X (horizontal) axis. y A floating-point value specifying the point's position with respect to the Y (
vertical) axis. Specifications This class was specified in the defunct 20 March 2009 Working Draft of CSS 2D Transforms Module Level 3. It is not present in the current working draft of the CSS Transforms Level 1 specification. ...
Pointer events - Web APIs
ments except: non-replaced inline elements, table rows, row groups, table columns, and column groups. A value of auto means the browser is free to apply its default touch behavior (to the specified region) and the value of none disables the browser's default touch behavior for the region. The values pan-x and pan-y, mean that touches that begin on the specified region are only for horizontal and
vertical scrolling, respectively. The value manipulation means the browser may consider touches that begin on the element are only for scrolling and zooming. In the following example, the browser's default touch behavior is disabled for the div element. <html> <body> <div style="touch-action:none;">Can't touch this ... </div> </body> </html> In the following example, default touch behavior is ...
ProcessingInstruction - Web APIs
ing 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. ...
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. ...
SyncEvent - Web APIs
The SyncEvent interface represents a sync action that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker. This interface inherits from the ExtendableEvent interface. ...
TaskAttributionTiming - Web APIs
ionTiming 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. ...
Text - Web APIs
hat 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. ...
TimeEvent - Web APIs
The TimeEvent interface, a part of SVG SMIL animation, provides specific contextual information associated with Time events. ...
Touch.clientX - Web APIs
rn value A long representing the X coordinate of the touch point relative to the viewport, not including any scroll offset. Example This example illustrates using the Touch object's Touch.clientX and Touch.clientY properties. The Touch.clientX property is the horizontal coordinate of a touch point relative to the browser's viewport excluding any scroll offset. The Touch.clientY property is the
vertical coordinate of the touch point relative to the browser's viewport excluding any scroll offset . In this example, we assume the user initiates a touch on an element with an id of source, moves within the element or out of the element and then releases contact with the surface. When the touchend event handler is invoked, the changes in the Touch.clientX and Touch.clientY coordinates, from the start...
Touch.clientY - Web APIs
ue A long value representing the Y coordinate of the touch point relative to the viewport, not including any scroll offset. Example This example illustrates using the Touch object's Touch.clientX and Touch.clientY properties. The Touch.clientX property is the horizontal coordinate of a touch point relative to the browser's viewport excluding any scroll offset. The Touch.clientY property is the
vertical coordinate of the touch point relative to the browser's viewport excluding any scroll offset . In this example, we assume the user initiates a touch on an element with an id of source, moves within the element or out of the element and then releases contact with the surface. When the touchend event handler is invoked, the changes in the Touch.clientX and Touch.clientY coordinates, from the start...
Touch.pageX - Web APIs
value A long representing the X coordinate of the touch point relative to the viewport, including any scroll offset. Example This example illustrates how to access the Touch object's Touch.pageX and Touch.pageY properties. The Touch.pageX property is the horizontal coordinate of a touch point relative to the viewport (in CSS pixels), including any scroll offset. The Touch.pageY property is the
vertical coordinate of a touch point relative to the viewport (in CSS pixels), including any scroll offset. In following simple code snippet, we assume the user initiates one or more touch contacts on the source element, moves the touch points and then releases all contacts with the surface. When the touchmove event handler is invoked, each touch point's Touch.pageX and Touch.pageY coordinates are access...
Touch.pageY - Web APIs
ong value that representes the Y coordinate of the touch point relative to the viewport, including any scroll offset. Example This example illustrates how to access the Touch object's Touch.pageX and Touch.pageY properties. The Touch.pageX property is the horizontal coordinate of a touch point relative to the viewport (in CSS pixels), including any scroll offset. The Touch.pageY property is the
vertical coordinate of a touch point relative to the viewport (in CSS pixels), including any scroll offset. In following simple code snippet, we assume the user initiates one or more touch contacts on the source element, moves the touch points and then releases all contacts with the surface. When the touchmove event handler is invoked, each touch point's Touch.pageX and Touch.pageY coordinates are access...
Touch.screenX - Web APIs
x = touchItem.screenX; Return value x The X coordinate of the touch point relative to the screen, not including any scroll offset. Example This example illustrates how to access the Touch object's Touch.screenX and Touch.screenY properties. The Touch.screenX property is the horizontal (x) coordinate of a touch point relative to the screen in CSS pixels. The Touch.screenY property is the
vertical coordinate of a touch point relative to the screen in CSS pixels. In following simple code snippet, we assume the user initiates multiple touch contacts on an element with an id of source and then releases contacts with the surface. When the touchstart event handler is invoked, each touch point's Touch.screenX and Touch.screenY coordinates are accessed. // Register a touchstart listeners for th...
Touch - Web APIs
top edge of the browser viewport, not including any scroll offset. Touch.pageX Read only Returns the X coordinate of the touch point relative to the left edge of the document. Unlike clientX, this value includes the horizontal scroll offset, if any. Touch.pageY Read only Returns the Y coordinate of the touch point relative to the top of the document. Unlike clientY, this value includes the
vertical scroll offset, if any. Touch.target Read only Returns the Element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document. Touch area Touch.radiusX Read only Returns the X radius of the ellipse that most closely circumscribes the area of cont...
TouchEvent - Web APIs
tecting 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. ...
Multi-touch interaction - Web APIs
Use same handler for touchcancel and touchend el.ontouchcancel = end_handler; el.ontouchend = end_handler; } function init() { set_handlers("target1"); set_handlers("target2"); set_handlers("target3"); set_handlers("target4"); } Move/Pinch/Zoom handler This function provides very basic support for 2-touch horizontal move/pinch/zoom handling. The code does not include error handling, or
vertical moving. Note that the threshold for pinch and zoom movement detection is application specific (and device dependent). // This is a very basic 2-touch move/pinch/zoom handler that does not include // error handling, only handles horizontal moves, etc. function handle_pinch_zoom(ev) { if (ev.targetTouches.length == 2 && ev.changedTouches.length == 2) { // Check if the two target touches are t...
UIEvent.layerY - Web APIs
This property takes scrolling of the page into account, and returns a value relative to the whole of the document, unless the event occurs inside a positioned element, where the returned value is relative to the top left of the positioned element. Syntax var ypos = event.layerY; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
UIEvent.pageY - Web APIs
The UIEvent.pageY read-only property returns the
vertical coordinate of the event relative to the whole document. Syntax var pageY = event.pageY; pageY is an integer value in pixels for the y-coordinate of the mouse pointer, relative to the whole document, when the mouse event fired. This property takes into account any
vertical scrolling of the page. Example <html> <head> <title>pageX\pageY & layerX\layerY example</title> <script type="text/javascript"> function showCoords(evt){ var form = document.forms.form_coords; 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"...
VTTCue - Web APIs
in seconds and fractions of a second, that describes the end of the range of the media data to which the cue applies. text The raw text of the cue, and rules for its interpretation. Properties This interface also inherits properties from TextTrackCue. VTTCue.region A VTTRegion object describing the video's sub-region that the cue will be drawn onto, or null if none is assigned. VTTCue.
vertical Returns an enum representing the cue writing direction. VTTCue.snapToLines Returns true if the VTTCue.line attribute is an integer number of lines or a percentage of the video size. VTTCue.line Returns the line positioning of the cue. This can be the string auto or a number whose interpretation depends on the value of VTTCue.snapToLines. VTTCue.lineAlign Returns an enum representing the al...
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. ...
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
EXTURE_CUBE_MAP_POSITIVE_Z: Positive Z face for a cube-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:...
WebGLRenderingContext.copyTexSubImage2D() - Web APIs
ure. gl.TEXTURE_CUBE_MAP_POSITIVE_Z: Positive Z face for a cube-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 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,...
WebGLRenderingContext.getUniformLocation() - Web APIs
for the full sample and to see the resulting animation in action. After setting the current shading program to shaderProgram, this code fetches the three uniforms "uScalingFactor", "uGlobalColor", and "uRotationVector", calling getUniformLocation() once for each uniform. Then the three uniforms' values are set: The uScalingFactor uniform -- a 2-component vertex -- receives the horizontal and
vertical scaling factors from the variable currentScale. The uniform uRotationVector is set to the contents of the variable currentRotation. This, too, is a 2-component vertex. Finally, the uniform uGlobalColor is set to the color [0.1, 0.7, 0.2, 1.0], the components in this 4-component vector represent the values of red, green, blue, and alpha, respectively. Having done this, the next time the shadin...
WebGLRenderingContext.pixelStorei() - Web APIs
er name (for pname) Description Type Default value Allowed values (for param) Specified in gl.PACK_ALIGNMENT Packing of pixel data into memory GLint 4 1, 2, 4, 8 OpenGL ES 2.0 gl.UNPACK_ALIGNMENT Unpacking of pixel data from memory. GLint 4 1, 2, 4, 8 OpenGL ES 2.0 gl.UNPACK_FLIP_Y_WEBGL Flips the source data along its
vertical axis if true. GLboolean false true, false WebGL gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL Multiplies the alpha channel into the other color channels GLboolean false true, false WebGL gl.UNPACK_COLORSPACE_CONVERSION_WEBGL Default color space conversion or no color space conversion. GLenum gl.BROWSER_DEFAULT_WEBGL gl.BROWSER_DEFAULT_WEBGL, gl.NONE ...
WebGLRenderingContext.readPixels() - Web APIs
ls(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 the rectangle. format A GLenum specifying the format of the pixel data. Possible values: gl.ALPHA: Discards the red, green and blue components and reads the alpha component. gl.RGB: Discards the alpha component...
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. 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 erro...
Writing a WebSocket server in C# - Web APIs
decoded[i] = (byte)(bytes[offset + i] ^ masks[i % 4]); string text = Encoding.UTF8.GetString(decoded); Console.WriteLine("{0}", text); } else Console.WriteLine("mask bit not set"); Console.WriteLine(); } } } } client.html <!doctype html> <style> textarea {
vertical-align: bottom; } #output { overflow: auto; } #output > p { overflow-wrap: break-word; } #output span { color: blue; } #output span.error { color: red; } </style> <h2>WebSocket Test</h2> <textarea cols=60 rows=6></textarea> <button>send</button> <div id=output></div> <script> // http://www.websocket.org/echo.html var button = document.querySelector("button"), outpu...
Geometry and reference spaces in WebXR - Web APIs
oor spaces, except that they attempt to automatically ensure that the viewer is positioned in a safe place at or near (but always above) ground level. This is the plane at which the y coordinate is always 0, unless a floor is otherwise established. These space types are not viable if the rooms have uneven floors or floors whose height above ground level vary, since they don't support the avatar's
vertical position changing. The primary reference space types The viewer reference space corresponds to the viewer's position in space; it's used by the XRViewerPose returned by the XRFrame method getViewerPose(). It's not typically used directly otherwise. The only real exception is that you are likely to use the viewer reference space when performing the XR scene inline within web content. The local ...
Example and tutorial: Simple synth keyboard - Web APIs
lign: 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: 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: bas...
WheelEvent() - Web APIs
new WheelEvent(typeArg, wheelEventInit); Properties typeArg Is a DOMString representing the name of the event. wheelEventInit Optional Is a WheelEventInit dictionary, having the following fields: "deltaX", optional and defaulting to 0.0, is a double representing the horizontal scroll amount in the deltaMode unit. "deltaY", optional and defaulting to 0.0, is a double representing the
vertical scroll amount in the deltaMode unit. "deltaZ", optional and defaulting to 0.0, is a double representing the scroll amount for the z-axis in the deltaMode unit. "deltaMode", optional and defaulting to 0, is a unsigned long representing the unit of the delta values scroll amount. Permitted values are: Constant Value Description DOM_DELTA_PIXEL ...
WheelEvent.deltaY - Web APIs
The WheelEvent.deltaY read-only property is a double representing the
vertical scroll amount in the WheelEvent.deltaMode unit. Syntax var dY = event.deltaY; Example var syntheticEvent = new WheelEvent("syntheticWheel", {"deltaY": 4, "deltaMode": 0}); console.log(syntheticEvent.deltaY); Specifications Specification Status Comment Document Object Model (DOM) Level 3 Events SpecificationThe definition of 'WheelEvent.deltaY' in that specification. Obsolete Initial definition. ...
Window.innerWidth - Web APIs
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(). ...
Window.moveBy() - Web APIs
ied amount. Note: This function moves the window relative to its current location. In contrast, window.moveTo() moves the window to an absolute location. Syntax window.moveBy(deltaX, deltaY) Parameters deltaX is the amount of pixels to move the window horizontally. Positive values are to the right, while negative values are to the left. deltaY is the amount of pixels to move the window
vertically. Positive values are down, while negative values are up. Example This example moves the window 10 pixels to the right and 10 pixels up. function budge() { moveBy(10, -10); } Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'window.moveBy()' in that specification. Working Draft ...
Window.moveTo() - Web APIs
The moveTo() method of the Window interface moves the current window to the specified coordinates. Note: This function moves the window to an absolute location. In contrast, window.moveBy() moves the window relative to its current location. Syntax window.moveTo(x, y) Parameters x is the horizontal coordinate to be moved to. y is the
vertical coordinate to be moved to. Example This example moves the window to the top-left corner of the screen. function origin() { window.moveTo(0, 0); } Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'window.moveTo()' in that specification. Working Draft Initial definition ...
Window.resizeBy() - Web APIs
Example // Shrink the window window.resizeBy(-200, -200); Notes This method resizes the window relative to its current size. To resize the window in absolute terms, use window.resizeTo(). ...
Window.screenTop - Web APIs
Note: screenTop is an alias of the older Window.screenY property. screenTop was originally supported only in IE but was introduced everywhere due to popularity. Syntax topWindowPos = window.screenTop Returns A number equal to the number of CSS pixels from the top edge of the browser viewport to the top edge of the screen. Examples In our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. ...
Window.screenY - Web APIs
Note: An alias of screenY was implemented across modern browsers in more recent times -- Window.screenTop. This was originally supported only in IE but was introduced everywhere due to popularity. Syntax topWindowPos = window.screenY Returns A number equal to the number of CSS pixels from the top edge of the browser viewport to the top edge of the screen. Examples In our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. ...
Window.scroll() - Web APIs
The Window.scroll() method scrolls the window to a particular place in the document. Syntax window.scroll(x-coord, y-coord) window.scroll(options) Parameters x-coord is the pixel along the horizontal axis of the document that you want displayed in the upper left. y-coord is the pixel along the
vertical axis of the document that you want displayed in the upper left. - or - options is a ScrollToOptions dictionary. Examples <!-- put the 100th
vertical pixel at the top of the window --> <button onclick="scroll(0, 100);">click to scroll down 100 pixels</button> Using options: window.scroll({ top: 100, left: 100, behavior: 'smooth' }); Notes Window.scrollTo() is effectively the same as this method. For relative scrolling, see Window.scrollBy(), Window.scrollByLines(), and Wi...
Window.scrollMaxX - Web APIs
ment 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
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. ...
Window.scrollX - Web APIs
The read-only scrollX property of the Window interface returns the number of pixels that the document is currently scrolled horizontally. This value is subpixel precise in modern browsers, meaning that it isn't necessarily a whole number. You can get the number of pixels the document is scrolled
vertically from the scrollY property. Syntax var x = window.scrollX; Value In practice, the returned value is a double-precision floating-point value indicating the number of pixels the document is currently scrolled horizontally from the origin, where a positive value means the content is scrolled to the left. If the document is rendered on a subpixel-precise device, then the returned value is also subpixel-precise and may contain a decimal component. If the document isn't scrolled at all left or rig...
Window.scrollY - Web APIs
The read-only scrollY property of the Window interface returns the number of pixels that the document is currently scrolled
vertically. This value is subpixel precise in modern browsers, meaning that it isn't necessarily a whole number. You can get the number of pixels the document is scrolled horizontally from the scrollX property. Syntax var y = window.scrollY Value In practice, the returned value is a double-precision floating-point value indicating the number of pixels the document is currently scrolled
vertically from the origin, where a positive value means the content is scrolled to upward. If the document is rendered on a subpixel-precise device, then the returned value is also subpixel-precise and may contain a decimal component. If the document isn't scrolled at all up or down, then...
self.createImageBitmap() - Web APIs
w 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. Either none (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 u...
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. ...
XMLHttpRequest - Web APIs
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. ...
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. ...
XRRenderStateInit - Web APIs
e between the distances specified by depthNear and depthFar. This is 1000 meters (1 kilometer) by default. depthNear Optional A floating-point value indicating the distance in meters from the viewer to a plane parallel to the display surface to be the near clip plane. No part of the scene on the viewer's side of this plane will be rendered. This is 0.1 meters (10 centimeters) by default. inline
VerticalFieldOfView Optional A floating-point value indicating the default field of view, in radians, to be used when computing the projection matrix for an inline XRSession. The projection matrix calculation also takes into account the output canvas's aspect ratio. This property must not be specified for immersive sessions, so the value is null by default for immersive sessions. The default value is oth...
ARIA: listbox role - Accessibility
ecommended to use the HTML select element, or a group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native HTML elements provide this functionality for you for free. Elements with the role listbox have an implicit aria-orientation value of
vertical. When a list is tabbed to, the first item in the list will be selected if nothing else already is. Up/down arrows navigate the list, and pressing Shift + Up/Down arrows will move and extend the selection. Typing one or more letters will navigate the list items (same letter goes to each item starting with that, different letters go to the first item starting with that entire string). If the curre...
Accessibility documentation index - Accessibility
e technology, such as screen readers, use this attribute to catalog the objects in a document so that users can navigate between them. Without an element ID, the assistive technology cannot catalog the object. 23 Using the aria-orientation attribute ARIA, Accessibility, Attribute The aria-orientation attribute is used to indicate whether an element is oriented horizontally or
vertically. 24 Using the aria-relevant attribute ARIA, Accessibility, NeedsExample, ariaLive, attri The aria-relevant attribute is an optional value used to describe what types of changes have occurred to an aria-live region, and which are relevant and should be announced. Any change that is not relevant acts in the same manner it would if the aria-live attribute were set to off. ...
Perceivable - Accessibility
1.4.9 Images of text (No Exception) (AAA) Text should not be presented as part of an image unless it is purely decoration (i.e., it does not convey any content) or cannot be presented in any other way. 1.4.10 Reflow (AA) added in 2.1 No horizontal scrolling for left-to-right languages (like English) or right-to-left languages (like Arabic) No
vertical scrolling for top-to-bottom languages (like Japanese) Except for parts of the content which require two-dimensional layout for usage or meaning (like a large data table) Understanding Reflow 1.4.11 Non-Text Contrast(AA) added in 2.1 Minimum color contrast ratio of 3:1 for user interface components and graphical objects. Understanding Non-Text Contrast 1.4...
::-webkit-scrollbar - CSS: Cascading Style Sheets
- the buttons on the scrollbar (arrows pointing upwards and downwards). ::-webkit-scrollbar-thumb -- the draggable scrolling handle. ::-webkit-scrollbar-track -- the track (progress bar) of the scrollbar. ::-webkit-scrollbar-track-piece -- the part of the track (progress 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. 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 cust...
::first-line (:first-line) - CSS: Cascading Style Sheets
Syntax /* CSS3 syntax */ ::first-line /* CSS2 syntax */ :first-line Examples HTML <p>Styles will only be applied to the first line of this paragraph. After that, all text will be styled like normal. See what I mean?</p> <span>The first line of this text will not receive special styling because it is not a block-level element.</span> CSS ::first-line { color: blue; text-transf...
size - CSS: Cascading Style Sheets
ize 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 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. (...
height - CSS: Cascading Style Sheets
t 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 box's containing block. If the height of the containing block is not specified expl...
max-height - CSS: Cascading Style Sheets
eyword value */ max-height: auto; /* <length> values */ max-height: 400px; max-height: 50em; max-height: 20cm; /* <percentage> value */ max-height: 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 height of the initial viewport at zoom factor 1.0 for
vertical lengths. Must be non-negative. Formal definition Related at-rule@viewportInitial valueautoPercentagesrefer to the height 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>...
min-height - CSS: Cascading Style Sheets
eyword value */ min-height: auto; /* <length> values */ min-height: 120px; min-height: 20em; min-height: 10cm; /* <percentage> value */ min-height: 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 height of the initial viewport at zoom factor 1.0 for
vertical lengths. Must be non-negative. Formal definition Related at-rule@viewportInitial valueautoPercentagesrefer to the height 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>...
min-width - CSS: Cascading Style Sheets
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. Formal definition Related at-rule@viewportInitial valueautoPercentagesrefer 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...
width - CSS: Cascading Style Sheets
rt 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. Formal definition Related at-rule@viewportInitial valueas each of the properties of the shorthand:min-width: automax-width: nonePercentagesas each of the properties of the shorthand:min-width: refer to the width of the containing blockmax-width: refer to the width of the containing blockComputed valueas each of the properties of the shorthand:min-wid...
Coordinate systems - CSS: Cascading Style Sheets
sed by the CSS object model. These are generally only different in terms of where their origin is located. Dimensions In the coordinate systems used by web technologies, convention dictates that the horizontal offset is called the x-coordinate, where a negative value indicates a position to the left of the origin and a positive value is to the right of the origin. The y-coordinate specifies the
vertical offset, with a negative value being above the origin and a positive value being below the origin. On the web, the default origin is the top-left corner of a given context (with positive y-coordinate values being below the origin). Note that this is unlike most mathematical models, where the origin is at the bottom-left corner, with positive y-coordinate values being above the origin. When drawi...
Resizing background images with background-size - CSS: Cascading Style Sheets
an 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: .square2 { background-image: url(favicon.png); background-size: 300px; width: 300px; height: 300px; border: 2px solid; text-shadow: wh...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
lexbox. 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 for the purpose of being able to use the alignment properties. Reference CSS Properties justify-co...
Box alignment in grid layout - CSS: Cascading Style Sheets
rking with grid layout we always have two axes on which to align our items. We have access to all of the box alignment properties to help us achieve this. The inline axis is the axis that corresponds to the direction that words in a sentence would run in the writing mode used. Therefore, in a horizontal language such as English or Arabic the inline direction runs horizontally. Should you be in a
vertical writing mode the inline axis will run
vertically. To align things on the inline axis you use the properties that start with justify-, justify-content, justify-items and justify-self. The block axis crosses the inline axis in the direction that blocks are displayed down the page -- for example paragraphs in English are displayed one below the other
vertically. This, therefore is the block dime...
CSS Box Alignment - CSS: Cascading Style Sheets
across all of CSS. This document details the general concepts found in the specification. Note: The documentation for each layout method will detail how Box Alignment is applied there. Older alignment methods CSS traditionally had very limited alignment capabilities. We were able to align text using text-align, center blocks using auto margins, and in table or inline-block layouts using the
vertical-align property. Alignment of text is now covered by the Inline Layout and CSS Text modules, and for the first time in Box Alignment we have full horizontal and
vertical alignment capabilities. If you initially learned Flexbox then you may consider these properties to be part of the Flexbox specification, and some of the properties are indeed listed in Level 1 of Flexbox. However the specificatio...
Handling Overflow in Multicol - CSS: Cascading Style Sheets
rflow behaviour. My multicol container has a height and there is more text than space to create columns, therefore we get columns created outside of the container. In a future version of the specification it would be useful to be able to have overflow columns in continuous media display in the block direction, therefore allowing the reader to scroll down to view the next set of columns. Using
vertical media queries One issue with multicol on the web is that, if your columns are taller than the viewport, the reader will need to scroll up and down to read, which is not good user experience. One way to avoid this is to only apply the column properties if you know you have enough height. In the example below we have used a min-height query to check the height before applying the column propertie...
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
verse | column | column-reverse Spec: https://drafts.csswg.org/css-flexbox/#flex-direction-property @mixin flex-direction($value: row) { @if $value == row-reverse { -webkit-box-direction: reverse; -webkit-box-orient: horizontal; -moz-box-direction: reverse; -moz-box-orient: horizontal; } @else if $value == column { -webkit-box-direction: normal; -webkit-box-orient:
vertical; -moz-box-direction: normal; -moz-box-orient:
vertical; } @else if $value == column-reverse { -webkit-box-direction: reverse; -webkit-box-orient:
vertical; -moz-box-direction: reverse; -moz-box-orient:
vertical; } @else { -webkit-box-direction: normal; -webkit-box-orient: horizontal; -moz-box-direction: normal; -moz-box-orient: horizontal; } -webkit...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
gap between items, and a negative margin on the container in order that the items still remain flush with the right and left edges. Until the gap properties from the Box Alignment specification are implemented in flexbox, we have to use margins in this way if we want to create a gutter between items. Center item Before flexbox, developers would joke that the hardest problem in web design was
vertical centering. This has now been made straightforward using the alignment properties in flexbox, as the following live example shows. You can play with the alignment, aligning the item to the start with flex-start or end with flex-end. In the future we may not need to make a container a flex container just to centre a single item, as the Box Alignment properties will ultimately be implemented in ...
CSS Flexible Box Layout - CSS: Cascading Style Sheets
CSS Flexible Box Layout is a module of CSS that defines a CSS box model optimized for user interface design, and the layout of items in one dimension. In the flex layout model, the children of a flex container can be laid out in any direction, and can "flex" their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. Both horizontal and
vertical alignment of the children can be easily manipulated. Basic Example In the following example a container has been set to display: flex, which means that the three child items become flex items. The value of justify-content has been set to space-between in order to space the items out evenly on the main axis. An equal amount of space is placed between each item with the left and right items being flush with the edges of ...
Introduction to formatting contexts - CSS: Cascading Style Sheets
ormatting context inside which such things as <strong>, <a>, or <span> elements are used on text. The box model does not fully apply to items participating in an inline formatting context. In a horizontal writing mode line, horizontal padding, borders and margin will be applied to the element and push the text away left and right. However, margins above and below the element will not be applied.
Vertical padding and borders will be applied but may overlap content above and below as, in the inline formatting context, the line boxes will not be pushed apart by padding and borders. Other formatting contexts This guide covers flow layout and is therefore not referring to other possible formatting contexts. As such, it is useful to understand that creating any kind of formatting context will chang...
OpenType font features guide - CSS: Cascading Style Sheets
he 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 (font-variant-east-asian) This allows access to various alternate forms of glyphs within a font. The example below shows a string of glyphs with only the OpenType set 'jis78' enabled. Uncheck ...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
al grid system to CSS. Grids can be used to lay out major page areas or small user interface elements. This article introduces the CSS Grid Layout and the new terminology that is part of the CSS Grid Layout Level 1 specification. The features shown in this overview will then be explained in greater detail in the rest of this guide. What is a grid? A grid is a set of intersecting horizontal and
vertical lines defining columns and rows. Elements can be placed onto the grid within these column and row lines. CSS grid layout has the following features: Fixed and flexible track sizes You can create a grid with fixed track sizes - using pixels for example. This sets the grid to the specified pixel which fits to the layout you desire. You can also create a grid using flexible sizes with percentages ...
Using CSS gradients - CSS: Cascading Style Sheets
ht: 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. <div class="angled-gradient"></div> div { width: 120px; height: 120px; } .angled-gradient { background: linear-gradient(70deg, blue, pink); } When using an angle, 0deg creates a
vertical gradient running bottom to top, 90deg creates a horizontal gradient running left to right, and so on in a clockwise direction. Negative angles run in the counterclockwise direction. Declaring colors & creating effects All CSS gradient types are a range of position-dependent colors. The colors produced by CSS gradients can vary continuously with position, producing smooth color transitions. I...
CSS Logical Properties and Values - CSS: Cascading Style Sheets
2.1. Logical properties define direction-relative equivalents of their corresponding physical properties. Block vs. inline Logical properties and values use the abstract terms block and inline to describe the direction in which they flow. The physical meaning of these terms depends on the writing mode. Block dimension The dimension perpendicular to the flow of text within a line, i.e., the
vertical dimension in horizontal writing modes, and the horizontal dimension in
vertical writing modes. For standard English text, it is the
vertical dimension. Inline dimension The dimension parallel to the flow of text within a line, i.e., the horizontal dimension in horizontal writing modes, and the
vertical dimension in
vertical writing modes. For standard English text, it is the horizontal dimensio...
Understanding CSS z-index - CSS: Cascading Style Sheets
-dimensional, because text, images, and other elements are arranged on the page without overlapping. In this case, there is a single rendering flow, and all elements are aware of the space taken by others. The z-index attribute lets you adjust the order of the layering of objects when rendering content. In CSS 2.1, each box has a position in three dimensions. In addition to their horizontal and
vertical positions, boxes lie along a "z-axis" and are formatted one on top of the other. Z-axis positions are particularly relevant when boxes overlap visually. (from CSS 2.1 Section 9.9.1 - Layered presentation) This means that CSS style rules allow you to position boxes on layers in addition to the normal rendering layer (layer 0). The Z position of each layer is expressed as an integer representing...
CSS Properties Reference - CSS: Cascading Style Sheets
ageBreakAfter 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 ...
Animatable CSS properties - CSS: Cascading Style Sheets
croll-snap-coordinate scroll-snap-destination scrollbar-color shape-image-threshold shape-margin shape-outside tab-size text-decoration text-decoration-color text-decoration-thickness text-emphasis text-emphasis-color text-indent text-shadow text-underline-offset top transform transform-origin translate
vertical-align visibility width word-spacing z-index zoom ...
CSS Layout cookbook - CSS: Cascading Style Sheets
on Layout Methods Media objects A two-column box with an image on one side and descriptive text on the other, e.g. a facebook post or tweet. CSS Grid, float fallback, fit-content() sizing Columns When to choose multi-column layout, flexbox or grid for your columns. CSS Grid, Multicol, Flexbox Center an element How to center an item horizontally and
vertically. Flexbox, Box Alignment Sticky footers Creating a footer which sits at the bottom of the container or viewport when the content is shorter. CSS Grid, Flexbox Split navigation A navigation pattern where some links are visually separated from the others. Flexbox, margin Breadcrumb navigation Creating a list of links to allow the visitor to navigate ba...
Replaced elements - CSS: Cascading Style Sheets
ent property are anonymous replaced elements. They are "anonymous" because they don't exist in the HTML markup. Using CSS with replaced elements CSS handles replaced elements specifically in some cases, like when calculating margins and some auto values. Note that some replaced elements, but not all, have intrinsic dimensions or a defined baseline, which is used by some CSS properties, such as
vertical-align. Only replaced elements can ever have intrinsic dimensions. Controlling object position within the content box Certain CSS properties can be used to specify how the object contained within the replaced element should be positioned within the element's box area. These are defined by the CSS Images Module Level 3 and CSS Images Module Level 4 specifications: object-fit Specifies how the...
Shorthand properties - CSS: Cascading Style Sheets
The 3-value syntax: border-width: 1em 2em 3em -- The first value represents the top edge, the second, the horizontal, that is left and right, ones, and the third value the bottom edge The 4-value syntax: border-width: 1em 2em 3em 4em -- The four values r...
Cubic Bezier Generator - CSS: Cascading Style Sheets
result + 0.5 : result; } function cY(y) { return (1 - y) * scaling + margin; } function reverseY(y) { return (margin - y) / scaling + 1; } function lY(y) { // Used when drawing horizontal lines to prevent subpixel blur var result = cY(y); return Math.round(result) == result ? r...
Visual formatting model - CSS: Cascading Style Sheets
r window. User agents can change the layout of the page when the viewport size changes -- for example, if you resize your window, or change the orientation of a mobile device. If the viewport is smaller than the size of the document then the user agent needs to offer a way to scroll to the parts of the document that are not displayed. We most often see this as scrolling in the block dimension --
vertically in a horizontal, top-to-bottom language. However, you might design something that requires scrolling in the inline dimension too. Box generation Box generation is the part of the CSS visual formatting model that creates boxes from the document's elements. Generated boxes are of different types, which affect their visual formatting. The type of the box generated depends on the value of the CSS...
WebKit CSS extensions - CSS: Cascading Style Sheets
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-box-reflect** C -webkit-column-axis -webkit-column-break-after -webkit-column-break-before -webkit-column-break-inside -webkit-column-progression -webkit-cursor-visibility D-I -webkit...
animation-name - CSS: Cascading Style Sheets
ub 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 convenient to use the shorthand property animation to set all animation properties at once. Syntax /* Single animation */ animation-name: none; animation-name: test_05; animation-name: -specific; animation-name: sliding-
vertically; /* Multiple animations */ animation-name: test1, animation4; animation-name: none, -moz-specific, sliding; /* Global values */ animation-name: initial animation-name: inherit animation-name: unset Values none A special keyword denoting no keyframes. It can be used to deactivate an animation without changing the ordering of the other identifiers, or to deactivate animations coming from t...
<basic-shape> - CSS: Cascading Style Sheets
is is the farthest side in any dimension. For ellipses, this is the farthest side in the radius dimension. Description Computed values of basic shapes The values in a <basic-shape> function are computed as specified, with these exceptions: Omitted values are included and compute to their defaults. A <position> value in circle() or ellipse() is computed as a pair of offsets (horizontal then
vertical) from the top left origin, each given as a combination of an absolute length and a percentage. A <border-radius> value in inset() is computed as an expanded list of all eight <length> or percentage values. Interpolation of basic shapes When animating between one <basic-shape> and another, the rules below are applied. The values in the shape functions interpolate as a simple list. The list val...
border-color - CSS: Cascading Style Sheets
border-inline-start-color, and border-inline-end-color. You can find more information about border colors in Borders in Applying color to HTML elements using CSS. Constituent properties This property is a shorthand for the following CSS properties: border-bottom-color border-left-color border-right-color border-top-color Syntax /* <color> values */ border-color: red; /* horizontal |
vertical */ border-color: red #f015ca; /* top |
vertical | bottom */ border-color: red rgb(240,30,50,.7) green; /* top | right | bottom | left */ border-color: red yellow green blue; /* Global values */ border-color: inherit; border-color: initial; border-color: unset; The border-color property may be specified using one, two, three, or four values. When one value is specified, it applies the same...
border-image-outset - CSS: Cascading Style Sheets
not trigger overflow scrollbars and don't capture mouse events. 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> value */ border-image-outset: 1rem; /* <number> value */ border-image-outset: 1.5; /*
vertical | horizontal */ border-image-outset: 1 1.2; /* top | horizontal | bottom */ border-image-outset: 30px 2 45px; /* top | right | bottom | left */ border-image-outset: 7px 12px 14px 5px; /* Global values */ border-image-outset: inherit; border-image-outset: initial; border-image-outset: unset; The border-image-outset property may be specified as one, two, three, or four values. Each value is a ...
border-image-repeat - CSS: Cascading Style Sheets
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. Syntax /* Keyword value */ border-image-repeat: stretch; border-image-repeat: repeat; border-image-repeat: round; border-image-repeat: space; /*
vertical | horizontal */ border-image-repeat: round stretch; /* Global values */ border-image-repeat: inherit; border-image-repeat: initial; border-image-repeat: unset; The border-image-repeat property may be specified using one or two values chosen from the list of values below. When one value is specified, it applies the same behavior on all four sides. When two values are specified, the first ap...
border-image - CSS: Cascading Style Sheets
solute lengthsAnimation typediscrete Formal syntax <'border-image-source'> | <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? | <'border-image-repeat'> Examples Bitmap In this example, we will apply a diamond pattern to an element's borders. The source for the border image is a ".png" file of 81 by 81 pixels, with three diamonds going
vertically and horizontally: HTML <div id="bitmap">This element is surrounded by a bitmap-based border image!</div> CSS To match the size of a single diamond, we will use a value of 81 divided by 3, or 27, for slicing the image into corner and edge regions. To center the border image on the edge of the element's background, we will make the outset values equal to half of the width values. Finally, ...
border-inline-end-color - CSS: Cascading Style Sheets
ues <'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
order-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
ues <'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
order-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
he 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-radius - CSS: Cascading Style Sheets
our-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-top-left-radius: 4px 2px; border-top...
border-width - CSS: Cascading Style Sheets
tps://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: border-bottom-width border-left-width border-right-width border-top-width Syntax /* Keyword values */ border-width: thin; border-width: medium; border-width: thick; /* <length> values */ border-width: 4px; border-width: 1.2rem; /*
vertical | horizontal */ border-width: 2px 1.5em; /* top | horizontal | bottom */ border-width: 1px 2em 1.5cm; /* top | right | bottom | left */ border-width: 1px 2em 0 4rem; /* Global keywords */ border-width: inherit; border-width: initial; border-width: unset; The border-width property may be specified using one, two, three, or four values. When one value is specified, it applies the same width...
box-decoration-break - CSS: Cascading Style Sheets
s without line breaks. Note that if you stack the rendering of the two fragments horizontally next to each other it will result in the non-fragmented rendering. Try the above example in your browser. Block box fragments A block element with similar styles as above and no fragmentation results in: Fragmenting the above block into three columns results in: Note that stacking these pieces
vertically will result in the non-fragmented rendering. Now, the same example but styled with box-decoration-break: clone results in: Note here that each fragment has an identical replicated border, box-shadow, and background. You can try the block examples above in your browser. Specifications Specification Status Comment CSS Fragmentation Module Level 3The definition o...
box-direction - CSS: Cascading Style Sheets
ntax The box-direction property is specified as one of the keyword values listed below. Values normal The box lays out its contents from the start (the left or top edge). reverse The box lays out its contents from the end (the right or bottom edge). Notes The edge of the box designated the start for layout purposes depends on the box's orientation: Horizontal left
Vertical top The edge opposite to the start is designated the end. If the direction is set using the element's dir attribute, then the style is ignored. Formal definition Initial valuenormalApplies toelements with a CSS display value of box or inline-boxInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax normal | reverse | inherit Examples Setting box direction .exa...
box-ordinal-group - CSS: Cascading Style Sheets
group: initial; box-ordinal-group: unset; Ordinal groups may be used in conjunction with the box-direction property to control the order in which the direct children of a box appear. When the computed box-direction is normal, a box will display its elements starting from the lowest numbered ordinal group and ensure that those elements appear to the left (for horizontal boxes) or at the top (for
vertical boxes) of the container. Elements with the same ordinal group are flowed in the order they appear in the source document tree. In the reverse direction, the ordinal groups are examined in the same order, except the elements appear reversed. Syntax The box-ordinal-group property is specified as any positive <integer>. Formal definition Initial value1Applies tochildren of box elementsInheritedn...
box-shadow - CSS: Cascading Style Sheets
hadow to one inside the frame (as if the content was depressed inside the box). Inset shadows are drawn inside the border (even transparent ones), above the background, but below content. <offset-x> <offset-y> These are two <length> values to set the shadow offset. <offset-x> specifies the horizontal distance. Negative values place the shadow to the left of the element. <offset-y> specifies the
vertical distance. Negative values place the shadow above the element. See <length> for possible units. If both values are 0, the shadow is placed behind the element (and may generate a blur effect if <blur-radius> and/or <spread-radius> is set). <blur-radius> This is a third <length> value. The larger this value, the bigger the blur, so the shadow becomes bigger and lighter. Negative values are not al...
clear - CSS: Cascading Style Sheets
or 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. When applied to non-floating blocks, it moves the border edge of the element down until it is below the margin edge of all relevant floats. The non-floated block's top margin collapses.
Vertical margins between two floated elements on the other hand will not collapse. When applied to floating elements, the margin edge of the bottom element is moved below the margin edge of all relevant floats. This affects the position of later floats, since later floats cannot be positioned higher than earlier ones. The floats that are relevant to be cleared are the earlier floats within the same block...
drop-shadow() - CSS: Cascading Style Sheets
) function accepts a parameter of type <shadow> (defined in the box-shadow property), with the exception that the inset keyword and spread parameters are not allowed. Parameters offset-x offset-y (required) Two <length> values that determine the shadow offset. offset-x specifies the horizontal distance, where negative values place the shadow to the left of the element. offset-y specifies the
vertical distance, where negative values place the shadow above the element. If both values are 0, the shadow is placed directly behind the element. blur-radius (optional) The shadow's blur radius, specified as a <length>. The larger the value, the larger and more blurred the shadow becomes. If unspecified, it defaults to 0, resulting in a sharp, unblurred edge. Negative values are not allowed. color (...
<length> - CSS: Cascading Style Sheets
it, this can be the size of a specific character, the line height, or the size of the viewport. Font-relative lengths Font-relative lengths define the <length> value in terms of the size of 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, ...
linear-gradient() - CSS: Cascading Style Sheets
degrees, with a red bottom-left half and a blue top-right half, with a hard line where the gradient changes from red to blue */ linear-gradient(45deg, red 0 50%, blue 50% 100%); Values <side-or-corner> The position of the gradient line's starting point. If specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the
vertical side (top or bottom). The order of the side keywords does not matter. If unspecified, it defaults to to bottom. The values to top, to bottom, to left, and to right are equivalent to the angles 0deg, 180deg, 270deg, and 90deg, respectively. The other values are translated into an angle. <angle> The gradient line's angle of direction. A value of 0deg is equivalent to to top; increasing values ro...
margin-left - CSS: Cascading Style Sheets
-left CSS property sets the margin area on the left side of an element. A positive value places it farther from 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 leng...
margin-right - CSS: Cascading Style Sheets
ight CSS property sets the margin area on the right side of an element. A positive value places it farther from 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. 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-righ...
margin - CSS: Cascading Style Sheets
teractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The top and bottom margins have no effect on non-replaced inline elements, such as <span> or <code>. Note: Margins create extra space around an element. In contrast, padding creates extra space within an element. Syntax /* Apply to all four sides */ margin: 1em; margin: -3px; /*
vertical | horizontal */ margin: 5% auto; /* top | horizontal | bottom */ margin: 1em auto 2em; /* top | right | bottom | left */ margin: 2px 1em 0 auto; /* Global values */ margin: inherit; margin: initial; margin: unset; The margin property may be specified using one, two, three, or four values. Each value is a <length>, a <percentage>, or the keyword auto. Negative values draw the element closer t...
mask-border-outset - CSS: Cascading Style Sheets
The mask-border-outset CSS property specifies the distance by which an element's mask border is set out from its border box. Syntax /* <length> value */ mask-border-outset: 1rem; /* <number> value */ mask-border-outset: 1.5; /*
vertical | horizontal */ mask-border-outset: 1 1.2; /* top | horizontal | bottom */ mask-border-outset: 30px 2 45px; /* top | right | bottom | left */ mask-border-outset: 7px 12px 14px 5px; /* Global values */ mask-border-outset: inherit; mask-border-outset: initial; mask-border-outset: unset; The mask-border-outset property may be specified as one, two, three, or four values. Each value is a <length> or <number>. Negative values are invalid. When one value is specified, it applies the same outset to all four sides. When two values are specified, the first out...
mask-border-repeat - CSS: Cascading Style Sheets
The mask-border-repeat CSS property sets how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border. Syntax /* Keyword value */ mask-border-repeat: stretch; mask-border-repeat: repeat; mask-border-repeat: round; mask-border-repeat: space; /*
vertical | horizontal */ mask-border-repeat: round stretch; /* Global values */ mask-border-repeat: inherit; mask-border-repeat: initial; mask-border-repeat: unset; The mask-border-repeat property may be specified using one or two values chosen from the list of values below. When one value is specified, it applies the same behavior on all four sides. When two values are specified, the first applies to the top and bottom, the second to the left and right. Values stretch The source image's edge regions ...
mask-border - CSS: Cascading Style Sheets
stacking contextyes Formal syntax <'mask-border-source'> | <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? | <'mask-border-repeat'> | <'mask-border-mode'> Examples Setting a bitmap-based mask border In this example, we will mask an element's border with a diamond pattern. The source for the mask is a ".png" file of 90 by 90 pixels, with three diamonds going
vertically and horizontally: HTML <div id="bitmap">This element is surrounded by a bitmap-based mask border! Pretty neat, isn't it?</div> CSS To match the size of a single diamond, we will use a value of 90 divided by 3, or 30, for slicing the image into corner and edge regions. A repeat value of round will make the mask slices fit evenly, i.e., without clipping or gaps. div { width: 200px; bac...
offset-position - CSS: Cascading Style Sheets
ion: unset; Values auto The initial position is the position of the box specified by the position property. <position> A <position>. A position defines an x/y coordinate, to place an item relative to the edges of an element's box. It can be defined using one to four values. If two non-keyword values are used, the first value represents the horizontal position and the second represents the
vertical position. If only one value is specified, the second value is assumed to be center. If three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). For more explanation of these value types, see background-position. Formal definition Initial valueautoApplies totransformable elementsInheritednoPercentagesreferToSizeOfContainingBlockComputed valuefo...
order - CSS: Cascading Style Sheets
Formal definition Initial value0Applies toflex items and absolutely-positioned flex container childrenInheritednoComputed valueas specifiedAnimation typean integer Formal syntax <integer> Examples Ordering items in a flex container This example uses CSS to create a classic two-sidebar layout surrounding 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 ...
overflow - CSS: Cascading Style Sheets
ame as auto, but with the scrollbars drawn on top of content instead of taking up space. Only supported in WebKit-based (e.g., Safari) and Blink-based (e.g., Chrome or Opera) browsers. Mozilla extensions -moz-scrollbars-none [1] Use overflow: hidden instead. -moz-scrollbars-horizontal [1] Use overflow-x: scroll and overflow-y: hidden, or overflow: hidden scroll instead. -moz-scrollbars-
vertical [1] Use overflow-x: hidden and overflow-y: scroll, or overflow: scroll hidden instead. -moz-hidden-unscrollable Intended mainly for internal use and by themes. Disables scrolling of XML root elements, <html>, and <body> with the keyboard's arrow keys and the mouse wheel. [1] As of Firefox 63, this feature is behind a feature preference setting. In about:config, set layout.css.overflow.mo...
overscroll-behavior-block - CSS: Cascading Style Sheets
nted. 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 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-beh...
padding - CSS: Cascading Style Sheets
t. An element's padding area is the space between its content and its border. Note: Padding creates extra space within an element. In contrast, margin creates extra space around an element. Constituent properties This property is a shorthand for the following CSS properties: padding-bottom padding-left padding-right padding-top Syntax /* Apply to all four sides */ padding: 1em; /*
vertical | horizontal */ padding: 5% 10%; /* top | horizontal | bottom */ padding: 1em 2em 2em; /* top | right | bottom | left */ padding: 5px 1em 0 2em; /* Global values */ padding: inherit; padding: initial; padding: unset; The padding property may be specified using one, two, three, or four values. Each value is a <length> or a <percentage>. Negative values are invalid. When one value is specif...
place-content - CSS: Cascading Style Sheets
in a flex container HTML <div id="container"> <div class="small">Lorem</div> <div class="small">Lorem<br/>ipsum</div> <div class="large">Lorem</div> <div class="large">Lorem<br/>impsum</div> <div class="large"></div> <div class="large"></div> </div> <code>writing-mode:</code><select id="writingMode"> <option value="horizontal-tb" selected>horizontal-tb</option> <option value="
vertical-rl">
vertical-rl</option> <option value="
vertical-lr">
vertical-lr</option> <option value="sideways-rl">sideways-rl</option> <option value="sideways-lr">sideways-lr</option> </select><code>;</code><br/> <code>direction:</code><select id="direction"> <option value="ltr" selected>ltr</option> <option value="rtl">rtl</option> </select><code>;</code><br/> <code>place-content:</code><select id...
radial-gradient() - CSS: Cascading Style Sheets
constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). If unspecified, it defaults to ellipse. <extent-keyword> A keyword describing how big the ending shape must be. The possible values are: Keyword Description closest-side The gradient's ending shape meets the side of the box closest to its center (for circles) or meets both the
vertical and horizontal sides closest to the center (for ellipses). closest-corner The gradient's ending shape is sized so that it exactly meets the closest corner of the box from its center. farthest-side Similar to closest-side, except the ending shape is sized to meet the side of the box farthest from its center (or
vertical and horizontal sides). farthest-co...
repeating-radial-gradient() - CSS: Cascading Style Sheets
ith constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). If unspecified, it defaults to ellipse. <extent-keyword> A keyword describing how big the ending shape must be. The possible values are: Keyword Description closest-side The gradient's ending shape meets the side of the box closest to its center (for circles) or meets both the
vertical and horizontal sides closest to the center (for ellipses). closest-corner The gradient's ending shape is sized so that it exactly meets the closest corner of the box from its center. farthest-side Similar to closest-side, except the ending shape is sized to meet the side of the box farthest from its center (or
vertical and horizontal sides). farthest-co...
ruby-position - CSS: Cascading Style Sheets
, or between the characters, on their right side (inter-character). /* Keyword values */ ruby-position: over; ruby-position: under; ruby-position: inter-character; /* Global values */ ruby-position: inherit; ruby-position: initial; ruby-position: unset; Syntax Values over Is a keyword indicating that the ruby has to be placed over the main text for horizontal scripts and right to it for
vertical scripts. under Is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for
vertical scripts. inter-character Is a keyword indicating that the ruby has to be placed between the different characters. Formal definition Initial valueoverApplies toruby annotations containersInheritedyesComputed valueas specifiedAnimation typediscrete For...
scroll-snap-type - CSS: Cascading Style Sheets
ty; scroll-snap-type: both mandatory; /* etc */ /* Global values */ scroll-snap-type: inherit; scroll-snap-type: initial; scroll-snap-type: unset; Syntax Values none When the visual viewport of this scroll container is scrolled, it must ignore snap points. x The scroll container snaps to snap positions in its horizontal axis only. y The scroll container snaps to snap positions in its
vertical axis only. block The scroll container snaps to snap positions in its block axis only. inline The scroll container snaps to snap positions in its inline axis only. both The scroll container snaps to snap positions in both of its axes independently (potentially snapping to different elements in each axis). mandatory The visual viewport of this scroll container will rest on a snap point if i...
text-align - 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. ...
text-emphasis - CSS: Cascading Style Sheets
ape is given. double-circle Display double circles as marks. The filled double-circle is '?' (U+25C9), and the open double-circle is '?' (U+25CE). triangle Display triangles as marks. The filled triangle is '?' (U+25B2), and the open triangle is '?' (U+25B3). sesame Display sesames as marks. The filled sesame is '?' (U+FE45), and the open sesame is '?' (U+FE46). This is the default shape in
vertical writing modes when no other shape is given. <string> Display the given string as marks. Authors should not specify more than one character in <string>. The UA may truncate or ignore strings consisting of more than one grapheme cluster. <color> Defines the color of the mark. If no color is present, it defaults to currentcolor. Formal definition Initial valueas each of the properties of the ...
text-shadow - CSS: Cascading Style Sheets
fter the offset values. If unspecified, the color's value is left up to the user agent, so when consistency across browsers is desired you should define it explicitly. <offset-x> <offset-y> Required. These <length> values specify the shadow's distance from the text. <offset-x> specifies the horizontal distance; a negative value places the shadow to the left of the text. <offset-y> specifies the
vertical distance; a negative value places the shadow above the text. If both values are 0, the shadow is placed directly behind the text, although it may be partly visible due to the effect of <blur-radius>. <blur-radius> Optional. This is a <length> value. The higher the value, the bigger the blur; the shadow becomes wider and lighter. If not specified, it defaults to 0. Formal definition Initial v...
text-underline-offset - CSS: Cascading Style Sheets
cales with the font size. <percentage> Specifies the offset of underlines as a <percentage> of 1 em in the element's font. A percentage inherits as a relative value, and so therefore scales with changes in the font. For a given application of this property, the offset is constant across the whole box that the underline is applied to, even if there are child elements with different font sizes or
vertical alignment. Formal definition Initial valueautoApplies toall elements. It also applies to ::first-letter and ::first-line.InheritedyesPercentagesrefer to the font size of the element itselfComputed valueas specifiedAnimation typeby computed value type Formal syntax auto | <length> | <percentage> Examples <p class="oneline">Here's some text with an offset wavy red underline!</p> <br> <p clas...
touch-action - CSS: Cascading Style Sheets
n-right, and/or one of the keywords pan-y, pan-up, pan-down, plus optionally the keyword pinch-zoom. Values auto Enable browser handling of all panning and zooming gestures. none Disable browser handling of all panning and zooming gestures. pan-x Enable single-finger horizontal panning gestures. May be combined with pan-y, pan-up, pan-down and/or pinch-zoom. pan-y Enable single-finger
vertical panning gestures. May be combined with pan-x, pan-left, pan-right and/or pinch-zoom. manipulation Enable panning and pinch zoom gestures, but disable additional non-standard gestures such as double-tap to zoom. Disabling double-tap to zoom removes the need for browsers to delay the generation of click events when the user taps the screen. This is an alias for "pan-x pan-y pinch-zoom" (which, fo...
rotateY() - CSS: Cascading Style Sheets
Its result is a <transform-function> data type. 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 axis of rotation passes through an origin, defined by the transform-origin CSS property. Note: rotateY(a) is equivalent to rotate3d(0, 1, 0, a). Note: Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. ...
scale() - CSS: Cascading Style Sheets
Its result is a <transform-function> data type. This scaling transformation is characterized by a two-dimensional vector. Its coordinates define how much scaling is done in each direction. If both coordinates are equal, the scaling is uniform (isotropic) and the aspect ratio of the element is preserved (this is a homothetic transformation). ...
scaleX() - CSS: Cascading Style Sheets
formation that resizes an element along the x-axis (horizontally). Its result is a <transform-function> data type. It modifies the abscissa of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic, and the angles of the element are not conserved. scaleX(-1) defines an axial symmetry, with a
vertical axis passing through the origin (as specified by the transform-origin property). Note: scaleX(sx) is equivalent to scale(sx, 1) or scale3d(sx, 1, 1). Syntax scaleX(s) Values s Is a <number> representing the scaling factor to apply on the abscissa of each point of the element. Cartesian coordinates on R2 Homogeneous coordinates on RP2 Cartesian coordinates on R3 Homo...
scaleY() - CSS: Cascading Style Sheets
Its result is a <transform-function> data type. It modifies the ordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic, and the angles of the element are not conserved. scaleY(-1) defines an axial symmetry, with a horizontal axis passing through the origin (as specified by the transform-origin property). Note: scaleY(sy) is equivalent to scale(1, sy) or scale3d(1, sy, 1). ...
skew() - CSS: Cascading Style Sheets
a <transform-function> data type. 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 transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the horizontal and
vertical directions. The coordinates of each point are modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. Syntax The skew() function is specified with either one or two values, which represent the amount of skewing to be applied in each direction. skew(ax) skew(ax, ay) Values ...
skewY() - CSS: Cascading Style Sheets
The skewY() CSS function defines a transformation that skews an element in the
vertical direction on the 2D plane. Its result is a <transform-function> data type. 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 transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the
vertical direction. The ordinate coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. Syntax skewY(a) Values a Is an <angle> representi...
translateY() - CSS: Cascading Style Sheets
Its result is a <transform-function> data type. Note: translateY(ty) is equivalent to translate(0, ty) or translate3d(0, ty, 0). Syntax /* <length-percentage> values */ transform: translateY(200px); transform: translateY(50%); Values <length-percentage> The value is a <length> or <percentage> representing the ordinate of the translating vector. A percentage value refers to the height of the reference box defined by the transform-box property. ...
transform-origin - CSS: Cascading Style Sheets
The transform-origin property may be specified using one, two, or three values, where each value represents an offset. Offsets that are not explicitly defined are reset to their corresponding initial values. If two or more values are defined and either no value is a keyword, or the only used keyword is center, then the first value represents the horizontal offset and the second represents the
vertical offset. One-value syntax: The value must be a <length>, a <percentage>, or one of the keywords left, center, right, top, and bottom. Two-value syntax: One value must be a <length>, a <percentage>, or one of the keywords left, center, and right. The other value must be a <length>, a <percentage>, or one of the keywords top, center, and bottom. Three-value syntax: ...
transition-property - CSS: Cascading Style Sheets
on't currently animate, as someday they might, causing unexpected results. If you specify a shorthand property (e.g., background), all of its longhand sub-properties that can be animated will be. Syntax /* Keyword values */ transition-property: none; transition-property: all; /* <custom-ident> values */ transition-property: test_05; transition-property: -specific; transition-property: sliding-
vertically; /* Multiple values */ transition-property: test1, animation4; transition-property: all, height, color; transition-property: all, -moz-specific, sliding; /* Global values */ transition-property: inherit; transition-property: initial; transition-property: unset; Values none No properties will transition. all All properties that can transition will. <custom-ident> A string identifying...
zoom - CSS: Cascading Style Sheets
This property originated in Internet Explorer. Apple has a description in the Safari CSS Reference. Rossen Atanassov of Microsoft has an u...
Event developer guide - Developer guides
systematic characterization of the events built-in or defined by modern web browsers. The device on which the web browser is running can trigger events, for example due to a change in its position and orientation in the real world, as discussed partially by the page on orientation coordinate systems and the page on the use of 3D transforms. That is different, but similar, to the change in device
vertical orientation. The window in which the browser is displayed can trigger events; for example, change size if the user maximizes the window or otherwise changes it. The process loading of a web page can trigger events in response to the completion of different steps in the downloading, parsing, and rendering of the web page for display to the user. The user interaction with the web page contents c...
HTML attribute: multiple - HTML: Hypertext Markup Language
om</option> <option>sneezy@woodworkers.com</option> <option>dopey@woodworkers.com</option> <option>doc@woodworkers.com</option> </select> </p> <p> <input type="submit" value="Submit"> </p> </form> Note the difference in appearance between the two form controls. /* uncomment this CSS to make the multiple the same height as the single */ /* select[multiple] { height: 1.5em;
vertical-align: top; } select[multiple]:focus, select[multiple]:active { height: auto; } */ There are a few ways to select multiple options in a <select> element with a multiple attribute. Depending on the operating system, mouse users can hold the Ctrl, Command, or Shift keys and then click multiple options to select/deselect them. Keyboard users can select multiple contiguous items by focusing on the...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
applet so that it can be identified by other resources; particularly scripts. 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. 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 Comme...
<frameset> - HTML: Hypertext Markup Language
d to contain <frame> elements. Note: Because the use of frames is now discouraged in favor of using <iframe>, this element is not typically used by modern web sites. Attributes Like all other HTML elements, this element supports the global attributes. cols This attribute specifies the number and size of horizontal spaces in a frameset. rows This attribute specifies the number and size of
vertical spaces in a frameset. Example <frameset cols="50%,50%"> <frame src="https://udn.realityripple.com/docs/Web/HTML/Element/frameset" /> <frame src="https://udn.realityripple.com/docs/Web/HTML/Element/frame" /> </frameset> ...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
rmenctype image, submit Form data set encoding type to use for form submission formmethod image, submit HTTP method to use for form submission formnovalidate image, submit Bypass form control validation for form submission formtarget image, submit Browsing context for form submission height image Same as height attribute for <img>;
vertical dimension list almost all Value of the id attribute of the <datalist> of autocomplete options max numeric types Maximum value maxlength password, search, tel, text, url Maximum length (number of characters) of value min numeric types Minimum value minlength password, search, tel, text, url Minimum length (number of charact...
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
terval in pixels. The default value is 6. scrolldelay 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 attribu...
<spacer> - HTML: Hypertext Markup Language
n image. However, <spacer> no longer supported by any major browser and the same effects can now be achieved using simple CSS. Firefox, 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 an...
<sub>: The Subscript element - HTML: Hypertext Markup Language
otes The <sub> element should be used only for typographical reasons--that is, to change the position of the text to comply with typographical conventions or standards, rather than solely for presentation or appearance purposes. For example, using <sub> to style the name of a company which uses altered baselines in their wordmark would not be appropriate; instead, CSS should be used (likely the
vertical-align property, such as
vertical-align: sub or, to more precisely control the baseline shift,
vertical-align: -25%. Appropriate use cases for <sub> include (but aren't necessarily limited to): Marking up footnote numbers. See Footnote numbers for an example. Marking up the subscript in mathematical variable numbers (although you may also consider using a MathML formula for this). See Variabl...
<sup>: The Superscript element - HTML: Hypertext Markup Language
y includes the global attributes. Usage notes The <sup> element should only be used for typographical reasons--that is, to change the position of the text to comply with typographical conventions or standards, rather than solely for presentation or appearance purposes. For example, to style the wordmark of a business or product which uses a raised baseline should be done using CSS (most likely
vertical-align) rather than <sup>. This would be done using, for example,
vertical-align: super or, to shift the baseline up 50%,
vertical-align: 50%. Appropriate use cases for <sup> include (but aren't necessarily limited to): Displaying exponents, such as "x3." It may be worth considering the use of MathML for these, especially in more complex cases. See Exponents under Examples below. Displaying s...
<textarea> - HTML: Hypertext Markup Language
ML forms provides some useful tips on styling <textarea>s. Baseline inconsistency The HTML specification doesn't define where the baseline of a <textarea> is, so different browsers set it to different positions. For Gecko, the <textarea> baseline is set on the baseline of the first line of the textarea's first line, on another browser it may be set on the bottom of the <textarea> box. Don't use
vertical-align: baseline on it; the behavior is unpredictable. Controlling whether a textarea is resizable In most browsers, <textarea>s are resizable -- you'll notice the drag handle in the right hand corner, which can be used to alter the size of the element on the page. This is controlled by the resize CSS property -- resizing is enabled by default, but you can explicitly disable it using a resize va...
Grammar and types - JavaScript
strings, as shown in the following example. 'one line \n another line' The following table lists the special characters that you can use in JavaScript strings. Table: JavaScript special characters Character Meaning \0 Null Byte \b Backspace \f Form feed \n New line \r Carriage return \t Tab \v
Vertical tab \' Apostrophe or single quote \" Double quote \\ Backslash character \XXX The character with the Latin-1 encoding specified by up to three octal digits XXX between 0 and 377. For example, \251 is the octal sequence for the copyright symbol. \xXX The character with the Latin-1 encoding specified by the two hexadecimal d...
Character classes - JavaScript
/\s\w*/ matches " bar" in "foo bar". \S Matches a single character other than white space. Equivalent to [^ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. For example, /\S\w*/ matches "foo" in "foo bar". \t Matches a horizontal tab. \r Matches a carriage return. \n Matches a linefeed. \v Matches a
vertical tab. \f Matches a form-feed. [\b] Matches a backspace. If you're looking for the word-boundary character (\b), see Boundaries. \0 Matches a NUL character. Do not follow this with another digit. \cX Matches a control character using caret notation, where "X" is a letter from A-Z (corresponding to codepoints U+0001-U+001F). For example, /\cM/ mat...
Regular expression syntax cheatsheet - JavaScript
/\s\w*/ matches " bar" in "foo bar". \S Matches a single character other than white space. Equivalent to [^ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. For example, /\S\w*/ matches "foo" in "foo bar". \t Matches a horizontal tab. \r Matches a carriage return. \n Matches a linefeed. \v Matches a
vertical tab. \f Matches a form-feed. [\b] Matches a backspace. If you're looking for the word-boundary character (\b), see Boundaries. \0 Matches a NUL character. Do not follow this with another digit. \cX Matches a control character using caret notation, where "X" is a letter from A-Z (corresponding to codepoints U+0001-U+001F). For example, /\cM/ mat...
String - JavaScript
\u{XXXXXX} (where X...XXXXXX is 1-6 hex digits; range of 0x0-0x10FFFF) UTF-32 code unit / Unicode code point between U+0000 and U+10FFFF \xXX (where XX...
Lexical grammar - JavaScript
necessary for the functionality of the code. Minification tools are often used to remove whitespace in order to reduce the amount of data that needs to be transferred. White space characters Code point Name Abbreviation Description Escape sequence U+0009 Character tabulation <HT> Horizontal tabulation \t U+000B Line tabulation <VT>
Vertical tabulation \v U+000C Form feed <FF> Page breaking control character (Wikipedia). \f U+0020 Space <SP> Normal space U+00A0 No-break space <NBSP> Normal space, but no point at which a line may break Others Other Unicode space characters <USP> Spaces in Unicode on Wikipedia Line terminators In addition ...
<menclose> - MathML
the contents top a2 + b2 line above of the contents bottom a2 + b2 line below of the contents updiagonalstrike a2 + b2 strikeout line through contents from lower left to upper right downdiagonalstrike a2 + b2 strikeout line through contents from upper left to lower right
verticalstrike a2 + b2
vertical strikeout line through contents horizontalstrike a2 + b2 horizontal strikeout line through contents madruwb a2 + b2 Arabic factorial symbol updiagonalarrow a2 + b2 diagonal arrow phasorangle a2 + b2 phasor angle Examples <math> ...
<mglyph> - MathML
URL is wrong, the image is not in one of the supported formats, 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 speci...
<mlabeledtr> - MathML
esheets. columnalign Overrides the horizontal alignment of cells specified by <mtable> for this row. Possible values are: left, center and right. groupalign href Used to set a hyperlink to a specified URI. 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. rowalign Overrides the
vertical alignment of cells specified by <mtable> for this row. Possible values are: axis, baseline, bottom, center and top. Examples Rendering: <math> <mtable> <mlabeledtr> <mtd><mn>1</mn></mtd> <!-- label --> <mtd><mi>A</mi></mtd> <mtd><mi>B</mi></mtd> </mlabeledtr> <mtr> <mtd><mi>C</mi></mtd> <mtd><mi>D</mi></mtd> <mtd><mi>E</mi></mtd> </mt...
<mo> - MathML
is the default value. separator There is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas). Allowed values are true or false. stretchy Specifies whether the operator stretches to the size of the adjacent element. Allowed values are true or false. symmetric If stretchy is true, this attribute specifies whether the operator should be
vertically symmetric around the imaginary math axis (centered fraction line). The default value is true if stretchy is set to true and otherwise false. Allowed values are true or false. Examples <math> <mrow> <mn>5</mn> <mo>+</mo> <mn>5</mn> </mrow> <mrow> <mo> [ </mo> <!-- default form value: prefix --> <mrow> <mn> 0 </mn> <mo> ; </mo> <!-- default form value: infix --> <mn> 1...
<mpadded> - MathML
"-") . href Used to set a hyperlink to a specified URI. lspace Sets or increments the horizontal position. 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 r...
<mstyle> - MathML
d additional attributes listed below. Attributes dir Overall directionality of formulas. Possible values are either ltr (left to right) or rtl (right to left). decimalpoint This attribute is specifying the character for the alignment point within <mstack> and <mtable> columns, if the decimalpoint value is used to specify the alignment. 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. See also largeop and movablelimits on <mo>. infixlinebreakstyle Specifies the default linebreakstyle to use for infix operators. The values before, after and duplicate are allowed. scr...
<mtd> - MathML
alues are: left, center and right. columnspan A non-negative integer value that indicates on how many columns does the cell extend. groupalign Unimplemented href Used to set a hyperlink to a specified URI. 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. rowalign Specifies the
vertical alignment of this cell and overrides values specified by <mtable> or <mtr>. Possible values are: axis, baseline, bottom, center and top. rowspan A non-negative integer value that indicates on how many rows does the cell extend. Specifications Specification Status Comment MathML 3.0The definition of 'mtd' in that specification. Recommendation Current specifi...
<mtr> - MathML
nalign Overrides the horizontal alignment of cells specified by <mtable> for this row. Possible values are: left, center and right. groupalign Unimplemented href Used to set a hyperlink to a specified URI. 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. rowalign Overrides the
vertical alignment of cells specified by <mtable> for this row. Possible values are: axis, baseline, bottom, center and top. Specifications Specification Status Comment MathML 3.0The definition of 'mtr' in that specification. Recommendation Current specification MathML 2.0The definition of 'mtr' in that specification. Recommendation Initial specificatio...
The "codecs" parameter in common media types - Web media technologies
8 VP8 vp09 VP9 vp10 VP10 PP The two-digit profile number, padded with leading zeroes if necessary to be exactly two digits. WebM profile numbers Profile Description 00 Only 4:2:0 (chroma subsampled both horizontally and
vertically). Allows only 8 bits per color component. 01 All chroma subsampling formats are allowed. Allows only 8 bits per color component. 02 Only 4:2:0 (chroma subsampled both horizontally and
vertically). Supports 8, 10, or 12 bits per color sample component. 03 All chroma subsampling formats are allowed. Supports 8, 10...
The building blocks of responsive design - Progressive web apps (PWAs)
Removes the top margin from the x-card contents so you don't end up with an unsightly gap at the top of the screen in landscape mode. Changes the sizing of the control buttons (e.g. Take Picture, Delete Photo) so they don't look too big and sit properly on the screen. This results in the following layout: Note: Another solution with respect to orientation might ...
baseFrequency - SVG: Scalable Vector Graphics
If one number is provided, then that value is used for both x and y. Negative values are forbidden. Example <svg width="200" height="200" viewBox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementFilter"> <feTurbulence type="turbulence" baseFrequency="0.05" numOctaves="2" result="turbulence"/> <feDisplacementMap in2="turbulence" in="Sou...
dy - SVG: Scalable Vector Graphics
List of <length> Default value none Animatable Yes Example html,body,svg { height:100% } <svg viewBox="0 0 150 100" xmlns="http://www.w3.org/2000/svg"> <!-- Horizontal lines --> <line x1="0" x2="100%" y1="30" y2="30" /> <line x1="0" x2="100%" y1="40" y2="40" /> <line x1="0" x2="100%" y1="50" y2="50" /> <line x1="0" x2="100%" y1="60" y2="60" /> <!--
Vertical lines --> <line x1="10" x2="10" y1="0" y2="100%" /> <line x1="50" x2="50" y1="0" y2="100%" /> <line x1="90" x2="90" y1="0" y2="100%" /> <!-- Behaviors change based on the number of values in the attributes --> <text dy="20" x="10" y="30">SVG</text> <text dy="0 10" x="50" y="30">SVG</text> <text dy="0 10 20" x="90" y="30">SVG</text> </svg> line { stroke: red; stroke-wid...
filterRes - SVG: Scalable Vector Graphics
r zero values disable the rendering of the element which referenced the filter. Only one element is using this attribute: <filter> Usage notes Value <number-optional-number> Default value None Animatable Yes <number-optional-number> This value takes one or two values, the first one outlining the resolution in horizontal direction, the second one in
vertical direction. If only one value is specified, it is used for both directions. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'filterRes' in that specification. Recommendation Initial definition ...
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
red. When the reference orientation direction is horizontal and the glyph-orientation-horizontal results in an orientation angle that is a multiple of 180 degrees, then the current text position is incremented according to the horizontal metrics of the glyph. Otherwise, if the value of this attribute is not a multiple of 180 degrees, then the current text position is incremented according to the
vertical metrics of the glyph. This attribute is applied only to text written in a horizontal writing-mode. Note: As a presentation attribute, glyph-orientation-horizontal 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 ...
orientation - SVG: Scalable Vector Graphics
The orientation attribute indicates that the given glyph is only to be used for a particular text direction, i.e. horizontal or
vertical. Only one element is using this attribute: <glyph> Usage notes Value h | v Default value None (meaning glyph can be used for both text directions) Animatable Yes h This value indicates that the glyph is only used for a horizontal text direction. v This value indicates that the glyph is only used for a
vertical text direction. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'orientation' in that specification. Recommendation Initial definition ...
shape-rendering - SVG: Scalable Vector Graphics
This option will sometimes cause the user agent to turn off shape anti-aliasing. 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. ...
stemh - SVG: Scalable Vector Graphics
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. ...
stemv - SVG: Scalable Vector Graphics
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 Statu...
transform-origin - SVG: Scalable Vector Graphics
The transform-origin property may be specified using one, two, or three values, where each value represents an offset. Offsets that are not explicitly defined are reset to their corresponding initial values. If two or more values are defined and either no value is a keyword, or the only used keyword is center, then the first value represents the horizontal offset and the second represents the
vertical offset. One-value syntax: The value must be a <length>, a <percentage>, or one of the keywords left, center, right, top, and bottom. Two-value syntax: One value must be a <length>, a <percentage>, or one of the keywords left, center, and right. The other value must be a <length>, a <percentage>, or one of the keywords top, center, and bottom. Three-value syntax: ...
v-ideographic - SVG: Scalable Vector Graphics
The value is an offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute. Only one element is using this attribute: <font-face> Usage notes Value <number> Default value None Animatable No <number> This value indicates the alignment coordinate for the glyphs. ...
v-mathematical - SVG: Scalable Vector Graphics
The value is an offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute. Only one element is using this attribute: <font-face> Usage notes Value <number> Default value None Animatable No <number> This value indicates the alignment coordinate for the glyphs. ...
vert-origin-x - SVG: Scalable Vector Graphics
The vert-origin-x attribute indicates the x-coordinate in the font coordinate system of the origin of a glyph to be used when drawing
vertically oriented text. Only one element is using this attribute: <font> Usage notes Value <number> Default value Half of horiz-adv-x value Animatable No <number> This value indicates the x-coordinate of the origin of a glyph for
vertically oriented text. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'vert-origin-x' in that specification. Recommendation Initial definition ...
vert-origin-y - SVG: Scalable Vector Graphics
The vert-origin-y attribute indicates the y-coordinate in the font coordinate system of the origin of a glyph to be used when drawing
vertically oriented text. Only one element is using this attribute: <font> Usage notes Value <number> Default value ascent value Animatable No <number> This value indicates the y-coordinate of the origin of a glyph for
vertically oriented text. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'vert-origin-y' in that specification. Recommendation Initial definition ...
visibility - SVG: Scalable Vector Graphics
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="button-icon"> <path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" /> <path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" class="invisible" /> <path d="M0 0h24v24H0z" fill="none" /> </svg> <span> click me </span> </button> CSS svg { display: inline !important; } span {
vertical-align: 50%; } button { line-height: 1em; } .invisible { visibility: hidden; } JavaScript document.querySelector("button").addEventListener("click", function (evt) { this.querySelector("svg > path:nth-of-type(1)").classList.toggle("invisible"); this.querySelector("svg > path:nth-of-type(2)").classList.toggle("invisible"); }); Specifications Specification Status Commen...
<image> - SVG: Scalable Vector Graphics
Any number of the following elements, 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 ren...
<rect> - SVG: Scalable Vector Graphics
le: 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|<length>|<percentage> ; Default value: auto; Animatable: yes rx The horizontal corner radius of the rect. Defaults to ry if it is specified. Value type: 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 ...
<text> - SVG: Scalable Vector Graphics
text baseline. Value type: <length>|<percentage> ; Default value: 0; Animatable: yes y The y coordinate of the starting point of the text baseline. Value type: <length>|<percentage> ; Default value: 0; Animatable: yes dx Shifts the text position horizontally from a previous text element. Value type: <length>|<percentage> ; Default 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|spacing...
<tspan> - SVG: Scalable Vector Graphics
baseline. Value type: <length>|<percentage> ; Default value: none; Animatable: yes y The y coordinate of the starting point of the text baseline. Value type: <length>|<percentage> ; Default value: none; Animatable: yes dx Shifts the text position horizontally from a previous text element. Value type: <length>|<percentage> ; Default 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|spacing...
<vkern> - SVG: Scalable Vector Graphics
This process is known as kerning. Usage context CategoriesFont elementPermitted contentEmpty Attributes Global attributes Core attributes Specific attributes u1 g1 u2 g2 k DOM Interface This element implements the SVGVKernElement interface. ...
Getting started - SVG: Scalable Vector Graphics
of the red rectangle (center of circle offset 150px to the right, and 100px downward from the top left corner). The text "SVG" is drawn. The interior of each letter is filled in with white. The text is positioned by setting an anchor where we want the midpoint to be: in this case, the midpoint should correspond to the center of the green circle. Fine adjustments can be made to the font size and
vertical position to ensure the final result is aesthetically pleasing. Basic properties of SVG files The first important thing to notice is the order of rendering elements. The globally valid rule for SVG files is, that later elements are rendered atop previous elements. The further down an element is the more it will be visible. SVG files on the web can be displayed directly in the browser or embe...
Gradients in SVG - SVG: Scalable Vector Graphics
eral other attributes, which specify the size and appearance of the gradient. The orientation of the gradient is controlled by two points, designated by the attributes x1, x2, y1, and y2. These attributes define a line along which the gradient travels. The gradient defaults to a horizontal orientation, but it can be rotated by changing these. Gradient2 in the above example is designed to create a
vertical gradient. <linearGradient id="Gradient2" x1="0" x2="0" y1="0" y2="1"> Note: You can also use the xlink:href attribute on gradients too. When it is used, attributes and stops from one gradient can be included on another. In the above example, you wouldn't have to recreate all the stops in Gradient2. <linearGradient id="Gradient1"> <stop id="stop1" offset="0%"/> <stop id="stop2" offset=...