Forum Moderators: not2easy

Message Too Old, No Replies

Need help with <div></div> question. Do i need to specify height?

Specify height or not include so each page will end on </div>?Please help:)

         

frenzy77

12:19 pm on Jul 26, 2005 (gmt 0)

10+ Year Member



Hey guys:)

>>>I'm trying to add the <div id="box"> to the code so that i can have a foreground(not sure if this is the right word.) so my text will be placed over this.<<<*******

Q.1. So, in the CSS i have height: 500px;. My question is if i am going to have this on *ALL* pages of my site, and all pages have different amounts of text, do i just *NOT* add the

height:

in the css so all my pages text will be in the box and end exactly at the </div>?

>>(Meaning that all the text will be in the <div></div> *box* no matter how long the page article is and end on </div>.
>>I would like to have it end exactly at the end of each </div> and not specify the height.<<

Here's the css for the <div id="box">

#box { height: 500px;
background-color: #002868; border-bottom: 1px solid #FFFFFF; border-top: 1px solid #FFFFFF; }

And the HTML for the page.>>

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

<html>
<head>

<title>
consol

</title>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />

<link rel="stylesheet" type="text/css" href="xyz.css" />

<link rel="stylesheet" type="text/css" href=abc.css" />

<link rel="stylesheet" type="text/css" href="box.css" />

</head>

<body>

<img src="logo.jpg" width="759" height="23" alt="" />

<div id="abc">

xyz
</div>

<img src="7.jpg" width="759" height="23" alt="" />
<img src="7.jpg" width="759" height="23" alt="" />

<table width="100%" cellpadding="0" cellspacing="0">

<tr>
<td valign="top" width="100">

<div id="xyz">
<ul>

<li>
<a href="index.html">Home</a>
</li>

<li>
<a href="score.html">Info</a>
</li>
<li>
<a href="score.html">Order</a>
</li>
<li>
<a href="score.html"> consolidation </a>
</li>

</ul>
</div>
</td>

<td width="575">

<div id="box">

<h1>
consol
</h1>

<p>

blah blah blah...

</p>

</div>

</td>
</tr>
</table>

</body>
</html>

Thanks for your help guys:)

frenzy77

abbeyvet

9:54 pm on Jul 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am really very unclear about what you are asking - I read it a few times and it still isn't clear. That may be just me. :(

A couple of things, why do you have three stylesheets? What is the table for?

I think you are saying that you want the div to end when the content does, so that there is no white space below the content?

If that is the case, then do not specify a height.

frenzy77

8:14 am on Jul 28, 2005 (gmt 0)

10+ Year Member



Hey abbeyvet:)

I merely want the text to stay within the <div></div> *box* no matter how long the page article is and end on </div>.

>>I would like to have it end exactly at the end of each </div> and not specify the height.<<

Like this:

<html>

etc...

<body>

etc...

<div id="box">

text goes here

</div>

</body>
</html>

*All the text will then be within the box for each page i place the <div id="box"> and the box highlight will end exactly under the last sentence no matter how long the article spans.

So if i have an article height 500px on one page and another one on another page the height of 1000px they will always be ending under the last sentence of the last paragraph.(within the box)

Q.1. So, can i *not* specify height: in the css and it will do this for all my pages with
<div id="box">?

Thanks for your help abbeyvet:)

Hope to here from you soon.

frenzy77

frenzy77

6:34 am on Aug 2, 2005 (gmt 0)

10+ Year Member



Hey guys:)

Does anybody know if i need to specify height or can i just not add the height: and it will display fine on all my pages no matter how long the article spans
each page?

Thanks guys for your help:)

frenzy77

tedster

6:38 am on Aug 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For text divs especially it's quite rare for me to use a height rule - I just let the document flow as far as it needs to, which might be different for different text settings on different computers. Why not experiment and see if you need it for your layout?

frenzy77

10:06 am on Aug 2, 2005 (gmt 0)

10+ Year Member



Thanks for replying tedster:)

I'm useing the div purely for design purposes as i don't know enough CSS to design a great layout with rounded corners or other design aspects. So this div
is a green foreground for the content.

It does work and is validated as xhtml 1.0

Well, thanks again tedster:)

frenzy77