Scrollbar malfunctioning

Hello everyone, I'm having some trouble with this code and can't figure out why it's not working. Can anyone suggest an alternative code for setting the scrollbar properties of my textarea?

<textarea style="scrollbar-arrow-color:pink; 
                     scrollbar-base-color:red; 
                     scrollbar-darkshadow-color:blue; 
                     scrollbar-highlightcolor:orange; 
                     scrollbar-shadow-color:green">
    </textarea>

Answer №1

You seem to be approaching it the wrong way. Inline style attributes can only contain property declarations; you cannot declare pseudo elements inline. Consider writing your CSS in a separate style sheet and linking it to your page.

Here are some pseudo elements for a textarea:

::-webkit-scrollbar              
::-webkit-scrollbar-button       
::-webkit-scrollbar-track        
::-webkit-scrollbar-track-piece  
::-webkit-scrollbar-thumb        
::-webkit-scrollbar-corner       
::-webkit-resizer

A basic example could be:

::-webkit-scrollbar {
   width: 12px;
}

::-webkit-scrollbar-track {
   -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
   border-radius: 10px;
}

::-webkit-scrollbar-thumb {
   border-radius: 10px;
   -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
 }

::-webkit-scrollbar {
    width: 12px;
}
 
::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    border-radius: 10px;
}
 
::-webkit-scrollbar-thumb {
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
}
<textarea id="message" rows="4" cols="50"> </textarea>

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

Align a series of divs in the center with variable width and height

I have a dilemma with my large div that contains multiple thumbnails. I am looking to center the thumbnails within the div and have the overall div centered on the page. Additionally, I want the width of the div to be flexible so that all thumbnails can be ...

Building HTML tables with JQuery for handling large datasets of over 4,000 rows and beyond

My goal is to create a table with 4000+ rows and 18 columns displaying parsed pages from my site. I need it all on one page for the following reasons: I require the use of filters in the table I need to be able to sort by more than 5 columns Every cell ...

Achieve a floating right alignment of an unordered list navigation using CSS without changing

I am currently implementing a jquery navigation system which can be found at this link: http://css-tricks.com/5582-jquery-magicline-navigation/ My goal is to have the navigation bar float to the right without changing the order of items (e.g. home, contac ...

In JavaScript, the array is being passed as "undefined"

<html> <head> <script> function replaceLocation() { var locationArray= new Array(); locationArray[1,2,3,4]=document.getElementById("From").value.split(" "); document.getElementById("map").src="https://maps.google.com/maps?f=d& ...

Viewing saved information prior to saving - JavaScript

I'm looking for a solution to allow users to preview captured records before they are inserted. Any suggestions on how to achieve this? HTML.html <form id="view" method="POST" class="formular"> <label>Name</label> ...

A curated list of Laravel form request validation resources

After researching, I couldn't find any information on how to validate collections in the documentation. In .NET Core, I can easily achieve this by creating a Model with data attributes that automatically bind to the front end model, displaying all err ...

The functionality of Jquery seems to be malfunctioning on the website

I recently deployed my Node.js app on Heroku and everything seemed to be running smoothly. However, upon loading the website, I encountered an issue with jQuery functionality. Despite confirming that jQuery was being loaded in the network calls, none of th ...

What is the best way to adjust a component to display varying content based on the scenario?

I am looking for a way to reuse a component on my website that displays messages. The challenge is that in one section, the content consists of only a title and paragraph, while in another section, there are multiple titles and content pieces. I have imple ...

Thai language does not appear in the output shown in forms sent via email

I am struggling with configuring my form to send emails in Thai language. Despite my efforts, I feel like I lack the necessary knowledge or understanding to fix this issue on my own. Therefore, I am reaching out for assistance. Upon checking phpMyAdmin, I ...

Troubleshooting PHP's JSON array encoding issue

My current issue is with a PHP file that should be returning multiple records. Initially, everything was functioning properly. However, due to what I suspect is a minor error somewhere in the code, it has stopped working. When using Json_encode on my PHP ...

Verify the status of the nested reactive forms to determine if the child form is in a dirty state

I am working on a form that consists of multiple sections within nested form groups. I need to find a way to detect when changes are made in a specific section. Here is the HTML structure: <div [formGroup]="formGroup"> <div formGroupN ...

Servlet: Struggling to retrieve the response from ajax function within the success block

Can I upload a file from jsp using an ajax call to make a request to a servlet and then return control back to the ajax function upon completion of the upload process, so that I can display all imported data to the user? // Below is the code snippet: ...

Creating a button that allows users to quickly navigate back to the top of a webpage

On my website, I have a convenient "back to top" feature that allows users to easily navigate back to the top of the page: If you scroll down the page, you'll see this feature in action. This particular feature is part of the theme I'm using on ...

Tips for utilizing the "this" keyword in JavaScript in conjunction with the change function

I'm currently facing an issue with the change function. I have two dropdowns that are dependent on each other. Whenever the first dropdown changes, it triggers a change in the second dropdown as well. I achieved this functionality using jQuery AJAX. H ...

Comparing a datetime string from HTML with a datetime object in Python: Best practices

I am currently using selenium to extract videos, and my goal is to create a function that verifies whether the video's posting datetime occurred prior to yesterday. I am encountering challenges when it comes to comparing the extracted datetime with ye ...

(Ways to Condense CSS) Tips for Making Your CSS Code More Efficient

Can you assist me in streamlining this code while maintaining its functionality? .taster a:link, a:visited { text-decoration: none; color: #FFFFFF; } .taster a:hover , a:active { font-size: 120%; color: #000000; } .contact a:link, a:vis ...

I am having trouble getting the JavaScript confirm function to function properly

Encountering a peculiar issue with the javascript confirm method - every time I call it, an error is thrown stating "Uncaught TypeError: Property 'confirm' of object [object Object] is not a function" var confirmVal = window.confirm("Please con ...

What is the best way to stop the browser from automatically redirecting to another page after submitting a form?

I am using an AJAX call to a method that returns JSON data. How can I retrieve and read the JSON response without being redirected to a new empty page? [HttpPost] public JsonResult Test() { return Json("JSON return test", JsonRequestBehavior.AllowGe ...

CSS: Card elevates when keyboard is activated on a mobile device

[view image 1[view image 2] Image 1: Normal View, Image 2: When the keyboard is enabled, the card jumps up and when I close it's normal. Is this behavior normal? Or is there a fault in my CSS? I utilized styled-components for writing the CSS. CSS ...

Guide to utilizing jQuery for setting values in all subsequent rows of a table

I have a table with 15 rows of text boxes labeled as text1, text2, and so on up to text15. If I enter text into, let's say, the 5th textbox, I want that same text to be automatically copied into all subsequent textboxes from the 6th through the 15th. ...