HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div class="container">
<br/>
<h1>Bootstrap Select - diablo3 style</h1><br/>
<div class="row">
<div class="col-md-6">
<h3>Single select // character selection :</h3>
<select class="d3-select form-control" id="character-selection" data-live-search="false">
<option value="barbarian" data-content="<img class='img-flag' src='https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/barbarianmale.png'>Barbarian">Barbarian</option>
<option value="crusader" data-content="<img class='img-flag' src='https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/crusadermale.png'>Crusader">Crusader</option>
<option value="demon-hunter" data-content="<img class='img-flag' src='https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/demon-huntermale.png'>Demon Hunter">Demon Hunter</option> <option data-content="<img class='img-flag' src='https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/monkmale.png'>Monk" value="Monk" >Monk</option>
<option value="necromancer" data-content="<img class='img-flag' src='https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/necromancermale.png'>Necromancer">Necromancer</option>
<option value="witch-doctor" data-content="<img class='img-flag' src='https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/witch-doctormale.png'>Witch Doctor">Witch Doctor</option>
<option value="wizard" data-content="<img class='img-flag' src='https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/wizardmale.png'>Wizard">Wizard</option>
</select>
</div>
</div>
<div class="row">
<div class="col-md-6">
<br/><br/>
<h3>Multiple select // Conquest selection :</h3>
<select class="d3-select form-control" title="Choose a conquest..." multiple data-selected-text-format="count > 1" data-count-selected-text= "{0} conquests selected" data-size="auto">
<option data-content="<img class='img-flag' src='https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/wizardmale.png'>Race to the top" value="Race to the top">Race to the top</option>
<option value="Living Dangerously">Living Dangerously</option>
<option value="It's A Marathon...">It's A Marathon...</option>
<option value="Better Lucky Than Good">Better Lucky Than Good</option>
<option value="Divinity">Divinity</option>
<option value="Lionhearted" data-subtext="Hardcore">Lionhearted</option>
<option value="Sprinter">Sprinter</option>
<option value="Speed Racer">Speed Racer</option>
<option value="Death Gets Got">Death Gets Got</option>
<option value="Sprinter">Top Spot</option>
<option value="Now You've Done It">Now You've Done It</option>
<option value="Now You've Really Done It">Now You've Really Done It</option>
<option value="The Thrill">The Thrill</option>
<option value="Super Human">Super Human</option>
<option value="On a good day">On a good day</option>
<option value="I can't stop">I can't stop</option>
<option value="Avarice">Avarice</option>
<option value="Avaritia">Avaritia</option>
</select>
</div>
</div>
</div>
/*
Make bootstrap-select work with bootstrap 4 see:
https://github.com/silviomoreto/bootstrap-select/issues/1135
*/
:focus{
outline:none;
}
.bootstrap-select .dropdown-toggle:focus{
outline:none !important;
box-shadow:none;
}
.dropdown-toggle.btn-default {
color: #292b2c;
background-color: #fff;
border-color: #ccc;
}
.bootstrap-select.show > .dropdown-menu > .dropdown-menu {
display: block;
height:100%;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li.hidden {
display: none;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li a {
display: block;
width: 100%;
padding: 3px 1.5rem;
clear: both;
font-weight: 400;
color: #292b2c;
text-align: inherit;
white-space: nowrap;
background: 0 0;
border: 0;
text-decoration: none;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li a:hover {
background-color: #f4f4f4;
}
.bootstrap-select > .dropdown-toggle {
width: 100%;
}
.dropdown-menu > li.active > a {
color: #fff !important;
background-color: #337ab7 !important;
}
.bootstrap-select .check-mark {
line-height: 14px;
}
.bootstrap-select .check-mark::after {
font-family: "FontAwesome";
content: "\f00c";
}
.bootstrap-select button {
overflow: hidden;
text-overflow: ellipsis;
}
/* Make filled out selects be the same size as empty selects */
.bootstrap-select.btn-group .dropdown-toggle .filter-option {
display: inline !important;
}
/*customized*/
.img-flag {
height: 26px;
width: 26px;
margin-top:-4px;
margin-right:5px;
}
.bootstrap-select.btn-group > .dropdown-menu {
width: calc(100% + 14px);
margin-left: -7px;
height:200px;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li.selected a{
background-color:#810102;
color:white;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li a:hover{
background-color:#da7e01;
color:white;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark{
display:none;
}
.dropdown-menu, .bootstrap-select.form-control{
border:none;
padding-top: 0px;
padding-bottom:0px;
/*max-height:200px !important;*/
border-radius: 0;
font-weight:400;
border-style: solid;
border-width: 7px 7px 7px 7px;
-moz-border-image: url(https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/scrolldown.png) 7 7 7 7 fill stretch repeat;
-webkit-border-image: url(https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/scrolldown.png) 7 7 7 7 fill stretch repeat;
-o-border-image: url(https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/scrolldown.png) 7 7 7 7 fill stretch repeat;
border-image: url(https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/scrolldown.png) 7 7 7 7 fill stretch repeat;
background:none;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li a{
color:#b3a684;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li a{
padding:6px;
}
.bootstrap-select.form-control{
height:44px;
}
.bootstrap-select.form-control .btn{
background:none;
color:white;
border:none;
padding:3px;
padding-right:25px;
font-size:18px;
}
.bootstrap-select.btn-group .dropdown-toggle .bs-caret{
position:absolute;
top: 0;
bottom: 0;
right: 0;
margin: auto;
margin-right: -1px;
width: 32px;
height: 32px;
background: url(https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/ScrolldownButton.png);
background-position: left top;
}
.bootstrap-select.btn-group .dropdown-toggle:hover .bs-caret{
background-position: left center;
}
.bootstrap-select.btn-group .dropdown-toggle:active .bs-caret{
background-position: left bottom;
}
.bootstrap-select.show .dropdown-toggle .bs-caret{
background-position: center top;
}
.bootstrap-select.show .dropdown-toggle:hover .bs-caret{
background-position: center center;
}
.bootstrap-select.show .dropdown-toggle:active .bs-caret{
background-position: center bottom;
}
/*scroll*/
.mCSB_inside>.mCSB_container{
margin-right:38px;
}
.mCSB_inside>.mCSB_container{
margin-right:34px;
}
.mCSB_scrollTools{
width:33px;
min-height:10px;
opacity:1;
}
.mCSB_scrollTools .mCSB_buttonUp{
background-image: url(https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/ScrollArrowBottom.png);
width:33px;
height:33px;
left:0;
right:0;
margin:auto;
background-position:right top !important;
opacity:1;
}
.mCSB_scrollTools .mCSB_buttonDown{
background-image: url(https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/ScrollArrowBottom.png);
width:33px;
height:33px;
left:0;
right:0;
margin:auto;
background-position:left top !important;
opacity:1;
}
.mCSB_scrollTools .mCSB_buttonUp:hover{
background-position:right -33px !important;
}
.mCSB_scrollTools .mCSB_buttonDown:hover{
background-position:left -33px !important;
}
.mCSB_scrollTools .mCSB_buttonUp:active{
background-position:right -66px !important;
}
.mCSB_scrollTools .mCSB_buttonDown:active{
background-position:left -66px !important;
}
.mCSB_scrollTools a+.mCSB_draggerContainer{
margin-top:35px;
margin-bottom:33px;
}
.mCS-light-2.mCSB_scrollTools .mCSB_draggerRail{
width:100%;
background:url("https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/scrollbar-vertical.png");
}
.mCS-light-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar {
width: 100%;
background: url(https://raw.githubusercontent.com/cromartie1984/diablo3-project/master/ScrollButton.png);
background-position: left top !important;
}
.mCSB_scrollTools .mCSB_dragger{
width:25px;
height: 35px;
left:0;
right:0;
margin:auto;
}
$('.d3-select').selectpicker();
$('.d3-select').on('shown.bs.select', function (e) {
$(this).find('.dropdown-menu.inner').mCustomScrollbar({
scrollButtons:{
enable:true,
scrollAmount : "auto",
scrollType: "stepless"
},
keyboard:{
enable: true,
scrollAmount : "auto",
scrollType: "stepless"
},
autoDraggerLength: false,
autoHideScrollbar : false,
autoExpandScrollbar : false,
snapAmount : 5,
alwaysShowScrollbar : 0 ,
mouseWheel:{
disableOver: ["select","option","keygen","datalist","textarea"],
deltaFactor : "100"
},
theme : "light-2"
});
});
$('.d3-select').on('hide.bs.select', function (e) {
$(this).find('.dropdown-menu.inner').mCustomScrollbar('destroy');
});
Also see: Tab Triggers