Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set min-height of a html page

Tags:

I'm using min-width and min-height to set the minimal width and height of a web page, when u try to resize the window. See snippet blow.

also i have put the html in dropbox. the min-width works in chrome not in IE, the min-height doesn't work at all. What's wrong with my code? Any help would be appreciated.

body {
  min-width: 330px; <!-- This only works in chrome not work in IE -->
  min-height: 400px; <!-- This doesn't work at all. -->
}
fieldset {
  border:5px;
}
select {
  width: 100px;
}
input {
  width: 195px;
}
input, select {
  height: 30px;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
}
table {
  width: 300px;
}
table, th, td {
  border: 1px solid grey;
  border-collapse: collapse;
}
#powered {
  margin-left: 60px;
}
<html>
  <head></head>
  <body>
    <div class="main">
      <form id="form_converter" action="#">
        <fieldset>
          <label>For test, not integrated yet.</label>
          <br>
          <select id="select_currency1" onchange="currency1Changed()">
            <option>USD</option>
            <option>EUR</option>
            <option selected="selected">SGD</option>
            <option>JPY</option>
            <option>CNY</option>
          </select>
          <input type="text" id="currency1" class="number">
          <br>
          <select id="select_currency2" onchange="currency2Changed()">
            <option selected="selected">USD</option>
            <option>EUR</option>
            <option>SGD</option>
            <option>JPY</option>
            <option>CNY</option>
          </select>
          <input type="text" id="currency2" class="number">
          <br>
          <br>
          <table>
            <tr>
              <th>Currency</th>
              <th>Code</th>
              <th>Value</th>
            </tr>
            <tr>
              <td>SGD</td>
              <td>SGD</td>
              <td>1</td>
            </tr>
            <tr>
              <td>USD</td>
              <td>USD</td>
              <td>0.7</td>
            </tr>
            <tr>
              <td>EUR</td>
              <td>EUR</td>
              <td>0.6</td>
            </tr>
            <tr>
              <td>JPY</td>
              <td>JPY</td>
              <td>82.063</td>
            </tr>
            <tr>
              <td>CNY</td>
              <td>CNY</td>
              <td>4.7</td>
            </tr>
          </table>
        </fieldset>
      </form>
    </div>
  <body>
<html>
like image 751
chancyWu Avatar asked Mar 17 '16 05:03

chancyWu


1 Answers

I don't think it's fully possible to restrict the user from resizing the window - see Setting minimum size limit for a window minimization of browser?. You can force it with a popup but min-height only applies to HTML elements, not the browser window itself.

Possibly an answer here that might help.

like image 180
tempranova Avatar answered Oct 12 '22 11:10

tempranova