
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 598 Articles for Front End Scripts

461 Views
To set the distance between lines, use the lineHeight property. You can try to run the following code to set the distance between lines in a text with JavaScript −ExampleLive Demo Heading 1 This is Demo Text.This is Demo TextThis is Demo Text Set distance between lines function display() { document.getElementById("myID").style.lineHeight = "2"; }

109 Views
To set the list properties in a single declaration, use the listStyle property in JavaScript.ExampleYou can try to run the following code to set the listStylePosition and listStyleType property in one declaration with JavaScript −Live Demo One Two Change style function display() { document.getElementById("myID").style.listStyle = "circle outside"; }

429 Views
To set the space between characters, use the JavaScript letterSpacing property.ExampleYou can try to run the following code to set the space between characters in a text with JavaScript −Live Demo Heading 1 This is Demo Text. Set Space between characters function display() { document.getElementById("myID").style.letterSpacing = "7px"; }

168 Views
Use the fontSizeAdjust property to preserve the readability of text. It sets the aspect value of a font i.e. the difference between the size of lowercase and uppercase letters.ExampleYou can try to run the following code to preserve the readability of text when font fallback occurs with JavaScript −Live Demo Heading 1 This is Demo Text. Set Aspect Value function display() { document.getElementById("myID").style.fontFamily = "verdana,sans-serif"; document.getElementById("myP").style.fontSizeAdjust = "0.90"; }

760 Views
Use the height property to set the height of an element. You can try to run the following code to set the height of a button with JavaScript −ExampleLive Demo Heading 1 This is Demo Text. Update Height function display() { document.getElementById("myID").style.height = "100px"; }

136 Views
Use the fontWeight property in JavaScript to set the font boldness.ExampleYou can try to run the following code to set the boldness of the font with JavaScript −Live Demo Heading 1 This is Demo Text. Set Font Family and Font Weight function display() { document.getElementById("myID").style.fontFamily = "verdana,sans-serif"; document.getElementById("myID").style.fontWeight = "800"; }

198 Views
To set the font in small capital letters, use the fontVariant property.ExampleYou can try to run the following code to set the font to be displayed in small capital letters with JavaScript −Live Demo Heading 1 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. Set Font Family and Font Variant function display() { document.getElementById("myID").style.fontFamily = "verdana,sans-serif"; document.getElementById("myID").style.fontVariant = "small-caps"; }

1K+ Views
Use the left property to set the left position of a positioned element, such as a button.ExampleYou can try to run the following code to set the left position of a positioned element with JavaScript −Live Demo #myID { position: absolute; } Heading 1 This is Demo Text. Change Left Position function display() { document.getElementById("myID").style.left = "150px"; }

908 Views
To set the font size, use the fontSize property in JavaScript. You can try to run the following code to set the font size of the text with JavaScript − Example Live Demo Heading 1 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. Set Font Family and Size function display() { document.getElementById("myID").style.fontFamily = "verdana,sans-serif"; document.getElementById("myID").style.fontSize = "smaller"; }

358 Views
To align the element horizontally, use the cssFloat property.ExampleYou can try to run the following code to set the horizontal alignment of an element with JavaScript −Live Demo 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. Align Horizontally function display() { document.getElementById("myID").style.cssFloat = "right"; }