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 includes JSX processing.

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

Packages

Add Packages

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.

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

              
                <body>

<header>
	<nav id="menu">
		<div class="conteneur_menu" onclick="menu(event);">
			<div id="menumobile">
				<a href="#nogo">
				&equiv;
				</a>
			</div>
			<div class="menudesktop">
				<div class="pagemenu visible">
					<a href="#haut">
					<span style="color: YellowGreen;">&#xe902;&nbsp;</span>
					<span>A propos</span>
					</a>
				</div>
				<div class="pagemenu visible">
					<a href="#real">
					<span style="color: yellow;">&#xe991;&nbsp;</span>
					<span>Réalisations</span>
					</a>
				</div>
				<div class="rubrique visible">
					<a href="#submenu">
					<span style="color: coral;">&#xea0c;&nbsp;</span>
					<span>Informations</span>
					</a>
					<div class="sousmenu">
						<div class="pagesousmenu">
							<a href="#infos1">
							infos1
							</a>
						</div>
						<div class="pagesousmenu">
							<a href="#infos2">
							infos2
							</a>
						</div>
						<div class="pagesousmenu">
							<a href="#infos3">
							infos3
							</a>
						</div>
						<div class="pagesousmenu">
							<a href="#infos4">
							infos4
							</a>
						</div>
						<div class="pagesousmenu">
							<a href="#infos6">
							infos6
							</a>
						</div>
						<div class="pagesousmenu">
							<a href="#infos7">
							infos7
							</a>
						</div>
						<div class="pagesousmenu">
							<a href="#infos8">
							infos8
							</a>
						</div>
					</div>
				</div>
				<div class="pagemenu visible">
					<a href="#contacts">
					<span style="color: LightSkyBlue;">&#xe944;&nbsp;</span>
					<span>Contacts</span>
					</a>
				</div>
			</div>
			<a href="#">
			<picture class="smalllogo">
			<source srcset="logo.gif" media="(min-width: 1430px)">
			<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" 
				alt="logo" height="46" width="179" loading="lazy">
			</picture>
			<picture class="smalllogo smalllogo2">
			<source srcset="logonoir.gif" media="(min-width: 1430px)">
			<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" 
				alt="logo" height="46" width="179" loading="lazy">
			</picture>
			</a>
		</div>
	</nav>
</header>
 
  <main>
    <section id="haut"
  <br><br><br><br>
  Patati<br>
  Patata<br>
  et tout ça<br><br>
  </section>

<section id="infos1" class="sectionvisible sectioncachee">
<div class="pageblanche" lang="fr" onmouseover="this.style.color='black'">
  <p> Bla Bla Bla </p>
</div>
</section>
 
<section id="infos2" class="sectionvisible sectioncachee">
<div class="pageblanche" lang="fr" onmouseover="this.style.color='black'">
  <p> Bla Bla Bla 2 </p>
</div>
</section>
  
  <section id="infos3" class="sectionvisible sectioncachee">
<div class="pageblanche" lang="fr" onmouseover="this.style.color='black'">
  <p> Bla Bla Bla 3</p>
</div>
</section>
  
  <section id="infos4" class="sectionvisible sectioncachee">
<div class="pageblanche" lang="fr" onmouseover="this.style.color='black'">
  <p> Bla Bla Bla 4</p>
</div>
</section>
  
  <section id="infos6" class="sectionvisible sectioncachee">
<div class="pageblanche" lang="fr" onmouseover="this.style.color='black'">
  <p> Bla Bla Bla 6 </p>
</div>
</section>
  
  <section id="infos7" class="sectionvisible sectioncachee">
<div class="pageblanche" lang="fr" onmouseover="this.style.color='black'">
  <p> Bla Bla Bla 7</p>
</div>
</section>
  
  <section id="infos8" class="sectionvisible sectioncachee">
<div class="pageblanche" lang="fr" onmouseover="this.style.color='black'">
  <p> Bla Bla Bla 8</p>
</div>
</section>
</main>
</body>
              
            
!

