Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / How to Align and resize input boxes?

How to Align and resize input boxes?

Locked

Views: 5,402

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
3 Aug 2009, 12:08 AM
#1
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

How to Align and resize input boxes?

Hello all,

I have a series of 7-10 attribute input boxes. They are currently different lengths and not aligned vertically. Is there a simple way to make them all the same length and align them vertically?

Any help is greatly appreciated.
Thank you.

3 Aug 2009, 1:38 AM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How to Align and resize input boxes?

A URL would help here....

But off the top of my head.

They are not aligned because the option names are not the same length. You can set the width of the option names with a css rule added to the bottom of the stylesheet something like:

.optionName{width:150px;}

change the 150px to suit your site.

I am surprised that the inputs are different lengths. What sort of inputs are they. Gosh a URL would help :smile:

3 Aug 2009, 2:21 PM
#3
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: How to Align and resize input boxes?

niccol:

A URL would help here....

But off the top of my head.

They are not aligned because the option names are not the same length. You can set the width of the option names with a css rule added to the bottom of the stylesheet something like:

.optionName{width:150px;}

> 
> change the 150px to suit your site.
> 
> I am surprised that the inputs are different lengths.  What sort of inputs are they.  Gosh a URL would help :smile:

Sorry about that Niccol! 

Here's an URL.

<http://www.kcbgraphics.com/index.php?main_page=product_info&cPath=10_6_7&products_id=12>

I have tried .optionName bit it doesn't seem to effect the length of the input box, only the space after the Option Name before the input box starts.

I'm using ZC 1.3.8
PHP5.2.9
MySql 5.0.81
3 Aug 2009, 5:08 PM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How to Align and resize input boxes?

Well optionname does exactly what you have discovered.

By default the select dropdown type menus are rendered just big enough to fit the contents. To change this you could add:

#productAttributes select{width:300px}
3 Aug 2009, 5:37 PM
#6
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: How to Align and resize input boxes?

niccol:

Well optionname does exactly what you have discovered.

By default the select dropdown type menus are rendered just big enough to fit the contents. To change this you could add:

#productAttributes select{width:300px}


Thanks Nick!

That works with well with the attributes that have a drop down of choices but not for a text or upload attribute.
You can see it in the link I provided earlier.
Any ideas on these two??
Sorry for my ignorance on this!!
3 Aug 2009, 5:46 PM
#7
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How to Align and resize input boxes?

Well the text input should be no problem. It will be something like:

#productAttributes input{width:300px}

but I can't find one of those on your site.:smile: but maybe I am missing it.

The "input type=file" which produce the upload boxes are notorously difficult to style. That is what the link I sent you is about. I thought I had talked about this but when I re-read my posts I realise I haven't (going mad:wacko:)

Browsers are very uneven about how they display these fields. Applying styles is fairly random in my experience.

Not a perfect answer I am afraid but maybe someone out there has better advice??

3 Aug 2009, 6:24 PM
#8
kcb410 avatar

kcb410

Zen Follower

Join Date:
Dec 2008
Location:
Toronto
Posts:
348
Plugin Contributions:
0

Re: How to Align and resize input boxes?

niccol:

Well the text input should be no problem. It will be something like:

#productAttributes input{width:300px}

> 
> but I can't find one of those on your site.:smile: but maybe I am missing it.
> 
> The "input type=file" which produce the upload boxes are notorously difficult to style.  That is what the link I sent you is about.  I thought I had talked about this but when I re-read my posts I realise I haven't (going mad:wacko:)
> 
> Browsers are very uneven about how they display these fields.  Applying styles is fairly random in my experience.
> 
> Not  a perfect answer I am afraid but maybe someone out there has better advice??

Thanks Nick! I appreciate your help.