Scrollbar missing in browser

I'm currently working on an HTML page, and I've encountered an issue where the browser scrollbar doesn't appear when the content exceeds the browser window. My CSS skills are at a beginner level, so I'm not entirely sure how to add attributes and make them function correctly. For this project, I have mainly utilized W3.CSS and Bootstrap for design purposes. Below is the snippet of HTML code:

<!DOCTYPE html>
<html lang="fa" dir="rtl">

<head>
  <title>Dr Salmani</title>
</head>

...

Here's a glimpse into the CSS code that accompanies my project:

.container {
  position: relative;
}

body {
  height: 100%;
  overflow: auto;
  box-sizing: border-box;
}

tr,
td {
  border-bottom: 1px solid #ddd;
  padding-bottom: 15px;
  padding-top: 15px;
  margin: 50px;
}

...

I've attempted to address the lack of scrollbar by adding height and overflow attributes to the body and HTML elements separately, but it seems ineffective. Interestingly, the scrollbar only appears when I apply these attributes to the main tag specifically. Even trying different browsers hasn't yielded any positive results.

Answer №1

The main section is set to a fixed position with a width of 70%, regardless of screen size. To enable scrolling within this container, apply the overflow property directly to the container itself, rather than the body element:

.dr-information {
  overflow: auto;
}

Answer №2

In the provided code, the position of your content is set to fixed within the centered and dr-info classes. If you remove this setting, scrolling will be enabled on the page.

.centered {
  /*position: fixed;*/
  /* or absolute */
  top: 20%;
  left: 13%;
}

.dr-info {
  /*position: fixed;*/
  top: 10%;
}

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

Is it feasible to update the value of a FormArray within a FormGroup?

Hey there, I'm new to working with reactive forms and I have a question about updating a FormArray without using the get method. Typically, I would use something like this.editForm.get('ingredients'). However, I would like to use patchValue ...

Delivering static assets through a POST request with express.js

I'm having an issue serving static content for a Facebook app using express.js app.configure(function (){ app.use('/', express.static(__dirname + '/public')); }); Everything is working fine with a GET request, but when I try ...

What is the significance of the "rc" within the version structure of an npm package?

Can someone help me understand what the rc in 2.2.0-rc.0 signifies? I'm curious if it indicates that this version is ready for production use. ...

Having issues with retrieving latitude and longitude data from the Geocoding API in Node.js when using the OpenWeather API

I attempted to create a program in node.js that utilizes the openweather API. The idea was for the user to input a city name, then use the Geocoding API to extract the latitude and longitude coordinates, and finally retrieve weather data from the current w ...

The inclusion of Bootstrap 4 in the header seems to be causing issues with mouse events not functioning correctly

Exploring the functionalities of Bootstrap 4 and jQuery has been an interesting journey. I recently worked on creating a Navbar with 4 links, where the 4th link has a submenu that opens upon hover. However, I encountered an issue where this functionality o ...

Utilizing a CSS identifier with jQuery

I'm struggling with a basic .each statement for comments where I want a form at the bottom to add new comments. The goal is simple - when someone submits a comment, I want it to display just above and move the form down using jQuery. Although this fun ...

Difficulty encountered when displaying JavaScript variable content within HTML in a React component

I'm currently exploring a backend administrative dashboard framework known as admin bro. My current project involves creating a tooltip component, and here is the code I have developed so far. class Textbox extends React.PureComponent { render() { ...

Tips for enabling selection of list items in an input tag

Below is the code I have written to create an InputFilter. MyFilter = function(args) { var dataUrl = args.url; var divID = args.divID; var div = document.getElementById(divID); var myTable = '<input type="text" id="myInput" on ...

What is the best way to change an array of strings into a single string in JavaScript?

I am working with a JavaScript array that contains strings arranged in a specific format: arrayOfString = ['a', 'b,c', 'd,e', 'f']; My goal is to transform this array into a new format like so: myString = ["a", "b ...

Retrieve JSON data from a RESTful API by utilizing pure javascript

I'm eager to try out the Wikipedia search API in JavaScript, even though it might be simpler with jQuery. I want to make sure I understand the basics first before turning to frameworks. Below is the code I've come up with, but for some reason, I ...

Controlling versatile URLs within Angular

I am facing a challenge where most parts of the URLs are optional, with the controller remaining the same. The URL structure is dynamic and changes based on the selected filter parameters. For example, it could be /search, /search/min-1000, /search/max-100 ...

In landscape mode on Safari for iOS, the final item in a vertical flexbox may be cut off

Describing my app: It is structured as a 3-row flexbox column. <div class="app" style="display: -webkit-flex; -webkit-flex-direction: column; -webkit-justify-content: space-around;"> <div class="question-header" style="-webkit-flex: 0 0 0;"&g ...

Dynamically setting the IMG SRC attribute with the base64 result of a FileReader for file input

Looking for a little guidance on something new, I'll keep it brief because I'm sure it's just some small detail I'm overlooking... Starting with an image like this, where currentImage is the initial existing image path; <img src="{ ...

YUI3 Searching with Selectors

I'm encountering an issue with selecting a single checkbox object in YUI3 based on its unique value attribute. In a table, there are multiple checkboxes with assigned unique keys to their value attributes. What should be the correct selector in YUI3 t ...

Loop through an array to find the average values of different segments within the array

I am currently working with an array structured like this: ["2011-06-16 16:37:20",23.2], ["2011-06-21 16:37:20",35.6], ["2011-06-26 16:37:20",41.8], ["2011-07-01 16:37:20",25], ["2011-07-06 16:37:20",22.8], ["2011-07-11 16:37:20",36.4], ["2011-07-16 16:37 ...

What could be causing the CSS and HTML connection to fail?

I am currently working with Flask on the Atom editor to build a website. Despite specifying the correct path for the CSS file in the link, every time I load the page, it appears without any styling. I have attempted changing the paths multiple times with n ...

Does setting white-space:nowrap enlarge the div?

My CSS code for div .name sets the width to 75% to truncate text if it doesn't fit. However, resizing the window causes the text to remain the same size and my entire website structure falls apart. This is the HTML code snippet: <tr> <t ...

What causes the z-index value to stay the same even after it has been modified using the .css() function?

The z-index property defaults to auto, as explained in the MDN documentation. Despite setting the z-index to 1 using the following code: $("body").css("z-index", 1); Upon retrieving the value of z-index with this code: $("body").css("z-index"); The re ...

What causes the issue of JavaScript code not loading when injected into a Bootstrap 4 Modal?

I've created a JavaScript function that triggers the opening of a Bootstrap Modal Dialog: function displayModal(message, headerMessage, sticky, noFooter){ var modal = $('<div />', { class: 'modal fade hide ...

Styling tables within HTML emails for Gmail and then utilizing PHPMailer to send the emails

I've been racking my brain over this for hours with no luck! Objective: Implementing inline styles for table, td, th, p elements in an HTML email intended for Gmail using PHPMailer. Challenge: Inline styles not being rendered HTML Snippet: <sec ...