Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   HTML / XHTML / CSS (http://www.programmingforums.org/forum27.html)
-   -   Center a page (http://www.programmingforums.org/showthread.php?t=6758)

Brokenkingpin Nov 1st, 2005 1:47 PM

Center a page
 
I have a page on my site that is done with frames(I know frames are sorta ugly but it works well for this page) and it is scaled perfectly to fit an 800X600 screen. As I put the screen rez higher the page shrinks up to the upper right hand of the screen with lots of white space to the left, which is fine because it still looks the way I want it to. I was just wondering if there is a way to keep this page in the center of the browser no matter what screen rez it is? So if you have a high screen rez the page will appear smaller but will still be centered in the middle of the screen.

Polyphemus_ Nov 1st, 2005 1:49 PM

I never use frames, but maybe setting the width of the left and the right frame to "*" helps.

Brokenkingpin Nov 1st, 2005 2:07 PM

Quote:

Originally Posted by Polyphemus_
I never use frames, but maybe setting the width of the left and the right frame to "*" helps.

If i do that the page gets all messed up at different screen resolutions

iignotus Nov 1st, 2005 2:11 PM

[php]<div align="center">
... your stuff here ...
</div>[/php]

frankish Nov 2nd, 2005 11:39 AM

Yep, you can use <center> but it has been depreciated. Frames have also been depreciated as well. You should look into the HTML coding standards and CSS.

Check out: http://www.htmlhelp.com

DaWei Nov 2nd, 2005 12:44 PM

Deprecation is the process of phasing-out of a feature, usually gradually.
Depreciation is a decrease in value.

Agent 47 Nov 6th, 2005 9:15 PM

It's pretty simple.
:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
/*<![CDATA[*/
body
{
        text-align:center;
}
#container
{
        margin:0 auto;
        text-align:left;
        width:700px;
        height:500px;
        border:1px solid black;
}
/*]]>*/
</style>
</head>

<body>
<div id="container">
        Your st*ff here...
</div>
</body>
</html>


Now, if someone could just point bja888 to this post, he might finally stfu... ;)

--47.

the_relic Nov 6th, 2005 10:05 PM

Quote:

Originally Posted by Agent 47
It's pretty simple.
:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


That is usually a sign of good coding ...

Why do I have the feeling bja888 wouldn't know what that meant? Perhaps it's because his own webpage - meant to show off his talents as a "professional" programmer - doesn't even have a DTD... :p

bja888 Nov 6th, 2005 10:41 PM

Quote:

Originally Posted by the_relic
That is usually a sign of good coding ...

Why do I have the feeling bja888 wouldn't know what that meant? Perhaps it's because his own webpage - meant to show off his talents as a "professional" programmer - doesn't even have a DTD... :p

a) That page was written over 2 years ago, that would make me a sophmore in high school. I had no idea what a DTD was.
b) "professional" programmer ? Welcome to the html area!! and just for good measure. Don't quote something someone never said.

stevengs Nov 7th, 2005 1:18 AM

Quote:

Originally Posted by bja888
..Welcome to the html area!! and just for good measure. Don't quote something someone never said.

what the heck are you on?

Does it even register to you, that the level of respect to which you have inspired other members of this community is such that they even deride you posts to which you have yet to contribute?


All times are GMT -5. The time now is 4:58 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC