Display Flex Lines in the Center of the Container with CSS

Lakshmi Srinivas
Updated on 25-Jun-2020 07:32:10

120 Views

Use the align-content property with value center to set the flex lines to the center.You can try to run the following code to implement the center valueExampleLive Demo                    .mycontainer {             display: flex;             height: 200px;             background-color: red;             align-content: center;             flex-wrap: wrap;          }          .mycontainer > div {             background-color: yellow;             text-align: center;             line-height: 60px;             font-size: 30px;             width: 100px;             margin: 5px;          }                     Queue                Q1          Q2          Q3          Q4          Q5          Q6          Q7          Q8          

Show Flex Lines with Spaces All Around Using CSS

Ankith Reddy
Updated on 25-Jun-2020 07:30:43

143 Views

Use the align-content property with value space-around to add space around the flex lines.You can try to run the following code to implement the space-around valueExampleLive Demo                    .mycontainer {             display: flex;             height: 200px;             background-color: #884EA0;             align-content: space-around;             flex-wrap: wrap;          }          .mycontainer > div {             background-color: #00FF00;             text-align: center;             line-height: 60px;             font-size: 30px;             width: 100px;             margin: 5px;          }                     Queue                Q1          Q2          Q3          Q4          Q5          Q6          Q7          Q8          

Touchmove Pointer Events Not Working on Chrome for Android 4.4

Lakshmi Srinivas
Updated on 25-Jun-2020 07:29:12

264 Views

The touchstart event is fired when the touchpoint is positioned on the touch surface. Use addEventListener() for touchmove pointer-events −overlay.addEventListener('touchstart', function(ev){    ev.preventDefault(); });Here, we have also used the preventDefault() method. The preventDefault() method prevents the browser from executing the default action.

Fire Event After Pressing ENTER in HTML Text Input

Vrundesha Joshi
Updated on 25-Jun-2020 07:28:39

462 Views

Use HTML with jQuery to achieve this and fire after pressing ENTER −Example                          $(document).ready(function(){             $('input').bind("enterKey",function(e){                alert("Enter key pressed");             });             $('input').keyup(function(e){                if(e.keyCode == 13)                {                   $(this).trigger("enterKey");                }             });          });                             Press Enter key in the above input text.    

Usage of Linear Gradient CSS Function

karthikeya Boyini
Updated on 25-Jun-2020 07:27:12

70 Views

Set a linear gradient as the background image, with linear-gradient() CSS function. You can try to run the following code to implement linear-gradient() function in CSSExampleLive Demo                    #demo {             height: 200px;             background: linear-gradient(green, orange, maroon);          }                     Setting background as linear gradient.          

What is a Transformation Matrix in HTML5 Canvas

Samual Sam
Updated on 25-Jun-2020 07:26:44

248 Views

HTML5 canvas provides methods that allow modifications directly to the transformation matrix. The transformation matrix must initially be the identity transform. It may then be adjusted using the transformation methods.ExampleLet us see an example of canvas transformation −                    function drawShape(){             // get the canvas element using the DOM             var canvas = document.getElementById('mycanvas');             // make sure we don't execute when canvas isn't supported             if (canvas.getContext){                // use getContext to use the canvas for drawing                var ctx = canvas.getContext('2d');                var sin = Math.sin(Math.PI/6);                var cos = Math.cos(Math.PI/6);                ctx.translate(200, 200);                var c = 0;                for (var i=0; i

DOMException: Failed to Load Because No Supported Source Was Found

karthikeya Boyini
Updated on 25-Jun-2020 07:26:12

3K+ Views

It can be a Cross-Origin Resource Sharing (CORS) issue.video.crossOrigin = 'anonymous';To enable cross-origin resource sharing, use the following. It allows the images to pass the HTTP header with an image response.Access-Control-Allow-Origin: *You can also use the HTML() method −$('#audio').html('');

Increase or Decrease Units in HTML5 Canvas Grid

Jennifer Nicholas
Updated on 25-Jun-2020 07:25:36

344 Views

HTML5 canvas provides scale(x, y) method that is used to increase or decrease the units in our canvas grid. This can be used to draw scaled down or enlarged shapes and bitmaps.This method takes two parameters where x is the scale factor in the horizontal direction and y is the scale factor in the vertical direction. Both parameters must be positive numbers.ExampleLet us see an example −                    function drawShape(){             // get the canvas element using the DOM             ... Read More

CSS Grid Row Property

Samual Sam
Updated on 25-Jun-2020 07:25:36

112 Views

With grid-row property, set the size of grid items. It has grid-row-start and grid-row-end properties. You can try to run the following code to implement the CSS grid-row property.ExampleLive Demo                    .container {             display: grid;             background-color: green;             grid-template-columns: auto auto;             padding: 20px;             grid-gap: 10px;          }          .container > div {             background-color: orange;             text-align: center;             padding: 10px 0;             font-size: 20px;          }          .ele1 {             grid-row: 1 / 6;          }                     Game Board                1          2          3          4          5          6          

Perform Animation on CSS Font-Weight Property

Chandu yadav
Updated on 25-Jun-2020 07:24:53

513 Views

To implement animation on font-weight property with CSS, you can try to run the following codeExampleLive Demo                    p {             border: 2px solid black;             width: 400px;             height: 100px;             animation: myanim 5s infinite;          }          @keyframes myanim {             70% {                font-weight: bold;             }          }                     This is demo text    

Advertisements