zoukankan      html  css  js  c++  java
  • 每天一个css text-indent

    text-indent :用于块级元素,指定块级元素第一行文本的缩进距离。
          
    值:  <长度> | <百分比> | inherit
    初始值:   0
    应用于:   块级容器
    是否继承:  
    百分比:   根据块级容器的宽度
    Media:   visual
    计算值:   百分比值或者绝对长度
    举例:p { text-indent: 3em } p为块级元素


    英文网址:http://www.w3.org/TR/CSS21/text.html#propdef-text-indent
    英文原版:
    'text-indent'
    Value:   <length> | <percentage> | inherit
    Initial:   0
    Applies to:   block containers
    Inherited:   yes
    Percentages:   refer to width of containing block
    Media:   visual
    Computed value:   the percentage as specified or the absolute length

    This property specifies the indentation of the first line of text in a block container. More precisely, it specifies the indentation of the first box that flows into the block's first line box. The box is indented with respect to the left (or right, for right-to-left layout) edge of the line box. User agents must render this indentation as blank space.

    'Text-indent' only affects a line if it is the first formatted line of an element. For example, the first line of an anonymous block box is only affected if it is the first child of its parent element.

    Values have the following meanings:

    <length>
    The indentation is a fixed length.
    <percentage>
    The indentation is a percentage of the containing block width.

    The value of 'text-indent' may be negative, but there may be implementation-specific limits. If the value of 'text-indent' is either negative or exceeds the width of the block, that first box, described above, can overflow the block. The value of 'overflow' will affect whether such text that overflows the block is visible.

    The following example causes a '3em' text indent.

    
    p { text-indent: 3em }
    

    Note: Since the 'text-indent' property inherits, when specified on a block element, it will affect descendant inline-block elements. For this reason, it is often wise to specify 'text-indent: 0' on elements that are specified 'display:inline-block'.

  • 相关阅读:
    快速排序?
    算法和数据结构?
    渲染一个react?
    移动端兼容适配?
    PWA全称Progressive Web App,即渐进式WEB应用?
    InnoDB一棵B+树可以存放多少行数据?
    移动端首屏优化?
    InnoDB什么时候会锁表?
    数组去重,多种方法?
    如何处理异形屏iphone X?
  • 原文地址:https://www.cnblogs.com/lifeisshort/p/4830484.html
Copyright © 2011-2022 走看看