element with flex/inline-flex affects its child nodes!
{display:flex; flex-direction:row;} /*horizontal*/
{display:flex; flex-direction:column;} /*vertical*/
{display:flex; flex-direction:row-reverse}
{display:flex; flex-direction:column-reverse}
justify-content : flex-start
align = leftjustify-content : flex-end
align = rightjustify-content : center
align = centerjustify-content : space-between
justified, use as much place as it can take
item.center = center of (width-2*w)/(n-2)justify-content : space-around
justified, item.center = center of width/n
align-items: stretch;
//item.height = container.heightalign-items: flex-start;
//item.height = auto, vertical-align=topalign-items: flex-end;
//item.height = auto, vertical-align=bottomalign-items: center;
//item.height = auto, vertical-align=middlealign-items: baseline;
//item.height = auto, vertical-align=text-baseline, display==inline-flex Only?;
flex-wrap: nowrap;
//like table>tr>td*N, width will be narrow than usualflex-wrap: wrap;
//like float:leftflex-wrap: wrap-reverse;
//float + reversed seq
flex-wrap == wrap Only!!, on the contrary of justify-content
align-content : stretch
align-content : flex-start
align-content : flex-end
align-content : center
align-content : space-between
align-content : space-around
order : -1;
//works good with display:flex
margin :
.item{margin:10px;}
.item:first-child{margin-right:auto;} /*1st item goes left, while others align to right*/
margin : auto
align-items : stretch
override parent.align-itemsalign-items : flex-start
override parent.align-itemsalign-items : flex-end
override parent.align-itemsalign-items : center
override parent.align-itemsalign-items : baseline
override parent.align-items
flex : 1
, 1 means 100% of other items.width
.container{direction: rtl;}
.container > *{}
https://www.w3schools.com/cssref/css3_pr_nav-index.asp
background-position: right 5px bottom 5px;
counter-increment counter-reset http://www.w3schools.com/cssref/tryit.asp?filename=trycss_gen_counter-reset
<input required>
input:optional{}
input:required{}/* this item is required */
input:empty{} /*no value is set*/
<p lang='en' class='required'></p>
p.required:lang(en):before{content:'Required'}
p.required:lang(jp):before{content:'必須'}
<input type="number" min="5" max="10" value="7">
input:in-range{outline : 1px solid green}
input:out-of-range{outline : 1px solid red}
<input type="color"/>
<input type="date"/>
<input type="datetime-local"/>
<input type="email"/>
<input type="month"/>
<input type="number"/>
<input type="range"/>
<input type="search"/>
<input type="tel"/>
<input type="time"/>
<input type="url"/>
<input type="week"/>
<input type="text" maxlength=120/>
<input type="text" pattern="[A-Za-z]{3}"/>
input:valid{}
input:invalid{}
<input type="reset">
div ~ p {} /* all <p> tag after <div>, <p>&<div> are siblings of the same parent. */
- Example 1:
<div data-key='my key'>...
div:before{content:attr('data-key');}
- Example 2:
<li name="my name"></li>
li:hover:after{content:attr(name);}
@media screen and (max-width: 300px) {
body {
background-color: lightblue;
}
}
OR
<link rel="stylesheet" media="mediatype and|not|only (expressions)" href="print.css">
#example1 {
width: 500px;
height: 250px;
background-image: url(sheep.png), url(betweengrassandsky.png);
background-position: center bottom, left top;
background-repeat: no-repeat;
}
div{width:100vmin; height:100vmax;} /* 1vmin=min(1vh,1vw) */
@media only screen and (orientation: landscape) {
body {
background-color: lightblue;
}
}
p::selection {
color: red;
background: yellow;
}