Arjun Thakur has Published 739 Articles

How do we add a push button to HTML?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 08:44:50

3K+ Views

Use the tag in HTML to add a push button. The HTML tag is used for creating a button within HTML form. You can also use tag to create similar buttons.The following are the attributes of the tag −AttributeValueDescriptionautofocusAutofocusSpecifies that the button should have input focus ... Read More

Fade in on Button hover with CSS

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 08:31:03

857 Views

You can try to run the following code to fade in on button hover with CSSExampleLive Demo                    .btn {             background-color: orange;             color: white;             padding: 10px;             text-align: center;             font-size: 16px;             margin: 5px;             opacity: 0.5;             transition: 0.5s;             display: inline-block;             text-decoration: none;             cursor: pointer;          }          .btn:hover {             opacity: 2          }                     Result    

Center an image with CSS

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 07:24:59

185 Views

To center an image, use the margin-left, margin-right and block CSS properties. You can try to run the following code to center an imageExampleLive Demo                    img {             border: 2px solid orange;             border-radius: 3px;             padding: 7px;          }          img {             display: block;             margin-left: auto;             margin-right: auto;             width: 50%;          }                        

Selects every

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 07:12:49

2K+ Views

Use the element ~ element selector to select elements preceded by element. You can try to run the following code to implement thisExampleLive Demo                    p~ul {             color: white;             background-color: blue;          }                     Demo Website       Fruits                Vegetables are good for health.                       Spinach             Onion             Capsicum                       Fruits are good for health.                Apple          Orange          Kiwi          

Why is [1,2] + [3,4] = “1,23,4” in JavaScript?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:41:33

126 Views

The JavaScript's + operator is used to add two numbers or join two strings. However, use the contact() method to join two arrays to get a new one. For example, [50, 70].concat([90, 100])The above prints, [50, 70, 90, 100]Let’s see your example. The + operator concats strings, and converts the ... Read More

How to convert the image into a base64 string using JavaScript?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:36:26

650 Views

To convert the image into a base64 string using JavaScript, use the FileReader API. You can try to run the following code to get base64string for an image −Example                    function toDataURL(url, callback) {             ... Read More

Set a CSS style for the element when the animation is not playing

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:35:03

135 Views

Use the animation-fill-mode property to set a style for the element when the animation is not playingExampleLive Demo                    div {             width: 150px;             height: 200px;             position: relative;             background: red;             animation-name: myanim;             animation-duration: 2s;             animation-fill-mode: backwards;          }          @keyframes myanim {             from {left: 0px; background-color: green;}             to {left: 200px; background-color: blue;}          }                        

How do I print a double value with full precision using cout in C++?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:34:50

2K+ Views

The output stream cout allows using manipulators that you can use to set the precision directly on cout and use the fixed format specifier. To get the full precision of a double, you can use the limits library. For example, Example#include #include using namespace std; int main() {   ... Read More

Selects all elements that are placed immediately after

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:26:54

376 Views

Use the element+element selector to select elements placed after first specified element. You can try to run the following code to implement this,ExampleLive Demo                    div + p {             color: white;             background-color: blue;          }                     Demo Website       Fruits                This is demo text.             Fruits are good for health.       Fruits makes you healthy.    

Is segmentation fault actual undefined behavior in C++?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:08:41

526 Views

Undefined behavior is a way to give freedom to implementors (e.g. of compilers or of OSes) and to computers to do whatever they "want", in other words, to not care about consequences.The cases in which segmentation fault occurs are transient in nature. They won't always result in a segmentation fault ... Read More

Advertisements