Articles on Trending Technologies

Technical articles with clear explanations and examples

How do I hide an element when printing a web page?

Alshifa Hasnain
Alshifa Hasnain
Updated on 15-Mar-2026 7K+ Views

In this article, we will learn to hide an element when printing a web page using CSS and JavaScript. When printing a web page, you can suppress elements such as navigation menus, advertisements, and interactive elements that you do not require on paper and print only the required information. Syntax @media print { selector { display: none; } } Different Approaches The following are the two different approaches to hiding an element when printing a web page − ...

Read More

Area of a leaf inside a square?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 1K+ Views

Here we will see how to calculate the area of a leaf-shaped region inside a square ABCD, where each side of the square has length 'a'. A B C D Center a The leaf consists of two equal circular segments. Each segment is formed by the intersection of ...

Read More

How to set text alignment in HTML?

Sharon Christine
Sharon Christine
Updated on 15-Mar-2026 238K+ Views

To align text in HTML, use the style attribute to define the CSS text-align property. Just keep in mind, that the usage of style attribute overrides any style set globally. It will override any style set in the HTML tag or external style sheet. HTML style attribute specifies an inline style for an element. The attribute is used with the HTML tag, with the CSS text-align property for the center, left, and right alignment. HTML5 does not support the align attribute of the tag, so the CSS style is used to set text alignment. Syntax ...

Read More

Area of a circle inscribed in a rectangle which is inscribed in a semicircle?

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

Let us consider a semicircle with radius R. A rectangle of length l and breadth b is inscribed in that semicircle. Now a circle with radius r is inscribed in the rectangle. We need to find the area of the inner circle. R l b r ...

Read More

Arc length from given Angle?

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

Here we will see how to calculate the arc length from a given angle. When a circle with radius r is given and we know the angle x in degrees, we can find the arc length using a simple formula. r L x° Here r is the radius and x is the angle in degrees. We need to find the value of L (arc length). The formula is − Syntax L = ...

Read More

In dynamic fashion setting a custom class to a cell in a row

Amit Sharma
Amit Sharma
Updated on 15-Mar-2026 182 Views

If you need to set CSS properties for a row, you can combine the predefined CSS class of the table along with your custom class. This allows you to apply specific styling to table cells dynamically. Syntax .table-class .custom-class { property: value; } Example: Custom Cell Styling The following example demonstrates how to apply custom styling to table cells using a combination of table class and custom class − .data-table { border-collapse: ...

Read More

An interesting solution to get all prime numbers smaller than n?

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

Here we will see how to generate all prime numbers that are less than n using Wilson's theorem. According to Wilson's theorem, if a number k is prime, then ((k - 1)! + 1) mod k will be 0. This approach provides a mathematical foundation for prime detection. Note: This method is primarily of theoretical interest because factorial calculations grow extremely large, making it impractical for larger values of n in standard programming languages. Syntax void genAllPrimes(int n); // Generates all prime numbers less than n using Wilson's theorem Algorithm Begin ...

Read More

Using CSS3 in SAP BSP application without using DOCTYPE tag

Amit Sharma
Amit Sharma
Updated on 15-Mar-2026 295 Views

You can use CSS3 features in SAP BSP applications even without adding a DOCTYPE tag by leveraging JavaScript libraries and polyfills that provide CSS3-like functionality. Syntax /* CSS3 features may not work without DOCTYPE */ selector { border-radius: value; box-shadow: value; transition: value; } Method 1: Using jQuery UI jQuery UI provides CSS3-like effects and styling that work across browsers without requiring DOCTYPE − .custom-button { ...

Read More

An Interesting Method to Generate Binary Numbers from 1 to n?

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

Here we will see one interesting method for generating binary numbers from 1 to n. This approach uses a queue data structure to generate binary representations in sequence. Initially the queue holds the first binary number '1'. We repeatedly remove elements from the queue, print them, then append '0' and '1' to create the next binary numbers and insert them back into the queue. Algorithm genBinaryNumbers(n) Begin define empty queue insert "1" into the queue while n is not 0, do delete ...

Read More

How do I center tag using CSS?

Yaswanth Varma
Yaswanth Varma
Updated on 15-Mar-2026 518 Views

Centering a in CSS is one of the most common layout tasks in web development. There are several approaches − Flexbox, Grid, and margin-based centering. Let's look at each method with examples. Syntax /* Flexbox Method */ .container { display: flex; justify-content: center; align-items: center; } /* Grid Method */ .container { display: grid; place-items: center; } /* Margin Method */ .element { margin: 0 auto; ...

Read More
Showing 21681–21690 of 61,297 articles
Advertisements