Nov 21, 2009

How To Divide A Webpage Into Section Using DIV? - how to devide the web page.

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

How To Divide A Webpage Into Section Using DIV? - how to devide the web page.

Takotsu
Hello.

I would describe myself as having a moderately high knowledge of html.
The one thing that eludes me is how to devide the web page into sections.
Not using tables or frames, but making seperate sections. I was told you
could use a DIV tag. But, I can't find anything about it. I'm not even sure
if what the guy was talking about was even html.

Thank you in advance for any help.

Comment/Reply (w/o sign-up)

minnieadkins
I'm sure someone will explain better than me, but since I found the post I'll put my $.02 in.

I personally still use tables a lot, but it's possible to use <DIV> tags. Div tags are block elements, but they can be styled with css to do pretty much anything.

CODE

<div> Header goes here </div>
<div style="float: left;width: 100px;">  Menu </div>
<div style="float: left;"> Main Content </div>
<div style="clear: both;"> Footer </div>


I'm not 100% about that, but that's something of how it would work. Obviously there's more than one way to go about it as you could have nested <div>'s encased in a wrapper or whatever you like. The styling is up to you as well. Google a little and I'm sure you'll find plenty of examples. Templates for 3 column, 2 column or what have you. There's lots of different templates designed with div's on the web. It can be done, and is becoming more and more popular.

If you're good with css then I think you should definately try using div's for you layout rather than tables.

 

 

 


Comment/Reply (w/o sign-up)

Arbitrary
@minnieadkins, Yep, that works well. happy.gif

Here's something else that's a bit more decorated and is a three-column template:



<html>
<head>
<title>Example</title>
<style type="text/css">


div.header {
position: absolute;
top: 15px;
padding: 10px;
height: 50px;
width: 100%;
border: 1px dashed orange;
}
div.left {
padding: 10px;
position: absolute;
left: 15px;
top: 100px;
width: 200px;
height: 500px;
border: 1px dashed orange;
}
div.center {
padding: 10px;
position: absolute;
top: 100px;
left: 250px;
height: 500px;
width: 500px;
border: 1px dashed orange;
}
div.right {
padding: 10px;
position: absolute;
right: 15px;
top: 100px;
width: 200px;
height: 500px;
border: 1px dashed orange;
}
div.footer {
padding: 10px;
position: absolute;
right: 15px;
top: 660px;
height: 50px;
width: 100%;
margin: 20px;
padding: 10px;
border: 1px dashed orange;
}
</style>

</head>

<body>

<div class="header">
Header
</div>

<div class="left">
Left Menu
</div>

<div class="center">
Main Content Div
</div>

<div class="right">
Right Menu
</div>
<div class="footer">
Footer
</div>


</body>
</html>



Except that I used absolute positioning...so it's not really a liquid layout, if that's what you wanted. And definitely Google it! Tons of stuff out there. The useful stuff is...colored. biggrin.gif

Comment/Reply (w/o sign-up)

sonoftheclayr
Arbitrary, I am using something like that for my page but it only works in Mozilla Firefox (as far as I can tell anyway, it's the only browser I use and I checked it out in IE but [surprise!] it doesn't work).

I find it much faster and neater than tablesa and it's easier to work with because you know what DIV does what. Would you be able to use a SPAN for this or not? Just something I might try out later.

Arbitrary, you really should have used id's as they are the current standard and much faster to write!

Comment/Reply (w/o sign-up)

minnieadkins
ID's are meant to be for elements that are only going to appear once in the page, so in this case I would say most of those would probably fit that description. The header, footer, and main content are obviously going to appear only once in that page...I would imagine that the left and right menu would be the same.

Div's work fairly well in most browsers. IE is a little more of a hassle to get working. Perhaps it's a problem with your code, and IE is just being picky.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : , devide, web, page

  1. Can I Make A Webpage With Javascript
    title kinda says it all (9)
  2. New To Webpage Creation
    (5)
    Hi I am fairly new to webpage creation, so I asked a friend of mine what is the best method of
    creating a good site. I know how to create a basic site using HTML and I have had a go at Frontpage,
    but both dont offer me what I want. He suggested to me to try Mambo or Dreamweaver. Any thoughts or
    hints would be greatly appreciated as I am trying to create a website for an online gaming guild.....
  3. Basket
    How do you make a basket for a webpage?? (2)
    I want to know how to make a basket for my website so people can buy from me. How? /huh.gif'
    border='0' style='vertical-align:middle' alt='huh.gif' /> ....
  4. How To Create A Copy Proof Webpage?
    (15)
    Sometimes I found something interesting on a webpage and hope to make a memo. Thus I will try to
    soft copy. Then I marking a quote, and the right click my mouse for laughing the menu. Sometime an
    warning box will show up to tell me that no right click is permitted here. It's cool! I hope to
    do it also, but I don't have any idea here. Could anyone teach me this? But this limitation
    won't be effect, I can just use the hotkey ctrl+P to copy it. However, the hotkey ctrl+P
    won't work all the time. Some webpage does not permit you to quote any word in their im....
  5. Anyone can tell me how to protect my webpage
    protect my webpage (6)
    Hi, Does anyone told me! how to protect my web page (.html) to the leeches........... my link are
    stolen by other and i have nothing yet else. One more i dont want to use any software like html
    protector..... I want manual solution for this.....

    1. Looking for , devide, web, page

See Also,

*SIMILAR VIDEOS*
Searching Video's for , devide, web, page
advertisement



How To Divide A Webpage Into Section Using DIV? - how to devide the web page.

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com