Solved

CSS: tab navigation

Posted on 2009-07-10
1
241 Views
Last Modified: 2012-05-07
Please see attachments and source code.
I have TAB navigation sample which works perfect, however when I shrink window size, I would like to make sure that TABs are getting under each other automatically if there is not enough room and ont staying outside of the firefox window see second attachment.

What do I need to change in the CSS.

Thank you
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

<title>Chapter 2: Scalable Navigation</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css" media="screen">

body {

	margin: 0;

	padding: 0;

	font-size: small;

	}

#nav {

	float: left;

	width: 720px;

	margin: 0;

	padding: 10px 0 0 46px;

	list-style: none;

	background: #FFCB2D url(img/nav_bg.gif) repeat-x bottom left;

	position: relative;

	}

#nav li {

	float: left;

	margin: 0 1px 0 0;

	padding: 0;

	font-family: "Lucida Grande", sans-serif;

	font-size: 80%;

	}

#nav a {

	float: left;

	display: block;

	margin: 0;

	padding: 4px 8px;

	color: #333;

	text-decoration: none;

	border: 1px solid #9B8748;

	border-bottom: none;

	background: #F9E9A9 url(img/off_bg.gif) repeat-x top left;

	}

#nav a:hover, body#intro #t-intro a {

	color: #333;

	padding-bottom: 5px;

	border-color: #727377;

	background: #fff url(img/on_bg.gif) repeat-x top left;

	}

</style>

</head>
 

<body id="intro">
 

	<ul id="nav">

		<li id="t-intro"><a href="/">Introduction</a></li>

		<li id="t-about"><a href="about.html">About Lance</a></li>

		<li id="t-news"><a href="news.html">News & Events</a></li>

		<li id="t-sponsors"><a href="sponsors.html">Sponsors</a></li>

		<li id="t-about"><a href="about.html">About Lance</a></li>

		<li id="t-news"><a href="news.html">News & Events</a></li>

		<li id="t-sponsors"><a href="sponsors.html">Sponsors</a></li>

		<li id="t-about"><a href="about.html">About Lance</a></li>

	</ul>
 

</body>

</html>

Open in new window

Picture-6.png
Picture-7.png
0
Comment
Question by:Goldblum
1 Comment
 
LVL 30

Accepted Solution

by:
renazonse earned 500 total points
ID: 24826724
in that case you'll need to remove the static width off of #nav to make it collapse. You'll need to generate the background color another way...an absolutely positioned div would do it.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to picture file 3 42
Hovering effect 9 30
Open a div with click on an image 7 49
C3-->D3 Line Chart 4 19
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now