为了账号安全,请及时绑定邮箱和手机立即绑定

如何首行悬挂?

http://img1.sycdn.imooc.com//583794760001bafd08480066.jpg

如图,如何实现这种段落排版,我想到的是首行悬挂?那有指令么?

正在回答

3 回答


<style type="text/css">

p {

    width: 200px;

    padding-left: 2em;

}

p:first-letter {

    margin-left: -2em;

}

</style>

 </head>


 <body>

    <h4>悬挂缩进样式</h4>

    <p>

        The length of the first line depends on a number of factors, such as the width of the page and the font size.</p>

    <p>

        The :first-line pseudo-element can be attached to block-level elements. It can be attached to inline elements if you set the corresponding display property to block.</p>

    <p>悬挂缩进其实是首字缩进滴一种特殊应用!没啥说滴,快结贴给分吧,哈哈</p>

 </body>


1 回复 有任何疑惑可以回复我~

p {

    width: 200px;

    padding-left: 2em;

}

p:first-letter {

    margin-left: -2em;

}


0 回复 有任何疑惑可以回复我~
#1

Yilia要多读书 提问者

get!
2016-11-25 回复 有任何疑惑可以回复我~
#2

慕的地9276089

p:first-lette{}. p后面加“:”,什么意思?之前没有加“:”的啊
2017-06-14 回复 有任何疑惑可以回复我~

属性 position:fixed;

0 回复 有任何疑惑可以回复我~
#1

Yilia要多读书 提问者

不懂,这是什么意思?运行了一下不行啊
2016-11-25 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
初识HTML(5)+CSS(3)-升级版
  • 参与学习       1226743    人
  • 解答问题       18245    个

HTML(5)+CSS(3)基础教程8小时带领大家步步深入学习标签用法和意义

进入课程

如何首行悬挂?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信