The div tag

T

Tony Johansson

Hello!

Is the reason to use the div tag only the following ?
This element is a container for other elements and can be used to separate
different regions on the page.
You can then position these regions and format them separately.

So does this mean that if I don't intend to either position or format a
region separately then it's no point to use the div
element ?

//Tony
 
T

Tony Johansson

Tony Johansson said:
Hello!

Is the reason to use the div tag only the following ?
This element is a container for other elements and can be used to separate
different regions on the page.
You can then position these regions and format them separately.

So does this mean that if I don't intend to either position or format a
region separately then it's no point to use the div
element ?

//Tony

For example what is the point to have the div tag in this document it work
just the same if I remove the div tag ?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Meeting Room</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1 style="text-align: center">
Enter details and set a day to initiate an event.
</h1>
</div>
</form>
</body>
</html>

//Tony
 
A

Arne Vajhøj

For example what is the point to have the div tag in this document it work
just the same if I remove the div tag ?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Meeting Room</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1 style="text-align: center">
Enter details and set a day to initiate an event.
</h1>
</div>
</form>
</body>
</html>

ASP.NET are related to C#, but this question seems to be pure HTML.

Arne
 
T

Tony Johansson

Arne Vajhøj said:
ASP.NET are related to C#, but this question seems to be pure HTML.

Arne

I know that this is a C# forum but I hope that somebody know HTML more then
I do and can answer this question

For example what is the point to have the div element in this document it
work
just the same if I remove the div tag ?
I don't see any point at all to have the div elemet in this pice of HTMl
document.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Meeting Room</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1 style="text-align: center">
Enter details and set a day to initiate an event.
</h1>
</div>
</form>
</body>
</html>

//Tony
 
A

Arne Vajhøj

I know that this is a C# forum but I hope that somebody know HTML more then
I do and can answer this question

Somebody probably does.

There may also be somebody here that are experts in DIY repair of
Volvos, but ...

:)
For example what is the point to have the div element in this document it
work
just the same if I remove the div tag ?
I don't see any point at all to have the div elemet in this pice of HTMl
document.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Meeting Room</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1 style="text-align: center">
Enter details and set a day to initiate an event.
</h1>
</div>
</form>
</body>
</html>

I can not see the point either - div's make most sense to me if they
have either a class or an id.

But then I stopped being uptodate on HTML around HTML 2.0!

:)

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top