I'm in doubt when applying some styles in css
. I want to modify a tag
by using a div
within it:
header {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-box-pack: start;
-webkit-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
box-sizing: border-box;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
width: 100%;
margin: 0;
padding: 0;
border: none;
min-height: 64px;
max-height: 1000px;
white-space: nowrap;
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
-ms-transition-duration: 0.2s;
-o-transition-duration: 0.2s;
transition-duration: 0.2s;
-webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-moz-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-ms-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-o-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-webkit-transition-property: max-height,box-shadow;
-moz-transition-property: max-height,box-shadow;
-ms-transition-property: max-height,box-shadow;
-o-transition-property: max-height,box-shadow;
transition-property: max-height,box-shadow;
background-color: #00bcd4;
color: #ffffff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
header .drawer-button {
display: block;
position: absolute;
height: 48px;
width: 48px;
border: 0;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
overflow: hidden;
text-align: center;
cursor: pointer;
font-size: 26px;
line-height: 50px;
margin: 10px 12px;
top: 0;
left: 0;
color: #ffffff;
z-index: 4;
}
header .li-row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
height: 64px;
margin: 0;
padding: 0 15px 0 80px;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
box-sizing: border-box;
-webkit-align-self: stretch;
-ms-flex-item-align: stretch;
align-self: stretch;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
header .li-row > * {
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
}
header .layout-spacer {
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
header .action-drawer {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
box-sizing: border-box;
margin: 0;
padding: 0;
height: 64px;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
header .action-drawer > .drawer-button {
position: inherit;
margin: inherit;
}
header .layout-spacer > input[type="search"] {
border: none;
width: 50%;
height: 40px;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 3px;
margin: 0 auto;
top: 0;
bottom: 0;
color: black;
}
header .layout-spacer > input[type="search"]:focus, input[type="search"]:focus + header.color, header .layout-spacer > input[type="search"]:focus + .color {
background-color: white;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
-ms-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
<header class="color">
<div class="drawer-button"></div>
<div class="li-row">
<!-- Title -->
<h1 class="text-title">Title</h1>
<!-- Center Espace -->
<div class="layout-spacer">
<input type="search" class="text-subhead" />
<div class="color">oi</div>
</div>
<!-- Navigation -->
<div class="action-drawer">
<div class="drawer-button"></div>
<div class="drawer-button"></div>
</div>
</div>
</header>
I want to change the color of <header>
through <input type="search">
without using jQuery
, only using css
.