zoukankan      html  css  js  c++  java
  • 用CSS让文字居于div的底部

    css文字的布局上没有靠容器底部对齐的参数,目前使用的一个不错的方法也比较好.就是用position属性来解决,看下面的代码,用position的相对和绝对定位功能也轻松的实现了,文字靠近div低部对齐,并且靠近的距离还可以精确到像素,自己可以调节,是不是很不错呢?

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    <style type="text/css">
    #txt{ 
     
     height:300px;
     300px;
     border:1px solid #333333;
     text-align:center;
     position:relative 
     
    }
    #txt p{
     position:absolute;
     bottom:0px;
     padding:0px;
     margin:0px
    }
    </style>
    </head
     
    <body>
    <div id=txt>
    <p>aadsad</p>
    </div>
    </body>
    </html>
  • 相关阅读:
    debounce
    react-xiguan
    备忘录
    ie导出问题
    umi 动态路由配置
    tsconfig
    关于vue 和react 中的hash与锚点冲突问题
    lodash
    pyplot绘图
    Numpy实现图像变换
  • 原文地址:https://www.cnblogs.com/turnip/p/11595803.html
Copyright © 2011-2022 走看看