Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the uses of DIV?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

What is the use of DIV, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

In the process of learning page layout, you may encounter problems with the use of DIV. Here we share the usage of DIV. First, let's take a look at the concept of DIV. DIV elements are elements used to provide structure and background for block-level content in HTML documents.

Introduction to the usage of DIV

DIV is also called integral division in programming, that is, integers that can only be quotient. DIV elements are elements that provide structure and background for block-level content in an HTML document. Everything between the start and end tags of the DIV is used to form this block, and the properties of the elements contained in it are controlled by the attributes of the DIV tag, or by formatting the block using a style sheet

Use DIV tags for DIV usage

When we use CSS-P, we mainly use it on DIV (division) tag. When you put text, images, or others in DIV, it can be called "DIV block", or "DIV element" or "CSS-layer", or simply "layer". In Chinese, we call it "hierarchy". So when you see these nouns later, you will know that they refer to a HTML in DIV.

DIV is used in the same way as other tag: This is a DIV tag.

If you use DIV alone without any CSS-P, it will have the same effect on a web page as it does in a web page.

But when we use CSS-P in DIV, we can strictly set its location. First we need to give the DIV that can be controlled by CSS-P an ID or its name. For example, we give the following DIV the name truck. The purpose of giving a name is that we can use JavaScript to control it later, such as moving it or changing some of its properties, and so on.

◆ This is a truck

The name for the hierarchy is arbitrary. The name can be any English letter or number, but * must be a letter. There are two ways to apply CSS-P to DIV.

Inline CSS:Inline is the most commonly used method. This is a truck.

External STYLE tag: the result of using the External method is the same. We will explain this method in more detail in a later course. Now let's focus on the Inline method. Notice the relationship between ID and DIV in the External method, in the STYLE.

This is a truck.

The Cross-Browser CSS nature of ◆ DIV usage:

The main purpose of our course is to make the web pages you write work on both NS4 and IE4, so we focus on properties that are common to both. The following properties conform to the standards given by the W3C.

Position determines how the DIV tag is placed. "relative" means that the position of the DIV is relative to other tag, while "absolute" means that the position of the DIV tag is relative to the window in which it is located.

The position of left relative to the left side of the window

The position of top relative to the top of the window

Width of the width DIV tag. All the words or html in DIV are in it.

Height of the height DIV tag. This property is rarely used unless you want to Clip the hierarchy.

Clip gives the clipping (visible) portion of layer. Clip makes the DIV appear as an accurate square that can be defined. You can use the following four values to give the location and size of the square in DIV.

Clip:rect (top,right,bottom,left)

Visibility conceals or shows DIV according to its values "visible", "hidden", "inherit".

The stereoscopic position of the z-index DIV tag. The higher the value, the higher the position of DIV.

The color of the background-color DIV background.

The DIV background color of the layer-background-color Netscape.

Background image of background-image DIV.

Background image of layer-background-image Netscape's DIV.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report