Bootstrap snippet and html example. summernote working if edit on sublime

Bootstrap 4.0.0-alpha.5 snippet "summernote working if edit on sublime" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.

HTML code

Clean, semantic HTML that powers this Bootstrap 4.0.0-alpha.5 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Add Article - Bootdey.com</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
    <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.7/summernote.css" rel="stylesheet">
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> 
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script> 
    <script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.7/summernote.js"></script>
    <style type="text/css">
        body{margin-top:20px;}.form-inline .form-group { margin-right:10px; }
        .well-primary {
            background-color: #3498db; 
        }

        .well-primary {
            color: rgb(255, 255, 255);
            background-color: rgb(66, 139, 202);
            border-color: rgb(53, 126, 189);
        }
        .glyphicon { margin-right:5px; }

        .container{
            margin-top:20px;
        }
        .image-preview-input {
            position: relative;
            overflow: hidden;
            margin: 0px;    
            color: #333;
            background-color: #fff;
            border-color: #ccc;    
        }
        .image-preview-input input[type=file] {
            position: absolute;
            top: 0;
            right: 0;
            margin: 0;
            padding: 0;
            font-size: 20px;
            cursor: pointer;
            opacity: 0;
            filter: alpha(opacity=0);
        }
        .image-preview-input-title {
            margin-left:2px;
        }


    </style>
</head>
<body>

    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="panel-group" id="accordion">
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"><span class="glyphicon glyphicon-file">
                                </span>POST NEW ARTICLE</a>
                            </h4>
                        </div>
                        <div id="collapseOne" class="panel-collapse collapse in">
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group">
                                            <input type="text" class="form-control" placeholder="Title" required />
                                        </div>
                                        <div class="form-group">
                                            <textarea id="summernote" class="form-control" placeholder="Content" rows="5" required></textarea>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label for="category">
                                                Category</label>
                                                <select class="form-control" id="category">
                                                    <option>Articles</option>
                                                    <option>PHP Native</option>
                                                    <option>PHP OOP</option>
                                                    <option>HTML</option>
                                                    <option>CSS</option>
                                                    <option>HTML [5] + CSS [3]</option>
                                                    <option>Javascript</option>
                                                    <option>JQurey</option>
                                                    <option>File Api</option>
                                                    <option>Belajar Framework Codeigniter</option>
                                                    <option>Freebies</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="tags">
                                                    Tags</label>
                                                    <input type="text" class="form-control" id="tags" placeholder="Tags" />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="well well-sm well-primary">
                                                    <div class="input-group image-preview">
                                                        <input type="text" class="form-control image-preview-filename" disabled="disabled"> <!-- don't give a name === doesn't send on POST/GET -->
                                                        <span class="input-group-btn">
                                                            <!-- image-preview-clear button -->
                                                            <button type="button" class="btn btn-default image-preview-clear" style="display:none;">
                                                                <span class="glyphicon glyphicon-remove"></span> Clear
                                                            </button>
                                                            <!-- image-preview-input -->
                                                            <div class="btn btn-default image-preview-input">
                                                                <span class="glyphicon glyphicon-folder-open"></span>
                                                                <span class="image-preview-input-title">Browse</span>
                                                                <input type="file" accept="image/png, image/jpeg, image/gif" name="input-file-preview"/> <!-- rename it -->
                                                            </div>
                                                        </span>
                                                    </div><!-- /input-group image-preview [TO HERE]--> 
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="well well-sm well-primary">
                                                    <form class="form form-inline " role="form">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" value="" placeholder="Date" required />
                                                        </div>
                                                        <div class="form-group">
                                                            <select class="form-control">
                                                                <option>Draft</option>
                                                                <option>Published</option>
                                                            </select>
                                                        </div>
                                                        <div class="form-group">
                                                            <button type="submit" class="btn btn-success btn-sm">
                                                                <span class="glyphicon glyphicon-floppy-disk"></span>Save</button>
                                                                <button type="button" class="btn btn-default btn-sm">
                                                                    <span class="glyphicon glyphicon-eye-open"></span>Preview</button>
                                                                </div>
                                                            </form>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="panel panel-default">
                                        <div class="panel-heading">
                                            <h4 class="panel-title">
                                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"><span class="glyphicon glyphicon-th-list">
                                                </span>META DATA</a>
                                            </h4>
                                        </div>
                                        <div id="collapseTwo" class="panel-collapse collapse">
                                            <div class="panel-body">
                                                <div class="row">
                                                    <div class="col-md-12">
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" placeholder="Title" required />
                                                        </div>
                                                        <div class="form-group">
                                                            <input type="text" class="form-control" placeholder="Description" required />
                                                        </div>
                                                        <div class="form-group">
                                                            <textarea id="summernote" class="form-control" placeholder="Keywords" required></textarea>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-md-12">
                                                        <div class="well well-sm well-primary">
                                                            <form class="form form-inline " role="form">
                                                                <div class="form-group">
                                                                    <a href="http://www.jquery2dotnet.com" class="btn btn-success btn-sm"><span class="glyphicon glyphicon-floppy-disk">
                                                                    </span>Save</a>
                                                                </div>
                                                            </form>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
                    <script type="text/javascript">
                     $(document).on('click', '#close-preview', function(){ 
                        $('.image-preview').popover('hide');
// Hover befor close the preview
$('.image-preview').hover(
    function () {
        $('.image-preview').popover('show');
    }, 
    function () {
        $('.image-preview').popover('hide');
    }
    );    
});

                     $(function() {
// Create the close button
var closebtn = $('<button/>', {
    type:"button",
    text: 'x',
    id: 'close-preview',
    style: 'font-size: initial;',
});
closebtn.attr("class","close pull-right");
// Set the popover default content
$('.image-preview').popover({
    trigger:'manual',
    html:true,
    title: "<strong>Preview</strong>"+$(closebtn)[0].outerHTML,
    content: "There's no image",
    placement:'bottom'
});
// Clear event
$('.image-preview-clear').click(function(){
    $('.image-preview').attr("data-content","").popover('hide');
    $('.image-preview-filename').val("");
    $('.image-preview-clear').hide();
    $('.image-preview-input input:file').val("");
    $(".image-preview-input-title").text("Browse"); 
}); 
// Create the preview image
$(".image-preview-input input:file").change(function (){     
    var img = $('<img/>', {
        id: 'dynamic',
        width:250,
        height:200
    });      
    var file = this.files[0];
    var reader = new FileReader();
// Set preview image into the popover data-content
reader.onload = function (e) {
    $(".image-preview-input-title").text("Change");
    $(".image-preview-clear").show();
    $(".image-preview-filename").val(file.name);            
    img.attr('src', e.target.result);
    $(".image-preview").attr("data-content",$(img)[0].outerHTML).popover("show");
}        
reader.readAsDataURL(file);
});  
});
</script>

