HTML Articles

Found 1,508 articles

Difference between :focus and :active selector in HTML

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 935 Views

In CSS, :focus and :active are pseudo-class selectors that apply styles based on user interaction. They are commonly used on buttons, links, and form elements but trigger at different moments of interaction. :focus Selector The :focus selector applies styles when an element receives focus − either by clicking on it or navigating to it using the Tab key. The focus remains on the element until another element receives focus. This is commonly used on form inputs, buttons, and links. :active Selector The :active selector applies styles when an element is being actively pressed (mouse button is ...

Read More

Difference between HTML and HTML 5

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 1K+ Views

HTML (HyperText Markup Language) is a markup language used to define the structure of web pages using tags. HTML5 is the latest major version of HTML, introducing native support for audio, video, graphics, offline storage, and many new semantic elements that eliminate the need for third-party plugins like Flash. HTML (Older Versions) Earlier versions of HTML (HTML 4.01 and below) provided basic document structuring with tags for text, images, links, tables, and forms. They relied on external plugins (like Flash) for multimedia and had limited client-side storage (only cookies). The doctype declaration was long and complex. HTML5 ...

Read More

How to horizontally center a <div> in another <div>?

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Mar-2026 360 Views

Here I have one HTML form and one CSS file (style.css). "o-div" is the outer div and "i-div" is the inner div class. This example demonstrates how to horizontally center a div using the margin: 0 auto technique. Example The following example shows how to center an inner div horizontally within an outer div − Center a div body { background-color: Gray; ...

Read More

Safari on iPad (iOS6) does not scale HTML5 video to fill 100% of page width

Yaswanth Varma
Yaswanth Varma
Updated on 13-Mar-2026 964 Views

This article will teach you how Safari on iPad iOS6 does not scale HTML5 video to fill 100% of page width. On a responsive HTML5 page, a video can be shown at full width (100%) by applying CSS styling. The video's native resolution is 480x270. On all desktop browsers, the video is resized to span the entire width of the page while preserving the aspect ratio. On the iPad (iOS 6.0.1), Mobile Safari and Chrome, however, display a black rectangle same width as the page. The black rectangle's center contains a small video that is shown at its original ...

Read More

HTML DOM Input Email autocomplete Property

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 216 Views

The HTML DOM Input Email autocomplete property sets/returns whether autocomplete is enabled or disabled. If enabled, it shows previously typed values.SyntaxFollowing is the syntax −Returning value - on/offinputEmailObject.autocompleteSetting autocomplete to valueinputEmailObject.autocomplete = valueValuesHere, “value” can be the following −valueDetailsonIt defines that input has autocomplete enabled, it is also the default.offIt defines that input autocomplete attribute is disabled.ExampleLet us see an example of Input Email autocomplete property − Input Email autocomplete    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: ...

Read More

HTML DOM Input Month readOnly Property

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 175 Views

The HTML DOM input month readOnly property returns and modify whether the input month field is read-only or not in an HTML document.SyntaxFollowing is the syntax −1. Returning readOnlyobject.readOnly2. Modifying readOnlyobject.readOnly = true | falseExample    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)       center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.1rem;    }    input{       display:block;       width:35%;     ...

Read More

What is nodeValue property in JavaScript HTML DOM?

Vikyath Ram
Vikyath Ram
Updated on 11-Mar-2026 335 Views

The nodeValue property is used to get the node value. You need to specify the node.ExampleYou can try to run the following code to learn how to get nodeValue property.           Get the node value       Demo Button Text                var val = document.getElementsByTagName("BUTTON")[0];          var res = val.childNodes[0].nodeValue;          document.write("Node Value: "+res);          

Read More

How -Infinity is converted to Number in JavaScript?

Monica Mona
Monica Mona
Updated on 11-Mar-2026 265 Views

Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert -Infinity Number in JavaScript.Example           Convert -Infinity to Number                var myVal = -Infinity;          document.write("Number : " + Number(myVal));           OutputConvert -Infinity to Number Number : -Infinity

Read More

What will happen when [50,100] is converted to Number in JavaScript?

Sai Subramanyam
Sai Subramanyam
Updated on 11-Mar-2026 159 Views

Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert [50, 100] to Number in JavaScript − Example Live Demo Convert [50,100] to Number var myVal = [50,100]; document.write("Number: " + Number(myVal));

Read More

How to preselect a value in a dropdown list of items in HTML forms?

Prabhas
Prabhas
Updated on 11-Mar-2026 6K+ Views

With HTML, you can easily create a simple drop down list of items to get user input in HTML forms. A select box also called drop down box provides an option to list down various options in the form of drop down list.You can also preselect a value in dropdown list of items in HTML forms. For that, add selected in the tag for the value you want to preselect.ExampleYou can try to run the following code to learn how to preselect value in a dropdown list of items works in HTML form −         ...

Read More
Showing 1–10 of 1,508 articles
« Prev 1 2 3 4 5 151 Next »
Advertisements