CSS Tooltips

To display any additional info on moving the mouse cursor over an element, the CSS Tooltip is used. Example: <!DOCTYPE html> <html> <style> .tooltip { position: relative; display: inline-block; border-bottom: 2px dotted red; } .tooltip .tooltiptext { visibility: hidden; width: 200px; background-color: crimson; color: white; text-align: center; padding: 5px; position: absolute; z-index: 5; } .tooltip:hover … Read more

CSS Transition

To modify an element gradually from one style to another, either the CSS transition, flash, or JavaScript can be used. To create a CSS transition, two things must be specified, the CSS property to add an effect and the effect time duration. If the time duration of the effect is not specified, its default value … Read more

CSS Gradient

To illustrate a smooth transition from and to two or more specified colors the CSS Gradient is used. There are the following benefits of using CSS Gradient: There is no need to use images to illustrate transition effects. The reduced download time and bandwidth usage. A gradient is generated by the browser and hence when … Read more

CSS Visibility

To specify an element to be visible or invisible, the CSS Visibility property is used. Both the invisible and invisible elements take up space on a web page. To create an invisible element with no space taken, the display property can be used. Syntax: visibility: visible|hidden|collapse|initial|inherit; Parameters: visible: It is used to define an element to … Read more

CSS Outline

Just like the CSS border property, the CSS Outline is used to render an additional border around an element to gain visual attention. Example: <!DOCTYPE html> <html> <head> <style> p { border: 5px solid black; outline: red solid 15px; margin-top: 30px; padding: 20px; text-align: center; } </style> </head> <body> <p>Hello World!!</p> </body> </html> Explanation: In … Read more

CSS Word Wrap

To wrap the long words onto the next line in order to prevent overflow, the CSS Word wrap property is used. It is useful for an unbreakable string that is too long to fit in the containing box. CSS Word Wrap Values: Value Uses normal To break words at allowed break points only. break-word To … Read more

CSS Width

To define the width of an element, the CSS width property is used. The width is specified for the area inside the padding, border, and margin of an element. CSS width Values: Value Uses auto To calculate the width. length To specify the width in px, cm, etc.