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
Create a draggable paragraph in HTML5
The draggable attribute in HTML5 allows you to make elements draggable by the user. When set to true, elements can be dragged and dropped using mouse interactions. This feature is commonly used for creating interactive user interfaces, sortable lists, and drag-and-drop file uploads. Syntax Following is the syntax for the draggable attribute − Content The draggable attribute accepts the following values − true − The element can be dragged false − The element cannot be dragged auto − Uses the browser's default behavior Basic Draggable Paragraph To create a ...
Read MoreCreate a hidden paragraph in HTML5
The hidden attribute in HTML5 is used to create elements that are not displayed or relevant to the current page state. When applied to a paragraph or any HTML element, it completely hides the content from both visual display and screen readers, making it semantically irrelevant until the attribute is removed. Syntax Following is the syntax for using the hidden attribute − This paragraph is hidden The hidden attribute is a boolean attribute, meaning its presence alone indicates the element should be hidden. You can also write it as hidden="hidden" or hidden="true", but simply ...
Read MoreHow to use small font in HTML?
To create small font text in HTML, use the CSS font-size property with the style attribute. Since HTML5 deprecated the tag, CSS is the modern standard for controlling font sizes. You can specify font size in various units like pixels (px), em, rem, or percentages. The inline style attribute overrides any global styles defined in external CSS files or within tags in the document head. Syntax Following is the syntax for setting small font using inline CSS − Content Where value can be specified in pixels (px), em units, rem units, ...
Read MoreCreate a paragraph with a right-to-left direction in HTML5
The dir attribute in HTML sets the text direction for an element's content. To create a paragraph with right-to-left direction, use dir="rtl" on the paragraph element. This is particularly useful for languages like Arabic, Hebrew, Persian, and Urdu that are naturally written from right to left. Syntax Following is the syntax for creating a right-to-left paragraph using the dir attribute − Your text content here The dir attribute accepts three values − rtl − Sets text direction from right to left ltr − Sets text direction from left to right (default) auto ...
Read MoreExecute a script when the element is finished loading in HTML?
In HTML, executing a script when an element finishes loading is accomplished using the onload event. This event triggers when an element has completely loaded, including all its content, images, and external resources. The onload event is most commonly used with the element to run scripts after a web page has fully loaded. It can also be applied to individual elements like images, iframes, and objects. This functionality is useful for initialization tasks, form validation, cookie checking, or dynamically adjusting content based on the loaded page. Syntax Following is the syntax for the onload event attribute ...
Read MoreHow to add multi-language content in HTML?
The lang attribute in HTML allows you to specify the language of content within elements, enabling proper rendering, accessibility, and search engine optimization for multi-language websites. This attribute helps browsers, screen readers, and translation tools understand and process content correctly. Syntax Following is the syntax for the lang attribute − Content The language code follows the ISO 639-1 standard (two-letter codes like en, fr, es) or BCP 47 standard for more specific regional variants (like en-US, fr-CA). Document-Level Language Declaration The most important use of the lang attribute is declaring the primary ...
Read MoreHow to add a unique id for an element in HTML?
The id attribute in HTML is used to assign a unique identifier to any HTML element. This unique ID serves multiple purposes: it allows CSS to target specific elements for styling, enables JavaScript to manipulate individual elements, and provides anchor points for navigation within a page. Syntax Following is the syntax for adding an id attribute to an HTML element − Content The id value must be unique within the entire HTML document and should not contain spaces. It is case-sensitive and typically starts with a letter. Key Rules for ID Attributes ...
Read MoreHow to set table width in HTML?
Setting table width in HTML controls how much horizontal space the table occupies on a web page. You can set table width using the inline style attribute with the width CSS property. The width can be specified in percentage (relative to parent container) or pixels (fixed width). Syntax Following is the syntax to set table width using inline styles − The width value can be specified as − Percentage − width: 50% (relative to container width) Pixels − width: 400px (fixed width) Keywords − width: 100% ...
Read MoreExecute a script when media data is loaded in HTML?
The onloadeddata event in HTML is triggered when the browser has loaded the current frame of media data (audio or video). This event fires when enough data has been loaded to render the media at the current playback position, making it useful for executing scripts when media becomes ready for playback. Syntax Following is the syntax for the onloadeddata event − ... ... You can also add the event listener using JavaScript − element.addEventListener("loadeddata", functionName); Video Element with onloadeddata Event The onloadeddata event is commonly used with video elements ...
Read MoreHow to mark inserted text in HTML?
In HTML, inserted text refers to content that has been added to a document. The tag is the semantic way to mark text as inserted, which browsers typically display with an underline to indicate the addition. The tag is particularly useful in document versioning, collaborative editing, and showing changes or updates to content. It provides semantic meaning that assistive technologies can understand, unlike purely visual styling approaches. Syntax Following is the syntax for the tag − The text to be inserted The tag supports optional attributes − ...
Read More