karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 91 of 143

Do you think Python Dictionary is really Mutable?

karthikeya Boyini
karthikeya Boyini
Updated on 05-Mar-2020 297 Views

Yes, Python Dictionary is mutable. Changing references to keys doesn't lead to the creation of new dictionaries. Rather it updates the current dictionary in place. examplea = {'foo': 1, 'bar': 12} b = a b['foo'] = 20 print(a) print(b)OutputThis will give the output −{'foo': 20, 'bar': 12} {'foo': 20, 'bar': 12}

Read More

How can we combine multiple print statements per line in Python?

karthikeya Boyini
karthikeya Boyini
Updated on 05-Mar-2020 5K+ Views

You can combine multiple print statements per line using, in Python 2 and use the end argument to print function in Python 3.examplePython2.x print "Hello", print " world" Python3.x print ("Hello", end='') print (" world")OutputThis will give the output −Hello worldAnother thing you could do is put all the things in an array and call ''.join(array). examplearr = ["Hello", "world"] print(' '.join(arr))OutputThis will give the output −Hello world

Read More

How to change the color of focused links with CSS

karthikeya Boyini
karthikeya Boyini
Updated on 05-Mar-2020 1K+ Views

Use the :focus class to change the color of focused links. Possible values could be any color name in any valid format.ExampleYou can try to run the following code to implement the color of the focused link −                    a:focus {             color: #0000FF          }                     This is demo link    

Read More

Usage of :first-child pseudo-class in CSS

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 71 Views

Use the :first-child pseudo class to add special style to an element that is the first child of some other element.ExampleYou can try to run the following code to understand the usage of :first-child pseudo class −                    div > p:first-child          {             text-indent: 25px;          }                              First paragraph in div. This paragraph will be indented          Second paragraph in div. This paragraph will not be indented                But it will not match the paragraph in this HTML:                Heading          The first paragraph inside the div. This paragraph will not be effected.          

Read More

Usage of :visited pseudo-class in CSS

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 78 Views

The :visited pseudo-class is used to add special style to a visited link. Possible values could be any color name in any valid format. Example                    a:visited {             color: #006600          }                     Click this link    

Read More

Using CSS z-index property

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 189 Views

The z-index property is used along with the position property to create an effect of layers. You can specify which element should come on top and which element should come at the bottom. ExampleYou can try to run the following code to implement the z-index property −                                                     

Read More

What to do when an element's content might be larger than the amount of space allocated to it?

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 143 Views

Use the CSS overflow property to solve this issue of a content exceeding the allocated space. You can try to run the following code to solve the issue −Example                   .scroll{          display:block;          border: 2px solid green;          padding:10px;          margin-top:10px;          width:300px;          height:50px;          overflow:scroll;       }       .auto{          display:block;          border: 2px solid green;     ...

Read More

CSS line-height property

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 128 Views

The line-height property is used to set the height of a line of text. The value of the line-height property can be a number, a length, or a percentage.Example                            This paragraph is 300 pixels wide and 100 pixels high and here line height is 50 pixels.          

Read More

Set outline style as a solid single line with CSS

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 111 Views

To set the outline style as a solid single line, use the outline-style property with the value solid −Example                            This text is having 3px solid outline.          

Read More

HTML5 Canvas layer disappears on mouse click in Fabric.js and Firefox stops responding when creating a canvas for the image?

karthikeya Boyini
karthikeya Boyini
Updated on 04-Mar-2020 528 Views

If the HTML5 Canvas layer disappears on mouse click in Fabric.js and Firefox stops responding when creating a canvas to the image, then there is a way to drag and drop images from your computer to canvas using Fabric.This can be done by making image draggable property to true by this way −

Read More
Showing 901–910 of 1,421 articles
« Prev 1 89 90 91 92 93 143 Next »
Advertisements