PDA

View Full Version : Off Topic HTML Question


WillySurvive
20th Jun 2003, 05:22 PM
If I wanted to make a page with an eighty pixel blank area (frame?) on the left side and the same on the right side with the rest of the display to go in the middle how could I do that? It seems like it should be simple but the html tuts I looked at in the past didn't point out exactly how to do that. Or at least they didn't in a way I could understand.

I'm using WebFoot as the HTML editor.

Birelli
20th Jun 2003, 08:30 PM
For something with that effect I personally would do this:
<html><body>

<table width="80" align="left">Stuff in the left column</table>

<table width="80" align="right">Stuff in the right column</table>

<table>Stuff in the center</table>

</body></html>

(code crunched to save space)


If you want blank side columns then just don't put anything in the left and right side tables.

I personally have a strong distaste for frames, I instead prefer to do tables like that and if needed on every page just include it on every page using PHP. If you want to use frames or for any web-design stuff I'd recommend http://www.w3schools.com (if you haven't already looked there), it's where I look up all my HTML.

WillySurvive
20th Jun 2003, 08:39 PM
Thank you very much!

Birelli
20th Jun 2003, 08:47 PM
It just occurred to me that since you just want blank space (at least I think that's what you mean) on either side, that there is a second (and much more elegant IMO) solution using CSS:

<html><body>

<style>
.normal { margin-left: 80px; margin-right: 80px; }
</style>

<span class="normal">Body of the page</span>

</body></html>


Some browsers (maybe all, I'm just not positive about this), also support making the statement:

<style>
body { margin-left: 80px; margin-right: 80px; }
</style>


If you do it that way, you don't need the <span> tag to set which style you're using, since just plain "body" as a style is used as the default. Again, w3schools covers the CSS stuff in much more depth.

WillySurvive
20th Jun 2003, 10:03 PM
Thanks again.

tarquin
25th Jun 2003, 08:27 AM
All browsers should support:

<style>
body { margin-left: 80px; margin-right: 80px; }
</style>

If you want stuff to the left & right, use CSS columns (http://css-discuss.incutio.com/?page=ThreeColumnLayouts).