Set Top Padding of an Element with JavaScript

Priya Pallavi
Updated on 23-Jun-2020 11:26:36

617 Views

Use the paddingTop property in JavaScript to set the top padding. You can try to run the following code to set the top padding of an element with JavaScript −Example                    #box {             border: 2px solid #FF0000;             width: 150px;             height: 70px;          }                     This is demo text.             Top Padding                      function display() {             document.getElementById("box").style.paddingTop = "20px";          }          

Dictionary Methods in C#

Samual Sam
Updated on 23-Jun-2020 11:26:04

5K+ Views

Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace.The following are the methods −Sr.NoMethod & Description1AddAdd key-value pairs in Dictionary2Clear()Remove all keys and values3RemoveRemoves the element with the specified key.4ContainsKeyChecks whether the specified key exists in Dictionary.5ContainsValueChecks whether the specified key value exists in Dictionary.6CountCount the number of key-value pairs.7ClearRemoves all the elements from Dictionary.Let us see how to add elements into a Dictionary and display the count.Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {       IDictionary d = new Dictionary();     ... Read More

Set the Type of Line in Text Decoration with JavaScript

Jennifer Nicholas
Updated on 23-Jun-2020 11:26:01

172 Views

To set the type of line in text-decoration, use the textDecorationLine property. You can try to run the following code to return the type of line in a text-decoration with JavaScript −Example                    This is demo text.                   Set Text Decoration                function display() {             document.getElementById("myText").style.textDecorationColor = "red";             document.getElementById("myText").style.textDecorationLine = "overline";          }          

Exception Propagation in C#

Ankith Reddy
Updated on 23-Jun-2020 11:25:19

1K+ Views

Exception Propogation can be understood by how exception handling works in C#.In try, when an exception occurs the corresponding catch blocks are checked. This is done to see if they can catch the exception. If no matching exception is found, the exception is propagated to a higher-level try block. This repeats until the exception is caught. In case, the exception isn’t caught, the execution of the program comes to an end.The above concept is explain in the below example showing nested try statements.Example Live Demousing System; using System.Text; public class Demo {    public static void Main() {       ... Read More

Set Text Shadow Effect with JavaScript

Sravani S
Updated on 23-Jun-2020 11:23:38

938 Views

To set the shadow effect, use the textShadow property in JavaScript.ExampleYou can try to run the following code to return the shadow effect of a text with JavaScript −           Set Text Shadow                This is Demo Text! This is Demo Text! This is This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text!                      function display() {             document.getElementById("myID").style.textShadow = "2px 2px 2px #ff0000,20px 5px 2px #F1F1F1";          }          

Delete Nth Element from Head Node Using Chash

George John
Updated on 23-Jun-2020 11:22:41

158 Views

Firstly, set a link list and add some elements.Demo list = new Demo(); list.Push(50); list.Push(100); list.Push(150);Now to delete nth element from headnode, pass what you want to delete. If you will set 1, then it will delete the head node.Exampleif (val == 1) {    head = head.Next;    return; } // n points to the node before the node we wish to delete Node n = head; // m is the node set to be deleted Node m = head.Next; for (int i = 2; i < val; i++) {    n = n.Next;    m = m.Next; } ... Read More

Set All Border Right Properties in One Declaration with JavaScript

Vikyath Ram
Updated on 23-Jun-2020 11:22:40

215 Views

To set all the border right properties in JavaScript, use the borderRight property. Set the border color, style, and, width at once using this property.ExampleYou can try to run the following code to learn how to set all the border right properties at once −Live Demo                    #box {             border: thick solid gray;             width: 300px;             height: 200px          }                     Demo Text             Change right border                function display() {             document.getElementById("box").style.borderRight = "thick solid #000000";          }          

Item Property of Hashtable Class in C#

Arjun Thakur
Updated on 23-Jun-2020 11:21:41

121 Views

Gets or sets the value associated with the specified key. You can also use the Item property to add new elements.If a key does not exist, then you can include it like −myCollection["myNonexistentKey"] = myValueThe following is the code showing how to work with Item property of Hashtable class in C#.Example Live Demousing System; using System.Collections; namespace Demo {    class Program {       static void Main(string[] args) {          Hashtable ht = new Hashtable();          ht.Add("One", "Amit");          ht.Add("Two", "Aman");          ht.Add("Three", "Raman");       ... Read More

Set Bottom Padding of an Element with JavaScript

Abhinaya
Updated on 23-Jun-2020 11:21:20

697 Views

To set the bottom padding, use the paddingBottom property in JavaScript.ExampleYou can try to run the following code to return the bottom padding of an element with JavaScript −                    #box {             border: 2px solid #FF0000;             width: 150px;             height: 70px;          }                     This is demo text.                   Bottom padding                      function display() {             document.getElementById("box").style.paddingBottom = "100px";          }          

Set Left Padding of an Element with JavaScript

Anvi Jain
Updated on 23-Jun-2020 11:19:22

679 Views

Use the paddingLeft property in JavaScript to set the left padding. You can try to run the following code to return the left padding of an element with JavaScript −Example                    #box {             border: 2px solid #FF0000;             width: 150px;             height: 70px;          }                     This is demo text.             Left padding                function display() {             document.getElementById("box").style.paddingLeft = "100px";          }          

Advertisements