Le unità nei fogli di stile (CSS) As unidades nas folhas de estilo (CS) Einheiten in Stylesheets (CSS) Les unités dans les feuilles de style (CSS) Unidades en las hojas de estilo (CSS)

Units

With style sheets, you can use numeric values to set style properties in multiple ways:

  • absolutely, meaning in units which are independent of the form of output (such as in centimetres);
  • relatively, meaning in units relative to an element.

Style sheet values may be given either in integers or in real numbers (digits with an integer part and a decimal part).

These values can, in some cases, be negative (preceded with a minus sign "-"). However, some properties have upper and lower limits to the values they can take.

Absolute units

The absolute units offered by the CSS standard are summarised in this chart:

Relative units

The relative units offered by the CSS standard are summarised in this chart:

unit description
cm centimetres
in inches (1 inch = 2.54 cm)
mm millimetres
pt points
pc picas (1 pica = 12 pt)
unit description
em Relative to the font size of the indicated element. Sole exception to this rule: when the property font-size is defined, it is relative to the font size of the parent element.
ex Relative to the lowercase letter height of the indicated element. Sole exception to this rule: when the property font-size is defined, it is relative to the lowercase letter height of the parent element.
px The pixel. This is a unit which may be rendered differently depending on the screen resolution of the user's monitor.
% The percentage is a unit which is relative to the size of the element or its parent.


Last update on Thursday October 16, 2008 02:43:13 PM.This document entitled « Units in style sheets (CSS) » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
Best answers for « Units in style sheets (CSS) » in :
Declaring a style sheet (CSS) Show Declaring a style sheet Style sheets are not directly integrated into the W3C's HTML recommendations. For this reason, you need to include elements in the HTML code indicating both the type of document, meaning the version of the HTML and CSS...
CSS - Style sheets Show Font properties Property Value Description font-family Specific font (Arial, Times, Verdana) Familly (serif, sans-serif, fantasy, monospace, cursive) Defines one or more font names or font families. If multiple fonts are defined,...
Style syntax (CSS) Show Defining a style Defining a style is done using simple text rules for describing the aspects of page elements. A CSS rule is characterised by two main elements: A type selector, for specifying which tags in the document the style applies to; A...
Create CSS easily ShowCreate CSS easily Easy links CSS is a short term for Cascading Style Sheets. CSS is used to alter the display of the HTML coded environment. For example, using CSS can change the appearance of your scroll bar, the color, headings...
Change the appearance of the cursor in CSS ShowChance the appearance of yhe cursor with CSS The cursor property allow you to change the appearance of the cursor on an element of a web page. The client will automatically display the cursor on his computer that matches the type of...
Filtering Apache logs / conditional Logging ShowFiltering Apache logs / conditional Logging Log-ins used by Apache Web server is usually very wordy, they contain all type of information (image files, style sheets, javascript, son RSS, etc.) This can be very troublesome when trying to...
Download Amaya ShowAmaya is a Web editor, developed collectively by the INRIA and the W3C, to edit and publish very simply pages containing text (in HTML or XHTML), graph (in SVG) and mathematical expressions (in MathML), the whole with style sheets CSS. Amaya is a...
Download Xenu's Link Sleuth ShowXenu's Link Sleuth is a software for checking broken links to a website. Advantage The check is performed on classic links, images, frames (frames), the Plugin, wallpapers, style sheets, applets and scripts (Javascript). It displays the...
Download SSH Secure Shell ShowSSH secure shell for workstations is a flexible client SSH allowing to connect in a secured way to remote applications. http://www.commentcamarche.net/faq/images/NHc6wz5jOYBhPXTis.png
CSS - Style sheets ShowIntroduction to style sheets The concept of style sheets first appeared in 1996 when the W3C published a new recommendation entitled "Cascading Style Sheets", or CSS for short. The principle behind style sheets involves using a single document to...
Units in style sheets (CSS) ShowBlock elements DIV tags define blocks of elements This is a structure created to define boxes such as menus or windows. CSS offers several properties for specifying the characteristics of margins. With a good working knowledge of these properties,...
Style classes (CSS) ShowClasses and IDs Classes A web designer might want to assign different styles to the same tags. For this reason, the CSS specifications introduced the concept of classes. The definition of classes is as simple as that of styles. It involves...