Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Make width 95% and yet shrink to 750px?

Make width 95% and yet shrink to 750px?

Locked

Views: 2,414

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
7 Mar 2008, 1:17 AM
#1
coolglobal avatar

coolglobal

New Zenner

Join Date:
Jul 2007
Posts:
64
Plugin Contributions:
0

Make width 95% and yet shrink to 750px?

I would like to make the page width 95% and when the browser window is reduced the page shrinks to 750px. How can I achieve this?

The stylesheet currently has the page width of 95%.

mainWrapper {
background-color: #ffffff;
text-align: left;
width: 95%;
vertical-align: top;
border: 2px solid #00AFF0;
}

Your help is very appreciated!

9 Mar 2008, 7:46 AM
#2
coolglobal avatar

coolglobal

New Zenner

Join Date:
Jul 2007
Posts:
64
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

Surely there is a simple solution?

9 Mar 2008, 12:58 PM
#3
brickoneer avatar

brickoneer

New Zenner

Join Date:
Mar 2008
Posts:
22
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

Why not add something like:


width: 95%;
min-width: 750px;

IE does not support the min-width feature, most other browsers do. Google around for a fix for IE.

9 Mar 2008, 2:23 PM
#4
coolglobal avatar

coolglobal

New Zenner

Join Date:
Jul 2007
Posts:
64
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

Thank for the tip Brickoneer.

Yep, min-width works fine in firefox. After a bit of a search I found that min-width should also work for ie7, haven't tested this though. A hack like this may may also work, (didn't work for my version of ie though):

min-width: 800px;
width:expression((document.documentElement.offsetWidth < 820)? “800px”: “auto” );

See more: HERE

12 Mar 2008, 11:48 PM
#5
jakedownhere avatar

jakedownhere

New Zenner

Join Date:
Aug 2006
Posts:
38
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

I'm trying to get mine to go to 100% but am having no luck. I have changed mainWrapper in the CSS files to be 100% from the 85% but it still hasn't changed.

Is there anywhere else that controls the overall width of the entire site?

Thanks!

Jake

13 Mar 2008, 1:12 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Make width 95% and yet shrink to 750px?

That depends on what template you are using.

Some templates set widths for the parts of the page as well as for #mainWrapper, and some commercial templates have all sorts of non-standard tags for parts of the page, so standard fixes are irrelevant.

And are you sure you edited the right copy of stylesheet.css? It needs to be the one in the template folder you have active.

With a link to your site, we could tell you exactly what will work in your case.

13 Apr 2008, 11:33 AM
#7
philpalmer avatar

philpalmer

Zen Follower

Join Date:
Dec 2005
Posts:
105
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

I'm having the same sort of problems.

My site seems to display nicely in 800 resolution or in a reduced size window - but in full screen it throws the graphic across to the right.
Is there any way I can stop this. Basically i'd like my site to be no wider than the width of the logo? or just slightly bigger say 800 pixels maxium - regardless of the resolution being used.
I guess its something in the stylesheet but I've played about with it and nothing seems to change regardless of what I do.

The site is https://www.rosebarnnursery.co.uk
thanks

Phil

13 Apr 2008, 11:42 AM
#8
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,844
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

#mainWrapper {
        width:741px;
	margin: auto;
} 

Add the part in red

13 Apr 2008, 12:01 PM
#9
philpalmer avatar

philpalmer

Zen Follower

Join Date:
Dec 2005
Posts:
105
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

thanks Mike but that doesn't seem to work either. It just seems to ignore what I put in the css file.

13 Apr 2008, 12:05 PM
#10
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,844
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

Actually it work fine but your logo is only 741px wide so 800px looks stupid.....which is what you put there

13 Apr 2008, 12:10 PM
#11
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,844
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

you also need to adjust this statement:```
#navColumnOneWrapper, #navColumnTwoWrapper {
margin: 0 0.5em;
}


To read:```
#navColumnOneWrapper, #navColumnTwoWrapper {
	margin: 0 0.5em 0 0;
}

To get the left column to line up

13 Apr 2008, 12:13 PM
#12
philpalmer avatar

philpalmer

Zen Follower

Join Date:
Dec 2005
Posts:
105
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

Thanks Mike

I've changed the css to 741px as you put but on my browser it still doesn't work. I've tried deleting the history and refreshing but to no avail. I am using IE 7.0
I'll try it on a different pc and see if it displays right.

Thanks

Phil : )

13 Apr 2008, 12:20 PM
#13
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,844
Plugin Contributions:
0

Re: Make width 95% and yet shrink to 750px?

ok it is displaying at 741 px wide but what is also happening is that the empty right column is displaying.....which I didn't catch before. so if your not going to use the right column goto admin>configuration>layout settings>Column Right Status - Global and set to 0
Then make that other fix I mention about the left column and everbody should line up