devxlogo

CSS

Using the Hover Effect on an HTML Element

We use the hover attribute to set the hover effect in Web pages within CSS. For example: div {color:#000;}div :hover{color:#f00;} You can apply the transaction property on top of this with

Using Shorthand Properties in CSS

CSS supports shorthand properties for margin, border properties, etc. For example: margin-top: 1.5em; margin-right: 1em; margin-bottom: 1.5em; margin-left: 1em; could be written in shorthand format as margin: 1.5em 1em 1.5em

Capitalize the First Letter of Every Word with CSS

Use the text-transform property with ‘capitalize’ value to capitalize the first letter of the words in an element., For example: div { text-transform: capitalize; }this is a statement that requires

Clip an Image Using CSS with the CLIP Property

Images with absolute positioning can be clipped very easily with the CSS Clip property. The syntax is as below. .clippedImageStyle { position: absolute; clip: rect(100px, 150px, 175px, 30px);}