Articles on Trending Technologies

Technical articles with clear explanations and examples

How to Move Image in HTML?

Way2Class
Way2Class
Updated on 16-Mar-2026 20K+ Views

Moving images in HTML can be achieved through various methods, from traditional HTML tags to modern CSS properties and JavaScript. An image is added to a web page using the HTML tag, which is a self-closing element that simply includes attributes. While the HTML tag was previously used to create scrolling images, it is now deprecated in HTML5. Modern web development favors CSS properties and JavaScript for more precise control over image positioning and movement. Syntax The basic syntax for adding an image in HTML is − To move images, ...

Read More

How to Allow the File Input Type to Accept Only Image Files

Eesha Gandhi
Eesha Gandhi
Updated on 16-Mar-2026 5K+ Views

The tag in HTML creates an input control that accepts user input. The type attribute determines the kind of input field displayed, such as text fields, checkboxes, buttons, or file uploads. When working with file uploads, you often need to restrict the allowed file types to only accept image files. The element by default accepts all file types, but you can limit it to images using the accept attribute or JavaScript validation. This ensures users can only select image files from their device. Syntax Following is the basic syntax for file input − ...

Read More

How to Add Multiple Elements in the Same Table?

Vikash Kumar
Vikash Kumar
Updated on 16-Mar-2026 754 Views

In HTML tables, the element is used to group and organize the content of the table into sections. It is especially useful when working with large tables as it helps to manage and style the data effectively. While a table typically contains one , you can have multiple elements within the same table to structure data into different sections or categories. Syntax Following is the syntax for using multiple elements in a table − Header 1Header 2 ...

Read More

HTML DOM Storage length property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 274 Views

The HTML DOM Storage length property returns the number of key-value pairs stored in the browser's storage object. This property works with both localStorage and sessionStorage objects, providing a simple way to count stored items. Syntax Following is the syntax for the Storage length property − localStorage.length sessionStorage.length Return Value The length property returns an integer representing the number of items currently stored in the storage object. If no items are stored, it returns 0. Example − localStorage Length Following example demonstrates how to get the number of ...

Read More

HTML max Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 269 Views

The max attribute in HTML specifies the maximum value for various input elements and the element. It defines the upper bound of the allowed range, ensuring that users cannot enter or display values beyond this limit. Syntax Following is the syntax for the max attribute − Where value is a number (for numeric inputs) or a date string (for date inputs) that sets the maximum allowed value. Elements Supporting Max Attribute The max attribute can be used with the following HTML elements − ...

Read More

HTML DOM Storage setItem() method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 246 Views

The HTML DOM Storage setItem() method is used to create or update a key-value pair in web storage. This method stores data in either localStorage (persistent across browser sessions) or sessionStorage (temporary for the current session) by specifying a key name and its corresponding value. Syntax Following is the syntax for the Storage setItem() method − localStorage.setItem(keyname, value); OR sessionStorage.setItem(keyname, value); Parameters The setItem() method accepts two parameters − keyname − A string representing the key name under which the data will be stored. ...

Read More

HTML DOM Variable Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 341 Views

The HTML DOM Variable Object represents the element in the DOM tree. The element is used to define variables in mathematical expressions, programming code examples, or technical documentation. When accessed through JavaScript, it becomes a DOM object with properties and methods for manipulation. Syntax Following is the syntax to create a var object using JavaScript − document.createElement("VAR"); Following is the syntax for the HTML element − variable_name Creating a Variable Object The var object can be created dynamically using JavaScript's createElement() method. Once created, you can ...

Read More

How to create div that contains the multiple fixed-size images

Aman Gupta
Aman Gupta
Updated on 16-Mar-2026 1K+ Views

Creating a div container with multiple fixed-size images is a common requirement in web development for galleries, portfolios, and product catalogs. This approach ensures visual consistency by giving all images uniform dimensions regardless of their original sizes. Syntax Following is the basic HTML structure for a div containing multiple images − Following is the CSS syntax to create fixed-size images − .image-container img { width: fixed-width; height: fixed-height; object-fit: ...

Read More

How to Control the Space between Bullets and li Elements?

Eesha Gandhi
Eesha Gandhi
Updated on 16-Mar-2026 2K+ Views

In HTML lists, controlling the space between bullet points and list items is a common styling requirement. By default, browsers apply standard spacing between bullets and text content, but this can be customized using various CSS techniques to achieve the desired visual layout. HTML provides three types of lists − Ordered List (ol) − Uses numbers or other schemes for sequential items Unordered List (ul) − Uses bullets for non-sequential items Description List (dl) − Used for term-definition pairs Default List Spacing When creating an unordered list, browsers apply default spacing between bullets and ...

Read More

HTML DOM KeyboardEvent altKey Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 201 Views

The HTML DOM KeyboardEvent altKey property returns a boolean value indicating whether the ALT key was pressed when a keyboard event was triggered. This property is particularly useful for detecting keyboard shortcuts and modifier key combinations in web applications. Syntax Following is the syntax for accessing the altKey property − event.altKey Return Value The altKey property returns a boolean value − true − If the ALT key was pressed when the event occurred false − If the ALT key was not pressed when the event occurred Example − Basic ...

Read More
Showing 12901–12910 of 61,299 articles
Advertisements