不透明度不按预期工作

时间:2016-10-11 03:35:58

标签: html css twitter-bootstrap

我试图在div上设置不透明度,但它没有按预期工作。

https://jsfiddle.net/std0tgsy/1/

HTML

<div class="col-lg-offset-4 col-lg-3 col-md-6 col-sm-12 col-xs-12  haveaccount" style="opacity: 2;text-align: center;" >
  <h2>JOIN US AT START HERE, GO PLACES.</h2>
  <p>Sign up here, create your account, and we'll follow up with you to complete your profile. You'll 
  <br> have access to our tools  and can expect to receive some
  <br> freebies along the way, Welcome!</p>  

2 个答案:

答案 0 :(得分:0)

div {
    opacity: 0.5;
}

<div style="background-color:rgba(0, 0, 0, 0.5);">
   <div>
      Text added.
   </div>
</div>

http://www.w3schools.com/cssref/css3_pr_opacity.asp&amp; https://css-tricks.com/almanac/properties/o/opacity/

答案 1 :(得分:0)

<div style="opacity: 2"; >

从这里开始加入我们,去吧。

   

OR

<h2 style="opacity:0.2">JOIN US AT START HERE, GO PLACES.</h2>

你也可以做外部css文件。

Visit