Click to See Complete Forum and Search --> : Placement and spacing question


Miggy
02-10-2009, 02:08 PM
I got my "picture as a background" issue resolved, thanks to the assistance I got from this board. Now, as I continue to make my website, I have another issue, and I'd like to know if there's a resolution to this.

I have a heading or title that is displayed near the top of the screen and centered. I have researched CSS spacing and how to define an area for a block of text - and how to place it where you want it on the screen. I created an area that extends approx. 3/4 of the way across, scrolls downwards, and should be centered. I knew from my previous attempts at creating a page with CSS spacing that it looks good on my monitor and resolution, but is way off when viewed on a smaller monior / lower resolution. I found the % function and thought that is was the answer. I thought it placed the block of text at a certain percentage of the screen. So I played around with the variables until it looked right on my monitor, uploaded the page, then looked at it with my other PC that is set at a lower resolution. The block of text is off, and skewed to the right.

Is there not any way to get it set up so that anyone who looks at it will view it as I intend? I could use the normal < center > html function, but then the each line of the block of text itself obviously gets centered and that messes up the look.

For reference, here is an example of the code:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test Page</title>
<style type="text/css">
html, body {margin:0; padding:0; width:100%; height:100%; overflow:hidden;}
body {font-family:vladimir script; pristina; brush script mt; font-size:550%;}
#scroller {position:absolute; width:100%; height:100%; top:0; left:0; overflow:auto; z-index:2;}
#content {padding:5px 300px 20px 200px;}

#fixed {position:absolute; top:25%; left:25%; width:950px; z-index:10; color:#99000; border:3px solid #98AFC7;

padding:10px;}
p.topmargin {margin-top: 1cm}
</style>
</head>
<body>
<div id="scroller">
<div id="content">
</div>
<p class="topmargin">
<center>
<font color="#99000">
This Is The Page Title
</center>
<p>
<br>
<div id="fixed">
<p style="font: 16pt/20pt Garamond, Georgia">
This starts the text that should be displayed with several spaces below the heading and also
centered on the page. It displays this way on my monitor at 1920X1200 resolution; however on
smaller monitors at lower resolution, it is displayed directly below and almost on top of the
heading, and skewed drastically to the right. It was hoped that the % function on the CSS spacing
would put it at at certain location on any monitor / resolution, but this is not so.<br>
The following is random text to fill up space:<br>
<br>
American McGee's<br>
Alice<br>
Observations, Comments, & Walkthrough<br>
By Soren Andersen<br>
<br>
"This is an all new Alice adventure, and can be considered a third chapter in her story. It takes place after Alice's

Adventures in Wonderland and Through the Looking Glass, and although it features many characters and places from those

stories, things have definitely taken a turn for the worst in Alice's childhood dreamland..."<br>
<br>
The foregoing is a quote that I found somewhere. There are a lot of things that are unique about this game, different

from most Adventure games. Actually, it is really a Role Playing Game, which is a very close relative of Adventure games,

or perhaps it may be considered an Action game. The dynamic graphics are exceptional, with much detail and continuously

adjustable perspective. There are whimsical quirks thrown in, just one example of many being Alice's breath becoming

visible in an icy scenario.<br>
<br>
EA Games has provided much supplemental information for and about this game. Go to START>Programs>EA GAMES>American

McGee's Alice>Gameplay Help for an Internet help supplement; in the header will be found several categories on which to

click for expansion. In addition, if in the above Start series you choose Web Resources instead of Gameplay Help you will

have the opportunity to access the game's home page, where under the Wonderland choice you will find descriptions and

illustrations of characters you will meet, and maps with none too accurate florid words concerning many locations,

including animated sketches. I strongly advise you to carefully peruse these two help items at the outset of gameplay,

and in addition I suggest that you print the entire Gameplay Help for ready reference while playing.<br>
<br>
</div>
</p>
</font>
</body>

Fang
02-11-2009, 05:24 AM
Avoid using position:absolute for container positions.
No-one will have the fonts you use (invalid use anyway). Use more common font and a default.
font-size:550%; :confused: Use a header element and semantic elements.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>Basic centering</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<style type="text/css">
* {margin:0;padding:0;}
body {text-align:center;
font-family:Garamond, Georgia, serif;
font-size:0.8em;
}
#container {
margin:0 auto;
width:950px;
text-align:left;
border:1px solid red;
}
h1 {
text-align:center;
font-size:3em;
}
</style>

</head>
<body>
<div id="container">
<h1>This Is The Page Title</h1>
<p>This starts the text that should be displayed with several spaces below the heading and also
centered on the page. It displays this way on my monitor at 1920X1200 resolution; however on
smaller monitors at lower resolution, it is displayed directly below and almost on top of the
heading, and skewed drastically to the right. It was hoped that the % function on the CSS spacing
would put it at at certain location on any monitor / resolution, but this is not so.</p>
</div>
</body>
</html>

