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

              
                <nav class="navbar">
  <ul class="navbar-nav">
    <li class="nav-item">
      <a class="nav-link" href="#">Home</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="#">News</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="#">Features</a>
    </li>
    <li class="nav-item">
      <a class="nav-link" href="#">Contact</a>
    </li>
  </ul>
</nav>

<header class="header">
  <div class="header-search">
    <input type="text" class="header-search-input" placeholder="Search">
    <button class="header-search-button">Search</button>
  </div>
</header>

<section class="hero">
  <div class="hero-overlay"></div>
  <div class="hero-content">
    <h1 class="hero-title">The Future of Technology</h1>
    <p class="hero-text">Stay ahead of the curve with the latest news and insights on the world of technology.</p>
    <a href="#" class="hero-button">Learn More</a>
  </div>
</section>

<section class="top-news">
  <div class="container">
    <div class="section-title">Top News</div>
    <div class="top-news-items">
      <div class="top-news-item">
        <div class="top-news-item-image">
          <img src="https://dummyimage.com/400x225/000/fff" alt="Top News">
        </div>
        <div class="top-news-item-content">
          <h2 class="top-news-item-title">The Latest News on Artificial Intelligence</h2>
          <p class="top-news-item-text">Get the latest news and insights on the world of artificial intelligence and machine learning.</p>
          <a href="#" class="top-news-item-link">Read More</a>
        </div>
      </div>
      <div class="top-news-item">
        <div class="top-news-item-image">
          <img src="https://dummyimage.com/400x225/000/fff" alt="Top News">
        </div>
        <div class="top-news-item-content">
          <h2 class="top-news-item-title">The Future of Cloud Computing</h2>
          <p class="top-news-item-text">Stay ahead of the curve with the latest news and insights on cloud computing and the future of the cloud.</p>
          <a href="#" class="top-news-item-link">Read More</a>
        </div>
      </div>
      <div class="top-news-item">
        <div class="top-news-item-image">
          <img src="https://dummyimage.com/400x225/000/fff" alt="Top News">
        </div>
        <div class="top-news-item-content">
          <h2 class="top-news-item-title">The Impact of Big Data on Business</h2>
          <p class="top-news-item-text">Discover the latest trends and insights on how big data is transforming the business world.</p>
          <a href="#" class="top-news-item-link">Read More</a>
        </div>
      </div>
    </div>
  </div>
</section>

<section class="latest-news">
  <div class="container">
    <h2 class="section-title">Latest News</h2>
    <div class="article-list">
      <div class="article-item">
        <a href="#" class="article-thumbnail">
          <img src="https://dummyimage.com/400x225/000/fff" alt="Article Thumbnail">
        </a>
        <div class="article-details">
          <h3 class="article-title"><a href="#">The Latest News on Cybersecurity</a></h3>
          <div class="article-info">
            <span class="article-date">Jan 25, 2023</span>
            <span class="article-author">By John Smith</span>
          </div>
          <p class="article-excerpt">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod lacus vel aliquet varius. Duis vel lacinia tellus.</p>
        </div>
      </div>
      <div class="article-item">
        <a href="#" class="article-thumbnail">
          <img src="https://dummyimage.com/400x225/000/fff" alt="Article Thumbnail">
        </a>
        <div class="article-details">
          <h3 class="article-title"><a href="#">The Future of Artificial Intelligence in Healthcare</a></h3>
          <div class="article-info">
            <span class="article-date">Jan 23, 2023</span>
            <span class="article-author">By Jane Doe</span>
          </div>
          <p class="article-excerpt">Nulla facilisi. Duis efficitur, felis eget lacinia venenatis, quam risus pulvinar neque, vitae volutpat massa lorem sit amet velit.</p>
        </div>
      </div>
      <div class="article-item">
        <a href="#" class="article-thumbnail">
          <img src="https://dummyimage.com/400x225/000/fff" alt="Article Thumbnail">
        </a>
        <div class="article-details">
          <h3 class="article-title"><a href="#">The Rise of E-Commerce: How COVID-19 is Changing the Game</a></h3>
          <div class="article-info">
            <span class="article-date">Jan 20, 2023</span>
            <span class="article-author">By Alex Johnson</span>
          </div>
          <p class="article-excerpt">Maecenas ac est at mi lobortis accumsan eu in turpis. Fusce aliquam orci quam, eu pretium lectus lobortis at.</p>
        </div>
      </div>
    </div>
  </div>
