How do I cut down a DIV's width?

D

delerious

I'm trying to change my code to not use tables at all. Please take a look at
this page:
http://home.comcast.net/~delerious1/index.html

The top set of links does not use tables, whereas the bottom set of links does
use a table. I would like the top set of links to look like the bottom set.
How do I get the DIV to be as wide as the longest text (actually 0.4 em wider
than the longest text), instead of going across the whole screen?
 
R

rf

I'm trying to change my code to not use tables at all. Please take a look at
this page:
http://home.comcast.net/~delerious1/index.html

The top set of links does not use tables, whereas the bottom set of links does
use a table. I would like the top set of links to look like the bottom set.
How do I get the DIV to be as wide as the longest text (actually 0.4 em wider
than the longest text), instead of going across the whole screen?

float: left;

Cheers
Richard.
 
B

brucie

I'm trying to change my code to not use tables at all. Please take a look at
this page:
http://home.comcast.net/~delerious1/index.html

The top set of links does not use tables, whereas the bottom set of links does
use a table. I would like the top set of links to look like the bottom set.
How do I get the DIV to be as wide as the longest text (actually 0.4 em wider
than the longest text), instead of going across the whole screen?

basic setup:
http://stuff.bruciesusenetshit.info/menu-thingy.html

more advanced:
http://stuff.bruciesusenetshit.info/menu/page1.html
 
D

David Dorward

float: left;

Actually, no - since the CSS spec requires that you set an explicit width
when you make content float.

The correct way to achieve this type of rendering would be to muck about
with the display property in ways which won't work in Microsoft's file
manager.
 
D

delerious

just for future reference:

<td>
this is yucky and causes problems with rendering
</td>

<td>this doesn't</td>

this is also yucky
<td><img ...> </td>

this is yummy
<td><img ...></td>

So the rule is that anything that only has inline elements inside it shouldn't
have superfluous whitespace?
 
B

brucie

in post <[email protected] said:

So the rule is that anything that only has inline elements inside it shouldn't
have superfluous whitespace?

no. it doesn't matter what the element contains. in the first example
the line break after <td> and the one before </td> is supposed to be
ignored but browsers don't so you may end up with extra space you don't
want.

in the second example the cell not only contains the image but also a
single space which you probably don't want. e.g if you're trying to
align images in adjacent cells that space will prevent it.
 
D

delerious


Hey I just noticed an IE (5.5) bug. Try this with the above menu:

- Move the mouse over 'menu 7'
- Click on 'menu 7', and while keeping the mouse button depressed, move the
mouse away from 'menu 7'
- Release the mouse button.

I've tried this several times, and many times (not all of the time), 'menu 7'
will remain black instead of going back to the yellowish color.
 
D

delerious

upgrade or put up with it.


i cant, i upgraded to IE6 over 2 years go

So you can't reproduce it in IE6, or you didn't try? If you can't reproduce
it, then that's good to know it's been fixed.
 
B

brucie

So you can't reproduce it in IE6, or you didn't try?

cant reproduce
If you can't reproduce it, then that's good to know it's been fixed.

it may not be a bug, it could just be IE5.5s way of indicating that that
link still has focus. what happens when you drag the link off the page
to another location? does it remain black after the link has been
written to the new location?
 

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

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top