Found 8894 Articles for Front End Technology

Maximum size of a element in HTML

Arjun Thakur
Updated on 30-Jul-2019 22:30:22

1K+ Views

 All web browsers limit the canvas element’s width, height, and area.For Google Chrome, the maximum allowable width and height are 32,767 pixels and the maximum allowable area is 268,435,456 pixels.For Firefox, the maximum allowable width and height are 32,767 pixels and the maximum allowable area is 472,907,776 pixels. For IE, the maximum allowable width and height are 8,192 pixels. For IE Mobile, the maximum allowable width and height are 4,096 pixels.

How to center canvas in HTML5?

vanithasree
Updated on 03-Mar-2020 12:46:08

8K+ Views

To center canvas in HTML 5, include the canvas tag in div tag. Then we can center align the div tag. By doing so, the canvas is also center aligned.Example.                    This is my canvas          

HTML5 inline video on iPhone vs iPad/Browser

Chandu yadav
Updated on 03-Mar-2020 12:44:55

417 Views

The allowsInlineMediaPlayback  property of a UIWebView) enables/ disables in line media playback in the iOS web browser for a native app. By default, on iPhone this is set to NO, but on iPad its set to YES. Hence, the native video player takes over the screen, thus obstructing us from playing other dynamic content simultaneously with the video Adjust this behaviour in HTML as follows − iOS10+ In iOS 10+, Apple has now enabled the attribute playsinline in all the web browsers on iOS 10. Now, play around with this easily −

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

seetha
Updated on 01-Jun-2020 10:44:14

9K+ Views

Add the following code snippet to image properties, and prevent images from being dragged and selected.img {      user-drag: none;      user-select: none;    -moz-user-select: none;    -webkit-user-drag: none;    -webkit-user-select: none;    -ms-user-select: none; }On double click on a text or image, it is highlighted (selected). The user select property can be used to prevent this. By setting this property to none, we can prevent our image from being selected (highlighted).ExampleYou can try to run the following code to prevent the image from being selected −                    img {             -drag: none;             user-select: none;             -moz-user-select: none;             -webkit-user-drag: none;             -webkit-user-select: none;             -ms-user-select: none;          }                        

Disabling Android's chrome pull-down-to-refresh feature with HTML.

George John
Updated on 01-Jun-2020 10:43:44

380 Views

The refresh button which was until now hidden in the flow menu, has been replaced by pull-down-to-refresh feature in chrome. However, some users do not need this feature in their application.body {    // disables pull-to-refresh    // allows overscroll glow effects overscroll-behavior-y: contain; }The overscroll behaviour property of CSS disables the pull to refresh action. In the above given code we have fixed double pull to refresh animation in the chatbox demo. The inbox blurs while the entire page is being refreshed.

How do I make a transparent canvas in HTML5?

vanithasree
Updated on 03-Mar-2020 12:43:23

3K+ Views

The globalAlpha property returns the transparency value of drawing. The value 1.0 of this property specifies no transparency and the value 0.0 of this property specifies full transparency. Hence, by setting the globalAlpha property to 0.0, we can get a transparent canvas.ExampleYou can try to run the following code to make a transparent canvas −                    Your browser does not support the HTML5 canvas tag.                var c = document.getElementById("idCanvas");          var ctx = c.getContext("2d");          ctx.fillStyle = "green";          ctx.fillRect(20, 20, 75, 50);          ctx.globalAlpha = 0.0;          ctx.fillStyle = "yellow";          ctx.fillRect(50, 50, 75, 50);          ctx.fillStyle = "red";          ctx.fillRect(80, 80, 75, 50);          

How to copy the content of one HTML5 Canvas to another Canvas locally?

Chandu yadav
Updated on 03-Mar-2020 12:41:45

2K+ Views

The drawImage() method is used to draw image, canvas and videos on canvas. It can also draw part of image and increase or decrease the image size.ExampleLet us see an example −//context grabbed from your destination canvas ctx = destinationCanvas.getContext('2d'); //drawImage() called passing the source canvas directly dCtx.drawImage(sourceCanvas, 0, 0);In this code, firstly the image is copied from the source canvas. The sourceCanvas can be a HTMLImageElement, HTMLVideoElement, or a HTMLCanvasElement. A canvas drawing context cannot be used as a source. If a canvas drawing context is your source canvas then there is a reference to the original canvas ... Read More

Align text and select boxes to the same width with HTML and CSS

seetha
Updated on 23-Nov-2023 13:14:11

1K+ Views

When we set the width and height of an element in CSS then often the element appears bigger than the actual size. This is because by default, the padding and border are added to the element’s width and height and then the element is displayed.The box sizing property includes the padding and border of an element with actual width and height so that the element does not appear bigger than the actual size. The format to use this property is box-sizing: box-border ExampleYou can try to run the following code to align text and select boxes to the same width ... Read More

Why is not in HTML 5 Tag list while is?

Prabhas
Updated on 03-Mar-2020 12:40:45

131 Views

Unlike HTML 4.01, HTML 5 does not support the tag. The makes the text font size one size smaller down to the browser's minimum font size. For example, the use of the tag in a text which is of large font size makes the font size to medium. In HTML5, this element is repurposed to represent side-comments and small print. It also supports the global attributes and event attributes in HTMLOn the contrary, the tag would make the text appear one size larger than the actual font size of the text. Though this tag is not ... Read More

Execute a script when the element gets focus in HTML?

V Jyothi
Updated on 01-Jun-2020 10:41:55

213 Views

Use the onfocus attribute to execute a script when the element gets focus in HTML.ExampleYou can try to run the following code to implement the onfocus attribute −           Enter subject name below,       Subject:                      function display(val) {             document.getElementById(val).style.background = "blue";          }          

Advertisements