Jump to: navigation, search

JQuery Set Font Size

From w3cyberlearnings

Contents

jQuery Set the font size

Set Font Size uses css() function.

Syntax

$("p").css("font-size","24px");
$("div.kk33").css("font-size","10px");

Note

Set font size for class attribute or just HTML elements.

Example TRY-IT

<!DOCTYPE html>
<html>
	<head>
		<title>Change Font Size</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="jquery.min.js">
		</script>
		<script>
			$(document).ready(function(){
				$("p").css("font-size","24");
				$("div.kk33").css("font-size","10");
			});
		</script>
	</head>
	<body>
                <p>All of the people are very happy.</p>
		<p class="k33">Great people like to say great things.</p>
		<div class="kk33">Nothing can be changed right now!</div>
	</body>
</html>


Related Links


Navigation
Web
SQL
MISC
References