Why do my navigation bar items in Bootstrap get highlighted in blue and underlined?

<!Doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>IBAE-Information Library</title>
        <link rel="stylesheet" href="/Users/jeevabharathi/Desktop/Project.css">
        <script src="https://unpkg.com/scrollreveal/dist/scrollreveal.min.js"></script>
    </head>
    <body>
        <nav>
            <h1 style="font-family:Helvetica;">
                <ul class="cf">
                    <li><a href="#">Menu 1</a>
                        <ul>
                            <li><a href="#">Sub-menu Item 1</a></li>
                            <li><a href="#">Sub-menu Item 2</a></li>
                            <li><a href="#">Sub-menu Item 3</a></li>
                        </ul>
                    </li>
                    <li><a class="dropdown" href="#">Menu 2</a>
                        <ul>
                            <li><a href="#">Sub-menu Item 1</a></li>
                            <li><a href="#">Sub-menu Item 2</a></li>
                            <li><a href="#">Sub-menu Item 3</a></li>
                        </ul>
                    </li>
                        <li><font size="+4", color="white">TITLE</font> <br></li>
                    <li><a href="#">Menu 3</a>
                        <ul>
                            <li><a href="#">Sub-menu Item 1</a></li>
                            <li><a href="#">Sub-menu Item 2</a></li>
                            <li><a href="#">Sub-menu Item 3</a></li>
                        </ul>
                    </li>
                    <li><a href="#">Menu 4</a>
                        <ul>
                            <li><a href="#">Sub-menu Item 1</a></li>
                            <li><a href="#">Sub-menu Item 2</a></li>
                            <li><a href="#">Sub-menu Item 3</a></li>
                        </ul>
                    </li>
                </ul>
            </h1>
        </nav>

        <script   src="https://code.jquery.com/jquery-3.3.1.js"   integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="   crossorigin=&#"anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
    </body>>

</html>

This code snippet showcases a simple HTML structure including the use of Bootstrap for a project aiming to implement fade in and smooth scrolling effects. The navigation bar styling is defined with CSS to achieve a clean and organized layout without any distracting highlights.

For further customization or modification, refer to the included CSS styles that enhance the visual presentation and functionality of the navigation menu.

Answer ā„–1

Bootstrap includes its own styles in their CSS file.

To remove these styles, adjust your own CSS code and consider using the !important declaration when needed.

For example, modify your nav a to override Bootstrap's text-decoration:

nav a {
  text-decoration: none !important;
}

Additionally, update your nav li:hover a to restore the color to white:

nav li:hover a {
  color: white;
}

Take a look at this JSFiddle demonstration showcasing the changes mentioned above.

Answer ā„–2

The default styles for a link include being blue and underlined. For example, if you input the following code:

<a href='www.google.com'>Google</a>

It will automatically display as blue and underlined.

It's important to note that this styling is not specifically from Bootstrap. One issue may be that you have not imported the Bootstrap CSS into your project. Make sure to add this line before importing your own custom CSS:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The item on my list is barely visible, as the height of the list column is adjusted upon loading the page

In my footer, I have a list of links. When I click on the last item labeled "See more links," jQuery's slideToggle() function replaces the list with new members. However, this action causes the bottom of my footer to shift slightly up and then back d ...

What is the best way to adjust padding within a flexbox layout?

I am attempting to replicate the design of this webpage using HTML and CSS: https://i.sstatic.net/bFVmg.jpg But, I am struggling to adjust the padding for the box on the right side. Here is how my version looks currently: https://i.sstatic.net/WMwii.jpg ...

Following the completion of the inspection, the next step

Check out my work at this link: Unfortunately, my code is too lengthy to include here, so please refer to the link above to see the issue I am facing. The problem I am encountering is that when I click the checkbox after adding an item to the list, the r ...

What is the best way to incorporate a <li> view cap within a div element using JavaScript?

Currently, I am attempting to implement a dynamic <li> view limit within the content of a div. My goal is to display only 3 <li> elements each time the div content is scrolled. Although not confirmed, I believe this example may be helpful: ...

Ensure that the element is positioned above other elements, yet below the clickable area