CSS

              
                	body { 
		background-color: #000;
    color: #FFF;
    scroll-behavior: smooth;
    article, figcaption, figure, footer, header, main, nav, section { display: block; } #real,#infos1,#infos2,#infos3,#infos4,#infos5,#infos6,#infos7,#infos8,#contacts { scroll-margin-top: 49px; }
	@supports (-webkit-appearance:none) { #real,#infos1,#infos2,#infos3,#infos4,#infos5,#infos6,#infos7,#infos8,#contacts { margin-top: 49px; } }
		}

    /* Menu */
	.conteneur_menu{
		border-spacing:0;
		position:fixed;
		top:0;
		width:100%;
		background-color:#676767;
		background-color:hsla(0, 0%, 60%, 0.80);
		height:46px;
		box-shadow:0px 1px 2px rgba(0, 0, 0, 0.5);
		z-index:2; 
		text-shadow: 1px 1px 1px #000;
		backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
		}
	.menudesktop{
		display:table;
		width:100%;
		max-width:1280px;
		margin:auto;
		}
	.conteneur_menu a {
		color: #FFF; 
		text-decoration:none;
		display:table-cell;
		vertical-align:middle;
		height:46px;
		padding:0;
		text-align:center;
		transition:.25s;
		}
	.pagemenu, .rubrique, #menumobile {
		float:left;
		position:relative;
		width:25%;
		text-align:center;
		font-size:1.125em;
		}
	@font-face { 
		font-family: 'icomoon'; 
		src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAVMAA0AAAAACCAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAFMAAAABoAAAAck8jkXkdERUYAAAUUAAAAHAAAAB4AJwAPT1MvMgAAAZQAAAA/AAAAYA8TBuFjbWFwAAAB7AAAAFoAAAF206raymdhc3AAAAUMAAAACAAAAAgAAAAQZ2x5ZgAAAlwAAAGSAAACeJtNstBoZWFkAAABMAAAACwAAAA2HAlRFGhoZWEAAAFcAAAAHQAAACQHwwPHaG10eAAAAdQAAAAX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NFq0IJ1K6XRHp6DgA3QqdXDpIB0b4yUE9F6IEXTvI3TsM/RhfCJPwrcmcMPvOzfnI8CMfxLaJ+GBJ/NAnpuH8ps5lb/MIx65mMfKf81TXrmplaQTJbNuQ+uB/GIeygtzKn+YRzzzbR4r/zFPWfFHRUHkqBMJUBXxGKPwiafkzIGcWqMvz4dc6Pu+L99qT81J923uWJLpL9n6+lTF4JbZor/73s2NWqW2hG5TrtmzV7bjqve6626sm6kUQ+NKH3ydN37vdle3LuJG+zLu5ds+Q3icY2BiwA84GRgYmRiYGJkZmBlZGFkZ2RjZ2dJzKgsyDNlL8zINDAzAtKulgRGENjGB0JYQcUcDZwBS5g2UAAAAAQAB//8AD3icY2BkYGDgAWIxIGZiYARCDiBmAfMYAAP2ADd4nGNgYGBkAIJb964fBdF3Stl8YDQAVVAGnAAA) format('woff'); 
		font-display: block; 
		}
	.pagemenu span:first-child, .rubrique span:first-child { font-family: 'icomoon'; }
	.pagemenu, .rubrique { display: table; }
	#menumobile { display: none; font-size: 3.3em; }
	.sousmenu {
		position: absolute;
		left: 0;
		top: 46px; 
		z-index: 2;
		width: 100%;
		background-color: #676767;
		box-shadow: 1px 1px 8px #333333;
		max-height: 0%; 
		overflow: hidden; 
		transition: .5s;
		}
	.sousmenuvisible { max-height: 800%; }
	@media (min-width:1367px) { .rubrique:hover .sousmenu { max-height: 800%; } }
