1

Text inside the p should start in the same line with the h3 element just like in the image bellow, but without using margin or padding. Any solution for this?

image

.inner h1, h3{
  display: inline-block;
  vertical-align: text-bottom;
}
<div class="inner">
  <h1>1.</h1> <h3>Download app</h3> <h3>Free</h3>
  <p> Some text here Some text here Some text here</p>
  <p> Some text here Some text here Some text here</p>
</div>

3
  • use paragraph instead of heading,and set style separately. Commented Nov 11, 2017 at 10:42
  • 2
    <h1>1.</h1><h3>Download app</h3> breaks my heart. I would rather do <h1><span>1.</span>Header</h1> or maybe even use CSS counters. Commented Nov 11, 2017 at 10:48
  • jsfiddle.net/F3Bcd/3 Commented Nov 11, 2017 at 11:02

3 Answers 3

3

You may simply use ol list for this :

<ol>
  <li>
    <h3>Download app<br/>Free</h3>
    <p> Some text here Some text here Some text here<br/>Some text here Some text here Some text here</p>
  </li>
</ol>

Sign up to request clarification or add additional context in comments.

Comments

1

Using flex-box you can "stretch" the h1 to take the entire height of the right side.

.inner {
  display: flex;
}

h1,
h3 {
  margin: 0;
}
<div class="inner">
  <h1>1.</h1>
  <div>
    <h3>Download app Free</h3>
    <p> Some text here Some text here Some text here</p>
    <p> Some text here Some text here Some text here</p>
  </div>
</div>

Comments

0

Give text-indent to p tag like this:

.inner p {
  text-indent: 23px;
}

.inner h1, h3{
  display: inline-block;
  vertical-align: middle;
}
.inner p {
  text-indent: 23px;
}
<div class="inner">
  <h1>1.</h1><h3> Download app</h3> <h3>Free</h3>
  <p> Some text here Some text here Some text here</p>
  <p> Some text here Some text here Some text here</p>
</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.