How can I prevent scroll bars from being hidden for OS X trackpad users in WebKit/Blink?
Tags: css,webkit,scrollbar,osx-lion,blink
Problem :
WebKit/Blink's (Safari/Chrome) default behaviour on on Mac OS X since 10.7 (Lion) is to hide scroll bars from trackpad users when they're not in use. This can be confusing; the scroll bar is often the only visual cue that an element is scrollable.
Example (jsfiddle)
HTML<div class="frame">
Foo<br />
Bar<br />
Baz<br />
Help I'm trapped in an HTML factory!
</div>
CSS
.frame {
overflow-y: auto;
border: 1px solid black;
height: 3em;
width: 10em;
line-height: 1em;
}
WebKit (Chrome) Screenshot
How can I force a scroll bar to always be displayed on a scrollable element in WebKit?
Solution :
The appearance of the scroll bars can be controlled with WebKit's -webkit-scrollbar
pseudo-elements [blog]. You can disable the default appearance and behaviour by setting -webkit-appearance
[docs] to none
.
Because you're removing the default style, you'll also need to specify the style yourself or the scroll bar will never show up. The following CSS recreates the appearance of the hiding scroll bars:
Example (jsfiddle)
CSS.frame::-webkit-scrollbar {
-webkit-appearance: none;
}
.frame::-webkit-scrollbar:vertical {
width: 11px;
}
.frame::-webkit-scrollbar:horizontal {
height: 11px;
}
.frame::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 2px solid white; /* should match background, can't be transparent */
background-color: rgba(0, 0, 0, .5);
}
.frame::-webkit-scrollbar-track {
background-color: #fff;
border-radius: 8px;
}
WebKit (Chrome) Screenshot
CSS Howto..
I finally figured it out. The magic ingredients are the view-port units. Given this html structure: .l-table .l-table-cell .square You can use this css (well actuall its scss, but you...
Would this do the job for you? Please test it on multiple browsers because it's only tested on FF 3.6, IE 7+
You are hiding your navigation at 700px (not 600px as stated in your question). If you dont want it to be hidden, remove this CSS from your media query :...
If you're using Apache, you can also embed PHP code in your CSS files, by adding this to your apache conf: AddHandler application/x-httpd-php .css ...
#navi ul li a { border-top: 1px solid #303030; cursor: pointer; color: #303030; -> change this: width: 178px; display: inline-block; height: 45px; text-decoration: none; font: 12px/45px "Open Sans",sans-serif; -> remove:...
I could do it myself!!! First you have to draw the four corner´s highlights on HTML: <img id="clt" src="img/clt.png" border="0" style="position:absolute;visibility:hidden"></span> <img id="crt" src="img/crt.png" border="0" style="position:absolute;visibility:hidden"></span> <img id="crb"...
I have modified your class #header.collapseTest .top { height: 0; margin: -1px; -webkit-transition: all 0.935s ease-in-out 0s; -moz-transition: all 0.935s ease-in-out 0s; -o-transition: all 0.935s ease-in-out 0s; transition: all 0.935s...
SASS with the .scss syntax is a superset of CSS. That means valid CSS is automatically valid SASS (not in the other syntax .sass though). Of course you need to...
CSS will only help you in certain browsers - for instance, Internet Explorer will ignore it for SELECTs completely you can, however, still use an ordinary select on page without...
If your menu view has the width set to 55%, you need to store the dp version of that percentage. "#main_menu": { width: "55%" } Device width: var width =...
There is nothing wrong with using relative paths with SSL pages, there must be something else involved. Have you considered any other logic you may have, an extra redirect with...
In add to the common solution of targeting the element itself, and then the class, AKA: '.paragraph' vs 'p.paragraph', you can also force some !important rules... wich can make your...
The problem you have here is that anything that is position: absolute; is removed from flow. Thus, #container can never contain the .boxes. In this cause you will need to...
Your styles task should depend on the less one to wait for its completion. Doing what you did will run the two tasks in parallel. You can specify an array...
In the end I have solved my problem a different way by making the wrapper a span instead of a div. That way I don't need to move its contents...
How to merge all with class
As per my understanding you want to merge td with col_span class. $(function(){ $("tr").each(function(){ var empty = $(".col_span:empty",$(this)).length; $notEmpty = $(this).find(".col_span").not(":empty"); $notEmpty.attr("colspan",empty+1); $(".col_span:empty",$(this)).remove(); }); }); <table class="mytables">...
Get the element you would like to get the current background-position for, and use: getComputedStyle(element).getPropertyValue("background-position"); I might recommend recoding it to use JavaScript however, since it will be more efficient...
perhaps put an <hr> in the cell and then use CSS to give it an absolute position.
Here is solution. It's called zig-zag border. http://jsfiddle.net/justinmc/QqnD3/ <div class="container"> <h1>Content Here</h1> </div> .container { position: relative; padding: 8px 8px 32px 8px; background: #dddccf; } .container:after { background: linear-gradient(-45deg, #ffffff...
As I said in my comment, you won't "see" the CSS - it will just affect the HTML on your page. A reason why you aren't seeing the red outline...
The problem here is that you cannot add stuff to the parsed CSS. You can only add inline styles to a particular element. Say, you had a <div class="usrgrid">. The...
You could target them like so: .bottom a:link, .bottom a:visited, .navt a:link, .navt a:visited{ color: white; } ...
Create a div container with position:relative and put your 3 canvases inside with position:absolute and use left to move the canvases as desired. var canvasB=document.getElementById("canvasBottom"); var ctxB=canvasB.getContext("2d"); var canvasL=document.getElementById("canvasLeft"); var...
Try to put variable content value instead of its name: ShortcutButton.setStyle("-fx-background-color: " + hex + ";"); ...
Change .rating:not(:checked) > label:hover, .rating:not(:checked) :hover ~ label { content:'\00a0 \00a0 \00a0 '; background-color: #4bce32;/*here is what I want to change when user clikc*/ } to .rating:not(:checked) :hover ~ label:before...
If you want to move up the text inside selectbox, you should decrease padding-top for that select. You can change all the paddings to position it the way you like.
I don't know why others are taking about Javascript, this is easily done with CSS. You use the adjacent sibling combinator or general sibling combinator. First, declare that you want...
Just add overflow: hidden to the h4 h4{ overflow:hidden; } Demo...
Standard answer: you can't. There is no way to do this with purely HTML/CSS2, unfortunately. We can make drop-downs in CSS with the :hover psuedo-class, but there's no equivalent for...
There are a number of problems with printing from within a browser. A lot of the printing-specific stuff doesn't work on most browsers and even where it's supported by multiple...
As per my understanding you want to merge td with col_span class. $(function(){ $("tr").each(function(){ var empty = $(".col_span:empty",$(this)).length; $notEmpty = $(this).find(".col_span").not(":empty"); $notEmpty.attr("colspan",empty+1); $(".col_span:empty",$(this)).remove(); }); }); <table class="mytables">...
Get the element you would like to get the current background-position for, and use: getComputedStyle(element).getPropertyValue("background-position"); I might recommend recoding it to use JavaScript however, since it will be more efficient...
perhaps put an <hr> in the cell and then use CSS to give it an absolute position.
Here is solution. It's called zig-zag border. http://jsfiddle.net/justinmc/QqnD3/ <div class="container"> <h1>Content Here</h1> </div> .container { position: relative; padding: 8px 8px 32px 8px; background: #dddccf; } .container:after { background: linear-gradient(-45deg, #ffffff...
As I said in my comment, you won't "see" the CSS - it will just affect the HTML on your page. A reason why you aren't seeing the red outline...
The problem here is that you cannot add stuff to the parsed CSS. You can only add inline styles to a particular element. Say, you had a <div class="usrgrid">. The...
You could target them like so: .bottom a:link, .bottom a:visited, .navt a:link, .navt a:visited{ color: white; } ...
Create a div container with position:relative and put your 3 canvases inside with position:absolute and use left to move the canvases as desired. var canvasB=document.getElementById("canvasBottom"); var ctxB=canvasB.getContext("2d"); var canvasL=document.getElementById("canvasLeft"); var...
Try to put variable content value instead of its name: ShortcutButton.setStyle("-fx-background-color: " + hex + ";"); ...
Change .rating:not(:checked) > label:hover, .rating:not(:checked) :hover ~ label { content:'\00a0 \00a0 \00a0 '; background-color: #4bce32;/*here is what I want to change when user clikc*/ } to .rating:not(:checked) :hover ~ label:before...
If you want to move up the text inside selectbox, you should decrease padding-top for that select. You can change all the paddings to position it the way you like.
I don't know why others are taking about Javascript, this is easily done with CSS. You use the adjacent sibling combinator or general sibling combinator. First, declare that you want...
Just add overflow: hidden to the h4 h4{ overflow:hidden; } Demo...
Standard answer: you can't. There is no way to do this with purely HTML/CSS2, unfortunately. We can make drop-downs in CSS with the :hover psuedo-class, but there's no equivalent for...
There are a number of problems with printing from within a browser. A lot of the printing-specific stuff doesn't work on most browsers and even where it's supported by multiple...