HTML Element: <font>
[this page | pdf | back links]
The
HTML <font> element was used to
indicate the font, colour and size of text. It is not supported in HTML 5.
Instead, use CSS.
EXAMPLE:
HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head></head>
<body>
Created using HTML:<br>
<font>text in specified font</font>
<br><br>Created using JavaScript:<br>
<span id="element"></span>
<script>
var x = document.createElement("FONT");
x.textContent = "text in specified font";
// or use var txt = document.createTextNode("text in specified font");
// x.appendChild(txt);
document.getElementById("element").appendChild(x);
</script>
</body>
</html>
|
NAVIGATION LINKS
Contents | Prev | Next | HTML Elements