George John has Published 1081 Articles

How to generate a 24bit hash using Python?

George John

George John

Updated on 05-Mar-2020 10:11:26

551 Views

A random 24 bit hash is just random 24 bits. You can generate these just using the random module. exampleimport random hash = random.getrandbits(24) print(hex(hash))OutputThis will give the output0x94fbee

Usage of margin property with CSS

George John

George John

Updated on 04-Mar-2020 12:44:07

91 Views

The margin property defines the space around an HTML element. It is possible to use negative values to overlap content. It specifies a shorthand property for setting the margin properties in one declaration.ExampleYou can try to run the following code to set margins −             ... Read More

Relative Positioning with CSS

George John

George John

Updated on 04-Mar-2020 12:35:00

195 Views

Relative positioning changes the position of the HTML element relative to where it normally appears. So "left:20" adds 20 pixels to the element's LEFT position.You can use two values top and left along with the position property to move an HTML element anywhere in the HTML document. Move Left - Use a negative value for ... Read More

Set the maximum width that a box can be with CSS

George John

George John

Updated on 04-Mar-2020 12:18:06

132 Views

The max-width property is used to set the maximum width that a box can be. The value of the max-width property can be a number, a length, or a percentage.Example                            This paragraph is 200px high and ... Read More

Set outline style as two solid lines with CSS

George John

George John

Updated on 04-Mar-2020 11:27:05

149 Views

To set the outline style as two solid lines, use the outline-style property with the value doubleExample                            This text is having 7px double outline.          

Cursor property of CSS

George John

George John

Updated on 04-Mar-2020 11:14:54

89 Views

The cursor property of CSS allows you to specify the type of cursor that should be displayed to the user.Example                   Move the mouse over the words and see the changes in cursor:       Auto       Crosshair       Default    

How to fix getImageData() error ‘The canvas has been tainted by cross-origin data’ in HTML?

George John

George John

Updated on 04-Mar-2020 04:52:20

2K+ Views

The crossOrigin attribute allows images that are loaded from external origins to be used in canvas like the one they were being loaded from the current origin.Using images without CORS approval tains the canvas. Once a canvas has been tainted, you can no longer pull data back out of the canvas. ... Read More

Set an image as a server-side image map in HTML?

George John

George John

Updated on 03-Mar-2020 09:58:38

756 Views

Use the ismap attribute in HTML to set the image as a server-side image map in HTML.ExampleYou can try to run the following code to implement the ismap attribute −                                 On clicking the coordinates is sent to the server as a URL query string.    

Execute a script when the media is paused either by the user or programmatically in HTML?

George John

George John

Updated on 03-Mar-2020 07:44:55

178 Views

The onpause attribute trigger when the media is paused. You can try to run the following code to implement the onpause attribute −Example           Play                                    Your browser does not support the video element.                      function myFunction() {          document.getElementById("test").innerHTML = "Media paused!";          }          

How do we create a sub window in HTML?

George John

George John

Updated on 03-Mar-2020 07:13:49

1K+ Views

Use the tag to create a sub window. The HTML tag is used to specify each frame within a frameset tag.Note − This tag is not supported in HTML5. Do not use.The following are the attributes −AttributeValueDescriptionFrameborder0 or 1Specifies whether or not to display border around the frame.MarginheightpixelsAllows ... Read More

Advertisements