PDA

View Full Version : Making a website - help!


Benjamin
09-02-2008, 01:09 AM
I've been making a page, and I'm pretty unexperienced.

Anywho, I'm having trouble with getting rid of white gaps between the images and table, leaving it extremely ugly.

Does anyone know how to fix this?

My site (http://www.freewebs.com/websitecreation101/index.html).

It's an assignment for school, by the way. We're required to build a website on how to build a website. :?

Gus the Crocodile
09-02-2008, 02:55 AM
You have cellpadding="0" and cellspacing="3" in your first table tag, which works fine, but you haven't specified these attributes for any other tables so it's probably falling back on defaults (whatever the browser defines those to be). Simply setting both cellpadding and cellspacing to zero in the next two table tags after that initial one seems to fix it for me.

I'd also recommend adding a <!DOCTYPE whatever> (http://www.w3schools.com/tags/tag_doctype.asp) tag on the first line so browsers know what they're rendering, and cutting out all the deprecated stuff like font tags and align and bgcolor attributes in favour of style sheets, but that could just be because I'm anal about standards; your teacher might not even notice for all I know. I'd hope they would though; pre-4.01 HTML shouldn't be being taught.

Benjamin
09-02-2008, 03:23 AM
Oh wow, thank you so much!

That definately fixed the problem for me, thank you!

Also, I was trying to use !DOCTYPE until I realised that it required CSS, which I'm not really interested in at the moment.

Smoko
09-02-2008, 10:21 AM
Also, I was trying to use !DOCTYPE until I realised that it required CSS, which I'm not really interested in at the moment.

They do? Since when?

Scott
09-02-2008, 11:25 AM
Hmm, I clicked on the link and it said the website wasn't found.

TSPhoenix
09-02-2008, 12:42 PM
Tables are not for layout, tables are for tabular data.
Tables are not for layout, tables are for tabular data.
Tables are not for layout, tables are for tabular data.

Say it with me.
You're new to this so just take it as a lesson. Using tables for layout is like one of the cardinal sins of web design.

Also your page isn't found also. 404'd for some reason.

Benjamin
09-02-2008, 12:54 PM
Yeah, I know it's down now.

I removed the html files for now, I'm trying to fix a few problems.

Also, I decided to use a table for my layout, as I heard that having a 600px-width is the easiest way to make the site compatible for just about every resolution.

I realise that there are better ways to lay it out, but for now, this is the best way to lay it out for me, due to simplicity. I showed the site to a friend earlier, and they were completely mezmorized at how much better mine looked compared to theirs. I'm also pretty sure that what I've done is much more than what our teacher is expecting.

EDIT: I opened my site in IE (I mostly always use Opera), and there is this ugly gap underneath the menu. Does anyone have any clue why its doing that? I've tried a few things, but that gap won't go away!

Smoko
09-02-2008, 01:10 PM
Also, I decided to use a table for my layout, as I heard that having a 600px-width is the easiest way to make the site compatible for just about every resolution.

If I'm doing fixed resolution I usually set it to 785px wide, but for the most part I use percentages. That way it doesn't look tiny on huge resolutions.

Benjamin
09-02-2008, 01:17 PM
Is it possible to a do a percentage with my current layout? :?

Smoko
09-02-2008, 01:28 PM
By changing your widths to percentages instead of pixel values. Also, the starting lesson is horrible.

Benjamin
09-02-2008, 01:37 PM
By changing your widths to percentages instead of pixel values. Also, the starting lesson is horrible.

Thanks. :P

It's exactly what we were told to do, so I was just following the guidelines.

Also, when I changed my widths to 65% (as a test), it was fine on one computer. I went to it on a computer with a bigger resolution, and the banner and menu were all the left side. I've tried everything to get it to center, but nothing is helping.

I opened my site in IE (I mostly always use Opera), and there is this ugly gap underneath the menu. Does anyone have any clue why its doing that? I've tried a few things, but that gap won't go away!

Gus the Crocodile
09-02-2008, 01:56 PM
TSP is right, of course, and if I didn't want to put too much "you're doing it wrong!!" in my previous post I would have said the same. Aside from the abstract "tables are not meant for that" stuff, the real problem with using tables is simply that reading and maintaining your code becomes a nightmare. Regardless, if you intend to do more website construction, it's a lesson you'll learn for yourself in time anyway.

Anyway, the gap below the menu? Linebreaks, I think. Your code near the menu is something like:
<table><tr><td>
<img> (blahblah)<a href blah><img></A>
</td></tr></table>

If you remove the break between the last </a> the </td> that follows it, the gap goes away (on IE6 at least; if you meant IE7 I don't have that to check). I don't know whether IE is incorrect for rendering the break in the first place (it's not unreasonable for it to assume anything in <td> is data to be displayed, since that's what <td> is for), but it's a simple fix nonetheless.

Bourbanog
09-02-2008, 02:02 PM
I lawled at your first lesson. I learnt something new.

Benjamin
09-02-2008, 03:00 PM
Okay, I've done that.

Is there any way that I can center the banner and menu for higher resolutions?

EDIT: Never mind, got it.

TSPhoenix
09-02-2008, 09:24 PM
Apart from making your code vomit worth there are several reasons not to use tables for layouts. Firstly they tend to render unpredictably, they also cause scaling issues on non-optimal screen sizes. I really can't overstate how much you shouldn't do it, as in seriously DON'T.

Secondly your styles are horrible, its impossible to tell what is a link and what isn't due to links being styled the same as everything else. As a rule of thumb you do not underline stuff on the internet unless you are supposed to interact with it in some way. Similarly links are a different colour to normal text for a reason, so you can tell the difference. Change the defaults if you want (changing the intersity/hue is often a good idea) but make sure they are distinguishable and logical.

Also the font tag was deperacated a loong time ago, don't use it. HTML is for content and CSS if for formatting.

Okay, I've done that.

Is there any way that I can center the banner and menu for higher resolutions?

EDIT: Never mind, got it.
Its not centering on mine, and yes cache = cleared. Its left aligned, not like that looks bad or anything.