开发者

How to align elemens inside <ol> with Numbering of <ol> when we have multiple elements inside <ol>

I need to make like this

How to align elemens inside <ol> with Numbering of <ol> when we have multiple elements inside <ol>

with this mark-up

<ol>
    <li>
        <h2>Lorem ipsum dolor sit amet</h2> 
        <h3>consectetuer adipiscing elit</h3></li>
   <li>
        <h2>Lorem ipsum dolor sit amet</h2>
        <h3>consectetuer adipiscing 开发者_开发问答elit</h3>
  </li>
   <li>
        <h2>Lorem ipsum dolor sit amet</h2>
        <h3>consectetuer adipiscing elit</h3>
  </li>
</ol>

But I'm unable to make H2, h3 inline with Digit

See Jsfiddle here http://jsfiddle.net/jitendravyas/ZaV3b/3/

Questions

Is my tag selection OK, or are there any better way?

How to get desired positioning?

You can try in my jS fiddle example


I think you are looking for this:

li {font-size:70px;padding-top:40px;}
h2 {font-size:30px;margin-top:-30px; position: absolute}
h3 {font-size:20px;margin-top:0;}

Give h2 an absolute position with negative margin-top.

See The Demo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