简体   繁体   English

如何使用PHP使用CSS将菜单/导航设置为水平样式?

[英]How to style a menu/nav to go horizontal with CSS using PHP?

I am really new to PHP coding so please let me know if anything I'm asking doesn't make sense. 我对PHP编码真的很陌生,所以请让我知道我要问的事情是否没有道理。 I have followed some tutorials and have written this php code to form a navigation through a local wordpress website to create a new theme. 我遵循了一些教程,并编写了此php代码,以通过本地wordpress网站形成导航以创建新主题。

I am now trying to style the theme, this is the code for the navigation: 我现在正在尝试设置主题样式,这是导航的代码:

    <div id="nav"><?php wp_nav_menu(array('theme location'=>'primary')); ?></div>

I am so confused as to how you would style this menu horizontally as I would normally use the unordered list and list item tags in html to display it inline etc. But these tags are not available to use with php. 我对如何水平设置此菜单样式感到困惑,因为我通常会使用html中的无序列表和列表项标签来内联显示它等。但是这些标签不适用于php。

If anyone could explain how I would do this I would be very grateful! 如果有人能解释我将如何做,我将不胜感激!

In html - find the ul with the navigation links -> CSS - use display:inline for li elements within the ul. 在html中-通过导航链接找到ul-> CSS-对ul中的li元素使用display:inline。

This will transpose the links. 这将转置链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM