TOP CATEGORIES

×

How to write HTML Div syntax?

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: advertise@gdatamart.com

Donate: To Support US

© 2024 GDATAMART.COM (All Rights Reserved)