Arjun Thakur has Published 739 Articles

CSS transition-duration property

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 05:34:36

95 Views

Use the transition-duration property to set the duration of transitionExampleLive Demo                    div {             width: 150px;             height: 150px;             background: blue;             transition-property: height;             transition-duration: 2s;          }          div:hover {             height: 200px;          }                     Heading One       Hover over the below box to change its height.          

Build a radial gradient with the shape of a circle

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 16:27:08

270 Views

To create a circle with radial gradient, you can try to run the following code. Set another parameter in radial gradient for shapes like circleExampleLive Demo                    #demo {             height: 400px;             background: radial-gradient(circle, red , blue, yellow);          }                     Radial Gradient       Radial Gradients    

Selects all elements with a lang attribute value starting with "en" with CSS

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 15:43:53

256 Views

Use the [attribute|=”value”] selector to select elements with the specified attribute starting with a specified value.You can try to run the following code to implement CSS [attribute|=”value”] Selector,ExampleLive Demo                    [lang| = en] {             border: 5px solid orange;             border-radius: 5px;          }                     Hello       Hei    

Add a background color to the form input with CSS

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 15:29:53

8K+ Views

To add background color to the form input, use the background-color property.You can try to run the following code to implement the background color property to formExampleLive Demo                    input[type=text] {             width: 100%;             padding: 10px 15px;             margin: 5px 0;             box-sizing: border-box;             background-color: gray;          }                     Fill the below form,                Subject                    Student                    

Iterator vs forEach in Java

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 15:12:22

3K+ Views

Collections can be iterated easily using two approaches.Using for-Each loop − Use a foreach loop and access the array using object.Using Iterator − Use a foreach loop and access the array using object.DifferencesConcurrentModificationException − Using for-Each loop, if an object is modified, then ConcurrentModificationException can occur. Using iterator, this problem ... Read More

How to create a responsive image gallery with CSS

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 15:10:00

468 Views

To create a responsive image gallery with CSS, you can try to run the following codeExampleLive Demo                    div.myGallery {             border: 2px solid orange;          }          div.myGallery:hover ... Read More

Infinity or exception in Java when divide by 0?

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 15:00:54

389 Views

Consider the following code snippet where we divide a number by 0.Example Live Demopublic class Tester{    public static void main(String[] args) {       double d = 100;       System.out.println(d/0);    } }OutputInfinityNow consider the following code snippet.Example Live Demopublic class Tester{    public static void main(String[] args) ... Read More

How to prevent Serialization to break a Singleton Class Pattern?

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 14:38:06

736 Views

A Singleton pattern states that a class can have a single instance and multiple instances are not permitted to be created. For this purpose, we make the constructor of the class a private and return a instance via a static method. But using serialization, we can still create multiple instance ... Read More

How to select a random element from a C# list?

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 14:12:45

45K+ Views

Firstly, set a list in C#.var list = new List{ "one", "two", "three", "four"};Now get the count of the elements and display randomly.int index = random.Next(list.Count); Console.WriteLine(list[index]);To select a random element from a list in C#, try to run the following code −Example Live Demousing System; using System.Collections.Generic; namespace Demo { ... Read More

How to inject JavaScript in WebBrowser control?

Arjun Thakur

Arjun Thakur

Updated on 23-Jun-2020 12:59:49

2K+ Views

To inject JavaScript in WebBrowser control, use the following steps − Firstly, create a Windows Forms application in Visual Studio. Now, drag a WebBrowser control to the form Set the Url property. Right-click the project, choose to Add reference... → COM → Type Libraries Select "Microsoft HTML Object Library"  Add the following code to inject JavaScript.private void ... Read More

Advertisements