Author Topic: Possible to set fixed page width, and center in browser?  (Read 4355 times)

Offline hidden

  • Checking the place out
  • *
  • Posts: 7
Possible to set fixed page width, and center in browser?
« on: January 07, 2012, 11:31:53 AM »
Thank you for recommending Xara Web Publisher Samantha, it is fabulous.

But I still have dozens of CSB sites, so it will take a while to rebuild them in Xara.

Is it possible to maybe inert some css code before the /head (or anywhere else) and do what Xara does:

Restrict the page to a set width (800 pixels) and center it in the browser, regardless of what the screen resolution is set to?

In searching the forum, I just learned how to design CSB sites for different screen resolutions. I did that, and added a left border. Looks great at 1024 resolution, but at 800 pixels the main page body gets all scrunched up. I tried different settings, nothing worked.

The only thing I have found that helps is to put all of the contents of the main page body into a Table. I also added a wider (1600 pixels) graphic in the top border. Now at 1024 px the border spreads across the width of the browser, and the page itself is flush left.

That solves the problem of keeping text from spreading out, but it sure will be a lot of work to have to do that on hundreds of pages.

If there is any way to add code into the Page html section of the Page Properties to set a fixed width for the page, that would sure help. Even if it is not centered, that would be good.

Here is the page I did with the contents of the main page body inside a table:

http://carolyn.SilvaCourses.com

Will sure appreciate any help anybody has.

Better and better

Ed

Offline hidden

  • Sami
  • Administrator
  • Senior Member
  • *****
  • Posts: 5924
  • Not a geek. Just a Nerd.
    • CSB Tutorials
Re: Possible to set fixed page width, and center in browser?
« Reply #1 on: January 08, 2012, 01:10:05 PM »
Restrict the page to a set width (800 pixels) and center it in the browser, regardless of what the screen resolution is set to?

No.  You can build with a CENTERED TABLE that forces all your content to stay inside that box, centered on the page.  I use this technique on my samisite home page. http://samisite.com    Here is an image with all the table lines on:  http://www.samisite.com/test-csb/HTMLobj-1457/tablelines_50.jpg  Simply put a table on the page, center it, then copy/move your content into it. The browser will open the page and force all content to remain in the specified size of the table.  You can hide the table lines using the DOTTED LINE option. Do not turn off your lines!   more about layered tables:    http://www.samisite.com/test-csb/layered_tables.htm
BEFORE MAKING ANY HUGE CHANGES to a file be sure to make a copy of your existing tlx design file. If you don't like your changes, you can go back to what you had!


In searching the forum, I just learned how to design CSB sites for different screen resolutions. I did that, and added a left border. Looks great at 1024 resolution, but at 800 pixels the main page body gets all scrunched up. I tried different settings, nothing worked.

Design for the lowest common setting YOU want to support. 800x600 was standard for many years. I design for 1024x768 now as my lowest concern generally since even offices have moved to hardware that uses this setting most.  CSB 5 has the option for % tables. this fixed a lot of problems with different resolutions. Read about it here: http://www.samisite.com/csb5demo_win7/tables.htm

The only thing I have found that helps is to put all of the contents of the main page body into a Table. I also added a wider (1600 pixels) graphic in the top border. Now at 1024 px the border spreads across the width of the browser, and the page itself is flush left.

That solves the problem of keeping text from spreading out, but it sure will be a lot of work to have to do that on hundreds of pages.

Well...yes and no.  CSB was designed for quick updates to any/all pages. BUT whether it would work for YOUR tlx design file or not, depends on how you created your pages in the first place, it could be as simple as making ONE change and it would apply to all pages that were built with the same layout.  Read this post I wrote to someone else needing to make sweeping changes:  http://samisite.com/forum/index.php?topic=681.msg7918#msg7918

If there is any way to add code into the Page html section of the Page Properties to set a fixed width for the page, that would sure help. Even if it is not centered, that would be good.
Nope. Not gonna happen in CSB.

Here is the page I did with the contents of the main page body inside a table:

http://carolyn.SilvaCourses.com
-Samantha
TNG: "Sometimes, you can make no mistakes, do everything right, and still lose" - Capt Picard to Data
(:turtle: In memory of Turtle: May 22, 1944 - Nov 24, 2007  GURU, mentor, and really nice guy! :turtleleft: )

Offline hidden

  • Checking the place out
  • *
  • Posts: 7
Re: Possible to set fixed page width, and center in browser?
« Reply #2 on: January 09, 2012, 03:39:05 PM »
Thanks Samantha,

In reading about css, from what little I could understand, you create a wrapper - a container - for all of the page content, then set the size, and center it. I experimented but couldn't find any way to get the appropriate code where it should go (as best I could tell).

So I did what you did: Created a page with no borders, then put a 2x2 table in the middle of it, merged the 2 cells in the first row and put my header there, then put my left column material in the cell on the left, main page content in the cell on the right - and it worked. More or less. Some of my tables have a lot of blank space at the bottom.

For now, I am just going through my existing pages and taking the text that goes the full width of the main page body and putting it into tables. That restricts the width so that the lines don't spread out when viewed at 1024 resolution.

Many items - text and graphics and tables - I can just center, and they look okay on either screen resolution.

