ONLINE LEARNING

WEB DEVELOPMENT WITH HTML AND CSS

It's all about self learning.

How to create DIV in HTML

Learn First DIV creation with HTML and CSS

We have seen in last chapter what we are going to learn in coming days

We have planned to design one HTML and CSS based page here. I am not going to teach you html and css. Kindly go through w3schools for HTML and CSS. We have to design one layout here to start our work.

We are going to make a simple div with background color blue and text Hello World

We have to follow some rules and structure of HTML. As we are learning HTML5, Its important to define HTML structure. For this DIV , we have to follow some points as below mentioned

  • >> Define HTML tag
  • >> Add HEAD tag , Title and CSS and Javascript(if required)
  • >> Define Body
  • >> Write content and code in body and close
  • >> Close HTML

Sample Code here with:

!DOCTYPE 
html
head
meta charset="UTF-8"
title How to create DIV/title
/head
body
div class="newclass">Hello World
        
/div
/body
/html

This code will create a webpage with text Hello world. But we will not see any background color blue because we have not added any CSS in this code.

Definition and Usage

The "DOCTYPE" declaration must be the very first thing in your HTML document, before the html tag. The "DOCTYPE" declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in HTML 5. Everything will written in tag like <> and closing tag '' !DOCTYPE html That meta tag basically specifies which character set a website is written with. Here is a definition of UTF-8: UTF-8 (U from Universal Character Set + Transformation Format 8-bit) is a character encoding capable of encoding all possible characters (called code points) in Unicode. The encoding is variable-length and uses 8-bit code units.

Follow below points

Multiple Choice Questions

logo