What is the best way to hide a background bottom line using bootstrap-4?

After creating my header and using an SVG to divide the section, I noticed a line appearing below the SVG. To try and cover it up, I added an empty white background line using :: after in CSS with the content empty, but the issue persisted. You can see the line at the end that corresponds to the background here

.header {
    background-image: url(../img/bg-header.jpg);
    background-position: center;
    background-size: cover;
    position: relative;
}

#logo-header {
    --tam: 40px;
    width: var(--tam);
}

a{
    color: #fff;
}

.header::after {
content: "";
display: block;
width: 100%;
height: 10px;
background-color: #fff;
position: absolute;
left: 0;
bottom: 0;
}
<!DOCTYPE html>
<html lang="es">
<head>

    <meta charset="UTF-8>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="juan diego gutierrez">;
    <meta name="description" content="">;
    <meta name="keywords" content="">;

    <title>Trip trip</title>;

    <!-- CSS Bootstrap -->;
    <link rel="stylesheet" href="./css/bootstrap.min.css" />;

    <!-- CDN Font awesome -->;
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"/>;

    <!-- CSS Main -->
    <link rel="stylesheet" href="./css/main.css" />;

</head>;
<body>;
    <!-- header -->;
    <header class="header">;
        <div class="container pt-2">;

            <!-- navbar -->;
            <nav class="navbar navbar-expand-lg">;
                <a class="navbar-brand" href="#"> <img id=\"logo-header\" class="mr-1" src="img/logo-white.svg" alt="logo">WESTON</a>;
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">;
                    <span class="navbar-toggler-icon"></span>;
                </button>;

                <div class="collapse navbar-collapse justify-content-end" id="navbarSupportedContent">;
                    <ul class="navbar-nav">;
                        <li class="nav-item active">;
                            <a class="nav-link" href="#">HOME</a>;
                        </li>;
                        <li class="nav-item">;
                            <a class="nav-link" href="#">EXPERIENCE</a>;
                        </li>;
                        <li class="nav-item">;
                            <a class="nav-link" href="#">FEATURES</a>;
                        </li>;
                        <li class="nav-item">;
                            <a class="nav-link" href="#">CONTACT</a>;
                        </li>;
                    </ul>;  
                </div>;
            </nav>;

            <!-- description -->;
            <div class="col-6 mt-5 pt-5">;
                <h6 class="text-warning">The Great Outdoor</h6>;
                <h1 class="text-white">Adventure</h1>;
                <p class="text-white">Lorem ipsum dolor sit, amet, consectetur adipisicing elit. A vitae, impedit, nesciunt velit iusto modi.</p>;
                <a href="#" class="btn btn-warning text-white mt-2">Buy now</a>;
            </div>;
        </div>;

        <!-- cut-image -->;
        <img src="img/cuts/cut-header.svg" alt="division section">;
        
    </header>;









    <!-- Jquery -->;
    <script src="./js/jquery-3.5.0.min.js"></script>;
    <!-- Popper -->;
    <script src="./js/popper.min.js"></script>;
    <!-- JS Bootstrap -->;
    <script src="./js/bootstrap.min.js"></script>;
</body>;
</html>
;
;
;

;

Answer №1

To resolve the issue, I found that adding display:block; to the SVG style was effective. This can be done within the tag itself like this:

<svg style="display:block;" ...>

Alternatively, you can add it to your CSS file:

svg { display:block; }

If you need further information, check out this resource: Svg line strange effect on bottom-border

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

I am struggling to make my button hover effects to function properly despite trying out numerous suggestions to fix it

As a newcomer, this is my first real assignment. I've managed to tackle other challenges successfully, but this one seems a bit more complex and I'm struggling to pinpoint where I'm going wrong. Despite googling various solutions, none of th ...

Using jQuery to store the name of a Div in a variable and subsequently invoking it in a function

Recently, I've been grappling with a task involving storing a div name in a variable for easier editing and incorporating it into standard actions like show/hide. My code functions perfectly without the variables, but introducing them causes the div ...

Deleting a row from a table when a similar element is found in another location

