![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||||||
| |||||||
|
|
I am converting to CSS an HTML site that used tables for positioning and layout. |
|
I have a menu bar at the top with 4 or 5 hyperlinks back to the main areas of the site. |
|
The menu bar is now defined by a DIV (see below). |
|
My stumbling block is as follows: I need to have the hyperlinks spaced evenly across the menu bar WITHOUT reverting to the use of a one-row table with 4 or 5 TD's. |
|
Is this even possible to do without using tables? TIA. |
|
Here's the DIV #banner |
|
HEIGHT: 35px; |
#3
| |||
| |||
|
|
I have a menu bar at the top with 4 or 5 hyperlinks back to the main areas of the site ... I need to have the hyperlinks spaced evenly across the menu bar WITHOUT reverting to the use of a one-row table with 4 or 5 TD's. |
#4
| |||
| |||
|
|
and then Neil Rossi said: I have a menu bar at the top with 4 or 5 hyperlinks back to the main areas of the site ... I need to have the hyperlinks spaced evenly across the menu bar WITHOUT reverting to the use of a one-row table with 4 or 5 TD's. div id="links" div> </div div> </div div> </div div> </div div> </div /div div#links {width:100%} div#links div {width:20%;float:left;text-align:center} If the links don't fit they'll go onto two lines. Play with it. |
#5
| ||||
| ||||
|
|
rossi (AT) kdvsystems (DOT) com (Neil Rossi) wrote: I am converting to CSS an HTML site that used tables for positioning and layout. I wonder why. What is the expected gain? If you want to achieve just the same rendering, what will you win? |
|
I have a menu bar at the top with 4 or 5 hyperlinks back to the main areas of the site. Menu bars are a permanent source of problems. It's less clear which problems they are meant to solve. Anyway, a menu bar is a collection of similar items, namely tables, so it's much closer to a structural table than most other uses of table markup on Web pages. The menu bar is now defined by a DIV (see below). Why didn't you post the URL? |
|
My stumbling block is as follows: I need to have the hyperlinks spaced evenly across the menu bar WITHOUT reverting to the use of a one-row table with 4 or 5 TD's. Why do you need that? And what did you try? By default, a DIV element is rendered as a block element, so that each DIV begins on a new line. You don't seem to have tried anything to change that. |
|
OK, now, engaging the ESP unit, I see that the DIV is the container for links and you have tried to set the width for those links. This won't work that simply, since the width property is ignored for inline elements. Something like the following may work, if you adjust the width property to reflect the length of the longest element (6em roughly corresponds to about 12 characters): #banner a { display: block; float: left; width: 6em; } |
#6
| |||
| |||
|
|
I'm sure this has been answered before but a search doesn't turn up anything. I am converting to CSS an HTML site that used tables for positioning and layout. I have a menu bar at the top with 4 or 5 hyperlinks back to the main areas of the site. The menu bar is now defined by a DIV (see below). My stumbling block is as follows: I need to have the hyperlinks spaced evenly across the menu bar WITHOUT reverting to the use of a one-row table with 4 or 5 TD's. Is this even possible to do without using tables? TIA. |
#7
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |