Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

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.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="site-container">
    <div class="site-pusher">
        <header class="header">
            <a href="#" class="header__icon" id="header__icon"></a>
            <a href="#" class="header__logo">Logo</a>
        </header>
        <div class="site-content">
            <nav class="menu">
                <a href="#">Accueil</a>
                <a href="#">Articles</a>
                <a href="#">Commentaires</a>
                <a href="#">Contacts</a>
                <a href="#">Paramètres</a>
                <a href="#">Déconnexion</a>
            </nav>
            <div class="container">
                <div class="article article-detail">
                    <div class="first_line_header clearfix">
                        <div class="header_title">
                            <span class="header_title_text">Article 1</span>
                        </div>
                        <div class="header_address">
                            Rue des 7 misères, 2                            
						</div>
                    </div>
                    <div class="second_line_header clearfix">
                        <div class="header_admin_datetime">
                            <span class="header_text">Sophie</span>
                        </div>
                        <div class="header_more_options_icon">
                            <div class="dropdown">
                                <input type="button" class="dropbtn" value="&#8942;">
                                <nav class="dropdown-content">
                                    <a href="#" class="manage-article">Modifier</a>
									<a href="#" class="manage-article">Supprimer</a>
									<a href="#" class="manage-article">Insérer</a>
                                </nav>
                            </div>
                        </div>
                    </div>
                    <div class="separate_line"></div>
                    <div class="article_content">
                        <p><span style="font-size:14px"><u><strong><span style="background-color:#27ae60">Ceci est un test ...</span></strong></u></span></p>
                    </div>
                </div>
                <div class="article article-detail">
                    <div class="first_line_header clearfix">
                        <div class="header_title">
                            <span class="header_title_text">Article 2</span>
                        </div>
                        <div class="header_address">
                            Chaussée romaine, 44                            
						</div>
                    </div>
                    <div class="second_line_header clearfix">
                        <div class="header_admin_datetime">
                            <span class="header_text">Julie</span>
                        </div>
                        <div class="header_more_options_icon">
                            <div class="dropdown">
                                <input type="button" class="dropbtn" value="&#8942;">
                                <nav class="dropdown-content">
                                    <a href="#" class="manage-article">Modifier</a>
									<a href="#" class="manage-article">Supprimer</a>
									<a href="#" class="manage-article">Insérer</a>
                                </nav>
                            </div>
                        </div>
                    </div>
                    <div class="separate_line"></div>
                    <div class="article_content">
                        <p><span style="font-size:14px"><u><strong><span style="background-color:#27ae60">Ceci est un second test ...</span></strong></u></span></p>
                    </div>
                </div>
                <div class="article article-detail">
                    <div class="first_line_header clearfix">
                        <div class="header_title">
                            <span class="header_title_text">Article 3</span>
                        </div>
                        <div class="header_address">
                            Rue des chasseurs, 95                            
						</div>
                    </div>
                    <div class="second_line_header clearfix">
                        <div class="header_admin_datetime">
                            <span class="header_text">Charlie</span>
                        </div>
                        <div class="header_more_options_icon">
                            <div class="dropdown">
                                <input type="button" class="dropbtn" value="&#8942;">
                                <nav class="dropdown-content">
                                    <a href="#" class="manage-article">Modifier</a>
									<a href="#" class="manage-article">Supprimer</a>
									<a href="#" class="manage-article">Insérer</a>
                                </nav>
                            </div>
                        </div>
                    </div>
                    <div class="separate_line"></div>
                    <div class="article_content">
                        <p><span style="font-size:14px"><u><strong><span style="background-color:#27ae60">Ceci est un 3ème test ...</span></strong></u></span></p>
                    </div>
                </div>
            </div>
            <div class="site-cache" id="site-cache">
            </div>
        </div>
    </div>
</div>
      
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
              
            
!

CSS

              
                a {
  text-decoration: none;
  color: inherit;
}

.container {
  padding: 0 20px;
  overflow: hidden;
  *zoom: 1;
  background-color: #f6f6f6;
}

.site-content {
  padding-top: 55px;
  background-color: #f6f6f6;
}

.header {
  position: fixed;
  left: 0;
  right: 0;
  height: 55px;
  line-height: 55px;
  color: #FFF;
  background-color: #222A35;
  -webkit-box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.16), 0 4px 10px 0 rgba(0, 0, 0, 0.12);
  -moz-box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.16), 0 4px 10px 0 rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.16), 0 4px 10px 0 rgba(0, 0, 0, 0.12);
}