</section>

<section class="category-page">
  <div class="container">
    <h2 class="category-page-title">Cybersecurity News</h2>
    <div class="category-page-articles">
      <div class="category-page-article">
        <a href="#" class="category-page-thumbnail">
          <img src="https://dummyimage.com/400x225/000/fff" alt="Article Thumbnail">
        </a>
        <div class="category-page-details">
          <h3 class="category-page-article-title"><a href="#">Why Cybersecurity is More Important Than Ever</a></h3>
          <div class="category-page-article-info">
            <span class="category-page-article-date">Jan 15, 2023</span>
            <span class="category-page-article-author">By John Smith</span>
          </div>
          <p class="category-page-article-excerpt">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod lacus vel aliquet varius. Duis vel lacinia tellus.</p>
        </div>
      </div>
      <!-- 他の記事も同様に記述 -->
    </div>
  </div>
</section>

<form class="search-form">
  <input type="text" class="search-input" placeholder="Search">
  <button type="submit" class="search-button">
    <i class="fas fa-search"></i>
  </button>
</form>

<footer class="footer">
  <div class="footer-container">
    <div class="footer-section">
      <h3 class="footer-heading">About Us</h3>
      <p class="footer-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla quam velit, vulputate eu pharetra nec, mattis ac neque. Duis vulputate commodo lectus.</p>
    </div>
    <div class="footer-section">
      <h3 class="footer-heading">Contact Us</h3>
      <ul class="footer-list">
        <li><a href="#" class="footer-link">Email</a></li>
        <li><a href="#" class="footer-link">Twitter</a></li>
        <li><a href="#" class="footer-link">Facebook</a></li>
      </ul>
    </div>
    <div class="footer-section">
      <h3 class="footer-heading">Links</h3>
      <ul class="footer-list">
        <li><a href="#" class="footer-link">Home</a></li>
        <li><a href="#" class="footer-link">Categories</a></li>
        <li><a href="#" class="footer-link">About Us</a></li>
        <li><a href="#" class="footer-link">Contact Us</a></li>
      </ul>
    </div>
  </div>
  <div class="footer-bottom">
    <p class="footer-text">Copyright &copy; 2023</p>
  </div>
</footer>

              
            
!

CSS

              
                .navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #000;
  color: #fff;
  height: 60px;
  padding: 0 20px;
}

.navbar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin: 0 15px;
}

.nav-link {
  text-decoration: none;
  color: #fff;
  transition: 0.3s;
  position: relative;
}

.nav-link::before {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #fff;
  transition: 0.3s;
}

.nav-link:hover::before {
  width: 100%;
}

.header {
  background-color: #009688;
  color: #fff;
  padding: 20px;
}

