Content of html page scatter when resized with browser

I have the css and html below. Everything looks good if the page is in a normal view but once I begin to resize my browser, the content begins to scatter meaning I might not be able to view the page in a hand held device.
How can I correct this?




* Html
-------------------------------------------------------------*/

html {
    background-color:#D8D8D8;
    margin: 0;
    padding: 0;
}


  * {
        padding: 0px;
        margin: 0px
    }


/* Page level
--------------------------------------------------------------*/
 #page-level
    {
        max-width:960px;
        margin:0 auto;
        padding-bottom:0;
       
    }

/* Header
--------------------------------------------------------------*/
    #ameHeader
    {
      background-image:url('../images/Ame_Revised_Header.png');
      max-width: 960px;
      height: 100px;
    }


/* Body
--------------------------------------------------------------*/    
    #mybody
    {
        background-color:white;
        margin:0;
        padding:0;
        min-height: 700px;
        font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
        font-size: .85em;
    }
   
   
 /* Footer
--------------------------------------------------------------*/  
    #ameFooter
    {
        background-image:url('../images/Ame_Footer.png');
        max-width: 960px;
        height:40px;
        border-top:5px solid red;  
    }
   
    #ameFooter p
    {
        color: White;
        text-align : center;
        padding-top: 6px;  
    }
   
   
 /* Others
--------------------------------------------------------------*/  
    .username
    {
        float:right;
        color:White;
        padding-right: 4px;
    }
   
    #ameHeader p
    {
        color: White;
       
    }
   
    .title
    {
       float:left;
       color:White;
       padding-top: 40px;
       font-weight:bold;
       font-size:x-large;
       padding-left: 4px;  
    }
   
    .uploadSection
    {
        padding-left: 20px;
        padding-top: 25px;  
    }
 
    h2
    {
        padding-left: 20px;
        padding-top: 10px;
    }

    button
    {  
        color: #FFF;  
        background-color: black;  
        font-weight: bold;
        max-width:90px;
        height:35px;
        border: 3px solid #900;
    }
   
   td
   {
       font-family: Arial;
       font-size: 12pt;
       font-weight:bold;
       }
       
   .spaceSecondDiv
   {
        padding-top: 140px;
        padding-left:80px;      
   }

******************************


<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Services</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
    </head>
    <body>
        <div id="page-level">
            <div id="ameHeader">
                <p class="title">ONLINE  PROCESS</Title></p>
                <p class="username">@User.Identity.Name</p>                            
            </div>
            <div id="mybody">
                @RenderBody()
            </div>
            <div id="ameFooter">
              <p> © Crazy Services, Inc. 2013. </p>
            </div>
       
        </div>
        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: false)

    </body>
</html>
SirdotsAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Scott Fell, EE MVEConnect With a Mentor Developer & EE ModeratorCommented:
If you don't want to show your url, it helps to put it to jsbin or jsfiddle.  Please see this version I made for you http://jsbin.com/iyidow/1/edit by clicking html and css tabs at the top, you can view just the rendered html.  I don't see anything scattering but I do see when you narrow the browser it stays off the page.  As suggested you will need to use media queries.  

There is nothing wrong with tables if used for tabular data.  In this case, they will get in your way with what you want to do.  I would suggest getting rid of the tables and use Div's instead.  

Here I have recoded using div's instead of your table.  http://jsbin.com/iyidow/2/edit  Not pretty for now, but you can see it is on the path to what you want.
0
 
Dave BaldwinFixer of ProblemsCommented:
Things like "@User.Identity.Name" mean nothing here because that's not what is seen by the browser.  You need to post a link or the HTML from the "View Source" so we can see what the browser sees.  For all we know, you could be putting 1000 characters in there for "@User.Identity.Name".
0
 
COBOLdinosaurCommented:
Yeah if you want real answers you need to give us a real link.  My preliminary asesment is that you are getting what you asked for because you are using inflexible values in pixels.  You may need to use media queries, and you position/dimensioning values may need to be converted to percentage em, or possibly viewport relative values.

Cd&
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
SirdotsAuthor Commented:
Thanks. Unfortunately I dont have this page online but here is my view source

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>AmeriPride Services</title>
        <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        <link href="/Content/site.css" rel="stylesheet"/>

        <script src="/Scripts/modernizr-2.5.3.js"></script>

    </head>
    <body>
        <div id="page-level">
            <div id="ameHeader">
                <p class="title">ONLINE SCRIPTING PROCESS</Title></p>
                <p class="username">CORP\F44ld</p>                            
            </div>
            <div id="mybody">
               

<h2>File upload section</h2>


    <form method="post" action="">
    <div class="uploadSection">
        <table>
            <tr>
            <td>Select script</td>
            <td>            
                <select name = "mydropdown">
                    <option value="12.1">12_1_flat_goods_bm_2_to_1</option>
                    <option value="12.2">12_2_mats_bm_1_2_to_3</option>
                    <option value="13">13_deliverybilling</option>
                    <option value="15">15_customersurvey</option>
                    <option value="16">16_costprice</option>
                    <option value="17">17_product_description</option>
                    <option value="18">18_emblem_template</option>
                    <option value="20">20_add_sample_product</option>
                    <option value="21">21_wearerinv_cleanup</option>
                    <option value="22">22_statementlayout</option>
                    <option value="23">23_customer_style_conversion_garments</option>
                    <option value="24">24_customer_special_charge</option>
                    <option value="25">25_customer_style_conversion_nongarments</option>
                    <option value="26">26_customer_size_conv_garments</option>                  
                </select>          
            </td>
            <td>Path to source file: </td>
            <td><input type="text" name="path" size="35"  /></td>
            <td><button type="submit" value="Submit">Upload File</button></td>
            <td><button type="submit" value="Submit">Submit</button></td>          
            </tr>            
        </table>
    </div>
    <div class="spaceSecondDiv">
            <table>
            <tr>
                <td>
                    <textarea cols="60" rows="15" ></textarea>
                </td>
            </tr>
            </table>
    </div>
    </form>








            </div>
            <div id="ameFooter">
              <p> © Pride Inc. 2013. </p>
            </div>
       
        </div>
        <script src="/Scripts/jquery-1.7.1.js"></script>

       

    </body>
</html>
0
 
COBOLdinosaurCommented:
The following require attention:

Using a table to layout a form makes it extremely lacking in responsive capabilities.

The very long strings in the options of the select force the select and the cell containing to be wide and rigid.

I don't see anything you are doing to actually control the layout under variable conditions.
"<meta name="viewport" content="width=device-width" /> guarantees nothing but trouble if you do not have media queries to apply styling for different devices.

Cd&
0
 
SirdotsAuthor Commented:
Thanks coboldinosaur. so what do you suggest I do? what is media queries? so what are your suggestiongs? Remove the table right?
0
 
SirdotsAuthor Commented:
Thanks a lot for this. Very helpful
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.