
|
View Full Version : positioning website in the centre of screen
ive just made a new website using dreamweaver. I made it to fit the resolution 800 x 600. How can i position the screen so that if a user looks at it in 1024 x 768 it is in the centre of the screen and not on the left.
pretty sure this is easy enough to do but can't find out how
www.ianblevins.co.uk
Thanks
Put the whole page in yet another table that stretches accross whole screen. Like this:
<body>
<table width="100%"><tr><td align="center">
here goes your existing age
</td></tr></table>
</body>
the_pm 12-20-2004, 11:22 AM Well, if you're willing to move into this century with the code, you can switch to a strict doctype, place everything into a <div> and apply margin:auto to it.
Oh wait, I just read "Best viewed in IE6 and with 1024 x 768 resolution," which means you'd prefer people use four year old technology anyway, so I guess we have to go with a four year old solution as well. In that case, add align="center" to the first table in your code, or wrap the entire page in yet another <table>/<tr>/<td> with width="100%" and set the alignment within that <td>.
<rant style="flavor:evangelical">
I don't mean to harsh out on you, but the Web is evolving more quickly than ever - people's browsing habits are requiring universal solutions (which is how the Web was created to be in the first place), and it's becoming more important than ever to make sure the right message is being delivered to those who are responsible for development.
</rant>
Edit: FWIW, I don't blame you - I do blame the technology you're using. You're simply a victim of it, and Dreamweaver is considered one of the better visual editors too.
Thanks for the "help".
btw, the info on the homepage was from my previous site, which i simply forgot to remove.
<rant style="flavor:nerd">
Secondly, if someone asks a question on a forum it is more than likely that they don't know the answer to something and need some help. What they don't need is some arrogant cockwatcher looking down their nose at them.
</rant>
the_pm 12-20-2004, 11:46 AM It's no more than the appropriate response to the arrogance of someone telling me my chosen browser and screen resolution are inadequate for viewing your site. Touche, as one might say.
Look, I apologize for coming off this way. My beef is with the way in which the technology you're using handicaps you - most likely without your knowledge of it - not with you personally. The answers you received from me, regardless of their sarcastic nature, are correct, and you have an opportunity to do things properly if you so choose, as you've also been given the correct answer to your question should you choose to update your techniques. That's double the help. Take it as you will.
touche my arse, I might say.
If I was using an outdated method to build a website then you could have pointed that out without using the sacarsim as you did. In this case I'd simply forgot to remove something from an old page. Not everyone learns everything overnight.
the_pm 12-20-2004, 11:59 AM Ahh, I see you've removed the slap-in-the-face statement from your page.
And so I ask that you please accept my sincerest apologies for my tone and demeanor. The attitude I displayed in my first post is no longer the least bit appropriate - please accept the answers I've given to your initial inquiries in the friendliest and most helpful light, as would normally be my desire :)
Lordmusic 12-24-2004, 01:48 AM If CSS is your prefered method (AND I SUGGEST IT)
Do this:
Make a div to surrount the whole page. Call it page.
SO:
<div id="page"></div>
Here's the CSS:
#page {
MARGIN-LEFT: auto;
MARGIN-RIGHT: auto;
}
baboon1000 12-24-2004, 06:36 PM i always just wrap all my code in a div so:
<div align=center>
all my code
</div>
MALdito 12-25-2004, 09:04 PM why? table allign=center does the trick
However, if you wish to center it vertically .. thats a whole other story!
muralee 12-25-2004, 11:04 PM <div> tag with align as "center" option will do the required alignment more precisely. Hence, it can be tried as a solution.
-alb- 12-27-2004, 04:58 PM Originally posted by the_pm
My beef is with the way in which the technology you're using handicaps you - most likely without your knowledge of it - not with you personally.
I wouldn't say that it is the technology that is handicapping him as much as it is his own knowlegde. The tools are only as good as the person using them and just because Dreamweaver is a WYSIWYG tool, doesn't mean that it is bad and that you cannot use CSS with it.
the_pm 12-27-2004, 05:12 PM That may be the case, but look at how it's been used here, and ask yourself if the technology was or wasn't responsible for the mess produced on the back end of the site. Once you've learned the ins and outs of the technology, it's possible to use WYSINWOPG tools such as Dreamweaver, as you'll be familiar with their many faults and inherent inefficiencies, and you'll know that the engineering being done backstage is flawed and you'll know how to handle it. I'd just a soon not pay for a piece of software to write faulty code I have to spend twice as long cleaning up later, but in the end that's up to the individual.
Regardless, if you've relegated yourself to allowing the software to write sites the way they were written six years ago, that's a decision you've made, and that's the handicap with which you must work...or as you correctly pointed out, he must gain the knowledge necessary to know better. In this case, that means throwing out the tool that will only teach you bad habits.
|