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 on Trending Technologies
Technical articles with clear explanations and examples
How to prevent inline-block divs from wrapping?
The CSS white-space property can be used to prevent inline-block elements from wrapping to the next line. When you set display: inline-block on elements, they normally wrap when there's insufficient horizontal space. Using white-space: nowrap on the parent container forces all inline-block children to stay on the same line. Syntax .parent-container { white-space: nowrap; } .child-element { display: inline-block; } Example 1: Basic Inline-Block Divs In this example, we create three inline-block divs that won't wrap even when the browser window is resized − ...
Read MoreASCII art using Python pyfiglet module
The pyfiglet module in Python allows you to create stylish ASCII art text with various fonts. This module transforms regular text into large, decorative ASCII representations that are perfect for banners, headers, or creative displays. Installation First, install the pyfiglet module using pip ? pip install pyfiglet Default Font Example The simplest way to create ASCII art is using the default font ? import pyfiglet # Text in default font result = pyfiglet.figlet_format("Python") print(result) ____ _ _ ...
Read MoreInherit a class to another file in Sass
The SASS is a pre-processor built on top of the CSS to manipulate the CSS code better. It contains multiple directives and rules, making it easy to write CSS code. It also contains some very useful features such as inheritance, if/else statements, functions, etc. In SASS, we can import one file into another file and use one file's content for another. It also allows us to create inheritance between multiple classes. We can use the @extend directive to inherit one class to another class. By using inheritance in CSS, we can increase the reusability of the code. In ...
Read MoreAdd one Python string to another
String concatenation in Python combines two or more strings into a single string. Python provides several methods to add strings together, with the + operator and join() method being the most common approaches. Using the + Operator The + operator concatenates strings by combining them sequentially. This is the most straightforward method for joining strings ? first_string = "What a beautiful " second_string = "flower" print("Given string s1:", first_string) print("Given string s2:", second_string) # Using + operator result = first_string + second_string print("Result after adding strings:", result) Given string s1: What ...
Read MoreHow to place background image using ::before pseudo selectors in CSS?
To place background image using ::before pseudo selectors, we will be using background-image and ::before pseudo element. CSS ::before pseudo-element is used to add content before the selected element with the content property allowing to insert text, images, or decorative elements, without modifying the HTML structure. This technique is particularly useful when you want to add a background image that can be styled independently from the main element, providing better control over layering and positioning. Syntax selector::before { content: ""; background-image: url("path/to/image.jpg"); position: absolute; ...
Read MoreAdd list elements with a multi-list based on index in Python
When working with nested lists, you may need to add elements from a simple list to elements within a nested list based on their index positions. This operation pairs each element from the simple list with the corresponding sublist in the nested list and adds the simple list element to each item in that sublist. If the lists have different lengths, the operation is limited by the shorter list. Below are three efficient methods to accomplish this task. Using for Loop This method uses nested loops to iterate through both lists simultaneously. We take the length of ...
Read MoreAdvanced JavaScript Animation Techniques using CSS and JavaScript Libraries
As web development continues to evolve, creating engaging and interactive user experiences has become an essential part of modern web applications. From subtle micro-interactions to complex visual effects, animations play a crucial role in capturing the attention of users and conveying information in a dynamic and visually appealing manner. JavaScript, in combination with CSS and various JavaScript libraries, offers powerful techniques for creating advanced animations on the web. In this article, we will delve into the world of advanced JavaScript animation techniques, exploring how CSS transitions and JavaScript libraries can be harnessed to bring your web animations to life. ...
Read MoreHow to Watch TCP and UDP Ports in Real-time in Linux?
In computer networks, services running on Linux systems communicate using protocols like TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) along with specific port numbers. Monitoring these ports in real-time helps system administrators track network activity, troubleshoot connectivity issues, and ensure security. List of Open Ports To view all currently open ports that are listening for connections, use the netstat command with specific flags ? $ sudo netstat -tulpn The flags have the following meanings ? t − Enable listing of TCP ports u − Enable listing of UDP ports l ...
Read MoreHow to Create a Combined Child Selector in SASS?
Sass (Systematically Awesome Style Sheets) is a CSS preprocessor that extends CSS with powerful features like variables, nesting, mixins, and inheritance. One of Sass's most useful features is the ability to create nested selectors, including combined child selectors that target direct children of elements. Syntax parent { > child { property: value; } } What is a Child Selector? A child selector (>) targets only the direct children of a parent element, not deeper nested descendants. In CSS, ...
Read MoreHow to View Colored Man Pages in Linux?
Man pages are important reference documents for Unix/Linux users, but their default appearance is plain text that can be hard to read. This article shows how to add colors and highlighting to man pages to make them more readable and easier to follow. Using most The most command is a pager that can display colored man pages. First, install it using your package manager ? sudo apt install most Once installed, add most as your default pager by adding this line to your .bashrc file ? export PAGER="most" Reload your ...
Read More