Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Centering site and Fixed width for X-Cart 4.3

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 12-30-2009, 12:20 AM
 
Tim Glavin Tim Glavin is offline
 

Member
  
Join Date: Dec 2009
Posts: 14
 

Default Re: Centering site and Fixed width for X-Cart 4.3

Thanks for all the replies and advice.

For the record. there are three lines that center and set the width. I actually figured it out myself from just simple CSS settings that I was already using in another website.

These settings are in the main.css file

html,body {
height: 100%;
background-color: #ffffff;
margin: 0px;
padding: 0px;
margin-left: auto;
margin-right: auto;

The margin left and right auto cause the page to auto center. These commands are not present in the stock template.
Then just below that in the stock template they set a minimum width and all you have to do is set the max width.

min-width: 780px;
max-width:995px;

Just an FYI, but in the template I am using. 4.3 neon lights
If you set the max width smaller than 995, it causes text to roll over to another line in the cart checkout and looks bad. Who ever designed this template basically set-it up to be used at approx. 1000px or wider.

BTW, Amazon.com is set to a minimum of 980. But their site is completely dynamic. If you have a wider monitor and browser settings the site adds products and images that are not there if the browser and monitor are narrower. Very cool stuff....

Thanks all
__________________
Tim Glavin
X-Cart 4.3
Reply With Quote
  #12  
Old 12-30-2009, 01:29 PM
  D Brugge's Avatar 
D Brugge D Brugge is offline
 

Advanced Member
  
Join Date: Oct 2008
Location: Memphis TN USA
Posts: 80
 

Default Re: Centering site and Fixed width for X-Cart 4.3

Tim,

There is a quirk in the older versions of IE that causes them to not recognize "margin:auto" unless you set the body to text-align:center; you can then set the wrapper (in the case of the 'neon' templates either content-container or page-container) to text-align:left to keep all of your type from centering on the page.

This will keep the margin:auto working for folks who still use IE6 or IE7
__________________
David Brugge
Gold v. 4.3 (but not functional as yet)
Reply With Quote
  #13  
Old 03-04-2010, 12:26 PM
 
phwuser phwuser is offline
 

Newbie
  
Join Date: Apr 2004
Posts: 9
 

Default Re: Centering site and Fixed width for X-Cart 4.3

Which file can I change the centering site and fixed width? Can you provide us the filename? Thanks!
Reply With Quote
  #14  
Old 03-12-2010, 10:23 PM
 
Tim Glavin Tim Glavin is offline
 

Member
  
Join Date: Dec 2009
Posts: 14
 

Default Re: Centering site and Fixed width for X-Cart 4.3

As I stated above it's in the main.css file right in the edit templates at the top.
See ya!
__________________
Tim Glavin
X-Cart 4.3
Reply With Quote
  #15  
Old 04-17-2010, 10:44 AM
 
Brian Peat Brian Peat is offline
 

Advanced Member
  
Join Date: Aug 2004
Location: Mc Connellsburg, PA
Posts: 73
 

Default Re: Centering site and Fixed width for X-Cart 4.3

Just to add to this, if you're using a skin (I'm using the chrome skin) you can edit the altskin.css file instead of the main file.
__________________
X-Cart Gold 4.3.1
Php 5.2.14
MySQL: 5.1.52
My Machine: OS X 10.6.5
Reply With Quote
  #16  
Old 06-18-2010, 05:31 AM
 
rogier rogier is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 1
 

Default Re: Centering site and Fixed width for X-Cart 4.3

For FireFuck you've to ad

html,body {
height: 100%;
width:100%;
background-color: #ffffff;
margin: 0 auto !important;
text-align: -moz-center;
padding: 0px;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 11px;
min-width: 780px;
border: 0px none;
}

in the main.FF style sheet. otherwise it won't work in firefox.
__________________
Version 4.1.8
Reply With Quote
  #17  
Old 02-04-2011, 10:56 PM
 
Wolfgang Hofbauer Wolfgang Hofbauer is offline
 

Newbie
  
Join Date: Dec 2010
Posts: 2
 

Default Re: Centering site and Fixed width for X-Cart 4.3

Am I reading it wrong or is the manual telling me that there is a single spot you place the width and as it is a main setting you can use an "if" statement to ensure the customer sees the fixed width and the admin has flexi.

Can not remember the page at the moment, stumbled across it some months ago but was thinking of doing that now and can not for the life of me find it again.

Making it fixed is better for layout design and the majority of my target market is still under 1000px.

Any samples or ideas on where and how to do this would be appreciated.
__________________
Version 4.4.1
Reply With Quote
  #18  
Old 02-04-2011, 11:07 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Centering site and Fixed width for X-Cart 4.3

in your css file set the width of page-container to whatever you want then add margin:0 auto;
__________________
xcart 5.1.2
Reply With Quote
  #19  
Old 02-06-2011, 01:43 PM
 
Wolfgang Hofbauer Wolfgang Hofbauer is offline
 

Newbie
  
Join Date: Dec 2010
Posts: 2
 

Thumbs up Re: Centering site and Fixed width for X-Cart 4.3

Thanks ARW VISIONS That was simpler compared to using an "if" statement and all.

Should have tried for the simple way first instead of attempting to use the more advanced method described in the manual.
__________________
Version 4.4.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:19 PM.

   

 
X-Cart forums © 2001-2020