Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML code to indent without using blockquote (so there is no space on the next line)

Tags:

html

css

I am trying to create a block of indented text without using block quote. The reason I want to do this is because block quote adds an additional space between the indented block of text and the previous paragraph.

alt text

I wan the indented piece of text to be flush up against the the non-indented piece of text.

like image 557
Spencer Avatar asked Feb 26 '23 12:02

Spencer


1 Answers

You can use padding-left and display: block CSS property and then wrap the text to be indented in a span. E.g.:

<p>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
    Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 
    when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
    <span style="padding-left: 20px; display:block">
        It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. 
    </span>
    It was popularised in the 1960s with the release of Letraset sheets containing Lore
</p>
like image 84
Chandu Avatar answered Apr 09 '23 16:04

Chandu