X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Getting Button Centered (https://forum.x-cart.com/showthread.php?t=44627)

AMMoyer 01-06-2009 08:03 AM

Getting Button Centered
 
1 Attachment(s)
I have got this button in a tpl file that I'm trying get centered horizontally in the box. I have added the following to skin1.css in the Vertical Menu section. I am very green with using CSS so all help is appeciated.
Code:

}
.MmySearchBox {
    margin: auto;
}


.tpl file:
Code:

{capture name=menu}
<form method="post" action="mmy.php" name="mmysearchform">
<select name="year2" style="width: 90%;"onchange="javascript:document.mmysearchform.submit ();">
<option value="" selected="selected">Select Year</option>
<option value="2009">2009
<option value="2008">2008
<option value="2007">2007
<option value="2006">2006
<option value="2005">2005
<option value="2004">2004
</select><br>
<select name="make" style="width: 90%;"onchange="javascript:document.mmysearchform.submit ();">
<option value"" selected="selected">Select Make</option>
{foreach item=row from=$row}
<option value="{$row.makeid}">{$row.makename}</option>
{/foreach}
</select><br>
<select name="model" style="width: 90%;"onchange="javascript:document.mmysearchform.submit ();">
<option value="" selected="selected">Select Model</option>
</select><br>
<font class="mmysearchbox"><input name="getparts" type="submit" value="Get Parts" />
</form>
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_mmy_search menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}


ARW VISIONS 01-06-2009 08:08 AM

Re: Getting Button Centered
 
your class assignment has a lowercase M while the definition has an uppercase M.

They must match exactly.

AMMoyer 01-06-2009 08:21 AM

Re: Getting Button Centered
 
Yeah, I caught that right after I posted, but the button remains on the left. Checked it with Firebug and it seems to be pulling the correct font class for the button. Is the font class statement in the .tpl file in the correct place?

Thanks!

jholley 01-06-2009 08:35 AM

Re: Getting Button Centered
 
If this is all in a table, then just put align center i the <td>

AMMoyer 01-06-2009 09:21 AM

Re: Getting Button Centered
 
No table. The pulldown boxes and the button are in a single form which is "in" div tags from the rounded corners mod. I would be OK with all elements of the form being centered in the box if that makes any of this easier.

Here is the part of the CSS file that Firebug is saying the form is in.

Code:

div.xboxcontent div{
padding: 0 4px 0 8px;
}

* html .xboxcontent {
height:1px;
}


ARW VISIONS 01-06-2009 09:22 AM

Re: Getting Button Centered
 
wrap the button in a div tag, set width to 100% AND ALIGN TO CENTER

jholley 01-06-2009 09:24 AM

Re: Getting Button Centered
 
try removing the "center" attribute and setting margin to auto
margin: auto;


All times are GMT -8. The time now is 12:00 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.