codegurukool.com · Free coding tutorials & online compiler

Home › CSS Tutorial › CSS opacity

CSS opacity

Make things see-through.

opacity goes from 0 to 1 and fades the element and its children. rgba() fades only a background.

Example code

<style>.o{background:#e4572e;color:#000;padding:10px;margin:4px}</style>
<div class='o' style='opacity:.4'>opacity .4</div>
<div class='o' style='background:rgba(228,87,46,.4)'>rgba background</div>

Run this code in the online editor

← Pseudo-elementsNavigation bars →