What is the method to achieve a full-width image when utilizing vertical scrollspy within Bootstrap?

Seeking a unique responsive webpage design utilizing Bootstrap. I envision a vertical scrollspy on the left paired with parallax scrolling on the right, akin to this example.

Here's my current code snippet:

<!DOCTYPE html>

<html>
<head>
    <title>Rwitaban Goswami</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
    <style>
        body{
            position: relative;
        }
        ul.nav-pills{
            top:20px;
            position:fixed;
        }
        .parallax{
            min-height:300px;
            background-attachment: fixed;
            background-size: cover;
            background-position: 50% 50%;
        }
        .parallaxsec{
            background-image: url("DP.jpg");
        }
        .jumbotron{
            margin-bottom: 0;
        }
        .parallax h1 {
            color: rgba(255, 255, 255, 0.8);
            font-size: 60px;
            text-align: center;
            padding-top: 60px;
            line-height: 100px;
          }
      p{
        font-size: 20px;
      }

    </style>
</head>

<body data-spy="scroll" data-target="#navbar" data-offset="20">

<div class="container">
    <div class="row no-gutters">
        <nav id="scrollspy" class="col-sm-3">
          <ul class="nav nav-pills nav-stacked">
            <li class="active"><a href="#item-1">Item 1</a></li>
            <li> <a href="#item-2">Item 2</a></li>
            </ul>
        </nav>
        <div class="col-sm-9">
            <div class="jumbotron parallax parallaxsec">
                <h1 class="display-3">Rwitaban Goswami</h1>
            </div>
            <div>
                <p>Text</p>
            </div>
        </div>
    </div>
</div>

</body>
</html>

However, I'm facing issues with excessive white space in the layout and narrow image width. How can I achieve a more preferable design with the scrollspy snugly placed without extra space and ample width for the image and text?

Answer №1

Try removing the "container" attribute from the first DIV, as it seems to be adding too much padding for your liking.

So after making that change, the code will appear like this:

        <div>
          <div class="row no-gutters">
    <nav id="scrollspy" class="col-sm-3">
      <ul class="nav nav-pills nav-stacked">
        <li class="active"><a href="#item-1">Item 1</a></li>
        <li> <a href="#item-2">Item 2</a></li>
        </ul>
    </nav>
    <div class="col-sm-9">
        <div class="jumbotron parallax parallaxsec">
            <h1 class="display-3">Rwitaban Goswami</h1>
        </div>
        <div>
            <p>Text</p>
        </div>
    </div>
</div>

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

Executing a SQL statement effortlessly with the press of an HTML button using PHP

Currently, I am working on a basic PHP website that retrieves a list of salespeople from a MySQL server based on a selection made from a drop-down box. I have successfully added a button next to each result with the intention of running a PHP script using ...

Angular CORS problem when sending information to Google Forms

When submitting the data: Error Message: Unfortunately, an error occurred while trying to send the data. The XMLHttpRequest cannot load https://docs.google.com/forms/d/xxxxxxxxxxxxx/formResponse. The response to the preflight request did not pass the ac ...

Automatically change div background image based on window resizing

.step-1-4 { background:url('../images/gadget-4-sprite.png') no-repeat; width:950px; height:70px; margin-left: 15px; } The code above sets the CSS for a div containing a background image. The dimensions of the div match that of the imag ...

Changing the name of a CSS file on the live server

I was recently browsing a website and noticed that they had given their CSS file a really long name. The website in question is It seems like they are using Twitter Bootstrap as their web UI framework, so I'm curious as to why they would choose such ...

When using AngularJS and PHP together, I encountered an error that stated "

My POST http request is encountering an error with the message Undefined property: stdClass::$number and Undefined property: stdClass::$message. Below are the codes I've been using: smsController.js angular .module('smsApp') .contr ...

Struggling to generate distinct charts with chart.js

I need assistance in displaying individual charts for different sensors on a web page. Currently, when multiple SensorData is selected by the user, it generates a single "multi chart" which is not the desired outcome. Below is the code snippet responsible ...

changing the default property value within an object

I'm looking to send an ajax request to a PHP file that will retrieve a user's information in JSON format. I then want to take this data and assign it to a property within an object. For example: User = { prop1: '' } I simply need to ...

Find a specific number within an array using Javascript, and if it is not found, return the closest

In Javascript, I want to find a number in an array. If the number does not exist in the array, I need to return a number that is lower than the target number. ...

Format specific words or characters in a text input

In HTML, when I want to display strings in a Text Input or TextArea, I am looking for a way to have specific substrings render with a box around them. I envision these boxed substrings as being treated as a single entity, similar to how highlighting or tex ...

How to integrate a chips feature in Angular 4 using Typescript

Struggling to incorporate a chips component into my Angular web application, which comprises Typescript, HTML, and CSS files. After grappling with this for weeks without success, I have yet to find the right solution. To review my current code, you can a ...

What is the best way to create a clickable <li> element from AJAX search results that display dynamic HTML?

Utilizing AJAX technology, I have implemented a live search feature that populates results from a database as the user types in a text field. The results are presented in an unordered list format. My goal is to allow users to click on an item within the li ...

generate a flexible div that adjusts its height based on the size of the browser window

Is it possible to create a div layout structured like this: <div_wrapper> <div_header> </div_header> <div_content> </div_content> </div_wrapper> Upon page load, the div_header o ...

unable to update database using jquery ajax

Hello everyone, this is my first time posting on Stackoverflow! I am facing an issue while trying to run an "Insert" query using Jquery's $.ajax function. Upon checking the network tab on Chrome Dev Tools, it seems like my file is being loaded but th ...

Develop a persistent overlay with HTML and CSS

I've been working on a project (HTML and CSS page) that features a navbar at the top of the page, a main container below the navbar, and a menu on the left side. The menu is initially hidden, but when I move my mouse to the left edge of the window, i ...

Tips for designing a versatile component to handle numerous buttons triggering form pop-ups

library used: mui 5.4.1 To implement a TableCell with an IconButton that triggers the opening of a Form, follow this code snippet. const items = [ { id: "001", name: "A", price: 2000 }, { id: "002", name: &q ...

Does the ES6 specification include .finally()?

Many Promise libraries such as Q or Bluebird have a method called .finally that is executed on both success and error. Does the ES6 promise also include this method? I haven't been able to find it. It doesn't seem to be present in Babel (6to5). ...

What is the best way to modify the text color in an MUI Text Field?

I'm completely new to using MUI and React, and I've run into an issue with changing the text color in my input field. Even though I specified inputProps={{sx: { color: "CCCCCC" }}}, the text color remains black while the label and searc ...

What steps can I take to ensure that the elements are in the same row instead of being displayed in three separate rows?

(I'm a beginner in web development and need some help) Is there a way to align elements into the same row instead of stacking them up in separate rows? I'm working on creating a header bar similar to the one on the Naive UI Documentation Website. ...

What could be causing html-webpack-inline-source-plugin to prevent the page from refreshing after editing CSS files?

Currently, I am utilizing a plugin that embeds all CSS within the final HTML file. This method prevents the application from refreshing in development mode. Whenever I make edits to the CSS, the build process completes normally, but the styles do not updat ...

Having trouble transmitting POST values through AJAX requests

I am facing an issue with two separate files, bargraph.html and data.php. Here is the content of bargraph.html: <form method="POST" name="dataform" action=""> <select name="data1" id="data1-value"> <option value="DateRecorded">Dat ...