Miggy
02-11-2009, 08:15 AM
Fang,

Thank you for your suggestions. I will look into that later today.

I put font size=550% because I raised it until it was the right size. If I remember correctly, 600 was too large and 500 too small. In questioning it, are you saying it's too large, or are you saying there's a better way to get the size I want?

Miggy, the Penitent Thief

Fang
02-11-2009, 09:02 AM
500 too small ?? That's what I call huge!

Miggy
02-11-2009, 01:44 PM
That font size looked good on my 24" 1920X1200 monitor. Maybe it'll be too big on other monitors - I'll have to look into that after I resolve the centering issue.

But it sounds like that goes back the original question I had in posting this thread. Why can't you set it up where it looks good on all monitors? Is there a function on the font size that will make it dependent on the resolution set on that computer?

Miggy, the Penitent Thief

Fang
02-12-2009, 01:33 AM
Did you try the code given?

Miggy
02-12-2009, 08:35 PM
I did a preliminary inspection of it at work yesterday. I just came here now (since I'm home) to pull the code onto my home computer and experiment with it. The first thing will be to put the title outside of the box and above it.

Thanks again, and I'll update once I get it finalized.

Miggy, the Penitent Thief

Miggy
02-13-2009, 07:58 AM
Fanq,

I had a little time last night, so I worked in your code into my page.

Your code by itself works, of course, but when combined into mine, the "CSS box" is not centered, but left justified. I tried removing everything from my original page that might have bene interfering, one item at a time. I haven't found what's wrong, so far. I'll see if I have time to look into it some more tonight or tomorrow, but if I can't figure it out, I'll post it here for assistance.

Thanks!

Miggy, the Penitent Thief

Miggy
02-14-2009, 08:09 AM
Okay, I wasn't able to figure out anything, yet, and I won't have time this weekend. Since I'd like to get this page up soon, I'd appreciate any assistance you could give.

Here is the code. I changed the border to 3px and also the color to a gray-ish silver. Also, don't worry about the fonts or the font size on the title - I'll get to that after I figure out the centering.

This is the code you gave me combined into my previous page:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Centering Test</title>
<style type="text/css">
html, body {margin:0; padding:0; width:100%; height:100%; overflow:hidden;}
body {font-family:vladimir script; pristina; brush script mt; font-size:550%;}
#background {position:absolute; z-index:1; width:100%; height:100%;}
#scroller {position:absolute; width:100%; height:100%; top:0; left:0; overflow:auto; z-index:2;}
#content {padding:5px 300px 20px 200px;}
#fixed {
margin:0 auto;
width:950px;
text-align:left;
border:3px solid #98AFC7;
}
h1 {
text-align:center;
font-size:3em;
}
p.topmargin {margin-top: 1cm}

</style>
</head>
<body>
<div>
<img id="background" src="clouds.jpg">
</div>
<div id="scroller">
<div id="content">
</div>
<p class="topmargin">
<center>
<font color="#99000">
Page Title
</center>
<p>
<br>
<div id="fixed">
<p style="font: 16pt/20pt Garamond, Georgia">

American McGee's<br>
Alice<br>
Observations, Comments, & Walkthrough<br>
By Soren Andersen<br>
<br>
"This is an all new Alice adventure, and can be considered a third chapter in her story. It takes place after Alice's

Adventures in Wonderland and Through the Looking Glass, and although it features many characters and places from those

stories, things have definitely taken a turn for the worst in Alice's childhood dreamland..."<br>
<br>
The foregoing is a quote that I found somewhere. There are a lot of things that are unique about this game, different

from most Adventure games. Actually, it is really a Role Playing Game, which is a very close relative of Adventure games,

or perhaps it may be considered an Action game. The dynamic graphics are exceptional, with much detail and continuously

adjustable perspective. There are whimsical quirks thrown in, just one example of many being Alice's breath becoming

visible in an icy scenario.<br>
<br>
EA Games has provided much supplemental information for and about this game. Go to START>Programs>EA GAMES>American

McGee's Alice>Gameplay Help for an Internet help supplement; in the header will be found several categories on which to

click for expansion. In addition, if in the above Start series you choose Web Resources instead of Gameplay Help you will

have the opportunity to access the game's home page, where under the Wonderland choice you will find descriptions and

illustrations of characters you will meet, and maps with none too accurate florid words concerning many locations,

including animated sketches. I strongly advise you to carefully peruse these two help items at the outset of gameplay,

