admin管理员组

文章数量:1287080

I am using 
 to break line inside bootstrap popover data-content attribute but it doesn't work. How is that possible? Also is that possible to make some bold content in it?

$(document).ready(function(){
    $('[data-toggle="popover"]').popover();   
});
 <link rel="stylesheet" href=".3.7/css/bootstrap.min.css">
  <script src=".3.1/jquery.min.js"></script>
  <script src=".3.7/js/bootstrap.min.js"></script></script>
<div class="container">
  <a href="#" title="Header" data-toggle="popover" data-trigger="hover" data-content="Hello, i need &#013; to break line.">hover me</a>
</div>

I am using &#013; to break line inside bootstrap popover data-content attribute but it doesn't work. How is that possible? Also is that possible to make some bold content in it?

$(document).ready(function(){
    $('[data-toggle="popover"]').popover();   
});
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn./bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis./ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn./bootstrap/3.3.7/js/bootstrap.min.js"></script></script>
<div class="container">
  <a href="#" title="Header" data-toggle="popover" data-trigger="hover" data-content="Hello, i need &#013; to break line.">hover me</a>
</div>

Share Improve this question edited Apr 17, 2018 at 11:07 asked Apr 17, 2018 at 11:00 user9402741user9402741 2
  • Possible duplicate of Bootstrap popover hides line breaks – raul.vila Commented Apr 17, 2018 at 11:02
  • Try this – Binar Web Commented Apr 17, 2018 at 11:02
Add a ment  | 

2 Answers 2

Reset to default 12

$(document).ready(function(){
    $('[data-toggle="popover"]').popover();   
});
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn./bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis./ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn./bootstrap/3.3.7/js/bootstrap.min.js"></script></script>
<div class="container">
  <a href="#" title="Header" data-toggle="popover" data-trigger="hover" data-content="Hello, i need <br /> to break line.<b>BOLD HERE</b>" data-html="true">hover me</a>
</div>

Use data-html="true" and <br/>

Use <br /> to break lines in popover

本文标签: javascriptBreaking line inside Bootstrap popoverStack Overflow