473,394 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to make a <div> sink at the bottom of its parent <div>?

The structure is very simple:

<div style="WIDTH: 500px; HEIGHT: 50px; BACKGROUND-COLOR: aqua">
<div id="nav">
<a href="#">menu1</a>
</div>
</div>

I want to let the "nav" div sink at the bottom of the aqua color div. I
tried to make the "nav" div 100% height and set "vertical-align:
baseline/bottom/text-bottom;" and they doesn't work.

Also I tried to set the margin-top of "nav" div to, saying, 40:
"margin-top: 40". It works on IE but not works on mozilla. On mozilla,
looks that the parent div has been set "margin-top: 40". very bizarre.
Jul 20 '05 #1
4 8174
nick wrote:
<div style="WIDTH: 500px; HEIGHT: 50px; BACKGROUND-COLOR: aqua">
<div id="nav">
<a href="#">menu1</a>
</div>
</div>

I want to let the "nav" div sink at the bottom of the aqua color div. I
tried to make the "nav" div 100% height and set "vertical-align:
baseline/bottom/text-bottom;" and they doesn't work.
Did you check the faq? Google the group archives? This has been
discussed on numerous occasions. I'm sure you'll find lots of help there
on your specific question, plus lots of pointers on the danger of fixing
widths of elements in pixels. And perhaps you'll learn other things
along the way.
Also I tried to set the margin-top of "nav" div to, saying, 40:
"margin-top: 40". It works on IE but not works on mozilla. On mozilla,
looks that the parent div has been set "margin-top: 40". very bizarre.


Not so bizarre, really. 40 what? Pixels? Ems? You must specify a unit.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2
Brian wrote:
nick wrote:
<div style="WIDTH: 500px; HEIGHT: 50px; BACKGROUND-COLOR: aqua">
<div id="nav">
<a href="#">menu1</a>
</div>
</div>

I want to let the "nav" div sink at the bottom of the aqua color div.
I tried to make the "nav" div 100% height and set "vertical-align:
baseline/bottom/text-bottom;" and they doesn't work.

Did you check the faq? Google the group archives? This has been
discussed on numerous occasions. I'm sure you'll find lots of help there
on your specific question, plus lots of pointers on the danger of fixing
widths of elements in pixels. And perhaps you'll learn other things
along the way.

I googled and didn't find it. Could you suggest better kwywords for me?
Thanks.
but it's common to set set width of a div which use picture as header...
Also I tried to set the margin-top of "nav" div to, saying, 40:
"margin-top: 40". It works on IE but not works on mozilla. On mozilla,
looks that the parent div has been set "margin-top: 40". very bizarre.

Not so bizarre, really. 40 what? Pixels? Ems? You must specify a unit.

i forgot type px here. what i tried is "margin-top: 40px"
Jul 20 '05 #3
"nick" <nb***@nospam.hotmail.com> schrieb im Newsbeitrag
news:c7**********@news3.bu.edu...
The structure is very simple:

<div style="WIDTH: 500px; HEIGHT: 50px; BACKGROUND-COLOR: aqua">
<div id="nav">
<a href="#">menu1</a>
</div>
</div>

I want to let the "nav" div sink at the bottom of the aqua color div. I
tried to make the "nav" div 100% height and set "vertical-align:
baseline/bottom/text-bottom;" and they doesn't work.

Also I tried to set the margin-top of "nav" div to, saying, 40:
"margin-top: 40". It works on IE but not works on mozilla. On mozilla,
looks that the parent div has been set "margin-top: 40". very bizarre.


For vertical-align check out Lauris article:
http://www.student.oulu.fi/~laurirai/www/css/middle/

HTH
Markus
Jul 20 '05 #4
nick wrote:
Brian wrote:
nick wrote:
<div style="WIDTH: 500px; HEIGHT: 50px; BACKGROUND-COLOR: aqua">
<div id="nav">
<a href="#">menu1</a>
</div>
</div>

I want to let the "nav" div sink at the bottom of the aqua color
div. I tried to make the "nav" div 100% height and set
"vertical-align: baseline/bottom/text-bottom;" and they doesn't
work.

Did you check the faq? Google the group archives? This has been
discussed on numerous occasions. I'm sure you'll find lots of help
there on your specific question, plus lots of pointers on the
danger of fixing widths of elements in pixels. And perhaps you'll
learn other things along the way.


I googled and didn't find it. Could you suggest better kwywords


Search for "vertical align". But search Google Groups, not the web.

http://groups.google.com/groups?grou...ng.stylesheets

http://groups.google.com/groups?&q=v...ng.stylesheets
but it's common to set set width of a div which use picture as
header...


Sure. But your example was for navigation, and included text ("menu1").

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Daniel Hansen | last post by:
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and <div>...</div> blocks. When I implement these on a...
4
by: Hal Canary | last post by:
<div align="center"> does not seem to be identical to <div style="text-align:center">, as this example http://home.earthlink.net/~canaryh3/example.html points out. Yet the 'align' attribute...
7
by: Tintax | last post by:
I'm trying to get a child DIV tag to overlap the border of it's parent DIV tag in order to create an effect as follows: +----------------------------------------------------------+ | ...
1
by: nick | last post by:
In the web site http://greywolfdesign.com , there is a pop-up menu (when mouse over 'Portfolio' menu item), it always works well when using IE (6). However, when using Mozilla 1.6, the popup...
8
by: nick | last post by:
In the web site http://greywolfdesign.com , there is a pop-up menu (when mouse over 'Portfolio' menu item), it always works well when using IE (6). However, when using Mozilla 1.6, the popup...
7
by: BBB | last post by:
I have a web form with a <div> section ... I have it setup so the Update/Cancel buttons are fixed at the bottom of the screen while the content of the form is in the <div> and scrolls. Nice to the...
2
by: gee.sucka.foo | last post by:
I have a few thumbnail images each surrounded by a few links. So I put the thumbnail and the links in a div tag and set the div's to float:left. So my intent is to have the thumbnails wrap at the...
28
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.