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 Chandu yadav
Page 26 of 81
Commonly used pseudo-classes in CSS
CSS pseudo-classes allow you to style elements based on their state or position without adding extra classes to your HTML. These powerful selectors help create interactive and dynamic styling effects. Syntax selector:pseudo-class { property: value; } Commonly Used Pseudo-Classes Pseudo-ClassDescription :linkStyles unvisited links :visitedStyles visited links :hoverStyles elements when mouse hovers over them :activeStyles elements when being clicked/activated :focusStyles elements that have keyboard focus :first-childStyles the first child element of its parent :langStyles elements based on their language attribute Example: Link States The following example demonstrates ...
Read MoreUsage of :link pseudo-class in CSS
The :link pseudo-class is used to add special style to an unvisited link. This pseudo-class targets anchor elements that have an href attribute and have not been visited by the user yet. Syntax a:link { property: value; } Possible Values You can apply any CSS property to :link, but commonly used properties include: PropertyDescription colorSets the text color of the unvisited link text-decorationControls underlining, overlining, or strike-through background-colorSets the background color of the link font-weightControls the thickness of the link text Example: Basic Link Styling ...
Read MoreUsage of CSS visibility property
The CSS visibility property controls whether an element is visible or hidden. Unlike display: none, hidden elements with visibility: hidden still occupy space in the layout. Syntax selector { visibility: value; } Possible Values ValueDescription visibleThe element and its contents are shown to the user (default) hiddenThe element and its content are invisible, but still affect the page layout collapseUsed only with table rows and columns to remove them from display Example: Visible vs Hidden Elements The following example demonstrates how visibility: hidden hides elements while ...
Read MoreCSS min-width property
The CSS min-width property sets the minimum width that an element can have. This property ensures that an element will never become smaller than the specified minimum width, even if the content would normally make it narrower. Syntax selector { min-width: value; } Possible Values ValueDescription lengthDefines minimum width in px, em, rem, etc. %Defines minimum width as a percentage of the parent element autoDefault value; browser calculates the minimum width Example: Setting Minimum Width The following example demonstrates how min-width prevents an element from becoming ...
Read MoreFloating Point Operations and Associativity in C, C++ and Java
In C, mathematical operations with floating point numbers do not always follow the associativity rule. This means that (a + b) + c may not equal a + (b + c) due to precision limitations and rounding errors in floating-point arithmetic. Syntax float result1 = a + (b + c); /* Right associativity */ float result2 = (a + b) + c; /* Left associativity */ Example: Floating Point Associativity Issue Here's an example demonstrating how floating point operations violate associativity − #include int ...
Read MoreC program to write an image in PGM format
The PGM (Portable Gray Map) format is part of the Netpbm package that provides an easy way to store 2D arrays as grayscale images. Unlike complex formats like PNG or JPEG, PGM files use a simple ASCII format that makes them easy to create and read programmatically. Each PGM file starts with a magic number P2 (for ASCII encoding) followed by dimensions, maximum gray value, and pixel data. The format is human-readable and portable across different platforms. Syntax P2 width height max_gray_value pixel_values... PGM File Structure To write a PGM file, follow these ...
Read MoreData Types we cannot use to create array in C
In C programming, arrays can be created using most data types like int, char, float, double, etc. However, there are certain data types that cannot be used to create arrays. The most notable restriction is with the void data type. Syntax datatype array_name[size]; // Valid for most data types void array_name[size]; // Invalid - compilation error Data Types That Cannot Be Used for Arrays 1. Void Data Type The void data type represents "no type" and has no size. Since arrays need to know the size of ...
Read MoreHow does the compilation/linking process work in C/C++?
The compilation of a C program involves several distinct phases that transform source code into an executable program. Understanding this process helps debug compilation errors and optimize build workflows. Compilation Process Overview Source Code (main.c) Preprocessor (main.i) Compiler (main.s) Assembler (main.o) Linker (executable) ...
Read MoreWhat does int argc, char *argv[] mean in C/C++?
In C programming, int argc and char *argv[] are parameters of the main function that allow your program to receive command-line arguments when executed. argc stands for argument count and argv stands for argument vector (or argument values). Syntax int main(int argc, char *argv[]) { // Program code return 0; } Parameters argc − An integer representing the number of command-line arguments passed to the program (including the program name itself) argv[] − An array of character pointers (strings) containing the actual command-line arguments ...
Read Moreimagecolorstotal() function in PHP
The imagecolorstotal() function returns the number of colors in an image's palette. This function only works with palette−based images (like GIF or PNG with limited colors), not true color images. Syntax imagecolorstotal($image) Parameters $image − An image resource created by one of the image creation functions like imagecreatefromgif() or imagecreatefrompng(). Return Value Returns the number of colors in the image's palette as an integer. For true color images, it returns 0. ...
Read More