I need to position the CSS vertical scrollbar on the right side of the page

I can't figure out how to move the vertical scrollbar to sit on the right side of my site's work page. Any help would be greatly appreciated.

Below is the provided HTML code:

   <div class="heading">

   <h1>PRINT</h1>

    <div class="scrollbar" id="style-6">
  <div class="force-overflow">
  </div>
   </div>

   </div>

   <p>&nbsp;</p>



   <div class="blog-container">

<div class="work_thumbs">
  <li class="print">
    <div><a href="Work/Tree Top News/treetopnews.html"><img src="../Images/Tree Top News/Thumbs/TTN2.jpg" alt="Tree Top" border="0" class="thumb">TREE TOP NEWS</a></div>
  </li>

      <li class="print">
    <div><a href="Work/Harrow Council/harrowcouncil.html"><img src="../Images/Harrow Council/Thumbs/Harrow Logo.jpg" alt="Harrow Council" border="0" class="thumb">HARROW COUNCIL</a></div>
  </li>

      <li class="print">
    <div><a href="Work/Regent Care/regentcare.html"><img src="../Images/Regent/Thumbs/Regent logo.jpg" alt="Regent Care" border="0" class="thumb">REGENT CARE SERVICES</a></div>
  </li>

      <li class="print">
    <div><a href="Work/NLCS/nlcs.html"><img src="../Images/NLCS/Thumbs/NLCS Logo2.jpg" alt="NLCS" border="0" class="thumb">NLCS</a></div>
  </li>

     <li class="print">
    <div><a href="Work/Aish/aish.html"><img src="../Images/Aish/Thumbs/AHC.jpg" alt="Aish" border="0" class="thumb"> AISH</a></div>
  </li>

     <li class="print">
    <div><a href="Work/Dental Perfection/dentalperfection.html"><img src="../Images/Dental/Thumbs/Dental Perfection Logo.jpg" alt="Dental Perfection" border="0" class="thumb"> DENTAL PERFECTION</a></div>
    </li>

     <li class="print">
    <div><a href="Work/FJL/fjl.html"><img src="../Images/FJL/Thumbs/FJL Logo.jpg" alt="chicago graphic design" border="0" class="thumb">FJL</a></div>
     </li>

                  <li class="print">
    <div><a href="Work/Canons High/canonshigh.html"><img src="../Images/Canons high/Thumbs/Canons.jpg" alt="Canons high school" border="0" class="thumb">CANONS HIGH SCHOOL</a></div>
     </li>

                   <li class="print">
    <div><a href="Work/NCSY/ncsy.html"><img src="../Images/NCSY/Thumbs/NCSY cover.jpg" alt="NCSY" border="0" class="thumb">NCSY</a></div>
  </li>

                  <li class="print">
    <div><a href="Work/Graham Allcott/grahamallcott.html"><img src="../Images/Graham Allcott/Thumbs/GA.jpg" alt="NCSY" border="0" class="thumb">GRAHAM ALLCOTT</a></div>
  </li>

The CSS for styling is as follows:

     #info
    {
font-size: 18px;
color: #555;
text-align: right;
margin-bottom: 25px;
    }

    a{
color: #074E8C;
    }

    .scrollbar
    {
margin-left: 0px;
float: right;
height: 300px;
width: 25px;
left: 200px;
background: #F5F5F5;
overflow-y: scroll;
margin-bottom: 25px;
    }

    .force-overflow
    {
min-height: 450px;
    }



    /*
     *  STYLE 6
     */

    #style-6::-webkit-scrollbar-track
    {
background-color: #F5F5F5;
    }

    #style-6::-webkit-scrollbar
    {
width: 10px;
background-color: #F5F5F5;
    }

    #style-6::-webkit-scrollbar-thumb
    {
background-color: #F90; 
background-image: -webkit-linear-gradient(45deg,
                                          rgba(255, 255, 255, .2) 25%,
                                                  transparent 25%,
                                          transparent 50%,
                                          rgba(255, 255, 255, .2) 50%,
                                          rgba(255, 255, 255, .2) 75%,
                                          transparent 75%,
                                          transparent)
    }

    .blog-container {
  min-height: 100%;
  width: 700px;
  margin-top: 45px;
   background-color: #FFF;
display: table;
   content: '';
  clear: both;
     }

    .work_thumbs {
width:1000px;
margin: 0px auto 0 auto;
float: left;
    }

    .work_thumbs li {
margin: 0px 15px 15px 0px;
list-style-type: none;
display: block;
float: left;
display: inline;
font-family: "geogtq rg", Helvetica;
color: #FFF;
overflow: hidden;
    }

    .work_thumbs li a {
float: inherit;
display: block;
width: 230px;
padding-bottom: 20px;
font-family: "geogtq rg", Helvetica;
color: #00BDE5;
height: 180px;
border: 1px solid #02BDE5;
overflow: hidden;
text-align: center;
font-size: 17px;
    }

    .work_thumbs li .type {
color: #01BDE6;
    }

    .work_thumbs li a:hover {
background-color: #ceeef6;
border-bottom: 1px solid #02BDE5;
text-decoration: none;
color: #007789;
font-family: "geogtq rg", Helvetica;
text-align: centre;
font-size: 17px;
    } 

    .work_thumbs li .thumb {
margin-bottom: 15px;
display: block;
    }

Any assistance on this matter would be greatly appreciated. Thank you in advance.

Answer №1

After reviewing your code, I noticed some markup issues:

Here is a suggestion - try this fiddle

