Solved

Content of html page scatter when resized with browser

Posted on 2013-06-21
8
989 Views
Last Modified: 2013-06-23
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>
0
Comment
Question by:Sirdots
8 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39267209
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39267250
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
 

Author Comment

by:Sirdots
ID: 39267294
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39267320
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Sirdots
ID: 39267328
Thanks coboldinosaur. so what do you suggest I do? what is media queries? so what are your suggestiongs? Remove the table right?
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39267335
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39267343
0
 

Author Closing Comment

by:Sirdots
ID: 39270223
Thanks a lot for this. Very helpful
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Form Processing in PHP 11 32
ASP.NET 5 Templates 2 66
How to add an image from an outside source to your signature in office 365 3 24
Objects on Same Line 2 18
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now