max-width在IE中不起作用

时间:2016-03-16 15:34:28

标签: php html css

出于某种原因,无论我在max-width选项中放置什么,我都没有得到任何改变..我让它工作并随机停止,所以我不确定发生了什么。希望我只是错过了一个简单的;某处或某事。我不太喜欢css,但我正在学习,因为我要去。

<?php
$MessageMondayMain = $_POST['MessageMondayMain'];
$MessageTuesdayMain = $_POST['MessageTuesdayMain'];
$MessageWednesdayMain = $_POST['MessageWednesdayMain'];
$MessageThursdayMain = $_POST['MessageThursdayMain'];
$MessageFridayMain = $_POST['MessageFridayMain'];
$MessageMonday = $_POST['MessageMonday'];
$MessageTuesday = $_POST['MessageTuesday'];
$MessageWednesday= $_POST['MessageWednesday'];
$MessageThursday = $_POST['MessageThursday'];
$MessageFriday = $_POST['MessageFriday'];

ob_start();
?>

<META http-equiv='Content-Type' content='text/html; charset=UTF-8'>;
<html>
<head>
<title>GCH Cafe Menu</title>

<style>
.menu {
  background: url(chef2.jpg);
  width: 1200px;
  height: 850px;
  box-sizing: border-box;
  padding-top: 80px;
  padding-right: 605px;
  margin: 0 auto;
  color: black;
  line-height: 100%;
}


.menu h1 {
  font-size: 40px;
  font-family: candara;
  position: static;

}

.menu h2 {
  font-size: 22px;
  font-family: Arial;
  text-decoration: Underline;
  color: green;
  text-transform: uppercase;
}

.menu h3 {
  font-family: candara;
  text-transform: uppercase;

}

.menu h4 {
  font-family: candara;
  font-size: 16px;
  max-width: 450px;
  line-height:90%;
}

</style>
</head>

<body>
<center>
    <div class="menu">
        <h1>GCH Cafe Menu</h1>
            <br><br>

    <h2>Monday</h2>
    <h3><?php echo nl2br ($MessageMondayMain);?></h3>
    <h4><?php echo nl2br($MessageMonday); ?></h4>

    <h2>Tuesday</h2>
    <h3><?php echo nl2br ($MessageTuesdayMain);?></h3>
    <h4><?php echo nl2br($MessageTuesday); ?></h4>

    <h2>Wednesday</h2>
    <h3><?php echo nl2br ($MessageWednesdayMain);?></h3>
    <h4><?php echo nl2br($MessageWednesday); ?></h4>

    <h2>Thursday</h2>
    <h3><?php echo nl2br ($MessageThursdayMain);?></h3>
    <h4><?php echo nl2br($MessageThursday); ?></h4>

    <h2>Friday</h2>
    <h3><?php echo nl2br ($MessageFridayMain);?></h3>
    <h4><?php echo nl2br($MessageFriday); ?></h4>
    </div>
    </div>
</center>
</body>
</html>

<?php
$html = ob_get_contents();
ob_end_clean();

$filename = "menu.html";

file_put_contents($filename, $html);

echo file_get_contents("menu.html");
?>

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以移除max-width并使用padding .menu来管理间距。

.menu{
  padding: 80px 675px 0 70px;
}