Found 9326 Articles for Object Oriented Programming

How to set the CSS property that the transition effect is for with JavaScript?

Nitya Raut
Updated on 23-Jun-2020 11:30:59

97 Views

Use the transitionProperty in JavaScript to set the CSS property. You can try to run the following code to return the CSS property that the transition effect is for with JavaScript −Example                    #div1 {             position: relative;             margin: 10px;             height: 300px;             width: 400px;             padding: 20px;             border: 2px solid blue;          }          #div2 {             padding: 80px;             position: absolute;             border: 2px solid BLUE;             background-color: yellow;             transform: rotateY(45deg);             transition: all 3s;          }          #div2:hover {             background-color: orange;             width: 50px;             height: 50px;             padding: 100px;             border-radius: 50px;          }                     Hover over DIV2       Set       DIV1          DIV2                      function display() {             document.getElementById("div2").style.transitionProperty = "width,height";          }          

How to set the capitalization of a text with JavaScript?

Ramu Prasad
Updated on 23-Jun-2020 11:35:30

141 Views

To set the capitalization, use the textTransform property in JavaScript. Set it to capitalize, if you want the first letter of every word to be a capital letter.ExampleYou can try to run the following code to return the capitalization of a text with JavaScript −           Capitalize Text                This is demo text! This is demo text!                      function display() {             document.getElementById("myID").style.textTransform = "capitalize";          }          

How to set the shadow effect of a text with JavaScript?

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

773 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";          }          

What is to be done when text overflows the containing element with JavaScript?

Krantik Chavan
Updated on 23-Jun-2020 11:36:08

50 Views

Use the textOverflow property to counter the text overflow issue. Add ellipses if the text overflows the containing element.ExampleYou can try to run the following code to learn what is to be done when text overflows the containing element with JavaScript −                    #myID {             border: 2px solid blue;             background-color: gray;             overflow: hidden;             text-overflow: visible;             width: 200px;       ... Read More

How to set the style of the line in a text decoration with JavaScript?

Shubham Vora
Updated on 22-Nov-2022 07:37:42

977 Views

In this tutorial, we shall learn to set the style of the line in a text decoration with JavaScript. To set the style of the line in JavaScript, use the textDecorationStyle property. You can set underline, double, or overline, etc. for the line style. Let us discuss our topic in brief. Using the Style textDecorationStyle Property We can set or return the line style in a text decoration with this property. The major browsers support this property. Firefox adds support with an alternate property named MozTextDecorationStyle. Syntax Following is the syntax to set the style of the line in ... Read More

How to set the type of line in a text-decoration with JavaScript?

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

96 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";          }          

How to set the top padding of an element with JavaScript?

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

393 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";          }          

How to set the decoration of a text with JavaScript?

Nikitha N
Updated on 23-Jun-2020 11:27:38

681 Views

Use the textDecoration property in JavaScript to decorate the text. You can underline a text using this property.ExampleYou can try to run the following code to set the decoration of a text with JavaScript −           This is demo text.       Set Text Decoration                function display() {             document.getElementById("myText").style.textDecoration = "underline";          }          

How to set how the last line of a block or a line right before a forced line break is aligned when text-align is "justify" with JavaScript?

Smita Kapse
Updated on 23-Jun-2020 11:28:24

311 Views

Use the textAlignLast property in JavaScript to set the last line to right. Set it to right and allow the right alignment.ExampleYou can try to run the following code to return how the last line of a block or a line right before a forced line break is aligned when text-align is "justify" with JavaScript −                    #myDIV {             text-align: justify;          }                              This is ... Read More

How to set the horizontal alignment of text with JavaScript?

Srinivas Gorla
Updated on 23-Jun-2020 11:28:55

654 Views

Use the textAlign property in JavaScript and set it to right for aligning it horizontally. You can try to run the following code to return the horizontal alignment of text with JavaScript −Example           This is demo text       Set Horizontal Alignment                function display() {             document.getElementById("myText").style.textAlign = "right";          }          

Advertisements