The page is still on the left side of the browser, but I can live with that.

Here is what I ended up with - just a test site, on a nonsense domain:

h**p://mapomnt.com/

So a little touch up work in CSB... and then on to Xara.

Thanks again for all of your help Samantha.

Better and better

Ed
« Last Edit: February 27, 2012, 08:34:47 PM by Samrc »

Offline hidden

  • Sami
  • Administrator
  • Senior Member
  • *****
  • Posts: 5924
  • Not a geek. Just a Nerd.
    • CSB Tutorials
Re: Possible to set fixed page width, and center in browser?
« Reply #3 on: January 09, 2012, 06:57:43 PM »
CSB does offer CONTAINER pages but that is not your best option for what you want to do.

Some of my tables have a lot of blank space at the bottom.
Check out the last two TIPS on this page: http://samisite.com/forum/index.php?topic=557

Yes, building with Tables in CSB is the BEST way to control your text.
And CSB 5 does allow for your tables to adjust with the screen size should you choose that.
-Samantha
TNG: "Sometimes, you can make no mistakes, do everything right, and still lose" - Capt Picard to Data
(:turtle: In memory of Turtle: May 22, 1944 - Nov 24, 2007  GURU, mentor, and really nice guy! :turtleleft: )

Offline hidden

  • Checking the place out
  • *
  • Posts: 7
Re: Possible to set fixed page width, and center in browser?
« Reply #4 on: January 11, 2012, 02:11:52 PM »
Thanks Samantha,

Check this out - Kathy did exactly what I wanted to do... but I don't think she did it on purpose:

http://sweetdreamswinery.com/

She has a picture on the page that is the full width of the page body, and a right border.

I am sure she has her monitor set for 1024 resolution, so it looked good to her - and the picture (and on other pages, tables) forced the main page body to maintain the original width even when viewed on an 800 pixel monitor.

I have noticed that many sites are designed so that all of the most important content shows up in less than 800 pixels, then some of the information on the right peeks out from the right side of the screen. I like that design.

Okay... now I am going to go check the post you referenced and find out why many of my tables have started getting longer and longer and...

Thanks again.

Ed

Offline hidden

  • Sami
  • Administrator
  • Senior Member
  • *****
  • Posts: 5924
  • Not a geek. Just a Nerd.
    • CSB Tutorials
Re: Possible to set fixed page width, and center in browser?
« Reply #5 on: January 12, 2012, 08:29:10 PM »
looks like the right border is turned on and contains links.

Looks fine on several resolutions.
You can turn on/off borders easily in CSB, can apply that page format to MANY pages at one time if you prefer it.

Concerning your tables, give me a link to one of the pages with LOOOONG tables. 
Let me take a look and see what I find...
-Samantha
TNG: "Sometimes, you can make no mistakes, do everything right, and still lose" - Capt Picard to Data
(:turtle: In memory of Turtle: May 22, 1944 - Nov 24, 2007  GURU, mentor, and really nice guy! :turtleleft: )

Offline hidden

  • Checking the place out
  • *
  • Posts: 7
Re: Possible to set fixed page width, and center in browser?
« Reply #6 on: February 25, 2012, 03:38:25 AM »
Hi Samantha,

Do you mean like this page - everything in the entire main page body is inside a table:

http://silvaseminars.com/

Yes, it is a long longer than it needs to be.

Here is another page on the same site. It has a couple of small tables in the main page body, left side, near the top - both are longer than they need to be. It has tables with the buy Now buttons that are the correct width to keep the page from squishing up when I view it at 800 pixels, and they look fine.

http://silvaseminars.com/esp.htm

This page has the table at the bottom, with the Copyright information. It is just 1 row, with 8 point type, but in my Firefox browser it is about 8 inches tall:

http://silvaseminars.com/thetasound.htm

I have updated a couple of dozen web sites now, going to Edit Page Properties to add the right border to all pages, as you mentioned.

Then I go through the site and on all pages that don't already have a table on the main page body that can keep it the correct width, I just copy and paste the table at the bottom, with the copyright information.

Even our big sites with a couple of hundred pages, I was able to do each one in less than an hour.

I also put a table in the top border, to hold the Navigation links and keep them from spreading out across Mr. Silva's picture. I probably could have done that by setting the right margin, but I felt more secure with the table.

Thanks again for your help. I don't even want to think about what it would take to rebuild all of those sites in another program.

Better and better

Ed

Offline hidden

  • Sami
  • Administrator
  • Senior Member
  • *****
  • Posts: 5924
  • Not a geek. Just a Nerd.
    • CSB Tutorials
Re: Possible to set fixed page width, and center in browser?
« Reply #7 on: February 27, 2012, 08:46:51 PM »
Nice job.  Consistent from page to page.

I want to mention to you that CUSTOM FIELDS make it VERY EASY to update copyright and other things like that on ALL pages at the same time.  Take a look at the QUICK TIPS thread for instructions.
http://samisite.com/forum/index.php?topic=557.0
-Samantha
TNG: "Sometimes, you can make no mistakes, do everything right, and still lose" - Capt Picard to Data
(:turtle: In memory of Turtle: May 22, 1944 - Nov 24, 2007  GURU, mentor, and really nice guy! :turtleleft: )