2

I'm trying to update the pfSense captive portal authentication page, and it appears fine everywhere except for IE (both desktop and mobile versions). The issue is that the upper table row (from a table of 2 rows), is extending to a large size as can be seen in the image below. The HTML is:

    <html> 
<link rel="stylesheet" type="text/css" href="style.css">
<body> 
<form method="post" action="#PORTAL_ACTION#" align="center" > 
    <input name="redirurl" type="hidden" value="#PORTAL_REDIRURL#">
    <input name="zone" type="hidden" value="#PORTAL_ZONE#">
    <center>
    <table class="MainTable">
    <!--Beginning of Form title heading-->
        <tr class="TableTopRow">
            <td class="TableTopCell1">
                <img src="captiveportal-wifi_icon.png" width="50%" height="3%" align="right">
            </td>
            <td class="TableTopCell2" >
                <img src="captiveportal-aragon_logo.png" width="50%" height="3%" align="left">
            </td>
        </tr>
    <!--End of Form title heading-->
    <!--Beginning of main area which contains authentication form and an area reserved for showing errors-->
        <tr class="TableLowerRow" colspan="2" height="70%">
            <td colspan="2" width="100%">
                <div id="mainlevel">
                <center>
                <table height="100%" width="100%" border="0" cellpadding="0">
                    <tr> 
                        <td style="color:#0B173B;font-family:arial; font-weight:bold; font-size:90%"><center>
                            Welcome to Aragon House Business Center
                        </td>
                    </tr>
                <tr>
                    <td>
                        <center>
                        <div id="mainarea">
                        <center>
                        <table width="100%" border="0" cellpadding="1px" cellspacing="2">
                        <tr  height="20%">
                            <td>
                                <div id="maindivarea">
                                <center>
                                    <!-- The statusbox area is where errors will be shown should there be an error when authenticating with the hotspot-->
                                    <div id='statusbox'>
                                        <font color='red' face='arial' size='+1'>
                                        <b>
                                            #PORTAL_MESSAGE#
                                        </b>
                                        </font>
                                    </div>
                                    <!--End of error message area-->
                                    <br />
                                    <!--Beginning of form area; this area will contain fields for authenticating users with the hotspot system-->
                                    <div id='loginbox'>
                                    <table>
                                        <!-- Beginning of area where you input the authentication details-->

                                        <tr><td>&nbsp;</td></tr>
                                        <tr><td align="right" style="color:#333333;font-family:arial; font-size:98%;">Username:</td><td><input name="auth_user" type="text" style="border: 1px solid;"></td></tr>
                                        <tr><td align="right" style="color:#333333;font-family:arial; font-size:98%;">Password:</td><td><input name="auth_pass" type="password" style="border: 1px solid;"></td></tr>
                                        <tr><td>&nbsp;</td></tr>
                                        <tr>
                                            <td align="right" style="color:#333333;font-family:arial; font-size:98%;">Enter Voucher Code: </td>
                                            <td><input name="auth_voucher" type="text" style="border:1px solid;" size="20"></td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" align="right" style="padding-right:10px"><input name="accept" type="submit" value="Continue"></td>
                                        </tr>
                                        <!-- End of area where you input the authentication details-->
                                    </table>
                                    </div>
                                    <!--End of  authentication form area-->
                                </center>
                                </div>
                            </td>
                        </tr>
                        </table>
                        </center>
                        </div>
                        </center>
                    </td>
                </tr>
                </table>
                </center>
                </div>
            </td>
        </tr>
    </table>
    </center>
    <!--End of main area-->
</form>
</body> 
</html>

While the CSS is:

    .MainTable{
    height: 40%;
    width: 30%;
    padding: 0;
    border-radius: 15px;
    border:1px solid #000000;
}

.TableTopRow{
    width: 30%;
    height: 30%;
    background-color:#CCCCCC;
    border-top-right-radius: 15px; 
    border-top-left-radius: 15px; 
    border-top:1px #6DA4DE; 
}

.TableLowerRow{
    height: 70%;    
}

.TableTopCell1{
    width: 50%;
    border-top-left-radius: 15px;
}
.TableTopCell2{
    width: 50%;
    border-top-right-radius: 15px;
}

The following shows how the page appears in IE

This image shows how the page appears in chrome

The first image shows how the form appears in IE, while the one below it shows how the same form appears in Chrome.

Help is greatly appreciated.

Thanks in advance, J

joebegborg07
  • 821
  • 3
  • 14
  • 27
  • which version of IE ?for IE 11 it is working fine https://jsfiddle.net/fqzfbw39/ – Shrinivas Pai Jul 27 '15 at 12:49
  • @SrinivasPai- Im using version 11, however I've tried to replicate the issue on jsfiddle with IE 11, just like you did and it worked fine. It's when I try to open it in the actual browser that it fails to load as intended. – joebegborg07 Jul 27 '15 at 12:53

3 Answers3

1

You have 6 opening <center> and 5 closing </center> . Probably IE is not smart enough to close it properly for you :D

Aramil Rey
  • 3,387
  • 1
  • 19
  • 30
0

Why your css might not be working

adding display: inline; usually fixes these bugs within IE, depending on which version you're on

You're also missing a doctype which fixes a lot of problems in IE Quirksmode IE CSS Fix

Put this at the top of your html page

<!DOCTYPE html>

And while we're at it please for something like this, you should be putting your css in the external file instead of mix and matching. In this day and age it's bad practice to use a table for styling

<div id='loginbox'>
   <table>
      <!-- Beginning of area where you input the authentication details-->
      <tr>
         <td>&nbsp;</td>
      </tr>
      <tr>
         <td align="right" style="color:#333333;font-family:arial; font-size:98%;">Username:</td>
         <td><input name="auth_user" type="text" style="border: 1px solid;"></td>
      </tr>
      <tr>
         <td align="right" style="color:#333333;font-family:arial; font-size:98%;">Password:</td>
         <td><input name="auth_pass" type="password" style="border: 1px solid;"></td>
      </tr>
      <tr>
         <td>&nbsp;</td>
      </tr>
      <tr>
         <td align="right" style="color:#333333;font-family:arial; font-size:98%;">Enter Voucher Code: </td>
         <td><input name="auth_voucher" type="text" style="border:1px solid;" size="20"></td>
      </tr>
      <tr>
         <td colspan="2" align="right" style="padding-right:10px"><input name="accept" type="submit" value="Continue"></td>
      </tr>
      <!-- End of area where you input the authentication details-->
   </table>
</div>
Huang Chen
  • 1,177
  • 9
  • 24
  • This page was a template provided by the pfSense captive portal service, I just amended the areas which concerned me. I did not include the inline CSS code. – joebegborg07 Jul 27 '15 at 12:55
  • @joebegborg07 just my suggestions but if you're working on it, you might as well move the css and give the images and table cells a class for the css. Hope my answer helps :) – Huang Chen Jul 27 '15 at 12:58
  • I'm just after solving the issue, and apply your suggestion at a later stage. On a small note, I've tried `display: inline` to **MainTable** class, however this only removed the colour of the background – joebegborg07 Jul 27 '15 at 13:00
  • have u added the doctype, thats the most important part. Usually the `display: inline` is for IE7/8 – Huang Chen Jul 27 '15 at 13:01
  • Yes I have, yet still the issue persists. – joebegborg07 Jul 27 '15 at 13:02
0

Apparently the issue was the image sizes, which needs to be in pixels rather than percentage.

joebegborg07
  • 821
  • 3
  • 14
  • 27