フォームのHTML部分
< div class = "ol-searchform" > |
< input id = "ol-search" type = "checkbox" > |
< label for = "ol-search" class = "search-icon" ></ label > |
< div class = "ol-search-wrap" > |
< label for = "ol-search" class = "overlay" ></ label > |
< form role = "search" method = "get" class = "searchform" action = "http://happychance.net/wp/" > |
< input type = "search" class = "search-field" name = "s" placeholder = "KEYWORD" > |
< button type = "submit" class = "search-submit" > |
< span class = "fa fa-search fa-fw" ></ span > |
フォームのCSS部分
animation:fade_overlay .3s; |
background:rgba(0,0,0,.4); |
#ol-search:checked ~ .ol-search-wrap, |
#ol-search:checked ~ .ol-search-wrap .overlay{ |
.ol-searchform .searchform{ |
transform:translate(-50%,-50%); |
.ol-searchform .search-field, .ol-searchform .search-submit{ |
background:rgba(0,0,0,.3); |
.ol-searchform .search-field{ |
border-radius:4px 0 0 4px; |
.ol-searchform .search-submit{ |
border-radius:0 4px 4px 0; |
.ol-searchform .search-field:focus, |
.ol-searchform .search-field:focus + .search-submit{ |
background:rgba(0,0,0,1); |
参考サイト
https://www.webnoiroha.net/webdesign/css/overlay-searchform/