Responsive Tabs
How do I make an responsive tabs?
What is a responsive tabs? How do you make a responsive tabs? This script and codes were developed by Daniel Grant on 28 December 2022, Wednesday.
Responsive Tabs - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Responsive Tabs</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ @charset "UTF-8";
.module { border: 1px solid #ccc;
}
.tabs + .module { border-top: none;
}
.tabs { height: 30px; background: #eee; border: 1px solid #ccc; overflow: hidden;
}
.tabs::after { clear: both; content: ""; display: table;
}
.tabs ul { margin: 0; padding: 0;
}
.tabs li { list-style: none; float: left; border-right: 1px solid #ccc;
}
.tabs li.is-active { background: #fff;
}
.tabs a { display: block; line-height: 30px; padding: 0 10px;
}
.segment { padding: 20px;
}
@media (max-width: 769px) { .tabs { position: absolute; top: 0; left: 0; z-index: 1; } .tabs li { width: 100%; border-top: 1px solid #ccc; border-right: none; } .tabs li.is-active { position: absolute; top: 0; z-index: 1; border-top: none; } .tabs li.is-active a::after { content: "▼"; float: right; font-size: 12px; } .tabs.is-open { height: auto; overflow: visible; } .tabs.is-open ul { padding-top: 30px; }
}
* { position: relative; box-sizing: border-box;
}
iframe { max-width: 100%; border: none;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="tabs"> <ul> <li><a href="#">Favourite Reports</a></li> <li class="is-active"><a href="#">General Reports</a></li> <li><a href="#">Income Reports</a></li> <li><a href="#">Expenditure Reports</a></li> <li><a href="#">Accounting Reports</a></li> <li><a href="#">Custom Reports</a></li> <li><a href="#">Advanced Reports</a></li> </ul>
</div>
<div class="module"> <div class="segment"> <iframe src="https://savedbythegoog.appspot.com/?id=2554790ee72c1b9dbb19f14e8f0e2619d38774c6" width=750 height=500></iframe> </div>
</div> <script src="js/index.js"></script>
</body>
</html>
Responsive Tabs - Script Codes CSS Codes
@charset "UTF-8";
.module { border: 1px solid #ccc;
}
.tabs + .module { border-top: none;
}
.tabs { height: 30px; background: #eee; border: 1px solid #ccc; overflow: hidden;
}
.tabs::after { clear: both; content: ""; display: table;
}
.tabs ul { margin: 0; padding: 0;
}
.tabs li { list-style: none; float: left; border-right: 1px solid #ccc;
}
.tabs li.is-active { background: #fff;
}
.tabs a { display: block; line-height: 30px; padding: 0 10px;
}
.segment { padding: 20px;
}
@media (max-width: 769px) { .tabs { position: absolute; top: 0; left: 0; z-index: 1; } .tabs li { width: 100%; border-top: 1px solid #ccc; border-right: none; } .tabs li.is-active { position: absolute; top: 0; z-index: 1; border-top: none; } .tabs li.is-active a::after { content: "▼"; float: right; font-size: 12px; } .tabs.is-open { height: auto; overflow: visible; } .tabs.is-open ul { padding-top: 30px; }
}
* { position: relative; box-sizing: border-box;
}
iframe { max-width: 100%; border: none;
}
Responsive Tabs - Script Codes JS Codes
var _each = function(a, b) { [].forEach.call(a, b);
}
var els = {};
els.tabs = document.querySelector('.tabs');
els.tabsLi = els.tabs.querySelectorAll('li');
var klasses = { active: 'is-active', open: 'is-open'
};
var selectors = { activeLi: 'li.is-active'
};
_each(els.tabsLi, function (li) { li.addEventListener('click', function () { els.tabs.classList.toggle(klasses.open); li.parentNode.querySelector(selectors.activeLi).classList.remove(klasses.active); li.classList.add(klasses.active); });
});
Developer | Daniel Grant |
Username | djgrant |
Uploaded | December 28, 2022 |
Rating | 3 |
Size | 3,473 Kb |
Views | 8,096 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Wireframe solar system | 4,856 Kb |
Responsive Modal | 4,178 Kb |
Gradient Border | 2,600 Kb |
Touch rem | 2,979 Kb |
Zero element inline validation bubble | 4,117 Kb |
Loading bar for ajax pages | 2,464 Kb |
CSS triangles with border | 3,146 Kb |
Facebook Paper Theme | 4,905 Kb |
Wireframe Planet | 5,744 Kb |
Auto expanding input addons | 3,140 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Obligatory CSS3 UI Nav | Romandiaz | 9,017 Kb |
Button fills | Zubfatal | 5,205 Kb |
IE flex collapse bug fix | Rowno | 2,678 Kb |
Minimal Menu | Achudars | 3,430 Kb |
JS Beispiel getElementsByClassName 3 | HSZG-Frontend-Kurs | 1,988 Kb |
Responsive scrolling text | Ashdurham | 2,259 Kb |
CSS Social Media Icon | TychoBlender | 3,871 Kb |
WRENCH - STAFF | Lolita-adams | 1,608 Kb |
CSS Link Zoom On Click | Bryce | 1,960 Kb |
Resizable SASS Icons | Marianarlt | 7,611 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!