question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spacing Not Working for Ordered List

See original GitHub issue

I’m trying the spacing utility for this ordered list. I will use all -n3 for this test case. It works for every other resolution except for the ml-sm-n3 class. It only works for sm resolution if I use ml-n3 instead of ml-sm-n3 class.

Here’s the code;

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" />
</head>
<body>
<p>Spacing utility</p>
<div>&nbsp;&nbsp;&emsp;&darr;</div>
<ol class="ml-sm-n3 ml-md-n3 ml-lg-n3 ml-xl-n3">
<li>Item</li>
<li>Item 2</li>
</ol>
</body>
</html>

Preview; bs-spacing

I’m using; Bootstrap: Version 4.4.1 Operating system: Microsoft Windows 10 Version 2004 (OS Build 19041.508) (64-bit) Browser: Microsoft Edge Version 85.0.564.51 (64-bit)

What am I doing wrong here?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mdocommented, Sep 23, 2020

It only works for sm resolution if I use ml-n3 instead of ml-sm-n3 class.

That’s by design. See the above comments for more information on this as well. Beyond that, you’re using negative margin to override the default padding-left on <ol>s when you could change the padding instead.

1reaction
razhcommented, Sep 22, 2020

.ml-n3 would work.

There’s no need for all of the other breakpoints since each class applies to all breakpoints above:

<ol class="ml-n3 ml-sm-n3 ml-md-n3 ml-lg-n3">

Is the same as:

<ol class="ml-n3">
Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I set vertical space between list items? - Stack Overflow
All CSS needs to be inline. In the case where you want to adjust the spacing between the bullets I use li style="margin-bottom:8px;"...
Read more >
Styling lists - Learn web development | MDN
The list items ( <li> elements) have no set defaults for spacing. The <dl> element has a top and bottom margin of 16px...
Read more >
Best Practices for List Spacing (both UL & OL) - SitePoint
Mostly concerned with spacing between list items, but also with left-indent issues across all browsers. These are NOT menus.
Read more >
How to change spacing between items in a list in Word
Add spacing between list items · Open Microsoft Word · Select the Layout tab from the Ribbon · From the Paragraph dialog box,...
Read more >
Topic: How to add space between items in ordered list
So there's space between the bulleted items up on wordpress but then no spacing when it's fed onto my site through rss.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found