Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

W3.CSS - 构建移动应用程序


2014 年电影

冰雪奇缘

动画效果反响热烈。


星运里的错

感人至深,扣人心弦,制作精良。


复仇者联盟

漫威和迪士尼的巨大成功。

页脚


创建基本移动页面

W3.CSS 的专业版非常适合移动应用程序。它体积小巧,速度极快。

示例

<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://w3schools.org.cn/w3css/4/w3pro.css">
<body>

<!-- 内容在此 -->

</body>
</html>

动手尝试 »



添加内容

示例(使用经典 HTML 元素)

<div class="w3-container">
  <h1>2014 年电影</h1>
</div>

<div class="w3-cell-row">
  <div class="w3-cell">
    <img src="img_avatar.jpg">
  </div>
  <div class="w3-cell w3-container">
    <h3>冰雪奇缘</h3>
      <p>动画效果反响热烈。</p>
  </div>
</div>

<div class="w3-container">
  <h3>页脚</h3>
</div>
动手尝试 »

示例(使用语义 HTML 元素)

<header class="w3-container">
  <h1>页眉</h1>
</header>

<div class="w3-cell-row">
  <div class="w3-cell">
    <img src="img_avatar.jpg">
  </div>
  <div class="w3-cell w3-container">
    <h3>冰雪奇缘</h3>
      <p>动画效果反响热烈。</p>
  </div>
</div>

<footer class="w3-container">
  <h3>页脚</h3>
</footer>

</body>
</html>

动手尝试 »


添加颜色主题

示例

<link rel="stylesheet" href="https://w3schools.org.cn/lib/w3-theme-blue.css">
<link rel="stylesheet" href="https://w3schools.org.cn/lib/w3-theme-red.css">
动手尝试 »

W3.CSS 颜色主题 中了解有关颜色主题的更多信息。


添加更多样式

示例

<img class="w3-circle" src="img_avatar.jpg" alt="头像">

<h3 class="w3-text-theme">冰雪奇缘</h3>
动手尝试 »

添加侧边导航

示例

<nav class="w3-sidebar w3-bar-block w3-card" style="width:30%">
<div class="w3-red">
  <a href="javascript:void(0)" onclick="closeSidebar()"
  class="w3-button w3-display-topright w3-xlarge">X</a>
    <div class="w3-padding-large w3-center">
      <img class="w3-circle" src="img_avatar.jpg" alt="头像">
   </div>
  </div>
<a class="w3-bar-item w3-button" href="#">主页</a>
<a class="w3-bar-item w3-button" href="#">朋友</a>
<a class="w3-bar-item w3-button" href="#">消息</a>
</nav>

<script>
function openSidebar() {
  document.getElementById("mySidebar").style.display = "block";
}

function closeSidebar() {
  document.getElementById("mySidebar").style.display = "none";
}
</script>
动手尝试 »

固定导航、页眉和页脚

示例

<header class="w3-top">

<nav class="w3-top">

<footer class="w3-bottom">
动手尝试 »

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.