Found 601 Articles for Front End Scripts

How to set fontStyle, fontVariant, fontWeight, fontSize, lineHeight, and fontFamily in one declaration with JavaScript?

Sharon Christine
Updated on 23-Jun-2020 12:08:47

61 Views

To set all the font properties, use the JavaScript font property. You can try to run the following code to set all font properties in a single declaration with JavaScript −ExampleLive 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                function display() {             document.getElementById("myID").style.font = "italic 15px verdana,sans-serif";          }          

How to set the style of the rule between columns with JavaScript?

Fendadis John
Updated on 23-Jun-2020 12:19:00

69 Views

Use the columnRuleStyle property to set the style of the rule. You can try to run the following code to set the style of the rule between columns with JavaScript −ExampleLive Demo                    #myID {             column-count: 4;             column-rule: 4px dotted yellow;          }                     Click below to change style       Change Style between Columns                This ... Read More

How to set the column rule properties with JavaScript?

Samual Sam
Updated on 23-Jun-2020 12:10:04

123 Views

The columnRule property is used in JavaScript to set the column rule. It allows you to set the style, color, and width between column rule.ExampleYou can try to run the following code to set the column rule properties with JavaScript −Live Demo           Click below to create 4 columns       Columns                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 ... Read More

How to return the color of the text with JavaScript?

Prabhdeep Singh
Updated on 07-Nov-2022 07:20:35

3K+ Views

In this tutorial, we will learn how to return the color of the text with JavaScript. In the Style (It is a rule of HTML, used to describe how a document will be presented in the browser.) we define the color under that rule of HTML. To return the color of the text in JavaScript, we have to use the color property of JavaScript. The Colour property is used for assigning the color of the text inside the HTML tags (like p, h1, h2, body, etc.), and with the help of the id of the tag we can return the ... Read More

How to set all outline properties in a single declaration with JavaScript?

Paul Richard
Updated on 23-Jun-2020 12:01:37

77 Views

To set all outline properties in one declaration, use the outline property. It sets the following properties: outline-width, outline-style, and outline-color.ExampleYou can try to run the following code to learn how to work with outline properties −Live Demo                    #box {             border: 2px dashed blue;          }                     This is a div.             Click to set Outline                function display() {             document.getElementById("box").style.outline = "5px solid red";          }          

How to set outline color with JavaScript?

Sai Subramanyam
Updated on 30-Jul-2019 22:30:21

370 Views

To set outline color, use the outlineColor property in JavaScript. You can try to run the following code to learn how to implement outlineColor property − Example Live Demo #box { border: 2px solid red; } Demo Content Change outline color function display() { document.getElementById("box").style.outlineColor = "#FF5733"; document.getElementById("box").style.outline = "2px solid"; }

Set whether or not an element should be visible while not facing the screen with JavaScript?

Monica Mona
Updated on 23-Jun-2020 12:03:19

121 Views

Use the JavaScript backfaceVisibility property to set whether or not an element should be visible while not facing the screen.ExampleYou can try to run the following code to learn how to implement a backfaceVisibility property in JavaScript −Live Demo                    div {             width: 200px;             height: 300px;             background: blue;             color: black;             animation: mymove 2s infinite linear alternate;          }          @keyframes mymove {             to {transform: rotateY(180deg);}          }                     Check below to display backface                Demo             backfaceVisibility Property                function display(x) {             if (x.checked === true) {                document.getElementById("box").style.backfaceVisibility = "visible";             } else {                document.getElementById("box").style.backfaceVisibility = "hidden";             }          }          

How to set whether the image-border should be repeated, rounded or stretched with JavaScript?

Shubham Vora
Updated on 26-Oct-2022 12:27:41

92 Views

This tutorial will teach us to set whether the border image should be repeated, rounded, or stretched with JavaScript. Use the borderImageRepeat property to set whether the image-border is to be repeated, rounded, or stretched. Borders are used to decorate or focus an element. You can define its width, color, and type of border. Various styles can be applied to the borders. But, these borders are without any special effects or any other designs. Using the border-image property, we can set an image as a border of an element. It does not look like a line. It will be an ... Read More

How to set or return the number of columns an element should be divided into with JavaScript?

Arushi
Updated on 23-Jun-2020 11:45:39

96 Views

To divide a div into three columns, use the columnCount property. Set the column count and divide the div.ExampleYou can try to run the following code to return the numbers of columns an element is to be divided into with JavaScript −Live Demo           Click below to create 4 columns       Columns                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 ... Read More

How to return which part of a positioned element is visible in JavaScript?

Prabhdeep Singh
Updated on 07-Nov-2022 07:51:59

129 Views

This tutorial teaches us how to return which part of a positioned element is visible in JavaScript. Positioned element is an element in JavaScript or Html which have some defined position it could be absolute which means fixed, or any relative position. To make the defined part visible only we are going to clip, remove, or hide the not required area by using the ‘clip’ property of the ‘style’ property of any element. We are going to define an area as a rectangle and defined its portion how much we are required to trim and how much we need to ... Read More

Advertisements