Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by George John
Page 25 of 79
Controlling Pagination with CSS
The CSS pagination properties allow you to control how content breaks across pages when printing or creating PDFs. These properties help ensure your content flows logically and looks professional in print format. Syntax selector { page-break-before: value; page-break-after: value; page-break-inside: value; } Possible Values ValueDescription autoDefault. Browser generates page breaks as needed alwaysForces a page break before or after the element avoidAvoids page breaks before, after, or inside the element leftForces page breaks to render element on a left-hand page rightForces ...
Read MoreHow to specify the target media types of a set of CSS rules
The media attribute on CSS elements and @media rules allows you to specify which types of devices or media should apply specific CSS styles. This enables responsive design and device-specific styling. Syntax /* Using @media rule */ @media media-type { /* CSS rules */ } /* Using link element */ Common Media Types Media TypeDescription allSuitable for all devices (default) printIntended for printed documents screenIntended for computer screens speechIntended for speech synthesizers Example: Using Link Element with Media Attribute The following example shows ...
Read MoreFade In Right Animation Effect with CSS
The CSS Fade In Right animation effect creates a smooth transition where an element starts invisible and positioned to the right, then gradually fades in while moving to its final position. This effect is commonly used for creating engaging entrance animations. Syntax @keyframes fadeInRight { 0% { opacity: 0; transform: translateX(distance); } 100% { opacity: 1; ...
Read MoreCreate a mirror image with CSS
The CSS mirror effect can be created using the transform property with scale() function. By applying negative values to the scale function, you can flip elements horizontally or vertically to create mirror images. Syntax /* Horizontal mirror (flip left-right) */ transform: scaleX(-1); /* Vertical mirror (flip top-bottom) */ transform: scaleY(-1); /* Both horizontal and vertical mirror */ transform: scale(-1, -1); Possible Values FunctionDescription scaleX(-1)Creates a horizontal mirror image (flips left to right) scaleY(-1)Creates a vertical mirror image (flips top to bottom) scale(-1, -1)Creates both horizontal and vertical mirror image ...
Read MoreUsage of CSS !important rule
The !important rule in CSS provides a way to give maximum priority to a CSS declaration. When applied, it ensures that the property value will override any other conflicting styles, regardless of specificity or source order. Syntax selector { property: value !important; } How CSS Cascade Works Without !important Normally, CSS follows the cascade rule where styles applied later override earlier styles. Here's an example ? p { color: red; ...
Read MoreUsage of margin property with CSS
The CSS margin property defines the space around an HTML element, creating transparent area outside the element's border. It is possible to use negative values to overlap content and it serves as a shorthand property for setting all margin properties in one declaration. Syntax selector { margin: value; } Possible Values ValueDescription lengthDefines margin in px, em, rem, etc. %Defines margin as percentage of container width autoBrowser calculates the margin automatically inheritInherits margin from parent element Example 1: Single Value Margin The following example applies 20px ...
Read MoreCursor property of CSS
The cursor property of CSS allows you to specify the type of cursor that should be displayed to the user when they hover over an element. Syntax selector { cursor: value; } Possible Values ValueDescription autoBrowser determines the cursor to display based on context defaultDefault cursor (usually an arrow) pointerHand cursor (typically for clickable elements) crosshairCrosshair cursor textText selection cursor (I-beam) waitLoading/wait cursor not-allowedCursor indicating something is not allowed Example: Basic Cursor Types The following example demonstrates different cursor types when hovering over elements − ...
Read Moreexit() vs _Exit() function in C and C++
In C, both exit() and _Exit() functions terminate a program, but they differ in how they handle cleanup operations. The exit() function performs cleanup operations before termination, while _Exit() terminates immediately without any cleanup. Syntax void exit(int status); void _Exit(int status); The exit() function calls registered cleanup functions (via atexit()), flushes buffers, and closes open streams before termination. The _Exit() function immediately terminates the program without performing any cleanup operations. Example 1: Using exit() Function Here's how exit() executes cleanup functions registered with atexit() − #include #include void ...
Read MoreC Program to print hollow pyramid and diamond pattern
In this tutorial, we will learn how to create hollow pyramid and diamond patterns in C programming. Unlike solid patterns, hollow patterns print stars only at the borders while keeping the interior empty using spaces. Syntax /* Hollow Pyramid Logic */ for(i = 1; i
Read MoreC program to print characters without using format specifiers
In this article we will see how we can print some characters without using any kind of format specifiers. The format specifiers in C are %d, %f, %c etc. These are used to print characters and numbers in C using the printf() function. Here we will see another way to print characters without using %c format specifier. This can be done by putting ASCII values directly in hexadecimal form using escape sequences. Syntax printf("\xHH"); // HH is hexadecimal ASCII value Method 1: Using Hexadecimal Escape Sequences The \x escape sequence allows us ...
Read More