Zen Cart Layouts

本文介绍如何通过修改CSS来调整ZenCart商店的布局,包括减少列数以简化界面和缩短加载时间的方法。适用于ZenCart 1.3.x及1.2.x版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Zen Cart Layouts

This tutorial shows how to modify the look and functionality of your Zen Cart store by changing the number of columns. You can do this with most templates. I have written this tutorial with Zen Cart 1.3.x in mind, but the same methods apply to 1.2.x - the CSS will just be used to resize tables instead of divs.

You will need a basic understanding of CSS to merge my sample code into your template's CSS file. My Free Red Zen Cart Template is used as an example.

2 Columns

Simplify your interface and cut download times by dropping a column.

1.   Get rid of a column in the Zen Cart admin panel. I recommend removing the right column. While a right column is common on blogs, people still expect to see the main navigation on the left side or top in a shop.

2.   This leaves the centre column too wide on most monitors. We'll narrow it down with some CSS. I've added a grey background to the page and some padding to the left column to prevent it from going right to the edge of the store.

3.            

4.           body {

5.           color:#000000;

6.           font:.75em/1.5 'trebuchet ms', arial, sans-serif;

7.           background-color:#ccc; /* grey background */

8.           margin:0 15px;

9.           }

10.        

11.       #mainWrapper {

12.       text-align: left;

13.       vertical-align: top;

14.       width:700px; /* sets the width of the store */

15.       background-color:#fff; /* gives the store a white background */

16.       }

17.        

18.       #navColumnOne {

19.       padding-left:10px; /* move the left column inwards */

20.       }

Alternatively, I could add some padding around the whole centre section. The difference is most noticeable around the header image - there is now a white border between it and the grey background.

#mainWrapper {

padding: 0 15px;

}

It looks a lot less like Zen Cart already! I've added the background images just for fun. There is a lot of blank space around the shop now, so why not use it?

1 Column

Still too much clutter? Turn off the other column and make sure CSS navigation tabs are turned on so that Zen Cart's categories are listed in the header. You don't need to change any CSS, unless you want to vertically centre the store as well.

If you are going to vertically centre the store, make sure you have total control over the amount of content on every page - the height needs to stay the same.

#mainWrapper {

height:550px;

position:absolute;

top:50%;

left:50%;

margin-top:-275px;

margin-left:-375px;

border:7px solid #aaa;

}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值