A simple search input with an icon at the right
A Pen by Ismail Ghallou (Smakosh) on CodePen.
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title></title> | |
| <link href='https://fonts.googleapis.com/css?family=Lato:300,400|Montserrat:700' rel='stylesheet' type='text/css'> | |
| <style> | |
| @import url(//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css); | |
| @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css); |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title></title> | |
| <link href='https://fonts.googleapis.com/css?family=Lato:300,400|Montserrat:700' rel='stylesheet' type='text/css'> | |
| <style> | |
| @import url(//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css); | |
| @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css); |
A simple search input with an icon at the right
A Pen by Ismail Ghallou (Smakosh) on CodePen.
A Pen by Pinnacle Web Development on CodePen.
| <div class="panels"> | |
| <a href="#" class="panel"> | |
| <div class="panel__content" style="background-image: url(https://unsplash.it/1100/1100/?image=760);"> | |
| <h3 class="panel__title">A</h3> | |
| </div> | |
| </a> | |
| <a href="#" class="panel"> | |
| <div class="panel__content" style="background-image: url(https://unsplash.it/1100/1100/?image=786)"> | |
| <h3 class="panel__title">B</h3> | |
| </div> |
A CSS only expanding panel gallery with keyboard support and CSS Vars to progressively enhance with animation.
The keyboard support is probably not truly accessible. I'll leave it as an exercise to the reader to add real accessibility aria-roles and JavaScript.
Thanks to @davidkpiano for help with setup and the Animation At Work community for helpful feedback.
Like sliding panels? Try these transform-based sliding panels
Sliding panels around to give greater emphasis to the active panel. Uses only CSS :hover states with transform/opacity transitions for maximum performance.
Responsively switches to a stacked layout on smaller screens, or by using the .panels--stacked class
| <main> | |
| <input type="text" class="search" /> | |
| <div class="line-1"></div> | |
| <div class="line-2"></div> | |
| </main> |