CSS changes made: .scrollbar { margin-left: 0px; float: right; height: 300px; left: 200px; background: #F5F5F5; overflow-y: scroll; margin-bottom: 25px; }

    .force-overflow
    {

    }

Also, please note the html change from

<div class="scrollbar" id="style-6">
  <div class="force-overflow">
  </div>
   </div>

   </div>

to

    <div class="scrollbar" id="style-6">
  <div class="force-overflow">
  </div>

I have shifted the two closing div tags lower down on the page. Does this meet your requirements?

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

Guide on extracting data from a JavaScript table using Python

Looking to extract information from a table on this page: . There are a total of 18 pages, but the url remains constant for each page. My usual method involves using BeautifulSoup to scrape data from HTML pages. However, in this case, the required data is ...

Having trouble with uploading image files in Laravel Vue.js?

I have been trying to upload my image file to a storage folder using Laravel and Vue.js. However, when I try to print the data using dd();, I get no response or error. How can I tell if I am doing it correctly? I suspect the error lies in the formData whe ...

The moment a file is uploaded from an HTML page, control is passed on to the servlet

Trying to incorporate file upload functionality in my application, I have implemented the following code in my HTML: <form action="http://localhost:8080/demo/Upload/a" method="post" enctype="multipart/form-data"> <input type="text" name="descript ...

Creating a spinning Cube with separate fields for x, y, and z rotation speeds: a step-by-step guide

After dabbling in Java, Visual Basic, HTML, and CSS, I'm now looking to create an interface featuring a central spinning cube with 3 fields to control its x, y, and z rotation speeds. Can you suggest which language would be the best fit for this proje ...

What are the steps to create an endless scrolling feature?

I'm trying to create a slider with a horizontal scrolling effect, but I've hit a roadblock. How can I make the slider scroll infinitely? In my code, you can see that after Item 6, it stops scrolling and I have to scroll backward. However, I want ...

Two child DIVs within a single parent DIV

I am struggling to keep two divs side-by-side within a parent div. Initially, I was able to position the image in the right div successfully, but when resizing the elements, everything became disorganized and I can't seem to fix it. As a beginner, I w ...

How can I make my div change color when the check-box is selected?

I have a dynamic table in my web application that is populated with data from a database. Each row in the table represents multiple time slots for a specific date. I am working on a feature where the background color of a time block can be changed if a che ...

"Unable to move past the initial segment due to an ongoing

My portfolio webpage includes a "blob" and "blur" effect inspired by this YouTube video (https://www.youtube.com/watch?v=kySGqoU7X-s&t=46s). However, I am encountering an issue where the effect is only displayed in the first section of the page. Even a ...

Introducing a pause in the function while rendering objects

After inserting setInterval into the code, it is causing all lasers to be delayed by one second. I am looking to have them fired in this order: - initially fire laser1 and laser2. - then take a 1-second break before firing another set of lasers, a ...

When trying to click the button in Navbar.jsx, I encounter an error when attempting to invoke the setShowCart(true) function

I've encountered an issue while trying to call the setShowCart(true) function in Navbar.jsx. I'm unsure of how to fix this. import React from 'react' import Link from 'next/link'; import {AiOutlineShopping} from 'react-ic ...

Images are not appearing correctly on Chrome browsers when using Windows operating system

img tags seem to have unusual margins in Chrome, Edge, and Opera browsers, while Firefox displays them correctly. Queries What is causing these margins specifically in Chrome? The Devtool does not detect any margin properties. Is there a straightforward s ...

The ">" CSS child selector does not seem to be functioning correctly with specific properties

While experimenting with applying CSS properties to direct child elements of a parent element using ">", I noticed that it works smoothly with certain properties like borders, but not so much with font-related properties such as color and font-weight. ...

The content in the flex box item with horizontal scroll is overflowing beyond its boundaries

I am working with a flex box container that contains two child elements: a left side and a right side. I want the right side item to have a horizontal scrollbar in order to fit its content. .container { display: flex; overflow: hidden; height: 300 ...

The iPhone header position switches when an HTML5 input type number is selected

I am currently working on a project that involves jQuery Mobile and PhoneGap. One issue I am encountering is when using the iPhone version, the header position changes when I click on an input type number. NOTE: When I focus on the input type number in my ...

Is it possible to incorporate a Material-UI theme palette color into a personalized React component?

My custom Sidebar component needs to have its background color set using Material-UI's primary palette color. Sidebar.js import styles from '../styles/Home.module.css'; export default function Sidebar() { return ( <div className={ ...

The small screen @media query is malfunctioning and not displaying correctly

After creating an HTML file and CSS file, I have encountered a styling issue. When viewing the output on a larger screen, the text "I LOVE CODING, I WILL BECOME AN EXPERT." should be displayed in blue on a red background. However, on smaller screens, it ne ...

Problem with Ajax causing full-page reload

I currently have a webpage that utilizes JqueryUI-Mobile (specifically listview) in conjunction with PHP and some Ajax code. When the page loads initially, it displays a list generated from a MySQL DB. I want this list to refresh itself periodically witho ...

Authenticating with Objective-C

I am currently developing an iPhone app that sends a username and password to a website in order to retrieve the HTML source code of the loaded page. The login information is included in the NSString *post. When I check the _responseData instance variable ...

Designing a dynamic 1-3 column arrangement with Angular for animated content

Let's discuss the current setup: I am in the process of creating a webpage for an application that includes a navigation bar, a footer, and a 3-column body layout. Initially, only one column is visible. This primary column will contain interactive d ...

Adjust the background color of a specific list item when hovering over another list item

My dilemma lies in my inadequate knowledge to solve this issue: I have a dropdown menu embedded within a website. (View screenshot here: [SCREENSHOT]) The desired outcome is for the background color of an icon on the main list to change when I navigate to ...