Advertisement
punkwasp

font selector code html

Jun 19th, 2023 (edited)
585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.39 KB | Source Code | 0 0
  1. <!-- The HTML portion of code I made in order to make a working font selector on my Neocities website, you will need Javascript code as well which I have already included a link to in this html so as long as you have a main.js file in the same folder it will work. The Javascript portion will be on my Pastebin profile as well, in a folder called "font selector code html and javascript". My code works by storing the user's selection in their browser selection and checking for it when they load the website, so if you have the code below somewhere on each webpage, it will work across multiple site pages as well. If you would like to see the code in action, my website is punkwasp.neocities.org. This code is completely free to use, no credit required. You could also tweak it to edit things besides font family, and it will work with custom fonts you've uploaded to the site as long as you've done the work of setting them up in your CSS file. -->
  2. <body>
  3.     <label for="fontFamily">Font:</label>
  4.         <select name="fontFamily" id="fontFamily">
  5.             <option value="Arial">Arial</option>
  6.             <option value="Times">Times</option>
  7.             <option value="Helvetica">Helvetica</option>
  8.             <option value="Tahoma">Tahoma</option>
  9.             <option value="Calibri">Calibri</option>
  10.             <option value="Verdana">Verdana</option>
  11.         </select>
  12.     <script src="main.js"></script>
  13. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement