CSS Facebook喜欢Box CSS布局设计

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CSS Facebook喜欢Box CSS布局设计相关的知识,希望对你有一定的参考价值。

HTML:

<div class="wrapper">
<div class="inner">
<div class="ribbon-wrapper-green">
<div class="ribbon-green">
Facebook</div>
</div>
<center><iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fmobilesforum&width=240&height=335&show_faces=true&colorscheme=light&stream=false&border_color&header=true&appId=713020622172524" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:240px; height:335px;" allowTransparency="true"></iframe></center>
  </div>
</div>

CSS:
 .wrapper {padding:5px;
    margin: 50px auto;
  width: 276px;
  height: 360px;
  border-radius: 0px;
  position: relative;
  z-index: 90;
background:#eee;background-image:-moz-linear-gradient(top, #fff, #eee);background-image:-ms-linear-gradient(top, #fff, #eee);background-image:-o-linear-gradient( top, #fff, #eee);background-image:-webkit-gradient(linear, left top, left bottom, from(#fff), to(#eee));background-image:-webkit-linear-gradient(top, #fff, #eee);background-image:linear-gradient(top, #fff, #eee);border:1px
solid #ddd;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:0 1px 0 #9a9a9a;-webkit-box-shadow:0 1px 0 #9a9a9a;box-shadow:0 1px 0 #9a9a9a;padding:10px;
}
.inner  {border:1px dashed #ccc;padding:0.5em;-moz-box-shadow:0 0 0 1px #fff;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}
 
.ribbon-wrapper-green {
  width: 85px;
  height: 88px;
  overflow: hidden;
  position: absolute;
  top: -3px;
  right: -3px;
}
 
.ribbon-green {
  font: bold 15px Sans-Serif;
  color: #333;
  text-align: center;
  text-shadow: rgba(255,255,255,0.5) 0px 1px 0px;
  -webkit-transform: rotate(45deg);
  -moz-transform:    rotate(45deg);
  -ms-transform:     rotate(45deg);
  -o-transform:      rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -5px;
  top: 15px;
  width: 120px;
  background-color: #306EFF;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#306EFF), to(#3BB9FF));
  background-image: -webkit-linear-gradient(top, #306EFF, #3BB9FF);
  background-image:    -moz-linear-gradient(top, #306EFF, #3BB9FF);
  background-image:     -ms-linear-gradient(top, #306EFF, #3BB9FF);
  background-image:      -o-linear-gradient(top, #306EFF, #3BB9FF);
 
  color: #fff;
  -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
  -moz-box-shadow:    0px 0px 3px rgba(0,0,0,0.3);
  box-shadow:         0px 0px 3px rgba(0,0,0,0.3);
}
 
.ribbon-green:before, .ribbon-green:after {
  content: "";
  border-top:   3px solid #6e8900;
  border-left:  3px solid transparent;
  border-right: 3px solid transparent;
  position:absolute;
  bottom: -3px;
}
 
.ribbon-green:before {
  left: 0;
}
.ribbon-green:after {
  right: 0;
}

以上是关于CSS Facebook喜欢Box CSS布局设计的主要内容,如果未能解决你的问题,请参考以下文章

css facebook_like-box_responsive.css

CSS 使用CSS自定义Facebook Fan Box小部件

CSS Facebook Like Box IFrame修复

CSS:CSS+DIV布局网页

css Deixa o Facebook Like Box Responsivo

网页设计中流行用css+div,但是要遵循一个规范,才能真正发挥优化作用。大家有啥心得来交流一下呀