Use the transition property to work with CSS Transitions.You can try to run the following code to implement transitions in CSS:ExampleLive Demo div { width: 150px; height: 150px; background: blue; transition: width 4s; } div:hover { width: 200px; } Heading One Hover over the below box to change its width.
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
With the transition effect, you can easily change the property values. You can also set a duration.Let us try to change the height of an element:ExampleLive Demo div { width: 150px; height: 150px; background: blue; transition: width 3s; } div:hover { height: 200px; } Heading One Hover over the below box to change its height.
To determine whether an element should be visible when not facing the screen or not, use the backface-visibility propertyExampleLive Demo .demo1 { position: relative; width: 150px; height: 150px; background-color: yellow; perspective: 80px; margin: 50px; perspective-origin: left; transform: rotateY(180deg); } .demo2 { position: absolute; padding: 20px; background-color: orange; transform-style: preserve-3d; transform: rotateX(45deg); backface-visibility: visible; } Rotation Demo Demo
The fibonacci series contains numbers in which each term is the sum of the previous two terms. This creates the following integer sequence −0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377…….The recurrence relation that defines the fibonacci numbers is as follows −F(n) = F(n-1) + F(n-2) F(0)=0 F(1)=1Programs to Display Fibonacci SeriesThere are two methods to display fibonacci series i.e. using dynamic programming and recursive programming. These are further explained as follows −Dynamic ProgrammingExample#include using namespace std; void fib(int n) { int f[n]; int i; f[0] = 0; f[1] ... Read More
To specify the bottom position of 3D elements, use the perspective-origin property.You can try to run the following code to implement the perspective-origin property:ExampleLive Demo .demo1 { position: relative; width: 150px; height: 150px; background-color: yellow; perspective: 80px; margin: 50px; perspective-origin: left; } .demo2 { position: absolute; padding: 20px; background-color: orange; transform-style: preserve-3d; transform: rotateX(45deg); } Rotation Demo Demo
Given a binary matrix contains 0 and 1, our task is to find duplicate rows and print it.Python provides Counter() method which is used here.ExampleInput: 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 Output: (1, 1, 1, 1) (0, 0, 0, 0)AlgorithmStep 1: Create a binary matrix, only 0 and 1 elements are present. Step 2: Which will have rows as key and it’s frequency as value. Lists are mutable so first, we will cast each row (list) into a tuple. Step 3: Create a dictionary using the counter method. Step 4: ... Read More
Use the [attribute = ”value”] selector to select elements with a specified attribute and value.You can try to run the following code to implement the CSS [attribute = "value"] Selector. Here, we have considered the attribute as rel,Example:Live Demo a[rel = nofollow] { border: 3px solid blue; } Uber's Business Model Share Market
Use the [attribute=”value”] selector to select elements with a specified attribute and value.You can try to run the following code to implement the CSS [attribute="value"] Selector. Here, we have considered the attribute as rel,ExampleLive Demo a[rel = nofollow] { border: 3px solid orange; } Uber's Business Model Share Market
Given a positive integer n, then we change to its binary representation and count the total number of set bits.ExampleInput : n=3 Output : 4AlgorithmStep 1: Input a positive integer data. Step 2: then convert it to binary form. Step 3: initialize the variable s = 0. Step 4: traverse every element and add. Step 5: display sum.Example Code# Python program to count set bits # in all numbers from 1 to n. def countbits(n): # initialize the counter c = 0 for i in range(1, n + 1): c += bitsetcount(i) return c def bitsetcount(x): if (x
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP