Articles on Trending Technologies

Technical articles with clear explanations and examples

How to use a not:first-child selector in CSS?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 3K+ Views

The CSS :not(:first-child) selector combines the :not and :first-child pseudo-classes to select all elements except the first child of their parent. This is useful when you want to style all child elements except the first one. Syntax element:not(:first-child) { /* CSS styles */ } Method 1: Selecting Specific Child Elements You can target specific elements within a parent container, excluding the first one − div p:not(:first-child) { color: green; ...

Read More

How to translate an image or icon by hovering over it?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 2K+ Views

In web development, interactivity is key to providing a memorable user experience. One common technique used to add interactivity is hovering over images or icons to reveal more information or change the appearance. Translating an image or icon by hovering over it is a great way to add some movement and interest to your website. In this article, we will learn how to translate an image or icon on hover. To perform this task, we will learn different approaches using only HTML and CSS. Syntax selector { transform: translateX(value) | translateY(value) | ...

Read More

Append Odd element twice in Python

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 280 Views

Sometimes we need to process a list where odd numbers appear twice while even numbers remain unchanged. This is useful in data processing scenarios where odd values need special emphasis or duplication. Using List Comprehension The most concise approach uses list comprehension with conditional repetition ? numbers = [2, 11, 5, 24, 5] # Repeat odd numbers twice, keep even numbers once result = [value for num in numbers for value in ([num] if num % 2 == 0 else [num, num])] print("Original list:", numbers) print("After processing:", result) Original list: [2, ...

Read More

Append at front and remove from rear in Python

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 304 Views

When working with Python lists, we often need to add elements to the front and remove elements from the rear. Python provides several efficient methods to accomplish this task, both from the standard library and through built-in operators. Using + Operator with List Slicing The simplest approach combines list concatenation with slicing to add an element at the front while removing the last element ? days = ['Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] print("Original list:", days) # Add 'Mon' at front and remove last element result = ['Mon'] + days[:-1] print("After append front and remove ...

Read More

How to transform child elements preserve the 3D transformations?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 374 Views

When working with 3D transformations in CSS, preserving the 3D context for child elements requires specific techniques. The transform-style property controls whether child elements are rendered in 3D space or flattened to a 2D plane. Syntax selector { transform-style: preserve-3d | flat; } Method 1: Using Transform-style Property The transform-style: preserve-3d property allows child elements to maintain their 3D positioning when the parent has 3D transforms applied − .container { perspective: 800px; ...

Read More

Adding a Chartsheet in an excel sheet using Python XlsxWriter module

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 552 Views

The XlsxWriter module in Python is a powerful external library that allows you to create Excel files with data, formatting, and charts. Unlike Python's built-in libraries, XlsxWriter specializes in generating Excel files with advanced features like charts, images, and complex formatting. What is a Chartsheet? A chartsheet is a separate worksheet in Excel that contains only a chart, without any data cells. This is different from inserting a chart into a regular worksheet − the entire sheet becomes the chart. Creating a Pie Chart in a Chartsheet Let's create a pie chart that displays data about ...

Read More

How to test CSS property of an element using Protractor?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 411 Views

Testing CSS properties is crucial in ensuring the quality of a web application. CSS properties determine how elements are displayed on a webpage, such as font size, color, and layout. Protractor is a popular end-to-end testing framework that uses WebDriver to automate interactions between a web application and a browser, widely used to test Angular applications. In this article, we will learn how to test the CSS properties of an element with the help of Protractor using different methods. Prerequisites Installation Requirements: Install Protractor: npm install -g protractor Update binaries: webdriver-manager update Start server: webdriver-manager ...

Read More

Add the element in a Python list with help of indexing

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 258 Views

A Python list is a collection data type that is ordered and changeable. It allows duplicate members and is the most frequently used collection data type in Python programs. We can add elements to a list at specific positions using indexing and the insert() method. Before adding elements, let's first understand how to access list elements using indexing. Accessing List Elements Using Index Every element in a list is associated with an index, which keeps the elements ordered. We can access elements by their index positions using slicing or direct indexing ? vowels_list = ['a', ...

Read More

How to style scrollbar thumb for the webkit browsers and what are components of scrollbar?

Tarun Singh
Tarun Singh
Updated on 15-Mar-2026 948 Views

Scrollbars are essential UI components that allow users to navigate through content that extends beyond the visible area. Webkit-based browsers (Chrome, Safari, Edge) provide special CSS pseudo-elements to style scrollbar components, including the draggable thumb handle. Syntax ::-webkit-scrollbar { width: value; } ::-webkit-scrollbar-thumb { background: color; border-radius: value; } ::-webkit-scrollbar-track { background: color; } Scrollbar Components Up Arrow ...

Read More

Add similar value multiple times in a Python list

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 7K+ Views

There are occasions when we need to add the same value multiple times to a Python list. This is useful for initializing lists, creating test data, or padding sequences. Python provides several built-in methods to achieve this efficiently. Using the * Operator This is the most straightforward method. The * operator creates a new list by repeating elements a specified number of times. Example Creating a list with repeated strings ? given_value = 'Hello! ' repeated_list = [given_value] * 5 print(repeated_list) The output of the above code is ? ['Hello! ...

Read More
Showing 19711–19720 of 61,297 articles
Advertisements