如何减少我的vue.js项目中我的分区元素之间的差距?

时间:2017-07-03 00:17:34

标签: twitter-bootstrap css3 vuejs2

如何将包含文本和图像的分割元素彼此更接近?

这是代码:

这个除法元素包含paragaph元素和图像元素,但是除法元素之间的余量太大。

<template lang = "html">

<div class = "">

  <h1>{{ Help }}</h1>
          <div class = "container">
        <div class = "row">


          <form>
                <input type="text" name="search" placeholder = "Search : Tutorial, FAQS, Contacts "class = " form-control input-lg" height = "">
          </form>


        </div>
        </div>

<div class = "container">

        <div class = "row">

                  <h2>levi basics</h2>

                <h3>What is levi?</h3>

                <p class = "" id = "Headline"> levi is data curation software. This means that from <b>collection</b> to <b>sharing</b> to <b>analyzing</b> of data, levi refines each step  in that process to provide wellbeing for institutions.</p>


          <h3>How does levi function?</h3>


<div class = "col-sm-4">

          <p class = "lead">levi receives data.</p>


            </div>

                      <div class = "col-sm-4" id = "align">
                                  <p class = "lead">levi will analyse data over time to show the historical behaviour of your business. </p>
                                  <img src = "../../assets/GraphAnalysis.png" alt = "GraphAnalysis" width = "200" height = "150" class = "Img">
                      </div>

                <div class = "col-sm-4">
                          <p class = "lead">levi will share data with those who need it and help businesses collaborate with each other better!</p>
                          <img src = "../../assets/DataShare.jpg" alt = "GraphAnalysis" width = "300" height = "150" class = "Img">

                </div>
        </div>
</div>

</div>
</template>

<script>
export default {
  name: 'Support',
  data() {
    return {

      Help: 'How can levi Help?',

    };
  },
};
</script>

<style lang = "css" scoped >

h1 { font-size: 90px; text-align: center; font-family: Heiti SC; font-weight: bolder;  line-height: 1em; margin-top: 90px; }

h2 { text-align: center; font-family: Heiti SC;  font-size: 50px; }

h3 { font-family: Heiti SC;  margin-top: 50px; font-size: 60px; }


 input {
    border: solid 1px 0;
    box-shadow: none;
    height: 60px;

}


 input[placeholder = Search] {
font-size: 90px;

}

#Headline {
  font-size: 30px;
  line-height: 1.2em;
  font-family: Heiti SC;
  font-weight: lighter;
}
</style>

这是JS如何看待页面的小提琴。

JS fiddle Help page

1 个答案:

答案 0 :(得分:0)

您需要重置初始样式以使margin-bottom: 0;在vue组件中通常将组件名称作为最高级别<div></div>元素。

在您的CSS中,您可以通过执行重置所有p标记;

.Support p{
    margin-bottom: 0;
}

上面将使用scoped属性定位模板中找到的所有p元素。如果你有覆盖组件css的全局样式,你可能需要添加!important属性给你margin-bottom: 0 !important;,这将使它成为比上面的常规初始化样式更高优先级的样式。