WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Centering nav menu in Slim Theme (3 posts)

  1. thestealthyfox
    Member
    Posted 1 year ago #

    Any ideas on what I would need to add to my child theme to centre my nav menu on Slim Theme? I've played around with the CSS, but nothing is working so far.
    Here's the coding.

    #navigation{
    	width: 940px;
    	margin: auto 20px;
    	float: left;
    	background: #4B5C7D;
    }
    #navigation ul{
    	list-style: none;
    	padding: 0 7px;
    }
    #navigation li{
    	float: left;
    	display: block;
    	line-height: 30px;
    	letter-spacing: 1px;
    	padding: 7px 0;
    }
    #navigation a{
    	float: left;
    	display: block;
    	position: relative;
    	padding: 0 10px;
    	color: #FFF;
    	text-decoration: none;
    }
    #navigation a:hover,
    .current-menu-item a{
    	background: #B8C8E1;
    }
    
    .sf-menu, .sf-menu *{margin:0; padding:0; list-style:none}
    .sf-menu ul{position:absolute; top:-999em; background: #4B5C7D; padding: 0 !important;}
    .sf-menu ul li{width:100%; padding: 0 !important;}
    .sf-menu ul li a{width: 210px;}
    .sf-menu li:hover{visibility:inherit}
    .sf-menu li{float:left; position:relative}
    .sf-menu li:hover ul,
    .sf-menu li.sfHover ul{left:0; top:44px; z-index:99}
    ul.sf-menu li:hover li ul,
    ul.sf-menu li.sfHover li ul{top:-999em}
    ul.sf-menu li li:hover ul,
    ul.sf-menu li li.sfHover ul{left:15em; top:0}
    ul.sf-menu li li:hover li ul,
    ul.sf-menu li li.sfHover li ul{top:-999em}
    ul.sf-menu li li li:hover ul,
    ul.sf-menu li li li.sfHover ul{left:15em; top:0}

    Thanks.

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    #navigation ul{
    	list-style: none;
    	padding: 0 7px;
            display: table;
            margin: 0 auto;
    }
  3. thestealthyfox
    Member
    Posted 1 year ago #

    You're a star - thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic