How to modify the list in the wordpress code?

2

Good afternoon, I have development problems. I want to know how I modify the appearance of the menu I'm making.

In function.php is the following code:

<?php
//menu
function register_my_menus() {
  register_nav_menus(
    array(
      'header-menu' => __( 'Header Menu' ),
      'extra-menu' => __( 'Extra Menu' )
     )
   );
 }
 add_action( 'init', 'register_my_menus' );
?>

in the file header.php is like:

<!doctype html>
<html>
<head>
 <meta charset="utf-8">
 <link rel="stylesheet" type="text/css" href="<?= get_template_directory_uri(); ?>/style.css">
<title><?php bloginfo('name'); ?></title>

</head>
<body>
<?php
wp_nav_menu( array( 'theme_location' => 'header-menu', 'menu_class' => 'menuclasse' ) );
?>

and in the style.css file:

body{
    background: lightblue;
    text-decoration: none;
}

.menuclasse{
    float: left;
}
.menu-item{
    background: blue;
}

Simply put. The menu on the site looks like this:

When I put code float:left, text-style:none , it does not work. My goal is to turn it into horizontal menu. It does not accept some css codes, and for me to do I need to accept it. Could someone help me?

    
asked by anonymous 20.08.2017 / 20:46

1 answer

0

As your goal is to leave the menu horizontal, simply add the following code in your CSS:

ul.menuclasse li {
    display: inline-block;
    padding: 0 10px;
    list-style: none;
}

In this way you are speaking to the <ul> element with the .menuclasse class that items within <li> should fit the inline-block display property >, responsible for ordering items horizontally.

I hope I have helped.

    
27.09.2018 / 17:11