View Full Version : justifying text in nav boxes
kalbi
April 29th, 2003, 08:32 AM
Hi
All the content of the nav box menus is centered by default. I want to change the text just in the Product Catalog container to display categories and sub-categories as left justified. It looks untidy centered especially when sub-categories are displayed as they are all of varied lengths. I want to leave the other menu (I have also created a main site menu) and account options/search box etc, with text centered, as they are at present.
I tried placing 'text-align=left' in the div style tag in window.php which controls <?=$Content?> , but this of course made the contents of all the menus and contents of the nav boxes as left aligned, which is not what I want.
Is there any way that I can get it to align only the text that displays in the Product Catalog menu and leave the others centered?
Thanks
Eric
Jamie
April 30th, 2003, 11:16 AM
Hi Eric,
This problem is due to poor coding in our stylesheet. We used a style for the TD tag, which is forcing everything centered. We will be resolving lots of design issues like this in the future.
For now, here is a hack that should accomplish what you need:
- in "window.php", put this at the top of the file:
<?
if ($Header == "Product Catalog"){
$left_alignment = "text-align: left";
}
?>
Then, in the <td> cell where <?=$Content?> appears, do this:
<td width="100%" bgcolor="#F1F4FF" style="padding: 0 3 3 3; <?=$left_alignment?>">
This will make the text-align property appear in the td tag only when the header is "Product Catalog".
Thanks,
Jamie
:squirrel:
kalbi
April 30th, 2003, 03:01 PM
Hi Jamie
Then, in the <td> cell where <?=$Content?> appears, do this:
I am using the supersquirrel theme so tried putting the code in the <div> tag like so:
<div style="width: 100%; color: navy; padding: 5";
<?=$left_alignment?>">
<?=$Content?>
</div>
I thought that the $left_alignment variable would still work even thought it's not in a <td> tag now, but it doesn't seem to do anything. Is there a reason for this?
Thanks
Eric
Jamie
April 30th, 2003, 03:37 PM
Hi Eric,
I think it might be because you have an extra quote which is ending the style property prematurely. You have:
<div style="width: 100%; color: navy; padding: 5";
<?=$left_alignment?>">
<?=$Content?>
</div>
and it should be:
<div style="width: 100%; color: navy; padding: 5; <?=$left_alignment?>">
<?=$Content?>
</div>
Thanks,
Jamie
kalbi
April 30th, 2003, 03:55 PM
I took it out, Jamie, but still doesn't seem to work :confused:
Jamie
April 30th, 2003, 05:20 PM
OK...in this section:
<?
if ($Header == "Product Catalog"){
$left_alignment = "text-align: left";
}
?>
change it to:
<?
if ($Header == "Product Catalog"){
$left_alignment = "text-align: left";
print "in section<br>";
}
?>
then, see if your page has the text "in section" on it. If it does, then we know $left_alignment is being set. If it is, then view source on the page, and respond to this post with the <div> tag we are working with, so we can see how it actually is being output to the browser. If it does not display "in section", then check your header text, and make sure it is "Product Catalog".
Thanks,
Jamie
kalbi
May 1st, 2003, 04:44 AM
Hi Jamie.
Am leaving in less than an hour for the airport on my way to the US for a short trip, so will try this as soon as I can get online with my laptop :D
Will let you know how it works!
Thanks again
Eric
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.