.header__logo {
  font-weight: bold;
  padding: 0 25px;
  float: left;
}

.menu {
  float: left;
}

.menu a {
  padding: 0 10px;
}

.menu a:hover {
  color: #222A35;
}

.menu img {
  float: left;
  padding: 10px 20px 0 12px;
}

  .header {
    z-index: 200;
  }

  .container {
    position: relative;
    margin-left: 235px;
    background-color: #f6f6f6;
  }

  .menu {
    float: left;
    position: fixed;
    padding-top: 25px;
    left: 0;
    top: 55px;
    bottom: 0;
    background-color: #f6f6f6;
    width: 235px;
    z-index: 1;
  }

  .menu a {
    display: block;
    height: 45px;
    text-align: left;
    line-height: 45px;
    color: #757575;
    font-size: 15px;
    font-weight: bold;
  }
  
  .clearfix::after {
  content: "";
  clear: both;
  display: table;
}

.article {
  margin: 12px 0px 0px 75px;
  padding: 12px;
  width: 67%;
  background-color: #FFF;
  -webkit-box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0), 0 4px 10px 0 rgba(0, 0, 0, 0.12);
  -moz-box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0), 0 4px 10px 0 rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0), 0 4px 10px 0 rgba(0, 0, 0, 0.12);
  border-radius: 5px;
  cursor: pointer;
}

.article:first-child {
  margin-top: 30px;
}

.article:last-child {
  margin-bottom: 30px;
}

.first_line_header {
  padding: 5px;
}

.first_line_header .header_title {
  float: left;
}

.first_line_header .header_title_text {
  font-weight: bold;
  font-size: 28px;
}

.first_line_header .header_address {
  float: right;
}

.second_line_header {
  padding: 5px;
}

.second_line_header .header_admin_datetime {
  float: left;
}

.second_line_header .header_text {
  font-size: 16px;
  font-family: calibry, sans-serif;
  color: #808080;
}

.second_line_header .header_more_options_icon {
  float: right;
}


.third_line_header {
  padding: 5px;
}

.user_rights_1st_line {
  padding: 5px;
}

.user_rights_1st_line .user_admins {
  float: left;
  width: 50%;
}

.user_rights_1st_line .user_players {
  float: right;
  width: 50%;
}

.user_rights_2nd_line {
  padding: 5px;
}

.user_rights_2nd_line {
  float: left;
  width: 50%;
}

.user_rights_2nd_line {
  float: right;
  width: 50%;
}

.separate_line {
  border-bottom: solid 2px #F2F2F2;
}

.article_content {
  padding: 0 0 0 5px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

/* Dropdown Button */
.dropbtn {
    background-color: #fff;
    color: black;
    font-size: 16px;
    height: 37px;
    width: 37px;
    border: none;
    cursor: pointer;
    outline: 0;
    display: none;
}

/* Dropdown button on hover & focus */
.dropbtn:hover, .dropbtn:focus {
    background-color: #2980B9;
}

/* The container <div> - needed to position the dropdown content */
.dropdown {
    position: relative;
    display: inline-block;
    z-index:150;
}

.dropdown-content {
    display: none;
    background-color: #fff;
    min-width: 300px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    position: absolute;
    right: 0;
    z-index: 100;
}

/* Links inside the dropdown */
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover { background-color: #ddd; }

.article:hover .dropbtn {
  display: block;
}

.article-detail {
  cursor: pointer;
}

/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show { display:block; }

#overlay{
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: none;
}

#overlay.show { display: block; }

              
            
!

JS

              
                $('.container').on('click', '.card-detail', e=>{
  e.preventDefault();
  e.stopPropagation();
  alert("j'ai cliqué sur l'article")
});

$('.container').on('click','.article .dropbtn', e=>{
        e.preventDefault();
        e.stopPropagation();
        $(e.target).next('nav').attr('actif', "on");
        $(".dropdown-content[actif!='on']").removeClass("show"); 
        $(e.target).next('nav').toggleClass('show');
        $(e.target).next('nav').attr('actif', "");
});
 
$('body').click(()=>{
  $('.dropdown-content').removeClass('show');
});

$(window).scroll(function () {
  $('.dropdown-content').removeClass('show');
});

$('body').on('touchmove', function(e) { 
  $('.dropdown-content').removeClass('show');
});

$('.container').on('click', '.dropbtn .manage-article', function(e){
  e.preventDefault();
  e.stopPropagation();
  alert("j'ai cliqué sur un élément du menu")
});
              
            
!
999px

Console