Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ 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

Auto Save

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

              
                <!--
	[출처]
	http://uyeong.github.io/bem-style-mdn/
-->

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">

<div class="header">
  <div class="header__inner">
		<!-- tabzilla -->
    <div class="tabzilla">
			<a href="#" class="tabzilla__link">
				<span>mozilla</span>
			</a>
		</div>
		<!-- header__logo -->
    <div class="header__logo">
			<div class="logo">
				<a href="#" class="logo__link">
					<h1>MDN</h1>
				</a>
			</div>
		</div>
		<!-- header__auth -->
    <div class="header__auth header__auth--opened">
			<div class="auth">
				<div class="auth-means">
          <p class="auth-means__text">Sign in with</p>
          <ul class="auth-means__list">
            <li class="auth-means__item auth-menas__item--persona">
              <a href="#">
                <i class="fas fa-user"></i>
                <span class="blind">Persona</span>
              </a>
            </li>
            <li class="auth-means__item auth-menas__item--github">
              <a href="#">
                <i class="fab fa-github"></i>
                <span class="blind">Github</span>
              </a>
            </li>
          </ul>
        </div>
				<div class="auth-picker">
					<ul class="auth-picker__list">
						<li class="auth-picker__item">
							<a href="#">
								<i class="fas fa-user"></i>
								<span>Persona</span>
							</a>
						</li>
						<li class="auth-picker__item">
							<a href="#">
								<i class="fab fa-github"></i>
								<span>Github</span>
							</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<!-- nav -->
    <div class="nav">
			<ul class="nav__list">
				<li class="nav__item">
					<a href="#" class="nav__link">
						<span>Nav Menu 01</span>
						<i class="fa fa-caret-down"></i>
					</a>
					<!-- nav__submenu -->
					<div class="nav__submenu nav__submenu--col2">
						  <div class="nav-submenu">
								<!-- nav-submenu__column -->
								<div class="nav-submenu__column">
									<strong class="nav-submenu__title">Column 01</strong>
									<ul class="nav-submenu__list">
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">HTML</a>
										</li>
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">CSS</a>
										</li>
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">Javascript</a>
										</li>
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">HTML</a>
										</li>
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">CSS</a>
										</li>
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">Javascript</a>
										</li>
									</ul>
								</div>
								<!-- nav-submenu__column -->
								<div class="nav-submenu__column">
									<strong class="nav-submenu__title">Column 02</strong>
									<ul class="nav-submenu__list">
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">Anne</a>
										</li>
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">NYKIM</a>
										</li>
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">Nana</a>
										</li>
										<li class="nav-submenu__item">
											<a href="#" class="nav-submenu__link">...more</a>
										</li>
									</ul>
								</div>
								<button class="nav-submenu__close">
									<span class="blind">Close submenu</span>
									<i class="fa fa-times-circle"></i>
								</button>
							</div>
					</div>
				</li>
				<li class="nav__item">
					<a href="#" class="nav__link">
						<span>Nav Menu 02</span>
					</a>
				</li>
				<li class="nav__item">
					<a href="#" class="nav__link">
						<span>Nav Menu 03</span>
					</a>
				</li>
				<li class="nav__item">
					<a href="#" class="nav__link">
						<span>Nav Menu 04</span>
					</a>
				</li>
			</ul>
		</div>
		<!-- header__search -->
    <div class="header__search">
			<div class="search">
				<form>
					<div class="search__inner">
						<div class="search__title">
							<label for="main-search">
								<i class="fa fa-search"></i>
								<span class="blind">Search</span>
							</label>
						</div>
						<input type="text" id="main-search" class="search__input search__input--extend"> <!--focus시 .search__input--extend 클래스를
						추가합니다-->
						<input type="submit" class="search__button blind" value="Search">
					</div>
				</form>
			</div>
		</div>
  </div>
</div>

<h2>search를 별도 분리한 경우</h2>
<div class="search">
	<form>
		<div class="search__inner">
			<div class="search__title">
				<label for="main-search">
					<i class="fa fa-search"></i>
					<span class="blind">Search</span>
				</label>
			</div>
			<input type="text" id="main-search" class="search__input "> <!--focus시 .search__input--extend 클래스를
추가합니다-->
			<input type="submit" class="search__button blind" value="Search">
		</div>
	</form>
</div>
              
            
!

CSS

              
                // ================
// _common.scss
// ================

