不同屏幕的適配

移動(dòng)端 :

rem 適配各種屏幕尺寸? 同時(shí)基于<html> 的 font-size 屬性 一般為100px

pc端:

運(yùn)用媒體查詢??

<divclass="gridcontainer">

<divclass="gridwrapper">

<divclass="gridbox gridheader">

<divclass="header">

<h1>The Pulpit Rock</h1>

</div>

</div>

<divclass="gridbox gridmenu">

<divclass="menuitem">The Drive</div>

<divclass="menuitem">The Walk</div>

<divclass="menuitem">The Return</div>

<divclass="menuitem">The End</div>

</div>

<divclass="gridbox gridmain">

<divclass="main">

<h1>The Walk</h1>

<p>The walk to the Pulpit Rock will take you approximately two hours, give or take an hour depending on the weather conditions and your physical shape.</p>

<imgsrc="pulpitrock.jpg"alt="Pulpit rock"width=""height="">

?

</div>

</div>

<divclass="gridbox gridright">

<divclass="right">

<h2>What?</h2>

<p>The Pulpit Rock is a part of a mountain that looks like a pulpit.</p>

<h2>Where?</h2>

<p>The Pulpit Rock is in Norway</p>

<h2>Price?</h2>

<p>The walk is free!</p>

</div>

</div>

<divclass="gridbox gridfooter">

<divclass="footer">

<p>This web page is a part of a demonstration of fluid web design made by www.w3schools.com. Resize the browser window to see the content response to the resizing.</p>

</div>

</div>

</div>

</div>

</body>

</html>

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容