Pen Settings



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


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


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.


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.


                <div class="container">
  <div class="phone-container">
 <i class="icon fa fa-home" aria-hidden="true"></i>
  <ul class="tab-nav-container">
    <li class="tab tab-purple active">
      <i class="fa fa-home fa-lg" aria-hidden="true"></i>
    <li class="tab tab-pink">
      <i class="fa fa-heart fa-lg" aria-hidden="true"></i>
    <li class="tab tab-yellow">
      <i class="fa fa-search fa-lg" aria-hidden="true"></i>
    <li class="tab tab-teal">
      <i class="fa fa-user fa-lg" aria-hidden="true"></i>


                @import url(',700&display=swap');

body {
   margin: 0;

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;

.phone-container {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 768px;
  width: 450px;
  background: #CE93D8;
  box-sizing: border-box;
  border-radius: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.3s linear;

.tab-nav-container {
  display: flex;
  justify-content: space-between;
  width: 450px;
  margin: 0;
  padding: 30px;
  background: #fff;
  box-sizing: border-box;
  border-top: 1px solid rgba(0, 0, 0, 0.3);
  border-bottom-right-radius: 30px;
  border-bottom-left-radius: 30px;
  list-style: none;

.tab {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  border-radius: 50px;
  cursor: pointer;
} {
  background-color: #CE93D8;
  color: #4A148C;
} {
  background-color: #F8BBD0;
  color: #880E4F;
} {
  background-color: #FFE082;
  color: #F57F17;
} {
  background-color: #00B8D4;
  color: #006064;

.tab p {
  font-family: Roboto, sans-serif;
  font-size: 16px;
  overflow: hidden;
  max-width: 0;
} p {
  margin-left: 10px;
  max-width: 200px;
  transition: max-width 0.4s linear;

.icon {
  position: absolute;
  top: 50%;
  left: 0;
  margin-top: -140px;
  width: 100%;
  text-align: center;
  font-size: 240px;
  color: #fff;



                const tabBtn = document.querySelectorAll(".tab"),
      tabContainer = document.querySelector(".tab-nav-container"),
      phContainer = document.querySelector(".phone-container");

tabBtn.forEach((clickedTab) => {
  clickedTab.addEventListener("click", () => {
    tabBtn.forEach((tab) => {
    //getComputedStyle() возвращает объект содержащий значения всех CSS свойств элемента, полученные после применения всех активных таблиц стилей
    //getPropertyValue() интерфейс метода, который возвращает DOMString, указанного CSS свойства.
    const clickedTabBGColor = getComputedStyle(clickedTab).getPropertyValue('background-color'); = clickedTabBGColor;
    let icon = clickedTab.querySelector(".fa"), 
        newIcon = document.createElement("i");

    newIcon.classList.add("fa", `${icon.classList[1]}`,"icon");
    phContainer.insertBefore(newIcon, tabContainer);