]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Floating labels examples in IE (#30965)
authorGaël Poupard <ffoodd@users.noreply.github.com>
Sat, 13 Jun 2020 06:38:13 +0000 (08:38 +0200)
committerGitHub <noreply@github.com>
Sat, 13 Jun 2020 06:38:13 +0000 (09:38 +0300)
* docs(example): drop IE workaround since it works fine in IE

* Serial comma

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <markd.otto@gmail.com>
site/docs/4.5/examples/floating-labels/floating-labels.css
site/docs/4.5/examples/floating-labels/index.html

index d8ad2f3c15db103307671ddb5db9baf7ed8a429d..1abf4c44cc55c19fedcb7907e01802bfe302e0ba 100644 (file)
@@ -67,11 +67,23 @@ body {
   color: transparent;
 }
 
+.form-label-group input:not(:-ms-input-placeholder) {
+  padding-top: 1.25rem;
+  padding-bottom: .25rem;
+}
+
 .form-label-group input:not(:placeholder-shown) {
   padding-top: 1.25rem;
   padding-bottom: .25rem;
 }
 
+.form-label-group input:not(:-ms-input-placeholder) ~ label {
+  padding-top: .25rem;
+  padding-bottom: .25rem;
+  font-size: 12px;
+  color: #777;
+}
+
 .form-label-group input:not(:placeholder-shown) ~ label {
   padding-top: .25rem;
   padding-bottom: .25rem;
@@ -89,14 +101,3 @@ body {
     color: #777;
   }
 }
-
-/* Fallback for IE
--------------------------------------------------- */
-@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
-  .form-label-group > label {
-    display: none;
-  }
-  .form-label-group input:-ms-input-placeholder {
-    color: #777;
-  }
-}
index d837ccaf1c8997653b655f3b0fa186d0189255a5..42cbdeb274d3a367671438ef9d6dc13efdff6d30 100644 (file)
@@ -9,7 +9,7 @@ include_js: false
   <div class="text-center mb-4">
     <img class="mb-4" src="{{ site.baseurl }}/docs/{{ site.docs_version }}/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
     <h1 class="h3 mb-3 font-weight-normal">Floating labels</h1>
-    <p>Build form controls with floating labels via the <code>:placeholder-shown</code> pseudo-element. <a href="https://caniuse.com/#feat=css-placeholder-shown">Works in latest Chrome, Safari, and Firefox.</a></p>
+    <p>Build form controls with floating labels via the <code>:placeholder-shown</code> pseudo-element. <a href="https://caniuse.com/#feat=css-placeholder-shown">Works in latest Chrome, Safari, Firefox, and IE 10/11 (prefixed).</a></p>
   </div>
 
   <div class="form-label-group">