Articles on Trending Technologies

Technical articles with clear explanations and examples

Linear gradient with rainbow color

George John
George John
Updated on 15-Mar-2026 1K+ Views

The CSS linear-gradient function can be used to create beautiful rainbow effects by combining all seven colors of the rainbow spectrum. A rainbow gradient provides a smooth transition from red through violet, creating an eye-catching visual effect. Syntax selector { background: linear-gradient(direction, red, orange, yellow, green, blue, indigo, violet); } Example: Rainbow Linear Gradient The following example creates a horizontal rainbow gradient using all seven spectrum colors − #demo { height: 100px; ...

Read More

An application on Bertrandís ballot theorem in C/C++

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 285 Views

Bertrand's ballot theorem states that in an election where candidate A receives p votes and candidate B receives q votes (where p > q), the probability that A is always strictly ahead throughout the counting process is (p-q)/(p+q). This theorem has practical applications in probability theory and combinatorics. Syntax Probability = (p - q) / (p + q) where p > q > 0 Mathematical Example Let there are 5 voters, of whom 3 vote for candidate A and 2 vote for candidate B (so p = 3 and q = 2). Ten possibilities ...

Read More

Set an animation with a slow start and end using CSS

vanithasree
vanithasree
Updated on 15-Mar-2026 382 Views

The CSS animation-timing-function property controls the speed curve of animations. Use the ease-in-out value to create animations that start slowly, speed up in the middle, and slow down at the end for smooth, natural motion. Syntax selector { animation-timing-function: ease-in-out; } Possible Values ValueDescription ease-in-outSlow start and slow end easeSlow start, fast middle, slow end (default) ease-inSlow start only ease-outSlow end only linearConstant speed throughout Example The following example demonstrates an animation with slow start and end using ease-in-out − ...

Read More

Selects all elements with class="mydemo" with CSS

varma
varma
Updated on 15-Mar-2026 206 Views

To select all elements with class="mydemo", you can use the CSS class selector. The class selector is denoted by a period (.) followed by the class name. Syntax .classname { /* CSS properties */ } Example The following example demonstrates how to select and style all elements with class="mydemo" − .mydemo { background-color: #f0f8ff; border: 2px dashed orange; ...

Read More

All combinations of strings that can be used to dial a number in C/C++?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 216 Views

Given a phone number, this program generates all possible string combinations that can be formed using the traditional phone keypad mapping. Each digit (2-9) maps to multiple letters, while digits 0 and 1 map to themselves. Syntax void printWords(int number[], int n); Keypad Mapping 2 ABC 3 DEF 4 GHI 5 JKL ...

Read More

Set an animation with a slow start, then fast, and end slowly with CSS

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 2K+ Views

The CSS animation-timing-function property with the ease value creates animations that start slowly, speed up in the middle, and then slow down at the end. This creates a natural, smooth animation effect that feels more realistic than linear timing. Syntax selector { animation-timing-function: ease; } Example The following example demonstrates an animation with ease timing that moves a yellow box horizontally − div { width: 150px; ...

Read More

Select elements whose attribute value contains a specified value with CSS

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 269 Views

The CSS [attribute*="value"] selector is used to select elements whose attribute value contains a specified substring. This selector matches any element where the attribute contains the specified value anywhere within it. Syntax [attribute*="value"] { /* CSS properties */ } How It Works The asterisk (*) in the selector means "contains". The selector will match any element where the specified attribute contains the given value as a substring, regardless of its position within the attribute value. Example: Selecting Images by Alt Text The following example selects all images whose ...

Read More

C vs BASH Fork bomb in C/C++?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 534 Views

A fork bomb is a type of denial-of-service attack that creates an exponential number of processes, consuming system resources. While BASH fork bombs are more persistent because created processes detach from the parent, C fork bombs have their own characteristics and can be modified to increase their impact. Syntax #include int main() { while(1) { fork(); } return 0; } BASH vs C Fork Bomb Differences The key differences between BASH and ...

Read More

Run Animation backward first and then forwards with CSS

radhakrishna
radhakrishna
Updated on 15-Mar-2026 2K+ Views

The CSS animation-direction property controls the direction of animation playback. Using the alternate-reverse value, you can run an animation backwards first, then forwards, creating a smooth back-and-forth effect. Syntax selector { animation-direction: alternate-reverse; } Possible Values ValueDescription normalAnimation plays forward (default) reverseAnimation plays backward alternateAnimation alternates between forward and backward alternate-reverseAnimation starts backward, then alternates Example The following example demonstrates an animation that runs backward first, then forwards using alternate-reverse − .animated-box { ...

Read More

How to delay an animation with CSS

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 103 Views

To delay an animation, use the CSS animation-delay property. This property specifies the amount of time to wait before starting the animation sequence. Syntax selector { animation-delay: time; } Possible Values ValueDescription timeSpecifies the delay time in seconds (s) or milliseconds (ms) 0sDefault value - no delay Negative valuesAnimation starts immediately but from a later point in the cycle Example: Basic Animation Delay The following example delays an animation by 2 seconds before it starts − ...

Read More
Showing 21081–21090 of 61,297 articles
Advertisements