Lembaran Gaya Lata/Panjang dan Unit: Perbezaan antara semakan

Kandungan dihapus Kandungan ditambah
Algazel (bincang | sumb.)
Pindah ke laman betul
 
Algazel (bincang | sumb.)
Baris 50:
 
== Unit-unit Relatif ==
Ketiga-tiga unit &ndash; <code>em</code>, <code>ex</code> dan <code>px</code> are disebut unit-unit relatif. Unit-unit ini tidak menetapkan panjang yang tetap, sebaliknya unit-unit ini mengikut skala kiraan yang lain. Dalam kes <code>em</code> dan <code>ex</code>, unit-unit ini berskala relatif kepada saiz fon sesuatu unsur.
 
=== ScreenPiksel pixelsskrin, printerpiksel pixelspencetak anddan CSSpiksel pixelsCSS ===
Unit <code>px</code> menetapkam ukuran panjang dalam ''piksel CSS''. Uinit piksel ini tidak sama dengan piksel skrin di mana dokumen dipaparkan mahupun titik alat pencetak yang mencetak dokumen. Satu piksel CSS mungkin dibuat sama dengan dua piksel skrin atau lima piksel cetak. Banyak pelayar web menggunakan peraturan bahawa satu piksel skrin sama dengan satu piksel CSS bagi memudahkan kerja akan tetapi anda tidak boleh menganggap ini sebagai penentuan tetap. Opera dan Internet Explorer versi 7 membenarkan pengguna untuk menukar bilangan piksel skrin bagi setiap piksel CSS. Sering kali pengguna yang terganggu penglihatan yang mengguna pelayar ini bagi memilih lima atau enam piksel skrin bagi setiap piksel CSS.
The <code>px</code> unit specifies a length in ''CSS pixels''. These are not the same as the pixels on the screen that the document is rendered on or the dots on the printer that it is printed on. It is perfectly possible, for example, for there to be two screen pixels or five printer dots to one CSS pixel. Many web browsers use the rule that one screen pixel equals one CSS pixel for simplicity but you can not rely on this. Opera and Internet Explorer version 7 allow the user to change the number of screen pixels per CSS pixel. It is common for users with poor vision who use these browsers to choose to have five or six screen pixels to the CSS pixel.
 
The [http://www.w3.org/TR/CSS21/syndata.html#value-def-length formalDefinisi definitionformal] of thepiksel CSS pixel is quite complicatedagak butrumit theakan basictetapi idea isasasnya thatadalah apiksel CSS pixelkelihatan appearssama tosaiznya beapabila thedokumen sameberada sizepada whenkejauhan theyang documentmembolehkan isia atdibaca adengan comfortable reading distanceselesa. SoJadi apiksel CSS pixelsebenarnya wouldlebih bebesar physicallypada bigger on askrin monitor thandaripada onskrin atelefon mobilebimbit phoneoleh because thesebab monitor would normally belazimnya furtherberada fromlebih thejauh user'sdari eyesmata thanpembaca theberbanding mobiletelefon phonebimbit.
 
=== CalculationsPenghitungan ===
Divide the desired margin width/height by the width/height of its container to convert it to ems. Multiply by 100 to convert that to percentages.
 
bagi mendapatkan ukuran dalam unit <code>em</code>, bahagikan jidar yang dimahukan dengan lebar/tinggi bekasnya. Darab dengan 100 untuk mengubahnya kepada peratusan.
Divide the desired container width by 1.62 to use the Golden Ratio as the size of the content block. Subtract the content width from the container width to use the Golden Ratio as the size of the sidebar
 
Bahagikan bekas yang dikehendaki dengan 1.62 untuk mengguna perkiraan Nisbah Keemasan (''Golden Ratio'') sebagai saiz blok kandungan. Tolak lebar kandungan daripada lebar bekas jika mahu menggunakan Nisbah Keemasan sebagai saiz ''side-bar''.
 
{{Prognav|Lembaran Gaya Lata|Mentakrif Peraturan Gaya|Pemilih}}
 
[[Kategori:Lembaran Gaya Lata|Panjang dan Unit]]
[[Category:Cascading Style Sheets]]
 
[[Categoryen:Cascading Style Sheets/Lengths and Units]]
[[de:Websiteentwicklung: CSS: Schriftgröße]]
[[it:CSS/Unità di misura, ereditarietà e box model]]