Currently, I am working on developing a notification system that will display a small box in the top right corner of the screen. However, I am facing an issue where the area underneath the notification is not clickable. Is there a way to make this part o ...

Selenium extracts valuable content, specifically the text within the <h2> tag of a webpage,

I am currently working on a project that involves entering a postcode (which will eventually be a list) into a website and saving the obtained results to a CSV file using a loop to move on to the next. However, I am encountering difficulties when it comes ...

Seeking animated SVGs using CSS styling

I've been trying to animate my SVG icon, but I seem to be missing something. I'm still fairly new to CSS animations. The issue I'm facing is that the position of the SVG isn't correct when the website loads. Additionally, during the an ...

Twig: A guide to showcasing HTML content within block titles

Within my Symfony2 project, I am utilizing various twig templates. One of these templates contains a block labeled title. {% block title %}{{ announcement.title }}{% endblock %} The issue arises when the variable {{ announcement.title }} contains HTML ta ...

Creating a personalized gradient using Tailwind CSS and Daisy UI framework

Iā€™m attempting to incorporate a unique gradient into my next.js application with the help of Tailwind CSS and Daisy UI. Below is the specific code snippet I plan on using: background: linear-gradient(180deg, rgba(192, 192, 192, 0.04) 0%, rgba(201, 180, ...

Applying jQuery .animate() to elements without specifying position: absolute

My goal is to create a website where clicking on an image triggers a dropdown menu. The jQuery method I'm using is as follows: function main() { $('#arrow').click(function() { $('.hidden').animate({ top: &a ...

GWT encrypted CSS class names not being correctly applied

I recently encountered a strange issue with GWT styles. While using UiBinder and programmatically styling my GWT widgets, I ran into the following scenario: <ui:UiBinder xmlns:ui="..." xmlns:g="..."> <ui:style src="bindings.css"/> ...

Using CSS to Create a Gradient Background with an Image

Is it possible to add a URL background image to a gradient and position it in a specific way? Since the gradient is considered an image on its own. CSS background: linear-gradient(to bottom, #98cb01 2%,#60a822 100%)!important; ...

What could be causing the absence of the margin in my code?

I am currently working on a website layout where I want to display an image with some information below it, and the information should have a colored background with some margin around it. However, when I try to view the code I have written, the margin i ...

Is there a way I can insert a line break right before a lengthy hyperlink?

I'm currently exploring ways to ensure that a line-break occurs before a link in order to prevent it from being wrapped on a new line. To clarify, let's consider a scenario where I have a few words followed by a long link displayed on a narrow d ...

Bootstrap modal within a nested clickable div

Utilizing the bootstrap MODAL plugin with nested divs, I have a requirement where clicking on the inside div should display the EDIT form, and clicking on the container div should show the ADD NEW form. Here is the code snippet: <div id="container" sty ...

Finding an element's id within a click event inside an iframe

<iframe id="myiframe" src="doc.html"> <button id="btn1"></button><!-- how do I retrieve this id? --> </iframe> $('#myiframe').on('click', function () { alert(this.id); }); I am trying to make it ...

When you select the checkbox button, a textfield and submit button will appear. Once you click the submit button, the checkbox button will be disabled

<td> <input type="checkbox" ng-model="alert.acknowledged" ng-disabled="alert.acknowledged" ng-click="onacknowledgedClick(alert)"></td> <td> <span ng-if="!alert.acknowledgeInProgress">{{alert.acknowledgedComments}}</span&g ...

Steps to display a text box once the dropdown list is updated

I have a dropdown menu with two options <div class="form-group"> <span class="col-sm-4 control-span">Member Type</span> <div class="col-sm-8"> <select class="form-control" id="membertype" name="me ...

Guide to customizing action button color on MatSnackbar?

Currently, I am encountering an issue with the snackbar in my Angular 9 project. Despite adding CSS styles to both the component.scss file and the global style.scss file, the action button on the snackbar displays the same background and text color. In an ...

Is there a way to incorporate text fields and input in BootstrapDialog?

Is it possible to include text fields and inputs within this modal using BootstrapDialog without modifying the library? Additionally, can I use $.ajax() inside? <button class="btn btn-primary" id="add_item">New item</button> jquery $('# ...