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 Shabaz Alam
51 articles
How to set caption for an image using HTML?
HTML provides a semantic way to add captions to images using the and elements. Image captions enhance accessibility, provide context, and improve the overall user experience by offering descriptive text that explains or complements the visual content. Syntax Following is the basic syntax for creating image captions in HTML − Caption text here The element groups the image and caption together semantically, while contains the actual caption text. Basic Image Caption The element represents self-contained content, typically with ...
Read MoreHow to set date and time when the text was deleted using HTML?
When creating web content, it's common to update text by removing outdated or incorrect information. HTML provides semantic elements to mark these changes while preserving a record of when modifications occurred. The del element and time element are the primary methods for tracking text deletions with timestamps. Syntax Following is the syntax for marking deleted text with a timestamp − deleted content The datetime attribute follows the ISO 8601 format, which includes date, time, and optionally timezone information. Following is the syntax for using the time element to display deletion timestamps − ...
Read MoreHow to set different background properties in one declaration?
CSS (Cascading Style Sheets) provides a powerful background shorthand property that allows you to set multiple background properties in a single declaration. This approach is efficient for web developers as it saves time, reduces code length, and improves readability while maintaining full control over background styling. Understanding Background Properties Before using the background shorthand, it's important to understand the individual background properties available in CSS − background-color − Sets the background color of an element using color names, hex values, RGB, or HSL values. background-image − Sets a background image using URLs, linear gradients, or radial ...
Read MoreHow to set fixed width for td in a table ?
To set the fixed width to the table's element we can use multiple approaches. But before that we need to know about the element. HTML element defines a data cell in an HTML table. It is used to display data in the table, such as text, images, or links. Each element is enclosed within a element, which represents the row in the table. Fixed Table Cell Width It is important that the table looks consistent and easy to read when it displays on the web page. We can easily achieve this by ...
Read MoreHow to set height of an iframe element using HTML?
The iframe element is a powerful tool in HTML that allows web developers to embed external content into a web page. It creates a container that displays other HTML documents within a page. The default height of an iframe element does not always fit with the webpage's layout, so we need to ensure that it's sized correctly to fit seamlessly into the page layout. Understanding the Iframe Element Iframe stands for inline frame. It allows developers to embed content such as videos, maps, or social media feeds from another website or web page into the current page. The ...
Read MoreHow to add section that is quoted from another source using HTML?
A quote is a text element that is used to indicate a quotation or a passage of text that is being referenced or cited from another source. HTML provides two main elements for creating quotes: the tag for longer, block-level quotations and the tag for shorter, inline quotations. Syntax Following is the syntax for the element − Quoted text content Author, Source Title Following is the syntax for the element − Short quoted text Using the Blockquote Element ...
Read MoreHow to add space between elements?
In an HTML web page, the space between elements refers to the area around and between different elements, such as text, images, and other HTML elements. There are several ways to add space between elements in web design. One common method is to use CSS (Cascading Style Sheets) to create margins and padding around elements. Syntax Following are the primary CSS properties for adding space between elements − /* Margin - space outside the element */ element { margin: value; margin-top: value; margin-bottom: value; ...
Read MoreHow to add sub heading using HTML?
A subheading is a text element used to organize and structure content on a webpage. Subheadings break up large blocks of text and provide a clear hierarchy of information for users. In HTML, subheadings are primarily created using heading tags , , , , or , with being the main heading and being the lowest level subheading. Syntax Following is the basic syntax for creating subheadings in HTML − Subheading Level 2 Subheading Level 3 Subheading Level 4 Subheading Level 5 Subheading Level 6 The heading tags create a semantic hierarchy where ...
Read MoreHow to set indent the second line of paragraph using CSS?
The CSS text-indent property is typically used to indent the first line of a paragraph. However, to create a hanging indent effect where the second and subsequent lines are indented instead of the first line, you need to combine negative text-indent with positive padding-left. Syntax selector { text-indent: negative-value; padding-left: positive-value; } How It Works To indent the second line of a paragraph, we use a two-step approach − Negative text-indent: Moves the first line to the left Positive padding-left: Moves the entire paragraph ...
Read MoreHow to set div width to fit content using CSS?
To set div width to fit content using CSS is an important task for creating responsive designs and optimal space usage. By default, div elements take the full available width, but we can make them shrink to fit their content. Syntax div { width: max-content; /* or fit-content */ } /* Alternative approach */ div { display: inline-block; } Method 1: Using max-content Width Property The max-content value sets the width to the maximum intrinsic width of the content, allowing the div to expand ...
Read More