search
HomeWeb Front-endHTML TutorialHorizontal Menu Bar in HTML

Horizontal Menu Bar in HTML

Sep 04, 2024 pm 04:45 PM
htmlhtml5HTML TutorialHTML PropertiesHTML tags

In Html, we have a different set of features for using highlighted and more attractive for the user end. We have already discussed in the previous article regarding scroll bars, like the same thing in menu bars also have some more facilities given to user end. Generally, a menu bar helps to categorize the contents and increases the web page readability. To get more interactive in the user end menu bar helps you for the simplest way. Scroll bars have both horizontal and vertical types like the same in menu bars also both the things which have to be used for developers end. We will see some more details in the below concepts.

Syntax:

While using horizontal/vertical menu bars we have to use CSS to reflect the styles in all parts of the HTML pages. Generally, a navigation bars need some standard HTML as a base for implementing the child or sub-derived documents. Navigation bars or Horizontal bars have basically a list of links, so using the

  • and
      elements are the syntax for the below basics.
    <style>
    ul{
    }
    li variablename:hover{
    }
    </style>
    
    

    The above code is the basic syntax for the horizontal menu bar.

    Examples of Horizontal Menu Bar in HTML

    We have seen a few examples for understanding the concepts more.

    Example #1

    Code:

    
    <style>
    ul {
    margin: 5;
    padding: 5;
    background-color: green;
    }
    li {
    float: left;
    }
    li v {
    color: white;
    text-align: center;
    padding: 5;
    }
    li v:hover {
    background-color: #111;
    }
    .active {
    background-color: green;
    }
    </style>
    
    
    

    Sample Output:

    Horizontal Menu Bar in HTML

    In the above example, we will show the menu items in horizontal view when we create the web page generally we will see only menu items are in the horizontal panel because the user-customized view here is row-wise so we will use horizontal wise. The same CSS style class is available for all the HTML documents.

    Example #2

    Code:

    
    <p style="font-family:Comic Sans MS">
    <a href="#home">Home</a>
    <a href="#about">About</a>
    <a href="#contact">Contact</a>
    </p>
    
    

    Sample Output:

    Horizontal Menu Bar in HTML

    The second example same as the first example but here we won’t use any CSS styles in the HTML documents.

    tag we will use some CSS styles like font families, width, height, etc

    Example #3

    Code:

    
    <style>
    ul {
    margin: 5;
    padding: 5;
    background-color: #333;
    }
    li {
    float: left;
    }
    li v {
    color: white;
    text-align: center;
    padding: 5;
    }
    li v:hover:not(.active) {
    background-color: #111;
    }
    .active {
    background-color: #4CAF50;
    }
    </style>
    
    
    

    Sample Output:

    Horizontal Menu Bar in HTML

    Some Free Horizontal Menu Types:

    Every feature was some collections for the different scenarios. Something in Horizontal menus was some pure CSS and also additionally they will use javascript for making sure they are responsive and work on Mobile.

    Some Horizontal navigations are working perfectly and some of the features are not supported in the scripts and also browser compatibility issues. In Website design horizontal bar is great for a minimalistic look and also works well to give the user a simple navigation interface space.

    Responsive Horizontal Navigation Menu in Orange:

    It is one of the types in the horizontal menu, it’s a light-weight, minimalistic menu with fully pure CSS styles. The menu also responsive and transforming into a vertical menu type on the mobile device supports for viewing the small screens to use mobiles. In desktop, they won’t change anything it will work just on the web browser screens as well it same on the mobile phones.

    Example:

    
    <link rel="stylesheet" href="styles.css">
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script src="script.js"></script>
    
    
    <div id="cssmenu">
    <ul>
    <li><a href="#home">Home</a></li>
    <li><a href="#about" class="active">About</a></li>
    <li><a href="#contact">Contact</a></li>
    </ul>
    </div>
    
    

    Output:

    Horizontal Menu Bar in HTML

    Green Tabbed Horizontal Menu Types:

    This Menu is one of the design patterns for the horizontal panel in a tabbed interface. It will use vast and expensive applications like Purchase/Sales Products goods applications it will helpful for the end-user to click the different menu items very fast and easily to get the results from the db to a user. In the above type we will use some scripts like jquery but here we will use only HTML and CSS so it will loads the data quickly to the user screens. Let us take the same example in the previous topic

    Example:

    
    <link rel="stylesheet" href="styles.css">
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script src="script.js"></script>
    
    
    <div id="cssmenu">
    <ul>
    <li><a href="#home">Home</a></li>
    <li><a href="#about" class="active">About</a></li>
    <li><a href="#contact">Contact</a></li>
    </ul>
    </div>
    
    

    Output:

    Horizontal Menu Bar in HTML

    The same example we have taken but some CSS styles we have modified and updated the HTML file. Whenever we place the mouse cursor in the tab it automatically highlighted the text for the mentioned green color so it will change when the mouse cursor moves through another tab based on the user choice.

    Bubble Wrap in Horizontal Bar:

    In this menu bar same as the previous types we will use fully CSS styles on the HTML. Additionally, we will add the border-radius property should enable then it will look like bubble types. We will see the same example with different CSS styles and the output shown like the below code with results.

    Example:

    
    <link rel="stylesheet" href="styles.css">
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script src="script.js"></script>
    
    
    <div id="cssmenu">
    <ul>
    <li><a href="#home">Home</a></li>
    <li><a href="#about" class="active">About</a></li>
    <li><a href="#contact">Contact</a></li>
    </ul>
    </div>
    
    

    Output:

    Horizontal Menu Bar in HTML

    We have taken sample examples as we discussed in the previous horizontal types but additionally, we add the border-radius in the style sheet.

    Conclusion

    Finally, we have concluded the session, like we have discussed in previous topics each and every HTML concepts have some more additional features that will depend on the versions. And also browser compatibility issue when comes to one version into another version. In the above horizontal menu bar not only the above concepts it will have further concepts also the same horizontal menu with textured tabs, and we have also used jquery plugins for further user attractive features if we need. If we won’t use the chrome browser in the web page output so we can add the tabbed and additionally blue screen type in CSS styles. When compare to HTML we have some additional features in jquery plugins.

  • The above is the detailed content of Horizontal Menu Bar in HTML. For more information, please follow other related articles on the PHP Chinese website!

    Statement
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    What is the purpose of HTML tags?What is the purpose of HTML tags?Apr 28, 2025 am 12:02 AM

    HTMLtagsareessentialforstructuringwebpages,enhancingaccessibility,SEO,andperformance.1)Theyareenclosedinanglebracketsandusedinpairstocreateahierarchicalstructure.2)SemantictagslikeandimproveuserexperienceandSEO.3)Creativetagslikeenabledynamicgraphics

    What are self-closing tags? Give an example.What are self-closing tags? Give an example.Apr 27, 2025 am 12:04 AM

    Self-closingtagsinHTMLandXMLaretagsthatclosethemselveswithoutneedingaseparateclosingtag,simplifyingmarkupstructureandenhancingcodingefficiency.1)TheyareessentialinXMLforelementswithoutcontent,ensuringwell-formeddocuments.2)InHTML5,usageisflexiblebutr

    Beyond HTML: Essential Technologies for Web DevelopmentBeyond HTML: Essential Technologies for Web DevelopmentApr 26, 2025 am 12:04 AM

    To build a website with powerful functions and good user experience, HTML alone is not enough. The following technology is also required: JavaScript gives web page dynamic and interactiveness, and real-time changes are achieved by operating DOM. CSS is responsible for the style and layout of the web page to improve aesthetics and user experience. Modern frameworks and libraries such as React, Vue.js and Angular improve development efficiency and code organization structure.

    What are boolean attributes in HTML? Give some examples.What are boolean attributes in HTML? Give some examples.Apr 25, 2025 am 12:01 AM

    Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values ​​need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

    How can you validate your HTML code?How can you validate your HTML code?Apr 24, 2025 am 12:04 AM

    HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

    HTML vs. CSS and JavaScript: Comparing Web TechnologiesHTML vs. CSS and JavaScript: Comparing Web TechnologiesApr 23, 2025 am 12:05 AM

    HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

    HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

    The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

    The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

    The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

    See all articles

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    Video Face Swap

    Video Face Swap

    Swap faces in any video effortlessly with our completely free AI face swap tool!

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    DVWA

    DVWA

    Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

    Dreamweaver Mac version

    Dreamweaver Mac version

    Visual web development tools

    SecLists

    SecLists

    SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)