HTML Dog
Skip to navigation

Inline tabs

Basic tabbed navigation using the display property.

HTML

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Tabs 1</title>
	<style>
		body {
			font: 0.8em arial, helvetica, sans-serif;
		}
	
		#header ul {
			list-style: none;
			padding: 0;
			margin: 0;
		}
	
		#header li {
			display: inline;
			border: 1px solid;
			border-bottom-width: 0;
			margin: 0 0.5em 0 0;
		}
	
		#header li a {
			padding: 0 1em;
		}
	
		#header #selected {
			padding-bottom: 1px;
			background: white;
		}
	
		#content {
			border: 1px solid;
		}
	</style>
</head>
<body>
	<div id="header">
		<h1>Tabs</h1>
		<ul>
			<li><a href="#">This</a></li>
			<li id="selected"><a href="#">That</a></li>
			<li><a href="#">The Other</a></li>
			<li><a href="#">Banana</a></li>
		</ul>
	</div>

	<div id="content">
		<p>Ispum schmipsum.</p>
	</div>

	<!-- Link back to HTML Dog: -->
	<p><a href="http://www.htmldog.com/examples/"><img src="http://www.htmldog.com/badge1.gif" alt="HTML Dog"></a></p>
</body>
</html>

Output

View original