CSS - How To Make Multi-row Navigation Tabs
Hello. I've searched far and wide for a good tutorial on how to make multi-row navigation tabs (something that kind of resembles the System Properties box in Windows). Can this be done using ordered lists? Does anyone know of a good source for this?
thanks much. -Dan Similar TutorialsI've search these forums and found several threads about this topic but none have any real answers to this issue. I've got some navigation tabs, similar to Sitepoint's tabs. How does one go about centering them in the page? My site: http://www.webhelpzone.com/ CSS: Page Layout and Navbar Styles I've tried doing this: Code: ul#nav { position: absolute; left: 50%; width: 505px; margin-left: -252px; } Which actually centers the navigation bar, but when the browser is shrunk down, the bar ends up being pushed off the screen. Sitepoint's nav bar just shrinks down, remaining centered in the browser window. How do you accomplish the centering of navigational tabs? How do I make multiple tabs in CSS? I want tabs with rounded corners. So far I can only get 1 tab. What do I do to make more? I am trying to create a Horizontal Multilevel Drop Down Navigation Menu, but instead of the css creating text i would like them to be images and when you hover over the links they rollover into a new image. I would really like your help on this been trying to do it for weeks now!! Cheers Hello! Im Using Joomla to build my website. Im using a module and im changing the css styling. There only one problem im having. The tabs on the module align to the left and because i dnt have enough tabs to fill out the space it leave a blank space on the right. I just want to know how to edit the CSS to make the taps justify / spread out evenly. The makers of the module say any question on customization will be ignored that why i post this question here to see if i could get some help. Its "Tabs Manager GK3" from Gavick Heres the CSS. Can any1 just make the changes for me please and post it below Thanks in advance! Code: .clearfix-tabs{ clear: both; } .gk_tab_item_space{ padding: 10px; } div.gk_tab-style3 { position: relative; } div.gk_tab_wrap-style3 { margin: 0 auto;background: #171717; border: 4px solid #822864; } div.gk_tabmenu-style3 { overflow:hidden; } ul.gk_tab_ul-style3 { list-style-type: none; margin: -1px 0 0; padding: 0; } ul.gk_tab_ul-style3 li { background: none; padding: 0; float: left; cursor: pointer; margin: 0; position: relative; } ul.gk_tab_ul-style3 li span { background: url('../../images/horizontal/style3/bg_tab.png') repeat-x 0 0; display: block; height: 28px; line-height: 27px; padding: 0 10px; font-size: 10px; color: #000; text-transform:uppercase; border: 1px solid #e1e1e1; border-left: none; } ul.gk_tab_ul-style3 li.active span { background: url('../../images/horizontal/style3/bg_tab-active.png') repeat-x 0 0; color: #171717; border: 1px solid #b32784; } div.gk_tab_container0-style3 { clear: both; } div.gk_tab_container1-style3 { overflow: hidden; } div.gk_tab_item-style3 { float: left; overflow: hidden; padding: 10px; } div.gk_tab_button_next-style3, div.gk_tab_button_prev-style3 { width: 24px; height: 24px; background: url('../../images/horizontal/style3/b_next.png') no-repeat 0 0; cursor: pointer; position: absolute; top: 43%; right: 0; } div.gk_tab_button_prev-style3 { background: url('../../images/horizontal/style3/b_prev.png') no-repeat 0 0; left: 0; right:inherit; } div.gk_tab_button_next-style3:hover { background: url('../../images/horizontal/style3/b_next.png') no-repeat 100% 0; } div.gk_tab_button_prev-style3:hover { background: url('../../images/horizontal/style3/b_prev.png') no-repeat 100% 0; } .gk_tab_container0-style3, .gk_tab_container1-style3, .gk_tab_container2-style3{ position:relative; } Hi, I want to make something that works like this: dhtmlgoodies.com/scripts/slidedown-menu2/slidedown-menu2.html# (cant post proper urls as I'm new) Whereby each link has a number of sub-links under it, and when you click a main link, the sub links for the previous one shut and the new one opens. But the tutorial on that site is not much help. It just gives you a load of code to copy into your editor, and when I've done that it didn't work anyway. Could someone point me in the direction of a tutorial to do this or let me know what I should be doing, as I can't seem to find anything on how to do it. Thanks! Hi All, I am building a site that has the following structure for the navigation; Code: <div id="navigation"> <ul id="navlist"> <li class="home"><a href="../index.asp" title="home"><span>home</span></a></li> <li class="aboutus"><a href="../aboutus.htm" title="aboout us"><span>about us</span></a></li> <li class="ourservices"><a href="../ourservices.htm" title="our services"><span>our services</span></a> <ul> <li class="internationalmail"><a href="ourservices_internationalmail.htm" title="international mail"><span>international mail</span></a></li> <li class="worldwidecourier"><a href="ourservices_worldwidecourier.htm" title="worldwide courier"><span>worldwide courier</span></a></li> <li class="worldwidefreight"><a href="ourservices_worldwidefreight.htm" title="worldwide freight"><span>worldwide freight</span></a></li> <li class="storage"><a href="ourservices_storage.htm" title="storage"><span>storage</span></a></li> <li class="publishingservices"><a href="ourservices_publishingservices.htm" title="publishing services"><span>publishing services</span></a></li> </ul> </li> <li class="requestquote"><a href="../requestquote.htm" title="request a quote"><span>request a quote</span></a></li> <li class="contactus"><a href="../contactus.htm" title="contact us"><span>contact us</span></a></li> </ul> </div> The main LI is horizontal, and the containing UL, LI is a vertical dropdown. The seperate CSS file does the image replacements on the <a> and hides the text within the <span>, usual stuff. The nav works great, with the graphic rollovers etc. The rollover, again, standard way of doing it, background: url(<FILE>) no-repeat top left; and the a:hover rollover is a background: bottom left;. Edit: Just noticed that I can't link to the full site that I have uploaded for preview. What I want to do, is when the user roll's over any of the items within the sub-navigation, it keeps the main Services navigation link rolled over also. The only way I could think of doing this, and relatively simply, would be to use JavaScript, but wanted to explore any other CSS ways of doing this. For example, is it possible to change a style of another class, from another? Your help would be much appreciated! hello. I am currently using a simple horizontal top menu with a vertical drop down. I would like to change the vertical drop down to be horizontal, multi column, and should accomodate more than one line, if possible. The example I'm going for is used as top navigation he nfl - baltimore ravens home page and he ge home page Here is the code I'm using currently (would like it to be all CSS). #### ul#mainNavigation { padding-left:185px; } ul#mainNavigation li { padding:0 16px; float: left; display:inline; position: relative; list-style: none; color:White; _width:1px; } ul#mainNavigation li.Seperator { padding:0px; _width:1px; } ul#mainNavigation li.over { background-color:white; } ul#mainNavigation li.over a { color:Red; } ul#mainNavigation li a { color:White; text-transform:uppercase; text-decoration:none; font-weight:bold; display:block; } ul#mainNavigation a:hover { color: Red; } ul#mainNavigation li a { display: block; } ul#mainNavigation li p { height:19px; } ul#mainNavigation li ul { display: none; position: absolute; background-color:Black; opacity:.8; filter: alpha(opacity=80); -moz-opacity: 0.8; margin-left:-16px; } ul#mainNavigation li.over ul { display: block; z-index:999; } ul#mainNavigation li.over ul li { float: none; background:none; border:none; white-space:nowrap; padding:0px; } ul#mainNavigation li.over ul li a { color: white; padding:5px; border-bottom:solid 1px black; } ul#mainNavigation li.over ul li a:hover { background: #3d1f6e; color: white; } ~~~~~~~ HTML ~~~~~~~~~~~~~~ <ul id="mainNavigation"> <li> <p><a href="Mainlink1.html">Mainlink1</a></p> <ul> <li><a href="link2.html">LINK 2</a></li> <li><a href="link3.html">LINK 3</a></li> <li><a href="link4.html">LINK 4</a></li> <li><a href="link5.html">LINK 5</a></li> <li><a href="link6.html">LINK 6</a></li> <li><a href="link7.html">LINK 7</a></li> </ul> </li> <li> <p><a href="Mainlink2.html">Mainlink2</a></p> <ul> <li><a href="link2.html">LINK 2</a></li> <li><a href="link3.html">LINK 3</a></li> <li><a href="link4.html">LINK 4</a></li> <li><a href="link5.html">LINK 5</a></li> <li><a href="link6.html">LINK 6</a></li> <li><a href="link7.html">LINK 7</a></li> </ul> </li> </ul> #### Thank you, in advance! ~ lahddah i'm trying this CSS Tab deelio, but I can't seem to get it right. I'm kind of new to this, but check out this page and tell me what I'm doing wrong. Thanks! (URL address blocked: See forum rules) Hello, I am having some problems with my code. I'm not able to insert these forms properly into these divs. I would like the forms to be placed within the tab (more or less centered), however, how it is now the form is half way in and half out of the tab. When I try and move the form over it distorts the tab image. Please help me fix this problem. I'm uncertain about what is wrong and how to fix it. Thank you in advance. Code: <head> <style type="text/css"> body { color: black; } /*Form Formatting*/ fieldset { margin: 1em 0; padding: 1em; border: 1px solid #ccc; background: #000000; } legend { font-weight: bold; color: #FFFFFF; } label { display: block; } input [type="text"] { width: 200px; } input.radio, input.checkbox, input.submit { width: auto; } input.radio { float: left; margin-right: 1em; } input.author:focus, input.email:focus { background: #E9C2A6; } input[type="text"] { border-top: 2px solid #999; border-left: 2px solid #999; border-bottom: 1px solid #ccc; } .required { font-size: 0.75em; color: green; } .author, .email, .subscribe-yes, .subscribe-no, .checkbox/*.HTML_Box, .Plain_Text*/ { color: #FFFFFF; } /*--------------------------------------------------------------------------------------------------------------------------------------*/ /*Form Placement*/ #Display_Name { margin: auto 33% auto 33%; width: 150px; left: 100px; } #Details { margin: auto 33% auto 33%; } #Subscription { margin: auto 33% auto 33%; width: 150px; } #Mailing { margin: auto 33% auto 33%; width: 180px; } #Submit_Subscription { margin: auto 33% auto 33%; } #HTML_Box { float: none; } #PText_Box { float: right; } /*------------------------------------------------------------------------------------------------------------------------------------*/ /*Background Tab*/ /* set the image to use and establish the lower-right position */ .cssbox, .cssbox_body, .cssbox_head, .cssbox_head h2 { background: transparent url(../../Working/red_tab.php.png) no-repeat bottom right } .cssbox { /* intended total box width - padding-right(next) */ width: 250px !important; /* IE Win = width - padding */ width: 320px; /* the gap on the right edge of the image (not content padding) */ padding-right: 15px; /* use to position the box */ margin: 20px auto; } /* set the top-right image */ .cssbox_head { background-position:top right; /* pull the right image over on top of border */ margin-right:-15px; /* right-image-gap + right-inside padding */ padding-right:40px } /* set the top-left image */ .cssbox_head h2 { background-position:top left; margin:0; /* reset main site styles*/ border:0; /* ditto */ /* padding-left = image gap + interior padding ... no padding-right */ padding:8px 0 0px 40px; height:auto !important; height:1%; /* IE Holly Hack */ font-family: Comic Sans MS, Arial, sans-serif; } /* set the lower-left corner image */ .cssbox_body { background-position:bottom left; margin-right:25px; /* interior-padding right */ padding:15px 0 15px 40px; /* mirror .cssbox_head right/left */ } </style> </head> <body> <!--Tab--> <div class="cssbox"> <div class="cssbox_head"> <h2>Mailing List</h2> </div> <div class="cssbox_body"> <!-- Contact Info --> <div id="Display_Name"> <fieldset id="Details"> <legend>Contact Details</legend> <!--Name--> <label for="author" class="author">Name: <em class="required">(Required)</em></label> <input name="author" id="author" type="text" size="25"/> <!-- E-mail Address--> <label for="email" class="email">Email: <em class="required">(Required)</em></label> <input name="email" id="email" type="text" size="25" maxlength="200"/> <!-- E-mail Format--> <div id="HTML_Box"> <p> <input class="checkbox" id="HTML" name="HTML" type="checkbox" value="HTML" /> <label>HTML</label> </p> </div> <div id="PText_Box"> <p> <input class="checkbox" id="Plain_Text" name="Plain_Text" type="checkbox" value="Plain_Text" /> <label>Plain Text</label> </p> </div> </fieldset> </div> <!-- Subscription Question --> <div id="Subscription"> <fieldset id="Mailing"> <legend>Join Mailing List?</legend> <p> <input id="add-subscribe" class="radio" name="add" type="radio" value="subscribe" checked="checked" /> <label for="add-subscribe" class="subscribe-yes">Subscribe</label> </p> <p> <input id="add-unsubscribe" class="radio" name="add" type="radio" value="unsubscribe" /> <label for="add-unsubscribe" class="subscribe-no">Unsubscribe</label> </p> <!-- Mailing List Submit Button --> <div id="Submit_Subscription"> <input id="enter" type="submit" value="Submit" /> </div> </fieldset> </div> </div> </div> </body> </html> -------------------------------------------------------------------------------- I am using tabs to switch between screens. So the tabs could be information, telephone, notes etc. So its the same customer just different aspects of their information. This has worked well however I now want to add a sideways tab system. This means I want to use similar tabs but rotate it 90 degrees. So its on its side. I was wondering if anyone had come across tabs that where on thier side before and a link to a tutorial would be great! thanks. Heya, Any ideas how I can center the tabs on this page? http://explosiveracing.net/testing/menu.html The HTML and CSS is self explanatory. Thanks I have been monkying around all day with this code and can't seem to get it reversed correctly, so that all the tabs start on the right side instead of the left. I end up messing it up pretty badly and I can't seem to figure out where I am going wrong with it.... any help is appreciated. The example can be seen he http://homelesspixel.de/tabs/ For ease of use I'll paste the HTML and CSS in one: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <style type="text/css"> body { color: #333; background-color: #fff; padding: 20px 20px; margin:0; font: normal 11px helvetica, arial, geneva, lucida, sans-serif; } h1 { font-size:2em; font-weight:normal; margin:1em 0; } ul#topnav { margin:0 0 100px; padding: 0 0 0 12px; list-style: none; border: none; } #topnav li { display: block; margin: 0; padding: 0; float:left; } #topnav a { display:block; color:#444; text-decoration:none; background: url(images/lia.gif) no-repeat; margin:0; padding: 0.2em 2.4em 0.2em 36px; border-right: 1px solid #aaa; position: relative; font: bold 11px helvetica, arial, geneva, lucida, sans-serif; } #topnav a#a0 { left: 0px;} #topnav a#a1 { left: -30px;} #topnav a#a2 { left: -60px;} #topnav a#a3 { left: -90px;} #topnav a#a4 { left: -120px;} #topnav a#a5 { left: -150px;} #topnav a#a6 { left: -180px;} #topnav a:hover { background: url(images/liahover.gif) no-repeat; } #topnav a.here { position:relative; z-index:102; background: url(images/liahover.gif) no-repeat; border-right: 1px solid #777; padding: 0.2em 1em 0.2em 35px; margin: 0 4px 0 0; } ul#subnav { position:absolute; z-index:101; margin: -1px 0 0; left: 10px; padding: 1px 0px 3px 30px; background: #bbb; border-top:1px solid #fff; border-bottom:1px solid #999; width: 720px; } #subnav li { position:relative; z-index:102; display: block; margin: 0; padding: 0; float:left; } #subnav a { color:#fff; display:block; text-decoration:none; margin:0; padding: 2px 12px 2px 10px; background: transparent; background-image: none; border: 0 none; } #subnav a:hover { color:#444; background: transparent; background-image: none; border: 0 none; } #subnav a.here { color:#444; background: transparent; background-image: none; border: 0 none; margin:0; padding: 2px 12px 2px 10px; } </style> <body> <h1>Example of CSS-driven tabs</h1> <ul id="topnav"> <li><a id="a0" href="#">Home</a></li> <li><a id="a1" href="#">About</a></li> <li><a id="a2" href="#">News</a></li> <li><a id="a3" href="#">Proof</a></li> <li><a id="a4" href="#" class="here">Process</a> <ul id="subnav"> <li><a href="#">Vision</a></li> <li><a href="#">Team</a></li> <li><a href="#" class="here">Culture</a></li> <li><a href="#">Careers</a></li> <li><a href="#">History</a></li> <li><a href="#">Sponsorship</a></li> </ul> </li> <li><a id="a5" href="#">Expertise</a></li> <li><a id="a6" href="#">Help</a></li> </ul> </body> </html> Hello all - I am trying to implement tabs to my forum, I currently have some on there but I like the looks better of the new ones that I am trying to get going. I find that when I get them working (using additional CSS as well as navbar/header edit) it will not work in all browsers. If I post the CSS as well as the navbar/header code would you be able to help me track down my issue? EDIT - I was going to post screenshots but was not permitted I've found a number of great examples of how to do tabs with CSS (http://unraveled.com/projects/css_tabs/ being the one I'm working off of), but they all link to various other HTML pages. Does anyone know of a reasonably simple way to do them inline? (think www.johnkerry.com) I'm sure there's javascript involved, but does anyone know of a good resource on how to accomlish something like this? Was working on a new design for one of my sites today and when I inadvertently discovered using buttons as tabs, however... I am more of a programmer than I am a designer. The tabs look differently in Firefox than they do in IE. In IE, I give the currently tab more padding than the other buttons and those other buttons stay attached to the <div> below them. In Firefox/Mozilla, the other buttons are raised up. See here* *You will notice that the Home page has rounded corners, while the About page does not; can't decide which one I like better The other issue I have in IE is that when I button is being clicked/activated, it detaches itself from the <div> below. -- Maybe a good time to also ask how I can accomplish something using div's or span's that I used to do with table's: How would I have a 700px wide box, with a div at the top, split 50/50 so that I could have a small logo at the top left and a search box (on the same row) at the top right? I have always: Code: <table width="700"> <tr> <td width="50%">logo</td> <td width="50%" align="right">search box</td> </tr> </table> -- One mo If I am using HTML 4.01 strict, can I still use: Code: <td align="center" valign="middle"> or do I have to: Code: <td style="text-align:center;vertical-align:middle"> Cheers! I have an issue with my first website. I'm trying to center the tabs at the top of my page, but I cannot seem to figure out how to do it. I've tried using floats, auto margins, clears, etc., but nothing seems to be working. Could I get some help on this? http://bud12345.fusedtree.com Here's the CSS: Code: body { font-family: Verdana, sans-serif; background-color: #50AD34; color: #000000; text-decoration: none; word-spacing: normal; text-align: left; letter-spacing: 0; line-height: 1.3em; font-size: 1.2em; } .update { font-style: italic; font-weight: bold; font-size: 0.9em; } span.updatehead { text-decoration: underline; } div.update { border-style: solid; border-width: thin; border-color: #F77900; padding-left: 1.0em; } #tabsC { float:left; width:100%; background:#50AD34; font-size:93%; line-height:normal; } #tabsC ul { margin:0; padding:10px 10px 0 50px; list-style:none; } #tabsC li { display:inline; margin:0; padding:0; } #tabsC a { float:left; background:url("tableftC.gif") no-repeat left top; margin:0; padding:0 0 0 4px; text-decoration:none; } #tabsC a span { float:none; display:block; background:url("tabrightC.gif") no-repeat right top; padding:5px 15px 4px 6px; color:#464E42; } #tabsC a:hover span { color:#FFF; } #tabsC a:hover { background-position:0% -42px; } #tabsC a:hover span { background-position:100% -42px; } Code: <div id="s_site"> <a href="#site">This site</a> <h2 id="site_h">About This Memorial Site</h2> <p id="site_p" class="tab_cont">This site is brought to you by the Royal Canadian Branch 3 Legion John Bernard Croak Victorian Cross. In honor of those fallen and served in WW2.</p> </div> the h2 and p element are hidden using display:none; when I click on the anchor link i'd like them to apper using display:block; It seems like I may need to use javascript but I'd rther not use javascript at all, except for thos eunfortunate enough to still be using IE. I can't figure it out I've tried amny thing that didnt work. I've been searching for a selector that will let me access these hidden elements but I can't come up with anything. I half accomplished what I was trying but I can't get the changes to stick. Thanks for reading Hi, New to CSS and all. Trying to work on a web site. I used a Wordpress theme and modified it to my liking. I am having a small issue that I would really appreciate help on. marinhome.inwire .net/lessons The page uses tabs. When you click from one tab to another, the tab content is shifting down. Can somebody please let me know what the problem is? Thanks, Gaurav I have too many items for one row of tabs, how do I get a second row? Save this as tab.png URL Here's my working fine one row code: design.css Code: ol#toc { height: 2em; list-style: none; margin: 0; padding: 0; } ol#toc li { float: left; margin: 0 1px 0 0; } ol#toc a { background: #bdf url(tab.png); color: #008; display: block; float: left; height: 2em; padding-left: 10px; text-decoration: none; } ol#toc a:hover { background-color: #3af; background-position: 0 -120px; } ol#toc a:hover span { background-position: 100% -120px; } ol#toc li.current a { background-color: #48f; background-position: 0 -60px; color: #fff; font-weight: bold; } ol#toc li.current span { background-position: 100% -60px; } ol#toc span { background: url(tab.png) 100% 0; display: block; line-height: 2em; padding-right: 10px; } div.content { border: #48f solid 3px; clear: left; padding: 1em; } h1.html Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>1 row</title> <link href="design.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>1 row</h1> <ol id="toc"> <li class="current"><a href="h1.html"><span>H1</span></a></li> <li><a href="h2.html"><span>H2</span></a></li> <li><a href="h3.html"><span>H3</span></a></li> </ol> <div class="content"> <h2>H1</h2> <p>Pic and text...</p> </div> </body> </html> And here's my bad attempt at 2 rows! design2rows.css Code: ol#toc { height: 2em;list-style: none; margin: 0; padding: 0; } ol#toc li.first { float: left; margin: 0 1px 0 0; } ol#toc li.drop { clear: left; margin: 0 1px 0 0; padding:0 0 0 6px; } ol#toc a { background: #bdf url(tab.png); color: #008; display: block; float: left; height: 2em; padding-left: 10px; text-decoration: none; } ol#toc a:hover { background-color: #3af; background-position: 0 -120px; } ol#toc a:hover span { background-position: 100% -120px; } ol#toc li.current a { background-color: #48f; background-position: 0 -60px; color: #fff; font-weight: bold; } ol#toc li.current span { background-position: 100% -60px; } ol#toc span { background: url(tab.png) 100% 0; display: block; line-height: 2em; padding-right: 10px; } div.content { border: #48f solid 3px; clear: left; padding: 1em; } q1.html Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Tab 2 row</title> <link href="design2row.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>Tab 2 row</h1> <ol id="toc"> <li class="first"> <li class="current"><a href="q1.html"><span>1</span></a></li> <li><a href="q2.html"><span>2</span></a></li> <li><a href="q3.html"><span>3</span></a></li> <li><a href="q4.html"><span>4</span></a></li> <li><a href="q5.html"><span>5</span></a></li> <li><a href="q6.html"><span>6</span></a></li> <li><a href="q7.html"><span>7</span></a></li> <li><a href="q8.html"><span>8</span></a></li> <li><a href="q9.html"><span>9</span></a></li> <li><a href="q10.html"><span>10</span></a></li> <li><a href="q11.html"><span>11</span></a></li> <li><a href="q12.html"><span>12</span></a></li> <li><a href="q13.html"><span>13</span></a></li> <li><a href="q14.html"><span>14</span></a></li> <li><a href="q15.html"><span>15</span></a></li> <li><a href="q16.html"><span>16</span></a></li> <li><a href="q17.html"><span>17</span></a></li> <li><a href="q18.html"><span>18</span></a></li> </li> <li class="drop"> <li><a href="q19.html"><span>19</span></a></li> <li><a href="q20.html"><span>20</span></a></li> <li><a href="q21.html"><span>21</span></a></li> </li> </ol> <div class="content"> <h2>1</h2> <p>Pic and text...</p> </div> </body> </html> |