Eliminate the border surrounding the navbar on the left and right sides in the mobile menu in

Working on my navbar for mobile view, I noticed some unwanted border lines above and below the form input field as shown in the image https://i.sstatic.net/HiOfz.png.

Question: How can I remove or disable those border lines above and below the form input in mobile view?

Here is an example on Codepen

body {
    background: url('../images/bg.png');
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
}

hr {
    border-top: 10px solid #444444;
    position: fixed;
}

.navbar-left {
    border-bottom: 0;
    border-top: 0;
}

.navbar-form {
    border-bottom: 0;
    border-top: 0;
}

.page-wrapper {
    margin-top: 40px;
}

@media (min-width: 768px) {
    .custom-nav .navbar-nav > li > a {
        padding-top: 15px;
        padding-bottom: 15px;
        min-width: 150px;
     }

}

.custom-nav { 
    margin-bottom: 0;
    background: #333333;
    border: none;
    border-radius: 0;
}

...

Below is the HTML code:

<div class="container">

    <nav class="navbar navbar-inverse custom-nav">
    <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        </button>
    </div>

    ...

Answer №1

Simply add the line box-shadow: none; to the

<form class="navbar-form navbar-right">
element and watch as your problem disappears.

Here is the code snippet:

form.navbar-form.navbar-right {
    box-shadow: none;
}

Check out the code in action on Codepen:here.

Answer №2

Give this code a shot


@media (max-width: 768px){
    .navbar-form{
        -webkit-box-shadow:none;
        box-shadow:none;
    }
}

Answer №3

Appreciation for all the solutions provided by everyone

ISSUE RESOLVED

Simply applying 'box shadow none' on its own resulted in visible lines, albeit darker

Therefore, I found that I needed to include border-top: 0 and border-bottom: 0 for it to work effectively

.navbar-form {
    box-shadow: none;
    border-top: 0;
    border-bottom: 0;
}

https://i.sstatic.net/BIiyj.png

Issue successfully resolved.

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

Utilize a Javascript function to retrieve a string and set it as the ID

I'm trying to modify a div ID by appending either a 'W' or 'H' depending on whether the screen width is greater than the height. I figured I could achieve this using JavaScript since PHP lacks the ability to detect screen sizes. A ...

Challenge with VueJS structure

I've been working on making nestable DOM elements draggable with VueJS and I've made some progress. However, after dragging and dropping, it seems like some elements are disappearing. Could someone please review my code and point out what might ...

Clicking elements reveal but page height remains unchanged?

Clicking on a label within #row-product_id_page-0-0 triggers the display of #row- elements as shown in the code snippet below: $('#row-product_id_page-0-0 label').click(function() { var str = $(this).find('.am-product-title').text ...

Steps for creating a resizable and automatically hiding side menu

I am working on a side menu that can be resized, and I want it to collapse (set to zero width) when it is empty. I have considered implementing one of these features individually, but I'm not sure how to make both work together. Is there a way to ad ...

Ensure that the inner div has a height of 100%

Can someone help me troubleshoot my HTML code? <div id="container"> <div id="left-container"> </div> <div id="right-container"> </div> </div> Although the container is set to 100% height, the #left_con ...

Optimizing Image Fit and Positioning for Different Web Browsers

I have designed a webpage using HTML, JavaScript, and CSS that features a photo carousel allowing users to navigate through images by clicking left and right arrows. The carousel's container is set at 500px tall and takes up 100% width of its parent d ...

Is there a way to temporarily toggle classes with jQuery?

Incorporating ZeroClipboard, I have implemented the following code to alter the text and class of my 'copy to clipboard button' by modifying the innerHTML. Upon clicking, this triggers a smooth class transition animation. client.on( "complete", ...

Adjusting the window size to see the responsive sidebar menu in Bootstrap 4

I am attempting to transform the left sidebar into a small icon (=more settings) when the window is resized for smaller devices. Problem: My code displays an overlap of two columns when the window is resized to medium size. How can I resolve this overlap ...

Tips for configuring Bootstrap v4.0.0-beta to efficiently compile SCSS files automatically while watching for changes

I am currently working on configuring Bootstrap v4 Beta, but I am a bit confused about setting up the Watch task. In Bootstrap version 3, they used Grunt Watch. Should I set up a custom watch task or does Bootstrap already have that functionality built i ...

Interactive Sideways Navigation Bar

showcases a sleek horizontal scrolling menu on mobile devices. I aim to replicate this functionality for a website I'm redesigning that features extensive navigation elements. Key Features: Left and right scroll button options Centered list item op ...

Optimal method for creating a seamless loop of animated elements passing through the viewport

My challenge involves managing a dynamic set of elements arranged next to each other in a row. I envision them moving in an infinite loop across the screen, transitioning seamlessly from one side to the other, as illustrated here: https://i.stack.imgur.com ...

Ensure you watch the video until the end before moving to the next carousel in Bootstrap

I need my carousel to pause at the end of each video before transitioning to the next slide. The code I have loops through the media files in my database to create the carousel. <div id="mediaCarousel" class="carousel slide" data-ride="carousel ...

CSS Attribute Selector Wildcard Capture Tool

Suppose I have the following HTML structure: <div class="tocolor-red"> tocolor </div> <div class="tocolor-blue"> tocolor </div> <div class="tocolor-green"> tocolor </div> <div class="tocolor-yellow"> tocolor ...

The col-xl-6 in bootstrap is malfunctioning as it is not displaying the remaining portion of the content

When I use the code col-xl-6, the remaining portion stays blank and the next content displays on the next line. What could be causing this issue? <div class="raw"> <div class="col-12 col-lg-6"> <p>Lorem Ipsum is s ...

Identifying added elements that respond to link hover effects

I've been working on a project where I'm trying to replace the default browser cursor with an SVG one using jQuery. Everything seems to be working smoothly, except for changing the cursor when it hovers over links - nothing I've tried so far ...

What is the best way to eliminate the extra spacing on the right side of my navigation bar?

Hello everyone! I am diving into the world of HTML and CSS, but I've hit a roadblock. Despite searching through various resources and forums, I can't seem to find a solution to my problem. The issue at hand involves an irritating space in my nav ...

Seamless border that flows through several elements

I'm currently working on integrating line numbers into a code snippet. I've managed to get it functioning, but there's an issue with the border between the line number and the code. Instead of being continuous, there are small, unsightly gap ...

Placing error notifications beneath my table rows for a more polished appearance

In the process of creating a review page for my app that showcases uploaded files, I've encountered an issue. Whenever a user uploads files with errors, I want to display a warning message below each specific file. Currently, I'm able to show the ...

Tips for transforming a scroll element into the viewport using Angular 2+

This is a sample Here is a component with a list of items: class HomeComponent { text = 'foo'; testObject = {fieldFirst:'foo'}; itemList = [ '1', '2', '3', & ...

How come I am unable to connect my CSS to my EJS files?

Having difficulty linking my css files to my ejs files. Using a standard node.js/express setup, I'm attempting to connect my main.css file from the public/css directory to my index.ejs file in views. The html and routing are functioning correctly. Ple ...