顯示具有 CSS3 標籤的文章。 顯示所有文章
顯示具有 CSS3 標籤的文章。 顯示所有文章

2022年4月24日 星期日

[研究][HTML5][CSS3]placeholder-shown偽類實現輸入框浮動文字效果

[研究][HTML5][CSS3]浮動標籤 (Floating labels)

[研究][HTML5][CSS3]placeholder-shown偽類實現輸入框浮動文字效果

2022-04-24

HTML5 + CSS3

<head>
<style>
.LoginForm {
            padding: 10px;
            width: 500px;
            border: 4px solid #1199CD;
            margin-right: auto;
            margin-left: auto;
            background-color: #FFF;
            margin-bottom: 30px;
            border-radius: 12px;
            overflow: auto;
        }

.input-group {
  position: relative;
  margin: 20px;
  font-size: 16px;
}

.input-group>input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 1em;
  font-size: 16px;
  line-height: 1.0;
  border: none; 
  border-bottom: 1px solid #cdcdcd;
  border-radius: 0.4em;
  transition: box-shadow 0.3s;
}

.input-group input::placeholder {
  font-style: italic;
  color: #cdcdcd;
}

.input-group>input:focus {
  outline: none;
  box-shadow: 0.2em 0.8em 1.6em #cdcdcd;
}

.input-group>label {
  position: absolute;
  bottom: 0;
  left: 1em;
  z-index: -1;

  visibility: hidden;
  color: #555555;
  opacity: 0;

  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: translate3d(0, 0, 0) scale(0);
  transform: translate3d(0, 0, 0) scale(0);
  -webkit-transition:
    opacity 0.3s,
    visibility 0.3s,
    transform 0.3s,
    z-index 0.3s;

  transition:
    opacity 0.3s,
    visibility 0.3s,
    transform 0.3s,
    z-index 0.3s;
}

.input-group>input:focus ~ label {
  z-index: 1;
  visibility: visible;
  opacity: 1;
  -webkit-transform: translate3d(0, -2.4em, 0) scale(1);
  transform: translate3d(0, -2.4em, 0) scale(1);
}
</style>
</head>
<form id="form1" runat="server" class="LoginForm">
<h1 style="text-align:center">管理平台</h1><hr>
<div class="input-group">
  <input type="text" id="username" placeholder="請輸入賬號">
  <label for="username">賬號</label>
</div>
<!-- 密碼 -->
<div class="input-group">
  <input type="text" id="password" placeholder="請輸入6~8位密碼">
  <label for="password">密碼</label>
</div>

<div class="input-group">
  <input type="text" id="password" placeholder="驗證碼">
  <label style="z-index: 1;
  visibility: visible;
  opacity: 1;
  -webkit-transform: translate3d(0, -2.4em, 0) scale(1);
  transform: translate3d(0, -2.4em, 0) scale(1);" for="password">驗證碼</label>
</div>
<div class="input-group">
  <input type="submit" value="登入">
</div>
</form>

(完)



2021年2月23日 星期二

[研究] 頁籤(tab) (HTML + CSS3)

[研究] 頁籤(tab) (HTML + CSS3)

2021-02-23

<meta charset="utf-8"> 這行要有,否則 Chrome 88正常,IE11 亂碼。

參考

CSS :target Selector
https://www.w3schools.com/cssref/sel_target.asp


<<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
<style>
.tab div {
  display: none;
}

.tab div:target {
  display: block;
}
</style>
</head>
<body>

<div class="tab">

<a href="#link1">Link 1</a>   
<a href="#link2">Link 2</a>
<a href="#link3">Link 3</a>

<div id="link1">
  <h3>Content to Link 1</h3>
  <p>Hello World!</p>
</div>

<div id="link2">
  <h3>Content to Link 2</h3>
  <h4>Great success!</h4>
</div>

<div id="link3">
  <h3>Content to Link 3</h3>
  <p>Yeah!</p>
</div>

</div>

</body>
</html>


網址若不含 錨文字 HTML anchor,則不會顯示任何頁籤內容
file:///C:/Users/Administrator/Desktop/4.htm

網址若包含 錨文字 HTML anchor,則會顯示
file:///C:/Users/Administrator/Desktop/4.htm#link1







(完)

相關

[研究] 頁籤(tab) (HTML + jQuery 3.5.1 + Bootstrap 3.4.1)
https://shaurong.blogspot.com/2021/02/tab-html-jquery-351-bootstrap-341.html

[研究] 頁籤(tab) (HTML + CSS3)
https://shaurong.blogspot.com/2021/02/tab-html-css3.html

[研究] 頁籤(tab) ( HTML + CSS + JavaScript + jQuery + jQuery UI)
https://shaurong.blogspot.com/2021/02/tab-html-css-javascript-jquery-jquery-ui.html

[研究] 頁籤(tab) (HTML+CSS+JavaScript+jQuery)
https://shaurong.blogspot.com/2021/02/tab-htmlcssjavascriptjquery.html

[研究] 頁籤(tab) (HTML+CSS+JavaScript)
https://shaurong.blogspot.com/2021/02/tab-htmlcssjavascript.html

Online HTML Code Generator | CSS Code Generator | JavaScript
https://www.html-code-generator.com/

JQuery Tabs Generator
https://www.html-code-generator.com/jquery/tabs-generator

Tabs | jQuery UI
https://jqueryui.com/tabs/

Tabs Widget | jQuery UI 1.8 Documentation
https://api.jqueryui.com/1.8/tabs/

Top Tabs Generator
https://www.pagecolumn.com/tool/top_tabs_generator.htm

Review techniques of making tabs with CSS
https://www.pagecolumn.com/webparts/making_tabs_with_CSS.htm

Tab Menu - Online Tab Menu builder
http://www.menucool.com/horizontal/tab-menu

「CSS3:target選擇器」免程式!純CSS就可實現Tab頁籤式的互動切換 | 梅問題.教學網https://www.minwt.com/webdesign-dev/css/16987.html

bootstrap頁籤
https://codepen.io/fenture/pen/pWEMdR

使用Jquery特效做出Tab頁籤切換效果
https://www.webdesigns.com.tw/jquery_tab.asp