Skip to navigation

Floated tabs

Basic tabs using the float property.


<!DOCTYPE html>
	<meta charset="utf-8">
	<title>Tabs 2</title>
		body {
			font: 0.8em arial, helvetica, sans-serif;
		#header ul {
			list-style: none;
			padding: 0;
			margin: 0;
		#header li {
			float: left;
			border: 1px solid;
			border-bottom-width: 0;
			margin: 0 0.5em 0 0;
		#header a {
			display: block;
			padding: 0 1em;
		#header #selected {
			position: relative;
			top: 1px;
			background: white;
		#content {
			border: 1px solid;
			clear: both;
		h1 {
			margin: 0;
			padding: 0 0 1em 0;
	<div id="header">
			<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>

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

	<!-- Link back to HTML Dog: -->
	<p><a href=""><img src="" alt="HTML Dog"></a></p>


View original