Dimension

Dimension in getcss


In getcss, the width and height properties of an element can be set in pixels or in percentage.


Width in pixel

Width of an element can be set in pixels by using class w-pixelsize-px.

The following example shows a div element with a 200-pixel width.

<div class="w-200-px">
<p>Width of this div element is 200px.</p>
</div>

Width of this div element is 200px.


Width in percentage

You can set the element's width in percentage also.

<div class="w-50-pr">
<p>Width of this div element is 50%.</p>
</div>

Width of this div element is 50%.


Height in pixel

Height of an element can be set in pixels

<div class="h-100-px">
<p>Height of this div element is 100px.</p>
</div>

Height of this div element is 100px.


Height in percentage

You can set the element's height in percentage also.

<div class="h-5-pr">
<p>Height of this div element is 5%.</p>
</div>

Height of this div element is 5%.

getcss logo


Designed and maintained with by Sunil

Source code licensed under MIT

Website content & documentation licensed under CC BY-NC-SA 4.0


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

getcss

Become a patron, sponsor, or backer!

Support getcss