About 11,000,000 results
Open links in new tab
  1. Resizing a font with pure JavaScript based on string length

    Jun 25, 2017 · Using a simple while loop which checks clientWidth against scrollWidth which you can learn more about here, we use the javascript .style.fontSize = "smaller" which decreases the font size by 1 unit.

  2. Set extremely small font size in html - Stack Overflow

    Jan 25, 2018 · Its possible, you can use rem for example: font-size: 0.01rem; See a CodePen here: https://codepen.io/fennefoss/pen/VyJPxq

  3. HTML DOM Style fontSize Property - W3Schools

    var listValue = selectTag.options[selectTag.selectedIndex].text; document.getElementById("demo").style.fontSize = listValue;

  4. Change Font Size of Text Using JavaScript - Online Tutorials …

    Learn how to change the font size of text using JavaScript with easy-to-follow examples and code snippets.

  5. Allow users to change font size of a webpage using JavaScript

    Jul 26, 2024 · Button Font Size Change: Define a function changeSizeByBtn(size) that takes a parameter size. Inside the function, set the fontSize property of the container (cont.style.fontSize) to the specified size. This function facilitates changing the font size based on a predefined size passed as an argument. Slider Font Size Change:

  6. HTML Font Size – How to Change Text Size with an HTML Tag

    Aug 4, 2022 · In this article, you will learn how to change the text size with an HTML tag. Before you proceed, it is essential to know that there is only one way we can do this: through CSS's font-size property. We can use the font-size property through inline, internal, or external styling.

  7. javascript - How to auto resize font size to smaller when text is ...

    Aug 18, 2022 · Reducing the text size will only work to a certain extent, as the text size will get unreadable very quickly. You'd probably want to look at either setting a hard limit, or allowing it to wrap instead.

  8. How to Change Font Size in Javascript? Easy Steps - WordSCR

    Jan 25, 2025 · Changing font size in JavaScript involves setting the CSS property “font-size” on an HTML element. There are several ways to do this, and we will explore each method in detail below: The `style` property is a DOM property that allows you to …

  9. How to Change Font Sizes with JavaScript - thesitewizard.com

    Apr 22, 2024 · There are many ways of changing the font size of an element. We will use the simple and direct method of modifying the style property. Let's say that you want to change the font size of an element assigned to a variable "x". The JavaScript code for this is essentially: Replace "150%" with the actual font size that you want.

  10. How to Make Text Resizer Using HTML JavaScript

    Jun 1, 2015 · Users of a particular web page are sometimes bothered with the font size especially when they have problems with eyesight. Yet, this problems can be solved through this Text Resizer. Text Resizer enables your user to change the font size in your website. The script is easy and works in any web page.

  11. Some results have been removed
Refresh