I am in no way html/website savvy, but I bought Dreamweaver and “Dreamweaver For Dummies” and have built a website sufficient and pretty enough for our business, but I cannot, for the life of me figure out how to make it so that the body of the website is centered, no matter the size of the monitor on which the website is viewed. Kinda like now, this message board is centered on my screen. And would be centered on any screen viewing it, there isn’t a lot of extra space on one side of the screen or anything.
I’ve gone to a few trouble shooting sites and followed the directions I’ve read, but no luck.
Also, not sure if this matters, but I’m using a Mac.
If it is in tables, put an align=“center” on the table tag wrapping around all the content.
If it is using divs and CSS, it’s more complicated. I have to run to work, but this site explains how to do it. I’m sure another Doper (or myself) can check back if you’re still having problems.
Whether you’re just starting out or need a good reference to how all this is supposed to work, try Html Help. I found this site invaluable when I first started messing with making my own web stuff, and I continue to use it as a refence.
Unfortunately, not all your web page behavior comes from the html tags. The behavior and appearance of those tags can be extended and modified by styles, so for that you’ll need to study Cascading Style Sheets. They’re very powerful, but tricky. Even after years of doing this I don’t know all the ins and outs of style sheets.
Just because you can do this doesn’t mean you should do it.
Centering all the text in the body of the website is a textbook example of ugly web design. Leave centering for headings or graphics. Large blocks of centered text just plain looks bad.
Are you talking about centering the text in your web page, or centering the browser window in the monitor? If the former, then see the suggestions above. If you’re talking about the latter, then you as a developer have absolutely no control over it.
From my read of the OP, he’s not trying to center the copy, just the area that the copy goes into.
My advice would be to make a table, set the table size for a percent (width =95%) and center the table that you put the content into.
Use the Code and Design view in Dreamweaver (it helped me), open up a fresh page and set up a table. Play with it in the design until you like what you see.
You know, the few small websites i’ve created use CSS, and i think it’s definitely preferable.
But, to be honest, i think this finger-wagging about using tables is fucking stupid. Yes, i’m well aware of the variety of reasons–from usability to accessibility to separating content from layout–for using CSS rather than tables, but the fact is that CSS can still be a major pain in the ass for people who aren’t web-design experts.
Even leaving aside browser differences, which can be a real shit to code for, the fact is that, for most people, putting together a decent-looking website is light years easier using tables than using CSS. If you’re relatively new to CSS, especially for the purposes of layout, it can literally take you hours to put together a webpage that would take all of 20 minutes using tables. Things like making columns work nicely together are just so much easier using tables than CSS that i don’t blame people for taking the easy route.
Sure, once you’ve worked out CSS and got your site set up, it’s much easier to make changes, because you can make drastic site-wide alterations simply by modifying a few lines of code in the style sheet, but for most people this isn’t a huge issue anyway.
I always recommend that people learn and do their best to use CSS, but i think it’s silly getting all haughty with people who decide that it’s just too goddamn hard.
Thanks for all of your help everyone. I’m checking this thread now, kinda late, but I’ll work on all of the above suggestions tomorrow.
I am talking about centering the content of the website, not text. I think on some screens, people may have a bar on the bottom to scroll to the right to see all of my page. I don’t have any important content way over there or anything, it’s just sort of an awkward extension of my page and I’d rather it conform to whatever sort of screen is viewing it.
I’m thinking the table route might be best. That’s more like what I’ve seen. Someone will have their color scheme be, say, red, white and blue, within a table with their banner and sidebar all within a box, with a border, then there will be another color in their scheme, say dark blue in the background behind the box, right?
Which is why, if you are running a business, you should hire someone who is a professional. I don’t care what people do on their hobby sites, but Hertz doesn’t go to the manager’s cousin who works out of his two car garage to make their car repairs, which is why a business that needs to have a website shouldn’t go to the manager’s cousin who uses a copy of Frontpage '97.
This view still hasn’t changed. I work in an office that also has print designers, and clients that need brochures and ads wouldn’t ever think of getting the secretary to make one in Word and print 500 copies on their crappy inkjet printer. Yet people think you can do the equivalent on websites.
This is getting out of GQ territory so I’ll stop here.
That’s overstating it a bit. It’s more correct to say it’s discouraged from within the web coding community. There’s nothing actually detrimental with using tables for formatting a page, though it can restrict a little.
The problem is, CSS doesn’t provide a formatting alternative that is as good and as logical as tables. Something as simple as a fixed height, variable width, three column layout is a piece of cake using tables, but a complete nightmare to figure out with CSS. Almost your only option is to locate a site where someone else has done the hard work and copy from them. And even then it probably won’t work quite so prettily in a couple of stubborn browsers and you’ll have to hack it around.