473,395 Members | 1,846 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,395 software developers and data experts.

Float/Div Confusion

I am trying without success to understand what is going on. I am
developing a site at

http://www.ianwatts.info/edensor/

http://www.ianwatts.info/edensor/edensor.css

and I have two problems.

1. I want the text (The Best Lesson of the Week) to sit at the right
hand side of the image - I have tried not floating, and it sits
underneath the image, the same goes with setting margin-left to 50 or
60% - it still sits underneath. So I tried floating left, and it then
sits outside the content div altogether. Surely float shouldn't take it
out of its normal flow?

2. The menu bar (which I pinched the idea from
http://www.alistapart.com/articles/dropdowns) will not center in the
content div - it pushes to the left all of the time. I have tried
various solutions, but to no avail.

I realise that navigation that relies on JS isn't a good idea, and when
finished the site will have alternative navigation in for non JS users -
for now it is simply a prototype.

Many thanks in advance
Ian Watts
Jul 20 '05 #1
3 7630
Ian Watts wrote:
I am trying without success to understand what is going on. I am
developing a site at

http://www.ianwatts.info/edensor/

http://www.ianwatts.info/edensor/edensor.css

and I have two problems.

1. I want the text (The Best Lesson of the Week) to sit at the right
hand side of the image - I have tried not floating, and it sits
underneath the image, the same goes with setting margin-left to 50 or
60% - it still sits underneath. So I tried floating left, and it then
sits outside the content div altogether. Surely float shouldn't take it
out of its normal flow?
I forgot to say that I have tested in IE6 and Firefox .8 - in IE6 it
stays within the content div but below the image -what am I doing wrong?
2. The menu bar (which I pinched the idea from
http://www.alistapart.com/articles/dropdowns) will not center in the
content div - it pushes to the left all of the time. I have tried
various solutions, but to no avail.

I realise that navigation that relies on JS isn't a good idea, and when
finished the site will have alternative navigation in for non JS users -
for now it is simply a prototype.

Many thanks in advance
Ian Watts

Jul 20 '05 #2
On Mon, 17 May 2004 22:27:53 +0100, Ian Watts
<iw****************@ntlworld.com.and.this> wrote:
I am trying without success to understand what is going on. I am
developing a site at

http://www.ianwatts.info/edensor/

http://www.ianwatts.info/edensor/edensor.css

and I have two problems.

1. I want the text (The Best Lesson of the Week) to sit at the right
hand side of the image - I have tried not floating, and it sits
underneath the image, the same goes with setting margin-left to 50 or
60% - it still sits underneath. So I tried floating left, and it then
sits outside the content div altogether. Surely float shouldn't take it
out of its normal flow?


Float sends it to the farthest possible position in its containing block,
and the next element is rendered at the floated element's position.

If you want the image and the text at the same vertical height, float what
comes first. Otherwise, it goes to its normal flow, which is whjat's
happening quite correctly.
Jul 20 '05 #3
Neal wrote:
On Mon, 17 May 2004 22:27:53 +0100, Ian Watts
<iw****************@ntlworld.com.and.this> wrote:
I am trying without success to understand what is going on. I am
developing a site at

http://www.ianwatts.info/edensor/

http://www.ianwatts.info/edensor/edensor.css

and I have two problems.

1. I want the text (The Best Lesson of the Week) to sit at the
right hand side of the image - I have tried not floating, and it sits
underneath the image, the same goes with setting margin-left to 50 or
60% - it still sits underneath. So I tried floating left, and it then
sits outside the content div altogether. Surely float shouldn't take
it out of its normal flow?

Float sends it to the farthest possible position in its containing
block, and the next element is rendered at the floated element's position.

If you want the image and the text at the same vertical height, float
what comes first. Otherwise, it goes to its normal flow, which is
whjat's happening quite correctly.

Thanks Neal

I tried that, and first off - nothing - the text still seemed to
disappear down the bottom, underneat the content div.

However, it seems that the menu bar was confusing matters - when I put
that in a containing div, eveything worked fine.

However, I still can't get the menu bar to center - I have tried setting
margin-left and margin-right to auto, and have tried text-align to
center (all of this on menu div, the container for the menu), but it
seems to stay pushed to the left.

I have tried this in IE6 and Firefox .8.

Thanks

Ian
Jul 20 '05 #4

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

Similar topics

12
by: Michael Rozdoba | last post by:
http://digitalrat.co.uk/test/index.html I float a div left in body prior to a div with top margin set. I expected the float to rise to the top of body, but instead in Firefox & Opera its top...
12
by: Nobody | last post by:
I'm trying to understand why this program... #include <stdio.h> #include <float.h> int main(void) { int i = 123456789 ; int j = 987654321 ;
7
by: Nobody | last post by:
I'm trying to understand why this program... #include <stdio.h> #include <float.h> int main(void) { int i = 123456789 ; int j = 987654321 ;
10
by: Alexander Malkis | last post by:
What is the biggest float number f so that -f doesn't overflow and is still representable as a float. -- Best regards, Alex. PS. To email me, remove "loeschedies" from the email address...
2
by: pango | last post by:
I write below code in my program: float f=0.371f; int i=(int)(f*1000.0f); I think the result of "i" should be "371",but in fact it is "370",why?How to solve it?
60
by: Erick-> | last post by:
hi all... I've readed some lines about the difference between float and double data types... but, in the real world, which is the best? when should we use float or double?? thanks Erick
13
by: Shirsoft | last post by:
I have a 32 bit intel and 64 bit AMD machine. There is a rounding error in the 8th digit. Unfortunately because of the algorithm we use, the errors percolate into higher digits. C++ code is...
37
by: The87Boy | last post by:
Hey all I have a problem with float I should write a program, where you are getting some numbers from the command-line and try to find the maximum and minimum-values of these numbers. I need...
22
by: Bill Reid | last post by:
I just noticed that my "improved" version of sscanf() doesn't assign floating point numbers properly if the variable assigned to is declared as a "float" rather than a "double". (This never...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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.