Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 06-28-2008, 07:15 PM Centering
FGU
FGU's Avatar
Super Talker

Posts: 116
Trades: 0
I need help centering this navigation bar I got from Exploding Boy. If you don't want to download it, this is the code.


Code:
<style type="text/css">
   


/*- Menu Tabs H--------------------------- */

    #tabsH {
      float:left;
      width:100%;
      background:#000;
      font-size:93%;
      line-height:normal;
      }
    #tabsH ul {
    margin:0;
    padding:10px 10px 0 50px;
    list-style:none;
      }
    #tabsH li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsH a     { float: left; background-image: url('tableftH.gif'); background-repeat: 
               no-repeat; background-color: left; background-attachment: 
               scroll; text-decoration: none; margin: 0; padding-left: 4px; 
               padding-right: 0; padding-top: 0; padding-bottom: 0; 
               background-position: top }
#tabsH a span { float: left; display: block; background-image: url('tabrightH.gif'); 
               background-repeat: no-repeat; background-attachment: scroll; 
               color: #FFF; padding-left: 6px; padding-right: 15px; 
               padding-top: 5px; padding-bottom: 4px; background-position: 
               right top }
/* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsH a span {float:none;}
    /* End IE5-Mac hack */
    #tabsH a:hover span {
      color:#FFF;
      }
    #tabsH a:hover {
      background-position:0% -42px;
      }
    #tabsH a:hover span {
      background-position:100% -42px;
      }


     background:#F4F4F4;
      font-size:93%;
      line-height:normal;
      border-bottom:1px solid #24618E;
      }
    #tabsJ ul {
    margin:0;
    padding:10px 10px 0 50px;
    list-style:none;
      }
    #tabsJ li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsJ a     { float: left; background-image: url('tableftJ.gif'); background-repeat: 
               no-repeat; background-color: left; background-attachment: 
               scroll; text-decoration: none; margin: 0; padding-left: 5px; 
               padding-right: 0; padding-top: 0; padding-bottom: 0; 
               background-position: top }
#tabsJ a span { float: left; display: block; background-image: url('tabrightJ.gif'); 
               background-repeat: no-repeat; background-attachment: scroll; 
               color: #24618E; padding-left: 6px; padding-right: 15px; 
               padding-top: 5px; padding-bottom: 4px; background-position: 
               right top }
/* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsJ a span {float:none;}
    /* End IE5-Mac hack */
    #tabsJ a:hover span {
      color:#FFF;
      }
    #tabsJ a:hover {
      background-position:0% -42px;
      }
    #tabsJ a:hover span {
      background-position:100% -42px;
      }

</style>

How do I center it? If I change the float to none, it goes bonkers. Thanks! Please bear in mind that I barely know CSS.

Thanks,
FGU
FGU is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-28-2008, 11:07 PM Re: Centering
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
It would be helpful to have a link to the live HTML.
I would also suggest cleaning up that CSS code. Seems a bit messy.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
Old 06-29-2008, 05:42 AM Re: Centering
shivaji's Avatar
Ultra Talker

Posts: 318
Trades: 0
without HTML is not easy to answer on your question, but try

Quote:
#tabsH {
float:left;
width:100%;
background:#000;
font-size:93%;
line-height:normal;
text-align : center;
}
Shivaji
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Old 06-29-2008, 05:11 PM Re: Centering
FGU
FGU's Avatar
Super Talker

Posts: 116
Trades: 0
Sorry shivaji, no go. Here's the HTML.

Code:
<p align="center"><div id="tabsH">
  <ul>
    <li>
      <p align="center"><a href="/gamespage1" title="Games Page 1"><span>Games
      Page 1</span></a></li>
    <li>
      <p align="center"><a href="/gamespage2" title="Games Page 2"><span>Games
      Page 2</span></a></li>
    <li>
      <p align="center"><a href="/forum" title="Forums"><span>Forums</span></a></li>
    <li>
      <p align="center"><a href="/testarea" title="Testarea"><span>Testarea</span></a></li>
    <li>
      <p align="center"><a href="/news" title="News"><span>News</span></a></li>
    <li>
      <p align="center"><a href="/Support%20Us.htm" title="Support Us"><span>Support
      Us</span></a></li>
    <li>
      <p align="center"><a href="/Search.htm" title="Search"><span>Search</span></a></li>
  </ul>
</div></p>
FGU is offline
Reply With Quote
View Public Profile
 
Old 06-29-2008, 05:20 PM Re: Centering
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
Get rid of the <p> centering tag.
Again, it would be much easier if you provided a link to a hosted copy of the web site.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
Old 06-29-2008, 08:18 PM Re: Centering
FGU
FGU's Avatar
Super Talker

Posts: 116
Trades: 0
www.fungamesuniverse.com/test/
FGU is offline
Reply With Quote
View Public Profile
 
Old 06-30-2008, 05:23 AM Re: Centering
shivaji's Avatar
Ultra Talker

Posts: 318
Trades: 0
Try this,
Quote:
#tabsH {
width : 700px; /* fit here width */
margin-left : auto;
margin-right : auto;
background:#000;
font-size:93%;
line-height:normal;
}
BTW, remove p tags from menu bar.

Shivaji
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Reply     « Reply to Centering
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54910 seconds with 12 queries