Skip to content

Instantly share code, notes, and snippets.

@coreymartella
Forked from tomhodgins/html-tooltips.html
Created July 19, 2017 18:08
Show Gist options
  • Save coreymartella/2c6dd17654874c30d5594256f722b815 to your computer and use it in GitHub Desktop.
Save coreymartella/2c6dd17654874c30d5594256f722b815 to your computer and use it in GitHub Desktop.
HTML inside Bootstrap tooltips
<!DOCTYPE html>
<html>
<head>
<title>Tooltip HTML Styles</title>
<!-- Bootstrap: with responsive, no icons -->
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<!-- FontAwesome -->
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
<!-- jQuery -->
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<!-- Boostrap JavaScript -->
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script>
<!-- Source Sans via Google Web Fonts -->
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
</head>
<body>
<!-- HTML Section -->
<div class="container">
<div class="row-fluid">
<div class="span12">
<div class="hero-unit">
<h1 style="text-align:center;">Tooltip HTML Styles</h1>
<h2>Default Bootstrap Tooltips, with HTML</h2>
<p>
<a href="#" data-toggle="tooltip" data-html="true" title="This is a regular Bootstrap tooltip<ul><li>item 1</li><li>item 2</li></ul>">I contain a &lt;ul&gt;</a>
</p>
<p>
<a href="#" data-toggle="tooltip" data-html="true" title="<img src='http://placehold.it/250/250'>">I contain an image</a>
</p>
</div>
</div>
</div>
<!-- JavaScript Section -->
<script type="text/javascript">
$(document).ready(function(){
$('a[data-toggle=tooltip]').tooltip();
});
</script>
<!-- CSS Section -->
<style>
* {
font-family: 'Source Sans Pro', sans-serif;
}
.hero-unit {
margin-top: 100px;
font-weight: 400;
}
</style>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment