[greenstone-users] Problem with the width of the navigation bar

From Oran of Greenstone Team
DateThu May 1 15:25:05 2008
Subject [greenstone-users] Problem with the width of the navigation bar
In-Reply-To (007801c8a55c$1fb72650$5f2572f0$-org)
Hi Allison,

I can see that you have created the 780px-wide div. But you still have
the pixel widths in the html of the navbar. If you put more than 780px
worth of content into a 780px div, it will either stretch the div (IE)
or the content will flow over the edge of the div (Firefox). You could
try 'overflow: hidden;' in your navbar780 css, which would hide the
overflowing content in Firefox (though IE may still stretch the div).
But the best thing to do would be to change your macros, getting rid of
all width attributes from the html.

I have put a page together to show the basic theory. You could integrate
this html and css approach into your collection by modifying the macros
which produce the nav bar html (see my last email for the macro names)
and your CSS stylesheet. Here's the page:
http://www.cs.waikato.ac.nz/~oranfry/mitchell-modern.html

This example works in IE6/7 and Firefox. Note that the titles are pushed
to the left of the screen (it is the modern way) with a fixed horizontal
gap. If you really want them spread across the screen as they are now,
you will have to use a tables approach, like this:
http://www.cs.waikato.ac.nz/~oranfry/mitchell-table.html

I hope it will be fairly straightforward to put the styles into you
stylesheet and modify the macros to produce the correct html. Please let
us know if you get stuck.

Kind Regards,
Oran Fry.

Allison Zhang wrote:
>
> Hi, Oran,
>
>
>
> Thank you very much for your help. I tried the changes you suggested
> but with no luck. The problem still exists. What puzzled me is that I
> used the same macro file for over 30 collections we built and none of
> them had this problem. I just built a collection yesterday using the
> same macro file and the navigation bar fits perfectly with the page
> width. I compared the macro file line by line for the problematic
> collection with the macro file for other collections and could not
> find any problem. Are there any other places should I look?
>
>
>
> Thanks
>
>
>
> Allison
>
>
> *From: * Oran of Greenstone Team
> [mailto:greenstone_team@cs.waikato.ac.nz]
> *Sent:* Wednesday, April 16, 2008 7:00 PM
> *To:* zhang@wrlc.org; greenstone-users@list.scms.waikato.ac.nz
> *Subject:* Re: [greenstone-users] Problem with the width of the
> navigation bar
>
>
>
> Hi Allison,
>
> I have looked at your problem and have come up with a solution. I have
> tested it on my machine and it looks good in Firefox and IE6/7. The
> problem is that the each html element in the nav bar has a pixel width
> hard coded in, and these widths add up to more than 780px. The
> solution is, create a containing div whose width is 780px, and have
> all elements inside use percentage widths instead of pixel widths.
>
> It looks like your collection's nav bar uses images of text, rather
> than text. The collection I used for testing just uses text, so this
> solution may not work straight off and may need some tweaking - just
> let me know if you get stuck. Here it is:
>
> In macros/nav_css.dm, change the 'optnavigationbar' macro to this:
>

{
> <div class="navbar" style="width:780px">
> SearchSubjectsFromDates
> </div>
> }
>
> Change the 'navtab' macro to this:
> {<div style="float:left; width:16%; background-image:
> url('/gsdl/web/images/tspace.gif'); text-align:center;"><a class="navlink_sel">_2_,class="navlink" href="_1_"
> title="_3_">_2_)</a></div>}
>
> And blank out the 'navbarspacer' macro:
> {}
>
> Please write back if you have any more questions.
>
> Cheers,
> Oran.
>
> Allison Zhang wrote:
>
> I just realized that I put the wrong Subject line for this message I sent
> out. Please ignore my previous message and help me with this problem
> stated below. --Allison
>
> I'm experiencing a problem with the width of the navigation bar. I set
> up the page width macro as 780 px:
> 537 {780}
>
> but the navigation bar is always longer than the page width. I created
> many collections using different page width and never had any problem. I
> don't know what's wrong with this one. I compared the collection macro
> file with the macro file for other collections and could not find anything
> wrong. Does anybody have any idea what could be wrong? Here is the URL
> for this trouble collection. The navigation bar is 817 px, 37 px longer
> than the page width 780 px.
>
> http://test.aladin.wrlc.org/gsdl/collect/mitchell/mitchell.shtml
>
>
> Many thanks
>
> Allison
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz <mailto:greenstone-users@list.scms.waikato.ac.nz>
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://list.scms.waikato.ac.nz/mailman/private/greenstone-users/attachments/20080501/8e015ab0/attachment-0001.html