0

Hi, I am having some problems with css on a website that i take care of for my local Scout Troop. I have little idea of css, but have managed so far to put the site together by hacking at a gnu released template.

The problems are related to the right hand side of the site, firstly there is a large gap between the radio button and text in a poll, and secondly when browsing using firefox, the images linking to sponsor sites appear to close together while on IE they are fine.

Any help would be greatly appreciated. I know that the post is probably a little ambiguous, but i wasn't sure what additional info to post.

2
Contributors
5
Replies
6
Views
10 Years
Discussion Span
Last Post by rgtaylor
0

My guess is that the radio buttons and text labels are aligned using a form... without being specifically set widths the browsers will just determine the widths as their internal logic dictates...

Otherwise you may need to see if the radio buttons have any margin-right values set by default...

The images for the sponsor links is different because IE and FF will use different default values to space various elements on the screen when the values are not specifically set...

You can usually resolve this be ensuring that all values are set to a common default... Typically in a page level CSS so you can manage these all from 1 central location...

Peace,

0

Hi, im gonna include the php file responsible for the polls. I think that it might have something to do with it. If somebody could have a quick look through it it would be greatly apreciated.

Attachments
<?php
/**
* @package Mambo Open Source
* @copyright (C) 2005 - 2006 Mambo Foundation Inc.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*
* Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure
* that Mambo remained free Open Source software owned and managed by the community.
* Mambo is Free Software
*/

/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

if (!defined( '_MOS_POLL_MODULE' )) {
	/** ensure that functions are declared only once */
	define( '_MOS_POLL_MODULE', 1 );

	function show_poll_vote_form( $Itemid ) {
		global $database;

		$Itemid = mosGetParam( $_REQUEST, 'Itemid', 0 );

		$query1 = "SELECT p.id, p.title"
		."\nFROM #__poll_menu AS pm, #__polls AS p"
		."\nWHERE (pm.menuid='$Itemid' OR pm.menuid='0') AND p.id=pm.pollid"
		."\nAND p.published=1";

		$database->setQuery( $query1 );
		$polls = $database->loadObjectList();

		if($database->getErrorNum()) {
			echo "MB ".$database->stderr(true);
			return;
		}

		if ($polls) foreach ($polls as $poll) {
			if ($poll->id && $poll->title) {

				$query = "SELECT id, text FROM #__poll_data"
				. "\nWHERE pollid='$poll->id' AND text <> ''"
				. "\nORDER BY id";
				$database->setQuery($query);

				if(!($options = $database->loadObjectList())) {
					echo "MD ".$database->stderr(true);
					return;
				}
				poll_vote_form_html( $poll, $options, $Itemid );
			}
		}
	}

	function poll_vote_form_html( &$poll, &$options, $Itemid ) {
		$tabclass_arr=array("sectiontableentry2","sectiontableentry1");
		$tabcnt = 0;
		?>
		<form name="form2" method="post" action="<?php echo sefRelToAbs("index.php?option=com_poll&amp;Itemid=$Itemid"); ?>">
		<table width="95%" border="0" cellspacing="0" cellpadding="1" align="center">
			<tr>
			  <td colspan="2" class="poll"><b><?php echo $poll->title; ?></b></td>
			</tr>
			<tr>
			  <td align="center">
			  <table class='pollstableborder' cellspacing='0' cellpadding='0' border='0'>
		<?php
		for ($i=0, $n=count( $options ); $i < $n; $i++) { ?>
			<tr>
			  <td class='<?php echo $tabclass_arr[$tabcnt]; ?>' valign="top"><input type="radio" name="voteid" id="voteid<?php echo $options[$i]->id;?>" value="<?php echo $options[$i]->id;?>" alt="<?php echo $options[$i]->id;?>" /></td>
			  <td class='<?php echo $tabclass_arr[$tabcnt]; ?>' valign="top"><label for="voteid<?php echo $options[$i]->id;?>"><?php echo $options[$i]->text; ?></label></td>
			</tr>
			<?php
			if ($tabcnt == 1){
				$tabcnt = 0;
			} else {
				$tabcnt++;
			}
		}
		?>
			  </table>
			  </td>
			</tr>
			<tr>
			  <td colspan="2" align="center">
			  <input type="submit" name="task_button" class="button" value="<?php echo T_('Vote'); ?>" />&nbsp;&nbsp;
			  <input type="button" name="option" class="button" value="<?php echo T_('Results'); ?>" onclick="document.location.href='<?php echo sefRelToAbs("index.php?option=com_poll&amp;task=results&amp;id=$poll->id"); ?>';" />
			  </td>
			</tr>
		</table>
		<input type="hidden" name="id" value="<?php echo $poll->id;?>" />
		<input type="hidden" name="task" value="vote" />
		</form>
	<?php
	}
}
show_poll_vote_form( $Itemid );
?>
0

I was right, the polls are formatted using tables and the widths are not set... you should edit the file to set the width of the column that contains theradio buttons to a narrow size... just big enough for the radio buttons and some buffer around it...

also the TD tags are using a CSS class, which is dynamic so I can't tell you anything about it... but confirm that A) it exists so the browser can find it... if not it won't give you any error message but the class="xxxxx" part will just be ignored....

That should fix that one... Your images issue is likely the same... you want to send the code for that one, I will look at it too...

Peace,

0

Thanks! Ill try it out after a meeting i have soon, and tell you how it goes then.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.