{"id":4845,"date":"2019-03-07T12:51:31","date_gmt":"2019-03-07T17:51:31","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=4845"},"modified":"2019-03-06T14:09:31","modified_gmt":"2019-03-06T19:09:31","slug":"html-opacity-v-s-alpha","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=4845","title":{"rendered":"HTML Opacity v\/s Alpha"},"content":{"rendered":"<p>I am building a page that allows employees to search for public MS Teams groups &#8212; for some reason, Teams uses a &#8216;starts with&#8217; search, and our staff rarely manages to find the public Teams that are out there. I wanted the list of teams and descriptions to have a visible line separation, and a table border looked bad with the enterprise color scheme. I decided to use even\/odd table rows to display a slightly lighter background color. I set an opacity on the background so the <em>actual<\/em> background image is still visible.<\/p>\n<p>My font colors changed! The opacity applied to the text as well.<\/p>\n<figure id=\"attachment_4846\" aria-describedby=\"caption-attachment-4846\" style=\"width: 792px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=4846\" rel=\"attachment wp-att-4846\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4846 size-full\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2019\/03\/Opacity.png\" alt=\"\" width=\"792\" height=\"318\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/03\/Opacity.png 792w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/03\/Opacity-300x120.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/03\/Opacity-768x308.png 768w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><\/a><figcaption id=\"caption-attachment-4846\" class=\"wp-caption-text\">tr:nth-child(even) {background-color: rgb(52,52,52); opacity: 0.5;}<\/figcaption><\/figure>\n<p>Instead of setting an opacity on the row, I added an alpha channel to the row background color without impacting the text within table cells.<\/p>\n<figure id=\"attachment_4847\" aria-describedby=\"caption-attachment-4847\" style=\"width: 799px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=4847\" rel=\"attachment wp-att-4847\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4847 size-full\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2019\/03\/Alpha.png\" alt=\"\" width=\"799\" height=\"319\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/03\/Alpha.png 799w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/03\/Alpha-300x120.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/03\/Alpha-768x307.png 768w\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" \/><\/a><figcaption id=\"caption-attachment-4847\" class=\"wp-caption-text\">tr:nth-child(even) {background-color: rgba(52,52,52,0.5);}<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am building a page that allows employees to search for public MS Teams groups &#8212; for some reason, Teams uses a &#8216;starts with&#8217; search, and our staff rarely manages to find the public Teams that are out there. I wanted the list of teams and descriptions to have a visible line separation, and a &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[765],"class_list":["post-4845","post","type-post","status-publish","format-standard","hentry","category-coding","tag-html"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/4845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4845"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/4845\/revisions"}],"predecessor-version":[{"id":4848,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/4845\/revisions\/4848"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}