Help me with some HTML

Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
Post Reply
DarkRanger
Registered User
Posts: 8346
Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:

Help me with some HTML

Post by DarkRanger »

Hi guys.

I have a little problem.

I want to add a login box to the center of a screen for any resolution. So I did this:

Code: Select all

{form action="logingin.php" method="post"}
        {table height = "100%" width = "100%" border = "1px"}
            {tr}
                {td}
                    {table align = "center" valign = "middle" border = "1" width = "364px" height = "166px"}
                        {tr}
                            {td}
                                {table border = "1"}
                                    {tr}
                                        {td class = "rightalign"}
                                            Username:
                                        {/td}
                                        {td}
                                            {input type="text" name="username" id="username"/}
                                        {/td}
                                    {/tr}
                                    {tr}
                                        {td class = "rightalign"}
                                            Password:
                                        {/td}
                                        {td}
                                            {input type="password" name="password" id="password"/}
                                        {/td}
                                    {/tr}
                                    {tr}
                                        {td colspan="2" class = "submit"}
                                            {input type="submit" value="Submit"/}
                                        {/td}
                                    {/tr}
                                    {tr}
                                        {td colspan = "2" style = "textalign:center"}
                                            {a}Not a member yet? Register now!{/a}
                                            {div} {?php echo $msg; ?} {/div}
                                        {/td}
                                    {/tr}
                                {/table}
                            {/td}
                        {/tr}
                    {/table}
                {/td}
            {/tr}
        {/table}
{/form}
At first I thought that I had made a mistake somewhere because it does align center to the screen, but at the top. So I redid it with a plain and basic html file which works out perfectly no matter what size I make the screen. Heres the code of the plain file:

Code: Select all

{html}
    {/head}
    {body}
        {table width = "100%" height = "100%" border = "1px" style = "background:blue"}
            {tr}
                {td}
                    {table align = "center" valign = "middle" width = "400px" height = "250px" border = "1px" style = "background:red"}
                        {tr}
                            {td}
                            {/td}
                        {/tr}
                    {/table}
                {/td}
            {/tr}
        {/table}
    {/body}
{/html}
Now what could be the problem here? I can't see why one works and the other one doesn't. The first one doesn't make the height 100% where the second one does.

Help me!! :cry:

(Sorry, I changed all the < > tags to { } because Nuke doesn't want me to post the tags)
Image
DarkRanger
Registered User
Posts: 8346
Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:

Post by DarkRanger »

I got the mistake. For some or other weird reason, this

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
caused it.

Can someone explain to me why?
Image
Post Reply