Css发行位置

时间:2015-08-10 09:30:09

标签: html css

这是html部分:

  FB.ui(
  {
     method: 'share',
     href: "http://SomeWebPage"
  }, 
  function (response) {
  });

这是css

<div class="sama_productblocks_grid">
    <div class="title-bar">
        <h3>Nieuwste producten</h3>
    </div>
.....
</div>

我想要实现的是在文本前后加上一行: .sama_productblocks_grid .title-bar h3 { margin: 0; position: relative;z-index: 3; font-size:18px; display: inline-block; color: #6D6C6C; font-weight: 400; text-transform: uppercase; font-family: "Open Sans",sans-serif !important; padding: 0px 65px; } /*newest product*/ .title-bar{ position: absolute; overflow: hidden; margin-bottom: 10px; text-align: center; border-bottom:3px solid black; z-index: 3; width:100%; margin-bottom: 10px; } .sama_productblocks_descrition {margin-top:40px;} 。所以我希望看起来像这样: Nieuwste producten

2 个答案:

答案 0 :(得分:0)

你的意思是这样的:

h3:before {
    content: "---------------- "
}
h3:after {
    content: " ----------------"
}

答案 1 :(得分:0)

这是你在找什么?

body {
    margin-top: 50px;
}

.hr-div {
    height: 1px; 
    background-color: #e6e6e7; 
    text-align: center;  
    margin: 10px 0 10px -10px;
}
.hr-span {
    background-color: white; 
    position: relative; 
    top: -10px; 
    padding:0 10px; 
}
<div class="hr-div">
    <span class="hr-span">Your Title Here</span>
</div>