Articles on Trending Technologies

Technical articles with clear explanations and examples

Preventing an image from being draggable or selectable in HTML without using JS

seetha
seetha
Updated on 16-Mar-2026 13K+ Views

Images in HTML are draggable and selectable by default, which allows users to drag them to other locations or select them by double-clicking. You can prevent this behavior using CSS properties without requiring JavaScript. CSS Properties for Preventing Image Interaction The following CSS properties control image dragging and selection − user-drag − Controls whether an element can be dragged by the user. user-select − Controls whether the text of an element can be selected. -webkit-user-drag − WebKit-based browsers (Chrome, Safari) specific property for drag control. -webkit-user-select − WebKit-based browsers specific property for selection control. -moz-user-select − ...

Read More

HTML DOM Option value Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 280 Views

The HTML DOM option value property allows you to get or set the value of an element within a dropdown. This value is what gets sent to the server when the form is submitted, which may differ from the visible text displayed to the user. Syntax Following is the syntax for returning the value − optionObject.value Following is the syntax for setting the value − optionObject.value = "newValue" Parameters newValue − A string that specifies the new value for the option element. Return Value ...

Read More

HTML5 inline video on iPhone vs iPad/Browser

Chandu yadav
Chandu yadav
Updated on 16-Mar-2026 735 Views

The allowsInlineMediaPlayback property controls whether videos play inline within the webpage or launch in fullscreen mode on iOS devices. By default, iPhones force videos to play fullscreen, while iPads allow inline playback, creating inconsistent user experiences across devices. Understanding this behavior is crucial for web developers creating video content that works seamlessly across all iOS devices and maintains consistent functionality with desktop browsers. Default iOS Video Playback Behavior On iOS devices, video playback behavior differs significantly − iPhone (iOS 9 and earlier) − Videos automatically launch in fullscreen mode, preventing simultaneous display of other content. ...

Read More

How to create a valid HTML document with no and element?

Amit Sharma
Amit Sharma
Updated on 16-Mar-2026 604 Views

With HTML, the essential elements are the doctype declaration, , , and . However, you will be amazed to know that a valid HTML document can work without the , , and elements. The doctype declaration should always be included since it tells and instructs the browser about the document type. Why This Works Modern browsers are designed to be fault-tolerant and will automatically insert missing HTML structure elements when parsing the document. When the browser encounters content without explicit , , or tags, it creates these elements in the DOM tree automatically. ...

Read More

How to center canvas in HTML5?

vanithasree
vanithasree
Updated on 16-Mar-2026 12K+ Views

To center a canvas element in HTML5, you can use several CSS techniques. The most common approach is to wrap the canvas in a div and apply text-align: center to the container, or use CSS flexbox for more control over positioning. Syntax Following is the basic syntax for centering a canvas element − Method 1 − Using Text-Align Center The simplest way to center a canvas is to wrap it in a div container and apply text-align: center to the div. Since canvas is an inline element ...

Read More

How to display a summary for a given in HTML5?

Sindhura Repala
Sindhura Repala
Updated on 16-Mar-2026 489 Views

The tag in HTML5 provides a visible heading for the element. When users click the summary heading, it toggles the visibility of the additional content inside the details element, creating an interactive collapsible section. The tag must be the first child element of the tag. If no summary is provided, the browser displays a default disclosure triangle or "Details" text. Syntax Following is the syntax for using the element − Heading text The tag supports all global attributes ...

Read More

Maximum size of a element in HTML

Arjun Thakur
Arjun Thakur
Updated on 16-Mar-2026 2K+ Views

The HTML5 element allows you to draw graphics dynamically using JavaScript. However, all web browsers impose limits on the canvas element's maximum width, height, and total area to prevent memory issues and ensure stable performance. Browser-Specific Canvas Size Limits Different browsers have varying maximum size restrictions for canvas elements. Understanding these limits is crucial when developing graphics-intensive web applications. Browser Maximum Width/Height Maximum Area Google Chrome 32, 767 pixels 268, 435, 456 pixels Mozilla Firefox 32, 767 pixels 472, 907, 776 pixels Internet Explorer 8, ...

Read More

Websockets Apache Server compatibility in HTML5

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

WebSocket technology enables real-time, bidirectional communication between web browsers and servers. While Apache HTTP Server is widely used for web applications, it presents specific challenges when implementing WebSocket connections due to its traditional request-response architecture. Apache Server was originally designed for stateless HTTP requests, where each request is processed independently and connections are short-lived. WebSockets, however, require persistent connections that remain open for extended periods to enable real-time data exchange. Apache WebSocket Implementation Options Several approaches exist for implementing WebSockets with Apache Server − Using mod_websocket Module The mod_websocket module extends Apache to handle WebSocket ...

Read More

How do we display a table cell in HTML

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

In HTML, table cells are the individual containers that hold data within a table structure. The element defines a standard data cell, while defines header cells. Understanding how to properly display and format table cells is essential for creating organized, accessible data presentations. Syntax Following is the basic syntax for creating table cells − Header Cell Header Cell Data Cell Data Cell ...

Read More

Drawing text to HTML5 with @fontface does not work at the first time

Chandu yadav
Chandu yadav
Updated on 16-Mar-2026 701 Views

Drawing text in an HTML5 canvas with a typeface loaded via @font-face often fails to display correctly on the first render. This occurs because the browser has not yet fully loaded the custom font from the network, causing it to fall back to a default system font instead. The key issue is timing − the canvas attempts to draw text before the custom font has finished downloading and becomes available to the rendering engine. Syntax Following is the basic syntax for defining a custom font with @font-face − @font-face { font-family: 'CustomFont'; ...

Read More
Showing 13781–13790 of 61,299 articles
Advertisements