Web Development Articles

Page 80 of 801

How do we set the visible number of lines in a text area in HTML?

Yaswanth Varma
Yaswanth Varma
Updated on 16-Mar-2026 5K+ Views

This article will teach you how to set the visible number of lines in a textarea in HTML. The HTML element is useful for multi-line editing control and allows the user to enter a sizeable amount of free-form text. The rows attribute determines how many lines of text are visible without scrolling. Syntax Following is the syntax to set the visible number of lines in textarea − Content The rows attribute specifies the number of visible text lines for the control. It determines the textarea's visible height in terms of character lines. The ...

Read More

Enable an extra set of restrictions for the content in an in HTML?

Giri Raju
Giri Raju
Updated on 16-Mar-2026 66 Views

The sandbox attribute in HTML enables an extra set of restrictions for the content loaded in an element. This attribute acts as a security feature that applies various limitations to the embedded content, preventing potentially harmful actions like form submissions, script execution, or navigation to other pages. The sandbox attribute provides a way to isolate iframe content and control what the embedded page can do, making it safer to embed third-party content on your website. Syntax Following is the syntax for the sandbox attribute − The sandbox attribute can be used ...

Read More

How to specify that the styles only apply to this element's parent element and that element's child elements in HTML?

seetha
seetha
Updated on 16-Mar-2026 314 Views

The scoped attribute was an HTML5 feature designed to limit CSS styles to only apply within a specific parent element and its child elements. However, this attribute was removed from the HTML specification and is no longer supported by modern browsers. Syntax The original syntax for the scoped attribute was − /* CSS rules here would only apply to parent and children */ Why Scoped Was Removed The scoped attribute was removed from HTML5 due to implementation complexity and lack of browser support. Only Firefox provided partial support, ...

Read More

How do we specify whether a header cell is a header for a column, row, or group of columns or rows in HTML?

Ankitha Reddy
Ankitha Reddy
Updated on 16-Mar-2026 160 Views

The scope attribute in HTML specifies whether a header cell () is a header for a column, row, or group of columns or rows. This attribute improves table accessibility by helping screen readers understand the relationship between header cells and data cells. Syntax Following is the syntax for the scope attribute − Header Content The value can be col, row, colgroup, or rowgroup. Scope Attribute Values The scope attribute accepts the following values − col − Specifies that the header cell is a header for a column. row − Specifies ...

Read More

How to specify that an option should be pre-selected when the page loads in HTML?

Jennifer Nicholas
Jennifer Nicholas
Updated on 16-Mar-2026 207 Views

Use the selected attribute to specify that an option should be pre-selected when the page loads in HTML. The selected attribute is a boolean attribute that, when present on an element within a dropdown, makes that option the default choice displayed to users. Syntax Following is the syntax for the selected attribute − Option Text The selected attribute can also be written in XHTML format as selected="selected", but in HTML5, the boolean form is preferred. How It Works When the browser loads a page containing a element, it looks ...

Read More

Execute a script when the element loses focus in HTML?

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 350 Views

The onblur attribute in HTML is used to execute a JavaScript function when an element loses focus. This event is triggered when a user clicks outside the element, tabs to another element, or navigates away from the current input field. Syntax Following is the syntax for the onblur attribute − The function() can be a JavaScript function name or inline JavaScript code that executes when the element loses focus. Text Input with onblur The most common use case is with form input fields where you want to validate or format data ...

Read More

How to specify the number of visible options for in HTML?

varma
varma
Updated on 16-Mar-2026 169 Views

The size attribute in HTML is used to specify the number of visible options in a dropdown list. By default, a select element shows only one option and displays as a dropdown. When you add the size attribute, it transforms the dropdown into a scrollable list box showing multiple options at once. Syntax Following is the syntax for the size attribute − Option 1 Option 2 Where number is a positive integer representing how many options should be visible without scrolling. Default Behavior vs ...

Read More

How do we add the width in characters for in HTML?

Yaswanth Varma
Yaswanth Varma
Updated on 16-Mar-2026 488 Views

The size attribute in HTML input elements specifies the visible width of an input field in terms of characters. This attribute controls how wide the input field appears on the screen, making it useful for creating forms with appropriately sized input fields based on expected content length. The size attribute works with text-based input types including text, search, tel, url, email, and password. While it affects the display width, it does not limit the actual number of characters a user can enter − that requires the maxlength attribute. Syntax Following is the syntax for the size attribute ...

Read More

Set the width of the element in HTML

Sravani S
Sravani S
Updated on 16-Mar-2026 352 Views

The width attribute in HTML sets the width of an element in pixels. This attribute is supported by several HTML elements including , , , , , and . The width attribute provides a quick way to control element dimensions directly in HTML markup. Syntax Following is the syntax for using the width attribute − The value is specified in pixels as a positive integer. For example, width="300" sets the element width to 300 pixels. Elements Supporting Width Attribute The width attribute can be used with the following HTML elements − ...

Read More

Set the size of the icons in HTML

Nikhilesh Aleti
Nikhilesh Aleti
Updated on 16-Mar-2026 7K+ Views

In this article, we are going to discuss how to set the size of the icons in HTML. Icons are essential visual elements that enhance user experience by providing intuitive symbols for actions, navigation, and content representation. An icon is a symbol that represents a specific action on a webpage. The Icon Fonts contain symbols and glyphs that can be easily styled with CSS just like regular text. There are several icon libraries (fonts) that provide icons and can be used on HTML webpages. The prominent icon fonts frequently used by web developers are Font Awesome, Bootstrap Glyphicons, ...

Read More
Showing 791–800 of 8,010 articles
« Prev 1 78 79 80 81 82 801 Next »
Advertisements