How do I add a margin to a CSS webkit scrollbar? -


here's site current webkit scrollbar: http://willwhitehead.com

i'd create gap between scrollbar , right edge of screen.

how achieve this?

thanks in advance,

will

this horrible hack seems work. use ::-webkit-scrollbar selector, give bar fixed of x pixels. set left property -px value.

::-webkit-scrollbar {     width: 10px; left:-100px; } 

alternatively following:

give ::-webkit-scrollbar fixed width of 30px, set border of ::-webkit-scrollbar-thumb padding wish scroll bar away right hand side of screen. , set background of border match of background colour.

this give illusion scroll bar floating right of window, though in actual fact not. can see in fiddle below.

body {    background: blue;  }  *::-webkit-scrollbar {    width: 30px;  }  *::-webkit-scrollbar-track {    background: green;    /* change me blue match background */  }  *::-webkit-scrollbar-thumb {    background: red;    border: 10px yellow solid;    /* change border color blue match background */  }
<p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower    cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>  <p>    <h5>the spirit of rang de</h5>    name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour    , exuberance , significance want our efforts have people reach out to.</p>  <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower    cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>  <p>    <h5>the spirit of rang de</h5>    name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour    , exuberance , significance want our efforts have people reach out to.</p>  <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower    cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>  <p>    <h5>the spirit of rang de</h5>    name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour    , exuberance , significance want our efforts have people reach out to.</p>  <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower    cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>  <p>    <h5>the spirit of rang de</h5>    name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour    , exuberance , significance want our efforts have people reach out to.</p>  <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower    cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>  <p>    <h5>the spirit of rang de</h5>    name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour    , exuberance , significance want our efforts have people reach out to.</p>  <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower    cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>  <p>    <h5>the spirit of rang de</h5>    name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour    , exuberance , significance want our efforts have people reach out to.</p>


however, best thing wrap content in container div. modify css container see:

body {    background: blue;    margin: 0 0 0 0;    padding: 0 0 0 0;  }  #container {    position: absolute;    left: 0;    overflow-y: scroll;    right: 60px;    height: 100%;    background: gold;    margin: 0 0 0 0;    padding: 0 0 0 0;  }  ::-webkit-scrollbar {    width: 20px;  }  ::-webkit-scrollbar-track {    background: red;  }  ::-webkit-scrollbar-thumb {    background: green;  }
<div id="container">    <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower      cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>    <p>      <h5>the spirit of rang de</h5>      name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour      , exuberance , significance want our efforts have people reach out to.</p>    <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower      cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>    <p>      <h5>the spirit of rang de</h5>      name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour      , exuberance , significance want our efforts have people reach out to.</p>    <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower      cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>    <p>      <h5>the spirit of rang de</h5>      name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour      , exuberance , significance want our efforts have people reach out to.</p>    <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower      cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>    <p>      <h5>the spirit of rang de</h5>      name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour      , exuberance , significance want our efforts have people reach out to.</p>    <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower      cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>    <p>      <h5>the spirit of rang de</h5>      name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour      , exuberance , significance want our efforts have people reach out to.</p>    <p>the idea of rang de sown in year 2006 - same year when mr. yunus awarded nobel prize work grameen bank. motivation starting rang de belief peer peer lending model leveraged lower      cost of microcredit , reach out under-served communities. rangde.org went live on january 26th 2008 (16:48 hrs precise!).</p>    <p>      <h5>the spirit of rang de</h5>      name rang de decided after lot of thought. goes patriotic struggle independence. believe similar movement same kind of urgency required address poverty in india. words rang de denote colour      , exuberance , significance want our efforts have people reach out to.</p>  </div>


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -