HTML basic tutorial: DIV in HTML

What is DIV

First look at a website

18.png

Every red color on this website The boxes roughly represent a DIV, which is a logical part.

During the web page creation process, some independent logical parts are divided and placed in a

tag. This
tag functions as a container.

Syntax:

Determine the logical part:

What is the logical part? It is a set of interrelated elements on the page. For example, an independent column section in a web page is a typical logical part. As shown in the picture above


Name the DIV

Above, we put some tags into

to divide it into an independent logical part. In common applications, in order to make the logic clearer, we can set a name for this independent logical part and use the id attribute to provide a unique name for
. This is like each of us having an ID card. Number, this ID number uniquely identifies our identity and must be unique.

Combine this id with the CSS and JavaScript that you will learn later, and you can create a very cool website. We will introduce this later. In this section, everyone understands the DIV Just use it

    php.cn 

HTML课程

  1. 轻松入门HTML+CSS,掌握编程必备技能
  2. HTML 0基础入门教程
  3. HTML+CSS 轻松入门

PHP课程

  • 轻松入门PHP,踏上成为大牛的第一步
  • php 新手入门
  • PHP 零基础 轻松学


Continuing Learning
||
php.cn

HTML课程

  1. 轻松入门HTML+CSS,掌握编程必备技能
  2. HTML 0基础入门教程
  3. HTML+CSS 轻松入门

PHP课程

  • 轻松入门PHP,踏上成为大牛的第一步
  • php 新手入门
  • PHP 零基础 轻松学
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!