Anvi Jain

Anvi Jain

427 Articles Published

Articles by Anvi Jain

Page 4 of 43

What is the purpose of wrapping whole JavaScript files in anonymous functions?

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 1K+ Views

The purpose of wrapping JavaScript files in anonymous functions is to create a namespace and control the visibility of member functions. It wraps the code inside a function scope and decreases clashing with other libraries. This is what we call Immediately Invoked Function Expression (IIFE) or Self Executing Anonymous Function. Syntax Here's the basic IIFE syntax: (function() { // code })(); As you can see above, the first pair of parentheses converts the code inside into an expression. The second pair of parentheses immediately calls the function that resulted from the ...

Read More

Achieve Responsiveness for background image with CSS

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 239 Views

Creating responsive background images ensures that your images adapt properly to different screen sizes and device orientations. The key is using CSS properties like background-size and proper viewport settings to make images scale appropriately. Syntax selector { background-image: url('image-path'); background-size: value; background-repeat: no-repeat; background-position: center; } Key Properties for Responsive Background Images PropertyValuesDescription background-sizecontain, cover, 100%Controls how the background image is sized background-repeatno-repeat, repeatPrevents image repetition background-positioncenter, top, bottomControls image positioning Method 1: Using background-size: ...

Read More

Role of CSS flex-direction property column value

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 191 Views

The CSS flex-direction: column property arranges flex items vertically in a column layout, stacking them from top to bottom. This is the opposite of the default row direction which arranges items horizontally. Syntax selector { display: flex; flex-direction: column; } Example The following example demonstrates how to create a vertical layout using flex-direction: column − .mycontainer { display: flex; flex-direction: ...

Read More

Create a transition effect on hover pagination with CSS

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 604 Views

To create a transition effect on hover pagination, use the CSS transition property. This property allows you to smoothly animate changes in CSS properties when a user hovers over pagination links, creating a professional and interactive user experience. Syntax selector { transition: property duration timing-function delay; } Example You can try to run the following code to add transition effect − .demo { ...

Read More

Role of CSS Grid Container

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 126 Views

The CSS Grid Container is the parent element that establishes a grid formatting context for its children. When you apply display: grid to an element, it becomes a grid container, and all its direct children automatically become grid items. Syntax .container { display: grid; grid-template-columns: value; grid-template-rows: value; } Key Properties PropertyDescription display: gridCreates a grid container grid-template-columnsDefines the number and size of columns grid-template-rowsDefines the number and size of rows grid-gapSets spacing between grid items Example: Basic Grid ...

Read More

Tada Animation Effect with CSS

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 513 Views

The CSS tada animation effect creates a playful shaking motion that combines scaling and rotation transforms. This effect is perfect for drawing attention to elements like buttons, notifications, or call-to-action items. Syntax @keyframes tada { 0% { transform: scale(1); } 10%, 20% { transform: scale(0.9) rotate(-3deg); } 30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); } 40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); } 100% { transform: scale(1) rotate(0); } } .element { ...

Read More

CSS Chroma Filter

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 3K+ Views

The CSS chroma filter is a legacy Internet Explorer-specific filter that was used to make a particular color transparent. This filter is not supported in modern browsers and has been replaced by CSS3 properties like background-color: transparent and opacity. Syntax filter: chroma(color=colorvalue); Legacy Browser Support Note: The chroma filter only worked in Internet Explorer and is now obsolete. Modern browsers do not support this property. Important: This filter is deprecated and should not be used in modern web development. Use CSS3 alternatives instead. Example: Legacy Chroma Filter (IE Only) ...

Read More

How to declaring pointer variables in C/C++?

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 552 Views

A pointer is a variable that stores the memory address of another variable. To declare pointer variables in C, we use the asterisk (*) operator before the variable name during declaration. Syntax data_type *pointer_name; Where data_type is the type of variable the pointer will point to, and pointer_name is the name of the pointer variable. Basic Pointer Declaration and Usage Here's how to declare and use pointer variables in C − #include int main() { // A normal integer variable int ...

Read More

How to write my own header file in C?

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 2K+ Views

Creating your own header file in C allows you to organize and reuse code across multiple programs. A header file typically contains function declarations, constants, and macros that can be included in other C files. Syntax #include "your_header_file.h" Steps to Create a Custom Header File Create the header file: Write your functions and save with .h extension Include in main program: Use #include "filename.h" (quotes, not angle brackets) Ensure same directory: Both files must be in the same folder Call functions: Use the functions directly in your main program Header File: ...

Read More

Write a program that produces different results in C and C++

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 190 Views

Here we will see some programs that produce different results when compiled with C and C++ compilers. These differences arise from how C and C++ handle certain language features differently. Difference 1: Character Literal Size In C, character literals are treated as int type, while in C++, they are treated as char type. This affects the result of the sizeof() operator − Example: C Compiler #include int main() { printf("The character: %c, size(%d)", 'a', sizeof('a')); return 0; } The character: a, size(4) ...

Read More
Showing 31–40 of 427 articles
« Prev 1 2 3 4 5 6 43 Next »
Advertisements