{"id":617,"date":"2012-02-15T02:33:06","date_gmt":"2012-02-15T02:33:06","guid":{"rendered":"http:\/\/brain.dailyon.net\/?p=617"},"modified":"2012-02-15T02:33:06","modified_gmt":"2012-02-15T02:33:06","slug":"css-%ed%88%ac%eb%aa%85%eb%8f%84-%ec%a0%81%ec%9a%a9-ie-filteralphaopacityx-ff-opacityx","status":"publish","type":"post","link":"https:\/\/blog.goorigo.com\/?p=617","title":{"rendered":"css : \ud22c\uba85\ub3c4 \uc801\uc6a9 (IE : filter:alpha(opacity=x),  FF :opacity:x)"},"content":{"rendered":"<table width=\"461\" border=\"1\" cellspacing=\"0\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td valign=\"center\" width=\"461\" height=\"38\">&lt;img src=&#8221;klematis.jpg&#8221; width=&#8221;150&#8243; height=&#8221;113&#8243; alt=&#8221;klematis&#8221;style=&#8221;opacity:0.4;filter:alpha(opacity=40)&#8221; \/&gt;<\/p>\n<p>IE\uac00?filter:alpha(opacity=x)\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc18\uba74, Firefox\ub294 \ud22c\uba85\ub3c4\uc5d0 \ub300\ud574 property?opacity:x\ub97c \uc0ac\uc6a9\ud55c\ub2e4.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Tip:?\ud22c\uba85\ub3c4\uc5d0 \ub300\ud55c CSS3 syntax\ub294?opacity:x\uc774\ub2e4.<\/p>\n<p>Firefox (opacity:x)\uc5d0\uc11c, x\ub294 0.0 ~ 1.0 \uae4c\uc9c0\ub2e4. \ub0ae\uc740\uac12\uc740 element\ub97c \ub354\uc6b1 \ud22c\uba85\ud558\uac8c \ub9cc\ub4e0\ub2e4.<\/p>\n<p>IE (filter:alpha(opacity=x))\uc5d0\uc11c, x\ub294 0 ~ 100 \uae4c\uc9c0\ub2e4. \ub0ae\uc740\uac12\uc740 element\ub97c \ub354\uc6b1 \ud22c\uba85\ud558\uac8c \ub9cc\ub4e0\ub2e4.<\/p>\n<p><a href=\"http:\/\/www.w3schools.com\/css\/css_image_transparency.asp\">http:\/\/www.w3schools.com\/css\/css_image_transparency.asp<\/a><\/p>\n<p>The CSS3 property for transparency is?<strong>opacity<\/strong>.<\/p>\n<p>First we will show you how to create a transparent image with CSS.<\/p>\n<p>Regular image:<\/p>\n<p><img loading=\"lazy\" src=\"http:\/\/www.w3schools.com\/css\/klematis.jpg\" alt=\"klematis\" width=\"150\" height=\"113\" \/><\/p>\n<p>The same image with transparency:<\/p>\n<p><img loading=\"lazy\" src=\"http:\/\/www.w3schools.com\/css\/klematis.jpg\" alt=\"klematis\" width=\"150\" height=\"113\" \/><\/p>\n<p>Look at the following CSS:<\/p>\n<div>\n<div>img<br \/>\n{<br \/>\nopacity:0.4;<br \/>\nfilter:alpha(opacity=40); \/* For IE8 and earlier *\/<br \/>\n}<\/div>\n<\/div>\n<p>IE9, Firefox, Chrome, Opera, and Safari use the property?<strong>opacity<\/strong>?for transparency. The opacity property can take a value from 0.0 &#8211; 1.0. A lower value makes the element more transparent.<\/p>\n<p>IE8 and earlier use?<strong>filter:alpha(opacity=x)<\/strong>. The x can take a value from 0 &#8211; 100. A lower value makes the element more transparent.<\/p>\n<hr \/>\n<h2>Example 2 &#8211; Image Transparency &#8211; Hover Effect<\/h2>\n<p>Mouse over the images:<\/p>\n<p><img loading=\"lazy\" src=\"http:\/\/www.w3schools.com\/css\/klematis.jpg\" alt=\"klematis\" width=\"150\" height=\"113\" \/>?<img loading=\"lazy\" src=\"http:\/\/www.w3schools.com\/css\/klematis2.jpg\" alt=\"klematis\" width=\"150\" height=\"113\" \/><\/p>\n<p>The CSS looks like this:<\/p>\n<div>\n<div>img<br \/>\n{<br \/>\nopacity:0.4;<br \/>\nfilter:alpha(opacity=40); \/* For IE8 and earlier *\/<br \/>\n}<br \/>\nimg:hover<br \/>\n{<br \/>\nopacity:1.0;<br \/>\nfilter:alpha(opacity=100); \/* For IE8 and earlier *\/<br \/>\n}<\/div>\n<\/div>\n<p>The first CSS block is similar to the code in Example 1. In addition, we have added what should happen when a user hover over one of the images. In this case we want the image to NOT be transparent when the user hover over it.<\/p>\n<p>The CSS for this is:?<strong>opacity=1<\/strong>.<\/p>\n<p>IE8 and earlier:?<strong>filter:alpha(opacity=100)<\/strong>.<\/p>\n<p>When the mouse pointer moves away from the image, the image will be transparent again.<\/p>\n<hr \/>\n<h2>Example 3 &#8211; Text in Transparent Box<\/h2>\n<div>\n<div>\n<p>This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box.<\/p>\n<\/div>\n<\/div>\n<p>The source code looks like this:<\/p>\n<div>\n<div>&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;style type=&#8221;text\/css&#8221;&gt;<br \/>\ndiv.background<br \/>\n{<br \/>\nwidth:500px;<br \/>\nheight:250px;<br \/>\nbackground:url(klematis.jpg) repeat;<br \/>\nborder:2px solid black;<br \/>\n}<br \/>\ndiv.transbox<br \/>\n{<br \/>\nwidth:400px;<br \/>\nheight:180px;<br \/>\nmargin:30px 50px;<br \/>\nbackground-color:#ffffff;<br \/>\nborder:1px solid black;<br \/>\nopacity:0.6;<br \/>\nfilter:alpha(opacity=60);?\/* For IE8 and earlier *\/<br \/>\n}<br \/>\ndiv.transbox p<br \/>\n{<br \/>\nmargin:30px 40px;<br \/>\nfont-weight:bold;<br \/>\ncolor:#000000;<br \/>\n}<br \/>\n&lt;\/style&gt;<br \/>\n&lt;\/head&gt;&lt;body&gt;<\/p>\n<p>&lt;div&gt;<br \/>\n&lt;div&gt;<br \/>\n&lt;p&gt;This is some text that is placed in the transparent box.<br \/>\nThis is some text that is placed in the transparent box.<br \/>\nThis is some text that is placed in the transparent box.<br \/>\nThis is some text that is placed in the transparent box.<br \/>\nThis is some text that is placed in the transparent box.<br \/>\n&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<\/div>\n<\/div>\n<p>First, we create a div element (class=&#8221;background&#8221;) with a fixed height and width, a background image, and a border. Then we create a smaller div (class=&#8221;transbox&#8221;) inside the first div element. The &#8220;transbox&#8221; div have a fixed width, a background color, and a border &#8211; and it is transparent. Inside the transparent div, we add some text inside a p element.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;img src=&#8221;klematis.jpg&#8221; width=&#8221;150&#8243; height=&#8221;113&#8243; alt=&#8221;klematis&#8221;style=&#8221;opacity:0.4;filter:alpha(opacity=40)&#8221; \/&gt; IE\uac00?filter:alpha(opacity=x)\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc18\uba74, Firefox\ub294 \ud22c\uba85\ub3c4\uc5d0 \ub300\ud574 property?opacity:x\ub97c \uc0ac\uc6a9\ud55c\ub2e4. Tip:?\ud22c\uba85\ub3c4\uc5d0 \ub300\ud55c CSS3 syntax\ub294?opacity:x\uc774\ub2e4. Firefox (opacity:x)\uc5d0\uc11c, x\ub294 0.0 ~ 1.0 \uae4c\uc9c0\ub2e4. \ub0ae\uc740\uac12\uc740 element\ub97c \ub354\uc6b1 \ud22c\uba85\ud558\uac8c \ub9cc\ub4e0\ub2e4.&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/617"}],"collection":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=617"}],"version-history":[{"count":0,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/617\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}