- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
HTML/CSS. How to create vertical and horizontal menu
March 13, 2020
This tutorial will show you how to create a vertical and horizontal menus in HTML using CSS styles. Before you proceed please make sure you are familiar with unordered list HTML tags. Also please check the tutorial on how to create a menu in HTML.
Ok, first of all create an HTML menu using the unordered list:
Then you need to create new CSS file and attach it to the HTML page:
Make sure you put the CSS attachement code into the
tag of your html page.You can also use the inline styles.
As a result you shou have the following HTMl code:
威尼斯人在线 Sun-City-official-website-support@waki-aiai.net 大庆师范学院 Sabah-Official-website-billing@chapterdesign.net 太阳城 MAXPDA论坛 Sports-betting-platform-admin@rf518.com Gaming-app-Download-contactus@anetalaya.com 菠菜平台 户外钓鱼网 南京烟草电子商务系统 厚普股份 Sabah-Official-website-info@83288.net 365体育 二维码生成器 Gaming-app-Download-customerservice@sdshty.com Sun-City-entertainment-City-service@lhjcmaigaiti.com 福岛精密 威廉希尔体育 Sabah-online-platform-info@pf168shop.com 香港教育学院 新浪宁波 揭阳潮汕机场官方网站 合肥工业大学宣城校区 QQ安全中心 苏州华硕电脑公司招聘官方网站 纹身控 参考消息网国际新闻 上海热线财经频道 u88加盟网 网购之家 乐施会 莱芜房地产网 福州教育网 报告船长
The unordered list has it’s own styles so without any additional changes you have a vertical menu.
As for the horizontal menu you need to perform some changes in HTML and CSS.
First of all add new class to the list, replace with
Now in the CSS file let’s make the menu horizontal. The unordered list has margin and padding values assigned by default. we need to clear them:
ul.horizontal{ margin:0; padding:0; }
Then make your list items display horizontally:
ul.horizontal li{ display:block; float:left; padding:0 10px; }
We added the horizontal padding value to the list items to make then not stick to each other. Now your menu is ready, assign links, add some fancy colors and background and your are good to go.
Zemez Responsive Navbar JavaScript

The average user has neither time nor patience to surf your website in search of the required information. Difficult-to-use navigation makes the user feel awkward and may leave the site anytime. Choose Zemez responsive Navbar JavaScript to avoid these mistakes and boost the functionality of your web resource.
This Navbar JavaScript is a beautiful solution for those who want to add more power to a web resource. The package comes with 8 unique layouts, multi-level dropdowns and megamenus, available in light and dark color schemes. Moreover, it is cross-browser compatible as it supports Edge 15+, Firefox 54+, Chrome 51+, Safari 10+. Click the demo link to view a demonstration of this script work.
More features:
- SASS
- Sticky navbar
- Fixed and fullwidth layouts
- Flexbox based
- Round-the-clock support