<script>
    $('#summernote').summernote({
  height: 240,                 // set editor height
  minHeight: null,             // set minimum height of editor
  maxHeight: null,             // set maximum height of editor
  focus: true                  // set focus to editable area after initializing summernote
});

    $('#summernote').summernote({
        placeholder: 'konten wajib diisi ...'
    });

</script>
</body>
</html>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 4.0.0-alpha.5 to keep the design, spacing, and responsiveness consistent.

body{margin-top:20px;}

Similar snippets

Bootstrap example and template. Pricing table

Pricing table

Bootstrap example and template. Pricing Package Table

Pricing Package Table

Bootstrap example and template. Bootdey new snippets cards

Bootdey new snippets cards

Bootstrap example and template. Compose message form

Compose message form

Bootstrap example and template. Login form with background image

Login form with background image

Bootstrap example and template. file manager with folders recent files and members

file manager with folders recent files and members

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template.  NavBar Menu Dropdowns

NavBar Menu Dropdowns

FAQ

How do I use this snippet?

Include Bootstrap 4.0.0-alpha.5, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 4.0.0-alpha.5.

Bootstrap example and template. summernote working if edit on sublime

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 1.2K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 4.0.0-alpha.5

<link rel='stylesheet' href='https://netdna.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css'>

<script src='https://netdna.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js'></script>

This code example is based on bootstrap 4.0.0-alpha.5 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working