{"id":178,"date":"2018-04-26T21:56:09","date_gmt":"2018-04-26T21:56:09","guid":{"rendered":"https:\/\/ucsbwebdev.fzilla.com\/?p=178"},"modified":"2018-04-26T21:56:09","modified_gmt":"2018-04-26T21:56:09","slug":"advanced-css-exercises","status":"publish","type":"post","link":"https:\/\/ucsbwebdev.fzilla.com\/?p=178","title":{"rendered":"Advanced CSS Exercises"},"content":{"rendered":"<h2>Selecting all matching children<\/h2>\n<p>When creating a selector, if you add a space after the first selector it will then select all children that match the second selector you specify.<\/p>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"ex-selectors\" src=\"https:\/\/codepen.io\/agrublev\/embed\/preview\/jxMJvJ?default-tabs=html%2Cresult&amp;height=300&amp;host=https%3A%2F%2Fcodepen.io&amp;slug-hash=jxMJvJ#?secret=afvCPcymLI\" data-secret=\"afvCPcymLI\" scrolling=\"no\" frameborder=\"0\" height=\"300\"><\/iframe><\/p>\n<h2>Select immediate children<\/h2>\n<p>Selecting only immediate children is done with the <strong>&gt;\u00a0<\/strong>character between two selectors<\/p>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"ex-selectors-2\" src=\"https:\/\/codepen.io\/agrublev\/embed\/preview\/YLGgRr?default-tabs=html%2Cresult&amp;height=300&amp;host=https%3A%2F%2Fcodepen.io&amp;slug-hash=YLGgRr#?secret=qmJzl777tk\" data-secret=\"qmJzl777tk\" scrolling=\"no\" frameborder=\"0\" height=\"300\"><\/iframe><\/p>\n<h2>Selecting multiple selectors<\/h2>\n<p>To select multiple selectors you use the\u00a0<strong>,\u00a0<\/strong>character between each selector.<\/p>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"ex-selectors-3\" src=\"https:\/\/codepen.io\/agrublev\/embed\/preview\/GdjeLd?default-tabs=html%2Cresult&amp;height=300&amp;host=https%3A%2F%2Fcodepen.io&amp;slug-hash=GdjeLd#?secret=miQte5CTCD\" data-secret=\"miQte5CTCD\" scrolling=\"no\" frameborder=\"0\" height=\"300\"><\/iframe><\/p>\n<h2>Selecting multiple elements with one class<\/h2>\n<p>Very often we want to apply the same styling to a number of elements, instead of selecting multiple selectors we just add a new class to each element we want to be selected.<\/p>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"ex-selectors-4\" src=\"https:\/\/codepen.io\/agrublev\/embed\/preview\/QrKoRR?default-tabs=html%2Cresult&amp;height=300&amp;host=https%3A%2F%2Fcodepen.io&amp;slug-hash=QrKoRR#?secret=r6zCwEqqOn\" data-secret=\"r6zCwEqqOn\" scrolling=\"no\" frameborder=\"0\" height=\"300\"><\/iframe><\/p>\n<h2>Colors and Sizes<\/h2>\n<p>We&#8217;ll set a global font-size and then based on it we&#8217;ll adjust different font sizes and spacing. We&#8217;ll also apply some transparent colors and text colors.<\/p>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"ex-sizes-colors\" src=\"https:\/\/codepen.io\/agrublev\/embed\/preview\/NMRmKm?default-tabs=css%2Cresult&amp;height=300&amp;host=https%3A%2F%2Fcodepen.io&amp;slug-hash=NMRmKm#?secret=glBtJy9e6n\" data-secret=\"glBtJy9e6n\" scrolling=\"no\" frameborder=\"0\" height=\"300\"><\/iframe><\/p>\n<h2>Pseudo Elements<\/h2>\n<p>We&#8217;ll need to apply a hover effect by using the :hover pseudo element. We&#8217;ll also need to select the first, third, and last .child element of .parent by using the :first-of-type, :nth-of-type, and :last-of-type pseudo selectors.<\/p>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"ex-pseudo-elements\" src=\"https:\/\/codepen.io\/agrublev\/embed\/preview\/rvMbxL?default-tabs=css%2Cresult&amp;height=300&amp;host=https%3A%2F%2Fcodepen.io&amp;slug-hash=rvMbxL#?secret=s2lQPZoGly\" data-secret=\"s2lQPZoGly\" scrolling=\"no\" frameborder=\"0\" height=\"300\"><\/iframe><\/p>\n<h2>Using LESS<\/h2>\n<p>We&#8217;ll use the main abilities of LESS by adding a selector inside an element that selects that element and adds a pseudo :hover selector. Then we&#8217;ll apply a style to a child of .parent by using the nesting properties of LESS and apply a variable form LESS.<\/p>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"ex-less\" src=\"https:\/\/codepen.io\/agrublev\/embed\/preview\/MGjRJy?default-tabs=css%2Cresult&amp;height=300&amp;host=https%3A%2F%2Fcodepen.io&amp;slug-hash=MGjRJy#?secret=vUduOgaKI6\" data-secret=\"vUduOgaKI6\" scrolling=\"no\" frameborder=\"0\" height=\"300\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Selecting all matching children When creating a selector, if you add a space after the first selector it will then select all children that match the second selector you specify. Select immediate children Selecting only immediate children is done with the &gt;\u00a0character between two selectors Selecting multiple selectors To select multiple selectors you use the\u00a0,\u00a0character [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=178"}],"version-history":[{"count":2,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":180,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions\/180"}],"wp:attachment":[{"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}