强制元素向上移动

时间:2016-01-20 19:50:56

标签: html css

我有一个渲染得更低的盒子,我无法弄清楚原因。

enter image description here

<div id="hint-history" class="popup">
<div class="row">
    <div class="col" id="closehistorypopup">

        <div class="body">

            <button class="x">
                <span class="sprite close"></span>
            </button>

            <div class="title">Hint History</div>

            <div class="lists">
                <?php for($i=0;$i<6;$i++) { ?>
                    <div class="list history[[$i]]" id="history[[$i]]">  
                        <div class="info">
                            <div class="picture monophoto">
                                <div class="text">BO</div>
                                <div class="img" style="background-image: url();"></div>
                            </div>
                            <div class="right">
                                <div class="lineone">John Smith</div>
                                <div class="linetwo">Daily Essentials</div>
                            </div>
                        </div>
                        <div class="boxes">
                            <div class="left">
                                <div class="box box1"></div>
                            </div>
                            <div class="right">
                                <div class="box box2"></div>
                                <div class="box box3"></div>
                            </div>
                        </div>
                        <a class="cbutton whiteonblack">VIEW LIST<!--SEE <span class="owner">JOHN'S</span>--></a>
                    </div>
                <?php } ?>
                <?php $i++; $privateCount = 1; ?>
                @if ($privateCount > 0)
                    <div id="privatecard" class="list history[[$i]]">  
                        <div class="info">
                            <div class="picture monophoto" style="visibility: hidden;">
                            </div>
                            <div class="right">
                                <p id="privatecounter">                        
                                    @if ($privateCount == 1)
                                        There is [[$privateCount]] private user.
                                    @else
                                        There are [[$privateCount]] private users.
                                    @endif
                                </p>
                                <div class="linetwo">&nbsp;</div>
                                <div class="linetwo">&nbsp;</div>
                                <div class="linetwo">&nbsp;</div>
                            </div>
                        </div>
                        <div class="boxes">
                            <div class="left">
                            </div>
                            <div class="right">
                            </div>
                        </div>
                    </div>
                @endif
            </div>

无论我做什么都不会让步。

.privatecard {
     margin-top: -500px !important;
}
.privatecard {
     padding-bottom: 500px !important;
}

//etc

如何强迫它向上移动?

1 个答案:

答案 0 :(得分:1)

发一个小提琴?

我过去曾遇到过这个问题,并且我已经通过确保所有// create some example data...BY DataFrame // note, third record has an empty string case class Stuff(a:String,b:Int) val d= sc.parallelize(Seq( ("a",1),("b",2), ("",3) ,("d",4)).map { x => Stuff(x._1,x._2) }).toDF // now the good stuff. import org.apache.spark.sql.functions.udf // function that returns 0 is string empty val func = udf( (s:String) => if(s.isEmpty) 0 else 1 ) // create new dataframe with added column named "notempty" val r = d.select( $"a", $"b", func($"a").as("notempty") ) scala> r.show +---+---+--------+ | a| b|notempty| +---+---+--------+ | a| 1| 1111| | b| 2| 1111| | | 3| 0| | d| 4| 1111| +---+---+--------+ 元素也是inline-block(或任何其他州,只要它都是一致的)。然后,将vertical-align:top;设置为父容器,将min-height设置为所有min-height&n;元素