[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Content of html page scatter when resized with browser

Posted on 2013-06-21
8
Medium Priority
?
1,014 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 84

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 

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 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

650 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