- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 9326 Articles for Object Oriented Programming
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"; }
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"; }
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"; }
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
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
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"; }
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"; }
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"; }
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
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"; }