Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS定位——元素位于右下角、左下角_Css - Fatal编程技术网

CSS定位——元素位于右下角、左下角

CSS定位——元素位于右下角、左下角,css,Css,我想把“9月27日的比赛”放在左下角,在“失去100个筹码”的对面,但我看不到它放在左下角 以下是我当前的CSS: 有什么建议吗?非常感谢 最简单的方法是将所有三个div(.recenteventsdeail、.recentEventsLowerLeftElement、.recenteventslowerrighelement)放入一个包装div中,位置为:relative。然后您可以使下divs位置:绝对并以此方式设置位置。例如: <style type="text/css">

我想把“9月27日的比赛”放在左下角,在“失去100个筹码”的对面,但我看不到它放在左下角

以下是我当前的CSS:


有什么建议吗?非常感谢

最简单的方法是将所有三个div(.recenteventsdeail、.recentEventsLowerLeftElement、.recenteventslowerrighelement)放入一个包装div中,位置为:relative。然后您可以使下divs
位置:绝对并以此方式设置位置。例如:

<style type="text/css">
  .reventEventsWrapper {position: relative;}
  .recentEventsLowerLeftElement {position: absolute; bottom: 0px; left: 0px;}
  .recentEventsLowerRightElement {position: absolute; bottom: 0px; right: 0px;}
</style>
<div class="reventEventsWrapper">
  <div class="recentEventsDetail"></div>
  <div class="recentEventsLowerLeftElement"></div>
  <div class="recentEventsLowerRightElement"></div>
</div>

.reventEventsWrapper{位置:相对;}
.recentEventsLowerLeftElement{位置:绝对;底部:0px;左侧:0px;}
.recentEventsLowerRightElement{位置:绝对;底部:0px;右侧:0px;}

在包装器上使用相对位置使绝对定位的子对象使用该div的原点来计算位置。这里唯一的问题是,可能存在重叠。此外,您可能还希望将填充底部添加到包装器中,使其等于左、右div的高度。这确保它们不会与细节div重叠。

最简单的方法是将所有三个div(.recenteventsdeail、.recentEventsLowerLeftElement、.recenteventslowerrighelement)放在一个包装div内,位置为
相对。然后您可以使下divs
位置:绝对并以此方式设置位置。例如:

<style type="text/css">
  .reventEventsWrapper {position: relative;}
  .recentEventsLowerLeftElement {position: absolute; bottom: 0px; left: 0px;}
  .recentEventsLowerRightElement {position: absolute; bottom: 0px; right: 0px;}
</style>
<div class="reventEventsWrapper">
  <div class="recentEventsDetail"></div>
  <div class="recentEventsLowerLeftElement"></div>
  <div class="recentEventsLowerRightElement"></div>
</div>

.reventEventsWrapper{位置:相对;}
.recentEventsLowerLeftElement{位置:绝对;底部:0px;左侧:0px;}
.recentEventsLowerRightElement{位置:绝对;底部:0px;右侧:0px;}

在包装器上使用相对位置使绝对定位的子对象使用该div的原点来计算位置。这里唯一的问题是,可能存在重叠。此外,您可能还希望将填充底部添加到包装器中,使其等于左、右div的高度。这将确保它们不会与细节部分重叠。

您当前为.recentEventsLowerLeftElement和.recentEventsLowerRightElement使用的css是什么

为了确保它们被清除到下一行,我将执行以下操作:

<div class="recentEventsLowerElement">
    <div class="recentEventsLowerLeftElement">
    </div>

    <div class="recentEventsLowerRightElement">
    </div>  
</div><!-- end .recentEventsLowerElement -->

.RecentEventSlowRelation{clear:两者;}

.最近事件降低 .recentEventsLowerLeftElement{ 浮动:左;}

.最近事件降低 .recentEventsLowerRightElement{ float:right;}


您当前对.recentEventsLowerLeftElement和.recentEventsLowerRightElement有什么css

为了确保它们被清除到下一行,我将执行以下操作:

<div class="recentEventsLowerElement">
    <div class="recentEventsLowerLeftElement">
    </div>

    <div class="recentEventsLowerRightElement">
    </div>  
</div><!-- end .recentEventsLowerElement -->

.RecentEventSlowRelation{clear:两者;}

.最近事件降低 .recentEventsLowerLeftElement{ 浮动:左;}

.最近事件降低 .recentEventsLowerRightElement{ float:right;}