Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

line break inside a list item generates space between the lines

Tags:

I want to break line <br/> inside a <li> Like:

  • First line
    second line
  • Second li
  • third li

but when doing so (both labels)- I get a space between them. margin and padding is 0 but still I get it.. any idea how to get rid of it? Thanks!

like image 886
Guy Avatar asked Feb 28 '11 10:02

Guy


People also ask

What creates a line break?

The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.

What is a line break in?

Also called "EOL" (end-of-line), "newline," and "hard return," a line break code is generated when the Enter key is pressed, When typing a command on a command line, pressing Enter executes the command. When typing text, pressing Enter signifies the end of the paragraph, and subsequent text goes to the next line.

How do you line break a list in Python?

You can split a string by line breaks into a list with the string method, splitlines() . In addition to \n and \r\n , it is also splitted by \v (line tabulation) or \f (form feed), etc. See also the following article for more information on splitlines() . Split strings in Python (delimiter, line break, regex, etc.)

How do you add space between list items in HTML?

To create space between list bullets and text in HTML, use CSS padding property. Left padding padding-left is to be added to <ul> tag list item i.e. <li> tag. Through this, padding gets added, which will create space between list bullets and text in HTML.


2 Answers

This is a simple solution...

by adding a <br/><br/> in your <li> will add a blank line break directly underneath

<ul>     <li>Line 1<br/><br/></li>     <li>Line 2</li>     <li>Line 3</li>     <li>Line 4<br/><br/></li>     <li>Line 5</li> </ul> 
like image 57
JGilmartin Avatar answered Sep 29 '22 19:09

JGilmartin


You can alter the line-height property in your css. Does that help ?

like image 22
Steven Ryssaert Avatar answered Sep 29 '22 19:09

Steven Ryssaert