Jump to content

align latest products


Guest maffs

Recommended Posts

Hi there,

Bit of a dumb question but how can i get the latest products to align centrally on the home page? When i float: center (index.tpl) i only get the products in a vertical line (not what i want). There must be a way but i think im missing something, i've even added a layer and tried to align that but to no joy!!!

Can anyone help

Thanks in advance

Chris

Link to comment
Share on other sites

Did you read the post about "READ THIS BEFORE POSTING"?

Just curious, because I don't see #5 - name of skin or link to store.

No matter - if you are using Killer, it has a variable width to fit browser window, I can't help you.

If you are using Legend or Classic (fixed width), you can accomplish this by trial and error.

Open includes/contents/index.inc.php

Find where VAL_WIDTH is defined. This will be your thumbnail width setting + a number, probably 75

Increase or decrease that number until you have equal spacing all the way across.

Link to comment
Share on other sites

  • 2 weeks later...

Basically you need to alter the:

includes/content/index.inc.php

skins/youskin/styleTemplates/content/index.tpl

If you would give us more info we could help you but suggest you perform a search first ;)

Link to comment
Share on other sites

Im sure this isn't possible... I have tried many methods and as of yet cant make them centralised... divs work with float left or float right atributes, though float bottom also works... my best tip to you is just have an even number of products and if you do but the whole group is floating to one side add some padding to them...

Link to comment
Share on other sites

Guest estelle

aikdo, checkout "margin: auto" ;)

It is possible to align a div centrally using "margin: auto" (although only the left and right margins need to be set to auto). However when you have multiple divs that you want side by side, they will have to be floated and so they can only be left or right aligned, but they can be all be placed within a larger div that is centrally aligned.

Therefore, if you add an extra div around all of the individual latest product divs, you can set this extra div (lets call it a wrapper div) to have a width less than the available space (eg. width: 400px), and set its margin to auto (ie. margin: auto).

Something like this should work, but I'm not a CSS pro so there may be more too it.

Edit: But i'm not sure if it would work with a variable width page (ie. the Killer skin)

Edited by estelle
Link to comment
Share on other sites

  • 2 weeks later...

I am using the killer skin, and was able to center the latest products by changing this line in:

/{VAL_SKIN}/styleTemplates/content/index.tpl

<div style="float: left; text-align: center; width: {VAL_WIDTH}px;">

to:

<div style="float: left; text-align: center; width: {VAL_WIDTH}px; width: 140px; height: 125px;">

Basically you need to give the div a width and height value to position the thumbs according to your site design. Whilst on the topic, I'd like to thank markscarts for the LateProdFix. */*

-Puppy

http://www.coldandcuddly.com/

Link to comment
Share on other sites

Guest vrakas

Im sure this isn't possible... I have tried many methods and as of yet cant make them centralised... divs work with float left or float right atributes, though float bottom also works...

I wouldnt rush and jump in to conclusions of what is and what is not possible */*

What you havent manage to do, doesnt mean that nobody else cant do it.

I and many others have done it on a few sites :(

Link to comment
Share on other sites

I ment centering each individual div in that post which i thought was the question IE if you had rows of 3 divs but one row only had two for those two to centralise but i now realise that was not what was wanted...

If anyone can tell me that they have found a way to centralise the Odd number of divs then great im always waiting for more knowlege but i my voyage through the Css atrabutes i cant see any way that doesn't involve a hack...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...