I require the box element within my section element to have a full-width layout

Looking at the code in the image, you can see that I am using MUI components. Within a section, there is a box containing navigation filter links. The red part represents the section, while the white inside is the navigation link bar. My goal is for this box to occupy the full width of the section, but I seem to be missing something.

Adding padding or margin has not proven effective. https://i.stack.imgur.com/l6ZcP.png

This is my CSS:

.section-filters {
  width: 100%;
  position: relative;
}
.sticky-filters {
  width: 100%;
  position: -webkit-sticky;
  position: sticky;
  top: 60px;
  z-index: 5;
}

This is my React code:

<Section className="section-filters">
        <Box className="sticky-filters" mb="10">
          <Filters />
        </Box>

        <ProjectList projects={filtered} />
      </Section>


I also attempted changing my code to:

<Section className="section-filters">
        <Box  sx{{
            width:1000,
            heigh:100

           }}
     className="sticky-filters" mb="10">
          <Filters />
        </Box>

        <ProjectList projects={filtered} />
      </Section>

With this approach, I achieved more width but only on the right side. As I am not very familiar with MUI components, I am still trying to grasp their functionality.

Answer №1

One way to utilize 100vw in your CSS width setting is by incorporating it like so:

width: 100vw;

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

Struggling with displaying nested JSON data in React components

I have a nested JSON structure running on my local server, and I'm using React to practice displaying this nested data. Currently, I am focusing on showing the day and the available time slots for that day. I have managed to extract the "days" (mon, t ...

Retrieve the user's information using their email address

I am attempting to retrieve "Registered user information" on my email address using the "mail()" function. The mail() function is functioning correctly and successfully sending the email to the specified email address, however, it is unable to retrieve the ...

Using jQuery within MediaWiki pages beyond just Monobook.js or extensions is a powerful tool

Currently, I am experimenting with some jQuery functionalities in a MediaWiki content page to enhance various features. I have referred to the following resources: http://www.mediawiki.org/wiki/Manual:$wgRawHtml (particularly for incorporating Paypal but ...

Modifying the .env variable in Next.js post compilation

When developing my application using Next.js, I rely on .env to manage endpoint registrations for data retrieval within the app. Given that this application may be used by various clients, it's essential to have a .env file to configure the endpoints ...

Modify the appearance of the gradient progression bar

I am working on a gradient progress bar with the following code: CSS: .progressbar { height: 15px; border-radius: 1em; margin:5px; background: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%,transparent 25%, t ...

Incorporate Text, HTML, and Embed Images into PHPWord

I am currently utilizing PHPWord to create word documents using PHP. I have a specific content format that I need to adhere to, as shown below: Title Description Image1 Image1 Description(HTML CONTENT) Image2 Image2 Description(HTML CONTENT) As of now ...

Guide on customizing the error color and underline color when input is focused in material-ui v1.0.0-beta.40

Currently implementing Material-UI v1.0.0-beta.40 and aiming to customize the border color and error text color. Any suggestions on how to achieve this? ...

Cannot populate Kendo Menu with images due to dataSource imageUrl not recognizing the content

I have integrated Kendo controls into my application, specifically a Menu control with a datasource in my controller. Currently, I am passing the relative path of URL for imageUrl. However, as the application has grown, there are multiple calls being made ...

Designing a custom CSS for enhancing the look of the orchard menu

Right now, I am in the process of implementing a layout that is already established in an MVC4 project. I am facing challenges in figuring out how to create a custom menu in the latest version of Orchard (using the source version so it runs in Visual Stud ...

Using CSS to add a resize handle and implement mouse events in Chrome

While experimenting with the resize property in CSS, I encountered an issue. I have a div that contains a canvas element. .resizable { resize: both; overflow: hidden; border: 1px solid black; } div { height: 300px; wi ...

Discovering the magic of Bootstrap 5 and mastering its classes

Currently facing an issue with the me and ms classes while learning to build a navbar. The requirement is for elements one and two to be left-aligned using the ms class, and elements three and four to be right-aligned using the me class. However, the eleme ...

Exploring Django's HTML QuerySet

Is there a way to verify if a student exists in the database class table, given that the student is assigned as a foreign key in the table? I am looking to achieve this without opening another loop. index.html: <ul> {% for student in studentList %} ...

Nested Dynamic Routing

I am facing an issue with my dashboard that involves multiple user access. The path "/" displays a default and generic dashboard, while other dashboards are customized for different users. I am using Reactjs along with version "react-router-dom": "^5.1.2" ...

Clever method for enabling image uploads upon image selection without needing to click an upload button using JQuery

Is there a way to automatically upload the file without having to click the upload button? Detail : The code below shows an input field for uploading an image, where you have to select the file and then click the "Upload" button to actually upload it: & ...

The dropdown menu in Mantine is malfunctioning, even though I copied and pasted the exact code from

While following a tutorial, I encountered an issue with the Mantine Menu and Dropdown components. The tutorial creator did not wrap the React App inside the MantineProvider, which resulted in errors when trying to use the Dropdown component. Even after add ...

When implementing react query's useInfiniteQuery, I noticed that it keeps returning previous data whenever I handle scroll events. Am I

I'm facing an issue with my backend when receiving a GET request in /?pages={number}. I'm attempting to implement infinite scroll in React Native using React Query to fetch data and pass it through a FlatList component. The problem arises when r ...

Adjusting the <div> size for optimal display on iPhone and iPad screens

I am having an issue with my jQuery Mobile app. I have a page with a header and footer, and the main content consists of 4 images arranged in a 2x2 grid format. Since I couldn't get JM grid to work, I created my own grid using a div container. Here is ...

Exporting headers of an HTML table using Jquery to Excel is not functioning properly

I need assistance with exporting an HTML Table that is dynamically generated based on the data. The table layout is defined before the data is populated, and once the data is queried, rows are added to the table dynamically. <table id="findCntrctTable" ...

Guide to creating a personalized TinyMCE plugin in a React JS environment

The code snippet above showcases the TinyMCE editor implementation in React JS: import { Editor} from '@tinymce/tinymce-react'; <Editor className="editor" onKeyUp={onclick} api ...

Exploring the intricacies of ReactJs lifecycle functions

After developing a website with ReactJs using the lifecycle method, I came across some articles suggesting that this approach should be avoided for production-level applications. They recommend sticking to functional components, hooks, and other practice ...