How to write HTML Div syntax?

Query By: ZAFAR KHAN

V

Vivek

<div> Syntax Example with Class in HTML


<div class="class-name">

  <!-- Content goes here -->

</div>


Example of Code in HTML

<!DOCTYPE html>

<html>

<head>

  <title>Example</title>

  <link rel="stylesheet" href="styles.css">

</head>

<body>

  <div class="container"></div>

</body>

</html>


CSS Code

/* styles.css */

.container { background-color: blue; color: white; padding: 20px; }

1 votes

Your Answer

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)