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
HTML Cleaning and Entity Conversion - Python
Hypertext markup language i.e. HTML is a markup language that is used to create webpages content on the internet. HTML document files may contain some unwanted or malicious elements which can cause several issues while rendering the webpage. Before processing the HTML content we need to perform HTML cleaning for removal and cleaning of the malicious elements in the file. HTML entities are special characters that need to be converted into corresponding HTML representations to ensure proper rendering in browsers. In this article, we will understand cleaning and entity conversion methods using Python. HTML Cleaning HTML cleaning is ...
Read MoreHTML DOM source object
The HTML DOM source object represents the HTML element in the Document Object Model. The element is used to specify multiple media resources for media elements like , , and . We can create and access source elements using DOM methods like createElement() and getElementById() respectively. The source object allows developers to dynamically add media sources to enhance browser compatibility by providing alternative formats for different devices and browsers. Syntax Following is the syntax for creating a source object − var sourceElement = document.createElement("SOURCE"); Following is the syntax for accessing an ...
Read MoreWhat are the Materialize Classes of Dropdowns?
Materialize is a front-end development framework based on Google's Material Design guidelines. It provides pre-designed HTML components with CSS styling and JavaScript functionality, including dropdown menus that allow users to select from multiple options in a clean, organized interface. Dropdowns are essential UI components when you need users to select single or multiple options from a list. Materialize provides basic pre-styled dropdown menus that can be easily customized using various classes and JavaScript properties like isOpen (returns boolean for dropdown state) and focusIndex (returns the focused item index). Syntax Following is the basic syntax for creating a ...
Read MoreHTML DOM Span object
The HTML DOM Span object represents the HTML element in the Document Object Model. The element is an inline container used to group text or other inline elements for styling or scripting purposes. We can create new span elements dynamically using JavaScript or access existing ones to manipulate their content and properties. Syntax Following is the syntax for creating a span object − var spanElement = document.createElement("SPAN"); Following is the syntax for accessing an existing span object by ID − var spanElement = document.getElementById("spanId"); Following is the syntax ...
Read MoreHTML ononline Event Attribute
The HTML ononline event attribute is triggered when the browser detects that the device has regained an internet connection. This event is useful for applications that need to respond when network connectivity is restored, such as syncing data or updating the user interface. Syntax Following is the syntax for the ononline event attribute − Content The script parameter can be a JavaScript function call or inline JavaScript code that executes when the online event is triggered. How It Works The ononline event is fired on the element when the browser's navigator.onLine ...
Read MoreHTML onpageshow Event Attribute
The HTML onpageshow event attribute is triggered when a user navigates to a webpage. This event fires every time the page is loaded, including when the page is loaded from the browser's cache (back/forward navigation). It is particularly useful for detecting when a page becomes visible to the user. Syntax Following is the syntax for the onpageshow event attribute − The script parameter contains JavaScript code or a function call that executes when the page is shown to the user. Key Features The onpageshow event has several important characteristics − ...
Read MoreDifference Between XML and HTML
In web development, HTML and XML are both markup languages that use tags to structure information, but they serve fundamentally different purposes. HTML is designed for displaying web pages in browsers, while XML is designed for storing and transporting data in a structured format. HTML Overview HTML (HyperText Markup Language) is the standard markup language for creating web pages and web applications. It uses predefined tags to structure content and define how it should be displayed in web browsers. Key Features of HTML Display-focused − Designed to present data visually in web browsers Predefined tags ...
Read MoreHow to sort HTML elements by data-attribute?
In HTML, you can sort elements by their data attributes using JavaScript. Data attributes allow you to store custom information directly in HTML elements, which can then be used for sorting, filtering, or other dynamic operations. This technique is particularly useful when you need to reorder elements based on custom criteria without modifying the original HTML structure. Common use cases include sorting product lists by price, organizing content by date, or arranging elements by priority levels stored in data attributes. Syntax Following is the basic syntax for adding data attributes to HTML elements − Content ...
Read MoreDifference Between Cellpadding and Cellspacing
In HTML, cellpadding and cellspacing are two attributes used for formatting table cells. Both attributes control whitespace in tables, but they serve different purposes. The cellpadding attribute sets the whitespace between the cell edge and cell content, whereas cellspacing controls the whitespace between adjacent cells. Cellpadding vs Cellspacing Visual Comparison Cellpadding (Internal Space) Content ...
Read MoreHow to remove extra space below the image inside div?
To remove extra space below the image inside div, we can use CSS. Images are treated as inline elements by default, which creates unwanted space below them due to text baseline alignment. The following CSS properties can be used to eliminate this space − The vertical-align property The line-height property The display property The extra space occurs because browsers reserve space for descenders (like g, j, p, q, y) in text, even when no text is present. This creates a gap between the image and the bottom of its container. Image Spacing ...
Read More