css - 如何使用 w3.css 显示与输入内联的标签

标签 css w3.css

使用 W3.CSS,我们如何显示与输入内联的标签?

<link href="http://www.w3schools.com/lib/w3.css" rel="stylesheet" />

<form class="w3-container">
  <p>
    <label>First Name</label>
    <input class="w3-input w3-border" type="text">
  </p>
  <p>
    <label>Last Name</label>
    <input class="w3-input w3-border" type="text">
  </p>
  <p>
    <label>Email</label>
    <input class="w3-input w3-border" type="text">
  </p>
</form>

最佳答案

人们可能想使用 w3.css 提供的解决方案(不需要覆盖 w3-input):

<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<div class="w3-bar w3-light-grey w3-border">
    <a href="#" class="w3-bar-item w3-button w3-mobile">Home</a>
    <a href="#" class="w3-bar-item w3-button w3-mobile">Link 1</a>
    <a href="#" class="w3-bar-item w3-button w3-mobile">Link 2</a>
    <input type="text" class="w3-bar-item w3-input w3-white w3-mobile" placeholder="Search..">
    <button class="w3-bar-item w3-button w3-green w3-mobile">Go</button>
</div>

<link href="http://www.w3schools.com/lib/w3.css" rel="stylesheet" />

<form class="w3-container">
  <p class="w3-bar">
    <label class="w3-bar-item">First Name</label>
    <input class="w3-bar-item w3-input w3-border" type="text">
  </p>
  <p class="w3-bar">
    <label class="w3-bar-item">Last Name</label>
    <input class="w3-bar-item w3-input w3-border" type="text">
  </p>
  <p class="w3-bar">
    <label class="w3-bar-item">Email</label>
    <input class="w3-bar-item w3-input w3-border" type="text">
  </p>
</form>

https://www.w3schools.com/w3css/w3css_navigation.asp
https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_navbar_input

关于css - 如何使用 w3.css 显示与输入内联的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40268917/

相关文章:

html - 有没有办法让某些 Action 只在特定时间可用?

html - 如何使用 html/css 和 javascript 制作响应式网站

html - 无法将段落在 div 内垂直居中

html - 将 Fontawesome-icon 与 w3-input 字段放在同一行

html - 如何修复 w3.css 列表项中的高度偏移

javascript - 禁用编辑不起作用

css - 如何让 Cordova 应用程序的 Tabbar 很好地适应各种手机屏幕尺寸?

html - 内部有图像的 w3-cell 元素不会调整到等高

html - div 元素的 CSS 背景不起作用

javascript - 在 div w3-row/w3-col (W3CSS) 上方显示 Canvas