.pagesousmenu { 
		border-top: 1px solid #797979; 
		border-bottom: 1px solid #000;
		width: 100%; 
		text-align: center; 
		display: table; 
		}
	@media (min-width:768px) {
		.pagemenu:hover > a, .rubrique:hover > a { font-size:1.125em; }
		.sousmenu a:hover { background-color:#474747 }
		}
	@supports (-webkit-hyphens:none) and (aspect-ratio:1/1) { 
		.conteneur_menu {
			background-color:hsla(0, 0%, 0%, .8);
			box-shadow:0px 1px 1px rgba(0, 0, 0, .5);
			} 
.sousmenu { background-color:#474747; } 
		@media (min-width:768px) {.sousmenu a:hover { background-color:black; }}
		@media (min-width:1367px) {.rubrique:hover > a { background-color:#474747; }}
		}

	.smalllogo { 
		position: fixed; 
		top: -46px; 
		left: 0; 
		z-index: 3; 
		opacity: .8; 
		transition: top .25s; 
		cursor: pointer; 
		}
	.smalllogo2 { display: none; }
	.animlogo { top: 0; }
	@supports (-webkit-hyphens:none) and (aspect-ratio:1/1) {
		.smalllogo { display: none; }
		.smalllogo2 { display: block; }
		}
	@media (max-width: 1429px) { .smalllogo, .smalllogo2 { display: none; } }

	.pageblanche {
		background-color: #fff;
		color: #000;
		padding: 18px 17% 18px 17%;
		padding: 18px max(17%, 50vw - 490px) 18px max(17%, 50vw - 490px);
		font-family: garamond, serif;
		font-size: 1.25em;
		box-shadow: inset 0px 5px 10px 0px #9b9b9b;
		text-align: justify;
		overflow: hidden;
		}

		/* Zones cachées */
	.sectionvisible { 
		max-height: 250%; 
		height: auto;
		transition: max-height 1.5s;
		overflow: hidden; 
		}
	.sectioncachee { max-height: 0%; }

@media (max-width:767px) {

	body { font-size: 0.75em; }
	#real,#infos1,#infos2,#infos3,#infos4,#infos5,#infos6,#infos7,#infos8,#contacts { scroll-margin-top: 0px; }
	@supports (-webkit-appearance:none) { #real,#infos1,#infos2,#infos3,#infos4,#infos5,#infos6,#infos7,#infos8,#contacts { margin-top: 0px; } }
	
	.conteneur_menu { 
		background-color: transparent; 
		box-shadow: none; 
		backdrop-filter: none; -webkit-backdrop-filter: none; 
		}
	#menumobile { display: table; width: 46px; }
	.pagemenu, .rubrique {  
		font-size: 1.5em; 
		width: 52%;
		background-color: #676767; background-color: hsla(0, 0%, 60%, 0.80); 
		box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.5); 
		border-radius: 6px;
		}
	.pagemenu a, .rubrique a { text-align: left; padding-left: .85em; }
	.visible { display: none; }
	.pagesousmenu:first-child { border-top: 1px solid transparent; }
	.pagesousmenu:last-child { border-bottom: 1px solid transparent; }
	.pagesousmenu a { text-align: center; padding: 0; }
	.sousmenu { 
		left: 230%; 
		top: -120px; 
		width: 120%; 
		border-radius: 6px; 
		max-height: 800%;
		overflow: visible;
		}
	.sousmenu:before {
		content: "";
		position: absolute;
		right: 100%;
		top: 130px;
		width: 0;
		height: 0;
		border-top: 13px solid transparent;
		border-right: 26px solid #676767;
		border-bottom: 13px solid transparent;
		filter: drop-shadow(-1px 1px 0px rgba(51, 51, 51, .5));
		}
	@supports (-webkit-hyphens:none) and (aspect-ratio:1/1){.sousmenu:before{border-right:26px solid #474747;}}
	.sousmenuvisible { left: 72%; top: -120px; }
 
}
              
            
!

JS

              
                document.body.addEventListener('touchstart', function(){}, false, {passive: true});


function montrer(id) {
document.getElementById(id).classList.remove("sectioncachee");
setTimeout(() => { location.hash = "#" + id; }, 1000); 
}

function masquer(id) {
document.getElementById(id).classList.add("sectioncachee");
}

function togglemenu() {
const x = document.querySelectorAll("div.rubrique, div.pagemenu");
for (var i= 0; i<x.length; i++) { x[i].classList.toggle("visible"); } 
var y = document.getElementById('menumobile').children[0];
if ( x[0].classList.contains("visible") ) 
	{ y.innerHTML = '&equiv;'; }
else 
	{ y.innerHTML = '&times;'; }
}

function togglesubmenu() {
if (window.matchMedia("(max-width: 1366px)").matches) {
	const y = document.querySelectorAll("div.sousmenu");
	y[0].classList.toggle("sousmenuvisible");
	}
}

function fermermenu() {
var element = document.getElementById('menumobile'),
    style = window.getComputedStyle(element),
    display = style.getPropertyValue('display');
if ( display == 'table' ) {
	const x = document.querySelectorAll("div.rubrique, div.pagemenu");
	for (var i= 0; i<x.length; i++) { x[i].classList.toggle("visible"); };
	element.children[0].innerHTML = '&equiv;';
	}
if (window.matchMedia("(max-width: 1366px)").matches) {
	const y = document.querySelectorAll("div.sousmenu");
	y[0].classList.remove("sousmenuvisible"); 
	}
}

function menu(event) {
	var cible = event.target.closest("a").getAttribute('href');
	if ( cible == '' ) { return; }
	if ( cible == '#nogo' ) { togglemenu(); return; }
	if ( cible == '#haut' ) { fermermenu(); return; }
	if ( cible == '#real' ) { montrer('realisations'); fermermenu(); return; }
	if ( cible == '#submenu' ) { togglesubmenu(); return; }
	if ( cible == '#infos1' ) { montrer('infos1'); fermermenu(); return; }
	if ( cible == '#infos2' ) { montrer('infos2'); fermermenu(); return; }
	if ( cible == '#infos3' ) { montrer('infos3'); fermermenu(); return; }
	if ( cible == '#infos4' ) { montrer('infos4'); fermermenu(); return; }
	if ( cible == '#infos6' ) { montrer('infos6'); fermermenu(); return; }
	if ( cible == '#infos7' ) { montrer('infos7'); fermermenu(); return; }
	if ( cible == '#infos8' ) { montrer('infos8'); fermermenu(); return; }
	if ( cible == '#contacts' ) { fermermenu(); return; }
	if ( cible == '#' ) { 
		masquer('realisations');			masquer('infos1'); 
		masquer('infos2');		masquer('infos3'); 
		masquer('infos4');				masquer('infos6'); 
		masquer('infos7');	masquer('infos8'); 
		fermermenu(); 
		}
}
              
            
!
999px

Console