Answers for "react setting fontsize with div dimensions"

0

css font size jsx

className={{fontSize: '12px'}}
Posted by: Guest on May-20-2021
1

scale text in div react

import useFitText from "use-fit-text";

function name(){
  const { fontSize, ref } = useFitText({maxFontSize: 240, minFontSize: 181});

  return (
    <div ref={ref} style={{ fontSize, height: 72, width: 240 }}>
      <div id="someId">Your Text</div>
    </div>
  );
}
Posted by: Guest on August-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language