and in addition I suggest that you print the entire Gameplay Help for ready reference while playing.<br>
</div>
</p>
</font>
</body>

Substitute clouds.jpg for whatever picture you have available if you need to see a background in action.

If I could get it to look just like it does now, except the body of the page being centered, then I'll be all set.

Thanks again!

Miggy, the Penitent Thief

Fang
02-14-2009, 02:29 PM
Use the document I gave to center your page.

<font> and <center> are depreciated, don't use them.

Apart from using absolute on the background image, don't use absolute to align blocks of content. It will give you problems later when the content changes.

No-one has the fonts you are (incorrectly) applying to the body. As a consequence I see 'Times New Roman', my default font.

Miggy
02-14-2009, 06:59 PM
Fanq,

Two issues with just using your unmodified code is that 1. I want to keep integrate the "background as an image" that I figured out in another thread here, and 2. the page title needs to be outside of that text block and on top of it. Are you saying that it's not possible?

BTW, the content's not going to be changed on this particular page (it's going to be a subpage of my main page) once I put it up. Also, I know about the font. As I said in my previous post, I'm going to address that once I get the placement issued settled (if it can be settled!)

Thanks again,

Miggy, the Penitent Thief

Miggy
02-15-2009, 11:19 PM
Fanq,

I ran into some unexpected extended free time tonight, and I knew that with enough time I could figure it out. I would edit the post to put [RESOLVED], but I don't know if I even can.

Here's the finished product:


<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test Page</title>
<style type="text/css">
html
body {margin:0; padding:0; width:100%; height:100%; overflow:hidden;}
body {text-align:center; font-family:vladimir script; pristina; brush script mt; font-size:500%;}
#background {width:100%; height:100%;}
#scroller {position:absolute; width:100%; height:100%; top:0; left:0; overflow:auto;}
#background {width:100%; height:100%;}
#content {}
#fixed {margin:0 auto; width:950px; text-align:left; border:4px solid #98AFC7; padding:10px}
p.topmargin {margin-top: 2cm}
</style>
</head>
<body>
<div>
<img id="background" src="clouds.jpg">
</div>
<div id="scroller">
<div id="content">
</div>
<p class="topmargin">
<font color="#99000">
This is the Title
<p>
<br>
<body>
<div id="fixed">
<p style="font: 16pt/20pt Garamond, Georgia">
American McGee's<br>
Alice<br>
Observations, Comments, & Walkthrough<br>
By Soren Andersen<br>
<br>
"This is an all new Alice adventure, and can be considered a third chapter in her story. It takes place after Alice's Adventures in Wonderland and Through the Looking Glass, and although it features many characters and places from those stories, things have definitely taken a turn for the worst in Alice's childhood dreamland..."<br>
<br>
The foregoing is a quote that I found somewhere. There are a lot of things that are unique about this game, different from most Adventure games. Actually, it is really a Role Playing Game, which is a very close relative of Adventure games, or perhaps it may be considered an Action game. The dynamic graphics are exceptional, with much detail and continuously adjustable perspective. There are whimsical quirks thrown in, just one example of many being Alice's breath becoming visible in an icy scenario.<br>
<br>
EA Games has provided much supplemental information for and about this game. Go to START>Programs>EA GAMES>American McGee's Alice>Gameplay Help for an Internet help supplement; in the header will be found several categories on which to click for expansion. In addition, if in the above Start series you choose Web Resources instead of Gameplay Help you will have the opportunity to access the game's home page, where under the Wonderland choice you will find descriptions and illustrations of characters you will meet, and maps with none too accurate florid words concerning many locations,
including animated sketches. I strongly advise you to carefully peruse these two help items at the outset of gameplay, and in addition I suggest that you print the entire Gameplay Help for ready reference while playing.<br>
</div>
</p>
</font>
</body>

I know, I know, no one has Vladimir Script... I just now got the placement working. I'll look for a more common font (why do I have it and no one else does?) that's as close as I can get to that.

Thanks for your assistance, wouldn't have been able to do it without your help!

Miggy, the Penitent Thief

Fang
02-18-2009, 04:26 AM
Here are similar fonts: http://www.informit.com/articles/article.aspx?p=31329&seqNum=3
"Vladimir Script" is a downloadable script and included with some versions of MS Office.
Always define a default font: font-family (http://www.w3.org/TR/CSS2/fonts.html):"Vladimir Script", "Lucia BT", cursive;

Miggy
03-09-2009, 10:01 PM
I finally got it all done. Thanks again for the help. I didn't feel like searching for the prefect elusive font, so I went with one of the old classics, placino linotype :)

Here's the result:

http://www.landowonder.com

Miggy, the Penitent Thief