Something went wrong. Try again.
A mirror of my personal website
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124body { background-color: lightblue;}
/* element (and group) selector */h1, h2, p { text-align: center; color: red;}
/* id selector */ #foss { text-align: center; color: green;}
/* clsss selector */.major { text-align: center;}
p.major { color: red;}
/* universal selector */* { text-align: center; color: blue;}
/* element only when inside other element (first is parent second is child) */
ul li { color: cyan}
/* element state *//* when hovered with mouse */h2:hover { background-color: red;}/* when clicked */h2:active { background-color: green;}/* also<p onclick="myFunction()">Click to show panel</p> */
/* make nth row in a table a different color */tr:nth-child(even){background-color: #f2f2f2;}
/* make table responsive (horizontally scrollable */div.tablecontainer { overflow-x: auto;}
/* clearfix hack */.clearfix::after { content: ""; clear: both; display: table;}
/* Combinators */
/* descendant combinator: space *//* all p elements inside div elements */div p { background-color: yellow;}
/* child combinator: > *//* only direct children, immediately descendant */ div > p { background-color: yellow;}
/* next sibling combinator: + *//* elements that are right next to each other on the same level within the same parent */div + p { background-color: yellow;}
/* subsequent-sibling combinator: ~ *//* style all ul elements that come after any p element, no need to be immediately after and within the same parent */p ~ ul { background-color: gold; border: 1px solid gray;}
/* Pseudo-classes, the ":" operator */ /* unvisited link */a:link { color: #FF0000;}
/* visited link */a:visited { color: #00FF00;}
/* mouse over link */a:hover { color: #FF00FF;}
/* selected link */a:active { color: #0000FF;}
/* when input box is focused */input:focus { background-color: yellow;}
/* with descendant combinator *//* change visibility of all p elements inside div when hovered */div:hover p { display: block;}