【发布时间】:2015-07-08 18:14:29
【问题描述】:
我目前正在调整我的 div 顶部和底部填充的百分比(菜单和关于),以便它们每个填充一个页面。它在我的屏幕尺寸上看起来很棒,但是当它进入不同的屏幕时,内容不适合页面。有什么方法可以检测屏幕大小并更改百分比吗?
HTML:
<div id="menu">
<p class="menu_info">
The food at Cure is inspired by the season’s best produce, gathered by a variety of local and global artisans. These seasonal flavors are crisply paired with a sharp drinks list which includes a reserve wine list of hard to source vintage wines for connoisseurs.
</p>
<div id="month_menu">
<p id="month">OUR JULY MENU</p>
<div>
<p id="lunch">LUNCH</p>
<div class="courses">
<p><a href="menu/cure_menu_july_lunch.pdf" target="_blank">2 course/3 course</a></p>
</div>
</div>
<div>
<p id="dinner">DINNER</p>
<div class="courses">
<p>mon-thurs:</p>
<p><a href="menu/cure_menu_july_4course.pdf" target="_blank">4 course</a></p>
</div>
<div class="courses">
<p>fri & sat:</p>
<p><a href="menu/cure_menu_july_5course.pdf" target="_blank">5 course</a></p>
</div>
</div>
</div>
<div id="about">
<p class="about_header">OUR RESTAURANT</p>
<p class="about_info">Cure, which in Latin (curare) stands for hospitality or “to take care of”, is headed by Chef-Owner Walsh, who has conceptualized a creative space where a seamless experience of top-notch food, drink and service is delivered in a casual yet refined environment. Cure seats 40, including a chef’s table of eight, within the 1,350 sq ft shophouse space.</p>
<p class="about_info" style="text-indent:25px;">It integrates his influences and inspirations from his many years of cooking in acclaimed Michelin star kitchens across Dublin, London and New York, and his firm belief in going back to the basics of hospitality: striving to take care of guests in the best way possible by offering them the best food, drink and service experience in an accessible and personable way.</p>
</div>
CSS:
#menu{
padding-top:20%;
padding-bottom:20%;
}
#about{
padding-top:22%;
padding-bottom:22%;
}
【问题讨论】: