Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Centre align menu

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #189325
    ani7ruddha
    Participant

    I have lost it the traditional way to centre align is not working
    {
    display:block;
    margin:0 auto;
    }

    http://goo.gl/WOyzIq

    #189330
    Krish1980
    Participant

    You’ve given a float:left to the ul and lis. Floats will not center your navigation. Remove the float from the ul and lis, give the li display:inline-block, and give the property ‘Text-align:center’ to the ul.

    http://csswizardry.com/2011/01/create-a-centred-horizontal-navigation/

    #189331
    robetnobe
    Participant

    try this

    .navbar .nav,
    .navbar .nav > li {
      float:none;
      display:inline-block;
      *display:inline; /* ie7 fix */
      *zoom:1; /* hasLayout ie7 trigger */
      vertical-align: top;
    }
    
    .navbar-inner {
      text-align:center;
    }

    hi try adding css code like this to your site footer

    .f_nav {
      width:90% !important;
      margin-right: auto !important;
      margin-left: auto !important;
      padding-top: 4%;
      padding-bottom: 4%;
      display:block;
      font-size:14px
      line-height:20px
      font-weight:normal
      text-transform:uppercase
      color:#d7d7d7
      text-decoration:none
    }
    
    .f_nav ul {
      margin:0;
      padding:0;
      text-align:center;
    }
    .f_nav ul li {
      display:inline;
    }
    .f_nav ul li a {
      float:none;
      display:inline-block;
    }
    #189377
    ani7ruddha
    Participant

    Yes done that but how to counter navbar.less ?

    http://screencast.com/t/sipYaqt2w7

    cant edit things their

    #189378
    Paulie_D
    Member

    Can you not edit the media query?

    #189379
    ani7ruddha
    Participant

    Their is no file as sch navbar.less in path shown and hence cant edit it.

    #189381
    Paulie_D
    Member

    No…you’d have to edit the LESS file and re-compile the CSS…wouldn’t you?

    #189392
    robetnobe
    Participant

    you just edit in bootstrap.css

    look at this
    center menu

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.