My webpage features a table list that showcases users linked to an organization: <script type="text/html" id="userListTemplate"> <div id="user_list_box"> <table class="list" style="margin-bottom: 15px;"> {{#Users} ...

Creating a centered and beautifully styled picture with a specific maximum size using React

I recently completed the development of a new website, which can be viewed at Upon inspection of the website, it is evident that the photo is not centered and appears too large on mobile phones. Despite my efforts to align it using various methods outline ...

Material UI Grid's layout does not support placing a select element within a row

As a newcomer in the world of full stack development, I am delving into coding projects to enhance my understanding of frontend technologies like React JS and Material UI. My latest endeavor involves creating a page that displays posts from the backend in ...

Is there a way to prevent Bootstrap 4's grid system from splitting column content when resizing the browser window?

Just delving into Bootstrap's grid system for the first time here, so bear with me if this sounds silly. My goal is to create a 3 column page that is responsive, featuring an image and a Spotify player in each column. Everything looks good on a full ...

Suddenly found an empty response from Ajax call

I am currently experimenting with testing my Ajax code using Node.js. This is new territory for me as I am a beginner in this field. Below is the code I have been working on: <script> var xmlHttp = false; /*@cc_on @*/ /*@if (@_jscript_vers ...

What is a better method for aligning an image in the middle of a floated container?

Is there a better way to center an image within a floated div without using an extra p tag? I currently have the image inside a p tag and center the p, but it annoys me having that extra tag. Any suggestions on how to center the image itself? Thanks! Below ...

Retrieving text from a draggable div using jQuery

I have a draggable div that I can move over another element with the class .outerDiv which contains text content. Is there a way for me to retrieve the text from .outerDiv that overlaps with the draggable div? $(".outerDiv .isStore").draggable({ contain ...

Show the cost on the HTML page according to the chosen currency option

I am currently dealing with two primary currencies in my business. The product page is created using HTML. There are 4 products on a single page, and I wish to display two prices for each product based on the selected currency (USD or EUR) without having t ...

Extracting table data using regular expressions in Import.io is a powerful method to retrieve specific values

Need some assistance. I am currently utilizing import.io and aiming to extract table data using regex. My goal is to retrieve values from specific columns, below is the code snippet: <table> <tr> <td class='label&apos ...

Retrieve a specific item from a Database ListView in Django

I'm currently working on a project where I have a class that includes a django ListView. The issue I am facing is that when accessing my database items through this ListView, it loads all the entries. What if I only need to access one specific entry, ...

Creating a customizable theme for a website built with Bootstrap, incorporating changes to brand colors and more, by utilizing a .less file

I have built my asp site using bootstrap as the client-side CSS framework. I am currently working on implementing a feature that allows users to customize their site's brand color and other aspects, with these changes being saved permanently. While I ...

"Unveiling the invisible: Revealing hidden characters in PHP

Currently I am dealing with some code extracted from a MySQL column. Within this code are hidden characters like "\t" and "\n". I am attempting to showcase the raw code in a DIV while also making sure these hidden characters are visible. The cod ...

Exploring and deciphering the intricacies of the underlying technology

Apologies if this question seems misplaced, but as a complete beginner, I'm a bit lost. Let's consider this website as an example: I'm trying to uncover the libraries and technologies employed in the background to learn more and replicate ...

What is the best way to fetch values from individual buttons using PHP?

<form action="posts-ayarlar.php" method="POST" id="demo-form2" data-parsley-validate class="form-horizontal form-label-left"> <table class="table table-striped table-bordered" ...

Dynamic element peeks out from behind parent container

When attempting to create an infinite animation for the rocket similar to the one shown here, I encountered an issue where the rocket does not hide beneath the parent div as demonstrated in the example. Instead, the rocket changes position on the Y-axis an ...

Emulate Bootstrap's Focus Style CSS

Is there a way to use JQuery to apply Bootstrap's blue highlight to text fields in a form that are not currently in focus, even if there are multiple inputs? ...

Using Font Awesome, can you please provide the icon and its corresponding code for resetting a password?

I need to create a button with an icon on it for resetting a password. For editing, I am currently using the following HTML code with Bootstrap 4: <button class="btn btn-primary btn-xs" type="button" id="edit" title=" ...

Issues with table nesting functionality

I'm attempting to organize tables in a nested manner, instead of placing a table within each cell. My engineers have advised against simply styling the table to appear nested, and suggested that it would be more effective to wrap each header around th ...