.header-search {
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-search-input {
  height: 40px;
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  flex: 1;
}

.header-search-button {
  height: 40px;
  padding: 5px 20px;
  background-color: #fff;
  color: #009688;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  margin-left: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.header-search-button:hover {
  background-color: #009688;
  color: #fff;
}

.hero {
  background-image: url('https://dummyimage.com/1920x1080/000/fff');
  height: 100vh;
  position: relative;
}

.hero-overlay {
  background-color: rgba(0, 0, 0, 0.5);
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1;
}

.hero-title {
  font-size: 4rem;
  margin: 0;
  padding: 0;
  color: #fff;
}

.hero-text {
  font-size: 1.5rem;
  margin: 20px 0;
  padding: 0;
  color: #fff;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-button {
  display: inline-block;
  background-color: #fff;
  color: #009688;
  padding: 10px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.2rem;
  transition: 0.3s;
}

.hero-button:hover {
  background-color: #009688;
  color: #fff;
}

.top-news {
  background-color: #fff;
  padding: 60px 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: #009688;
}

.top-news-items {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
}

.top-news-item {
  flex-basis: calc(33.33% - 20px);
  display: flex;
  flex-direction: column;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: 0.3s;
}

.top-news-item:hover {
  transform: translateY(-5px);
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
}

.top-news-item-image img {
  width: 100%;
  height: 225px;
  object-fit: cover;
}

.top-news-item-content {
  padding: 20px;
}

.top-news-item-title {
  font-size: 1.5rem;
  margin: 0;
  color: #333;
  margin-bottom: 10px;
}

.top-news-item-text {
  font-size: 1rem;
  margin: 0;
  color: #777;
  margin-bottom: 20px;
  max-height: 60px;
  overflow: hidden;
}

.top-news-item-link {
  display: inline-block;
  background-color: #009688;
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1rem;
  transition: 0.3s;
}

.top-news-item-link:hover {
  background-color: #fff;
  color: #009688;
}

.latest-news {
  padding: 80px 0;
  background-color: #f7f7f7;
}

.latest-news .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.latest-news .section-title {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 50px;
}

.article-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.article-item {
  width: calc(33.33% - 20px);
  margin-bottom: 40px;
  background-color: #fff;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
}

.article-item:hover {
  box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
}

.article-thumbnail {
  display: block;
  position: relative;
  overflow: hidden;
}

.article-thumbnail img {
  width: 100%;
  height: auto;
  transition: all 0.3s ease-in-out;
}

.article-thumbnail:hover img {
  transform: scale(1.1);
}

.article-details {
  padding: 20px;
}

.article-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
}

.article-title a {
  color: #000;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.article-title a:hover {
  color: #0084ff;
}

.article-info {
  margin-bottom: 15px;
}

.article-info span {
  font-size: 14px;
  font-weight: 400;
  margin-right: 20px;
  color: #888;
}

.article-excerpt {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #333;
}

.category-page {
  background-color: #f5f5f5;
  padding: 80px 0;
}

.category-page-title {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 50px;
}

.category-page-articles {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -20px;
}

.category-page-article {
  width: calc(33.33% - 20px);
  margin: 0 20px 40px;
  background-color: #fff;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
}

.category-page-article:hover {
  box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
}

.category-page-thumbnail {
  display: block;
  position: relative;
  overflow: hidden;
}

.category-page-thumbnail img {
  width: 100%;
  height: auto;
  transition: all 0.3s ease-in-out;
}

.category-page-thumbnail:hover img {
  transform: scale(1.1);
}

.category-page-details {
  padding: 20px;
}

.category-page-article-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
}

.category-page-article-title a {
  color: #000;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.category-page-article-title a:hover {
  color: #0084ff;
}

.category-page-article-info {
  margin-bottom: 15px;
}

.category-page-article-info span {
  font-size: 14px;
  font-weight: 400;
  margin-right: 20px;
  color: #888;
}

.category-page-article-excerpt {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #333
  margin-bottom: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-input {
  height: 40px;
  width: 300px;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  margin-right: 10px;
  font-size: 16px;
  font-weight: 400;
  color: #555;
  background-color: #f5f5f5;
  transition: all 0.3s ease-in-out;
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.search-button {
  height: 40px;
  width: 40px;
  border: none;
  border-radius: 20px;
  background-color: #0084ff;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.search-button:hover {
  background-color: #0073e6;
}

.search-button:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.search-button i {
  font-size: 18px;
  vertical-align: middle;
}

.footer {
  background-color: #333;
  color: #fff;
  padding: 50px 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
}

.footer-section {
  width: 33.33%;
  padding: 0 20px;
  box-sizing: border-box;
}

.footer-heading {
  font-size: 24px;
  margin-bottom: 20px;
}

.footer-text {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.footer-list {
  list-style: none;
  padding: 0;
}

.footer-link {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  margin-bottom: 10px;
  display: inline-block;
  transition: all 0.3s ease-in-out;
}

.footer-link:hover {
  color: #0084ff;
}

.footer-bottom {
  background-color: #222;
  text-align: center;
  padding: 20px 0;
}

.footer-bottom p {
  font-size: 14px;
  margin: 0;
}

              
            
!

JS

              
                
              
            
!
999px

Console