* {
	margin: 0;
	padding: 0;
	list-style: none;
	text-decoration: none;
	box-sizing: border-box;
}

.blind {
	display: none;
}

body {
	background-color: #fafafa;
}


// ================
// _header.scss
// ================

.header {
	width: 100%;
	background-color: #eaeff2;
	
	&__inner {
		position: relative;
		width: 100%;
		max-width: 1200px;
		min-width: 800px;
		height: 120px;
		margin: 0 auto;
		padding: 0 20px;
	}
	
	&__logo {
		margin-bottom: 30px;
	}
	
	&__auth {
		position: absolute;
		top: 20px;
		right: 180px;

		&--opened {
			.auth-means {
				border-radius: 8px 8px 0 0;
			}
			.auth-picker {
				display: block;
			}
		}
	}
	
	&__search {
		position: absolute;
		top: 60px;
		right: 0;
		
		.search__input {
			width: 60px;
		
			&[class$=--extend] {
				width: 160px;
			}
		}
	}
}


.nav {
	
	&__list {
		display: flex;
	}
	
	&__item {
		position: relative;
		margin-left: 40px;
		
		&:first-child {
			margin-left: 0;
		}
	}
	
	&__link {
		color: #4d4e53;
		font-size: 18px;
		font-weight: bold;
		text-transform: uppercase;
		
		&:hover {
			text-decoration: underline;
		}
	}
	
	&__submenu {
		position: absolute;
		top: 34px;
		left: 0;
		z-index: 10;
	}
}

.nav-submenu {
	display: none;
	background: #fff;
	border-top: 6px solid #333;
	box-shadow: 3px 4px 10px #eaeaea;
	
	[class$=--col2] &{
		display: flex;
	}
	
	&__column {
		min-width: 140px;
		padding: 10px 0;
		border-left: 1px solid #ccc;
		
		&:first-child {
			border-left: 0;
		}
	}
	
	&__title {
		display: block;
		margin: 10px 0;
		text-align: center;
	}
	
	&__link {
		display: block;
		padding: 0 12px;
		margin: 4px;
		font-size: 14px;
		color: #0095dd;
		
		&:hover {
			text-decoration: underline;
		}
	}

	&__close {
		position: absolute;
		top: 10px;
		right: 4px;
		background: transparent;
		border: 0;
		cursor: pointer;
	}
}

.search {
	&__inner {
		position: relative;
	}
	&__title {
		position: absolute;
		top: 4px;
		right: 4px;
		font-size: 12px;
	}
	&__input {
		width: 100%;
		border: 0;
		border-radius: 3px;
		padding: 4px;
	}
}

// ================
// _partial.scss
// ================

.tabzilla {
	position: absolute;
	top: 10px;
	right: 40px;
	
	&__link {
		font-size: 20px;
		color: #333;
		text-decoration: none;
		font-weight: bold;
	}
}

.logo {
	width: 153px;
	height: 55px;
	background-color: #aaa;
	
	&__link {
		color: #fff;
		text-decoration: none;
		text-align: center;
		line-height: 52px;
	}
}

.auth {
	
	&-means {
		display: flex;
		background-color: #ccc;
		border-radius: 8px;
		padding: 4px 6px;
		
		&__text {
			margin-right: 4px;
			line-height: 160%;
			color: #333;
			font-size: 14px;
		}
		
		&__list {
			display: flex;
		}
		
		&__item {
			width: 24px;
			height: 24px;
			margin: 0 3px;
			
			a {
				display: block;
				width: 100%;
				height: 100%;
				padding: 2px 6px;
				border-radius: 4px;
				font-size: 13px;
				color: #fff;
			}
			
			&[class$=--persona] a{
    		background: linear-gradient(#43a6e2,#1d80bc);
			}
			
			&[class$=--github] a {
    		background: linear-gradient(#5d649a,#40456a);
			}
		}
	} //end of .auth-means
	
	&-picker {
		display: none;
		
		&__list {
			position: relative;
			z-index: 1;
		}
		
		&__item {
			a {
				display: block;
				color: #0095dd;
				padding: 4px;
				background: #fff;
				
				&:hover {
					background-color: #e0e0e0;
					
					span {
						text-decoration: underline;
					}
				}
			}
		}
		
		&__item:last-child a {
			border-radius: 0 0 8px 8px;
		}
	}
}


              
            
!

JS

              
                // https://nykim.work/15
              
            
!
999px

Console