chrometweaks.org

Best iPage web hosting Companies in India?

Click Here To View All Answers...


Got a question, hope someone can answer... Best iPage web hosting Companies in India? Thanks for any answer or 2. Another question on my mind: Usually I'd use this code below to center something both horizontally and vertically. It works in most browsers... Unfortunately, I get an error when validating a page with this code in it, the TABLE element does not have the height attribute. How would I accomplish the same, but using valid HTML 4.01?..

Comments (9)

Good question... I dunno what is the answer to your question. I'll do some poking around and get back to you if I got an good answer. You should email the people at iPage as they probably could give you an answer..

Comment #1

Deprecated does not mean that it's not valid. The W3C HTML 4.01 Validator does not complain about it.. If it was invalid, I'm sure it would mention it, it never misses anything else..

Comment #2

Deprecated means that while it is still included in the.

Loose.

Version of this level of HTML, it is unlikely to be included in future versions of HTML, and therefore you should try to avoid it as it may not be well supported by user agents in the future..

Deprected means it is about to be phased out. It is still in, for now; but might not be so for very much longer..

See also:.

Http://www.htmlforums.com/showthread...5&pagenumber=2.

And maybe:.

Http://www.htmlforums.com/showthread...threadid=17971..

Comment #3

Actually Rydberg, if you want to get technical.

Valign="middle" align="center".

Those are also deprecated and shouldn't be used. the validator should have told you the errors on those as well..

And it isn't just tables, but all block level elements..

Just an FYI..

Comment #4

Yes you're right scoutt, I am still a bit old-school when it comes to tables, I guess. However, this is what I'm using now...

The next step would be to use DIV instead, but I don't know how to set the height to 100% in a DIV, or how to align it vertically in the middle, whatever the problem is..

This apparently won't do the job. how then?..

Comment #5

In a div you have to use top and left I believe...

Comment #6

Hhmmm. ok first off setting your div height to 100% will only work if it has some value to to fill to 100%, ie it's parent container the body, so if you have body height set to 100% then the div will also go to 100%, otherwise it will just size to it's content..

And yup, scoutt it is top and left, example being:.

Div.left{.

Position:absolute;.

Left:100px;.

Top:200px;.

Width:100%;.

Height:100%;.

Background:#ffffff;.

}..

Comment #7

Hmm I haven't thought of the BODY as a parent container that way.. I've never set width and height to the body before. If I don't set width and height to it, why does it still display the background all over the window? It's different... And it didn't work with adding height: 100%; to the body, it still didn't display the DIV in the middle.. and the text got all messed up, it stretched _all_ my text to the bottom, no matter where it was.. Meaning I got about 48pt line-height which I didn't ask for.

Maybe I'm not doing it right... I don't understand what you mean when you say I have to use top and left.. How can I use that to position it in the middle and center? I can't use any fixed sizes. The whole point was to do it with vertical-align and text-align.... ?

Comment #8

Sorry rydberg, I gave you a half ****ed answer there lol,.

Vertical-align doesnt work on block elevel elements like divs,use this to center it.

Div.centered {.

Position: absolute;.

Top: 25%;.

Left: 25%;.

Width: 50%;.

Height: 50%;.

}.

And you need to set your body like this.

If you truly want your div to be 100%, try without this first!).

Body {.

Height: 100%;.

Padding: 0;.

Margin: 0;.

}..

Comment #9

Thanks leoo24, but it still won't really do what I want it to.. Well it was close, but the text does that weird thing as soon as I alter the height of the body.. It gets like double line spacing or something, I have no idea why. Anyway, using a DIV doesn't seem like the optimal solution right now, I think I'll stick to my TABLE for now, and try to exercise using DIV's later on, although it's not recommended to use TABLE's for the layout. Thanks anyway..

Comment #10


This question was taken from a support group/message board and re-posted here so others can learn from it.