Jump to: navigation, search

HTML Block

From w3cyberlearnings

Contents

HTML - Block

Block uses to group HTML elements together. You can define block in CSS for the class or id attribute.

HTML - Syntax Block

<div>.....</div>
<span>....</span>

Example TRY-IT

<!DOCTYPE html>
<html>
	<head>
		<title>block</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<style>
			#container {
				width:980px;
				color:grey;
				font-size:12px;
			}
			.title {
				font-size: 18px;
				color:black;
				font-weight: bolder;
			}
			.textbody {
				width:480px;
				line-height: 150%;
			}
			.textbody2 {
				width:300px;
				line-height: 250%;
				color:red;
			}
			.textbody2 span {
				color:blue;
			}
		</style>
	</head>
	<body>
      <div id="container">
			<span class="title">Build Your Professional Page</span>
			<div class="textbody">
				You require to learn how to use HTML, PHP, CSS, and MySQL.
				Please check all of the examples and tutorials in our website.
				If you have any question, you can also join our forum.
			</div>
			<div class="textbody2">
				If you want to learn how to install LAMP for your project.
				You can also can find all of those information within our web site.
				The URL is <span>www.w3cyberlearnings.com</span>
			</div>
		</div>
	</body>
</html>

Output

Html block 1.png

Related Link


Navigation
Web
SQL
MISC
References