Customize scrollbar using css

What is a scrollbar in CSS?
Your web page has extra content from your screen height then he creates in the right side of the page two arrow symbol in top arrow & bottom arrow box and also shows a movable bar in between both arrow boxes. Scrollbar show default design as the browser. All browser have different CSS.
If you want to change the color style of your scrollbar then we need custom CSS as given below example:

View Demo
CSS Code:
body::-webkit-scrollbar-track {
            box-shadow: 0 0 6px 0 #ccc inset;
            border-radius: 10px;
        }
        body::-webkit-scrollbar-thumb {
            background: #0bf;
            outline: 1px solid #ccc;
            border-radius: 10px;
        }
        body::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        .anythingScrollbar {
            background: #F5F5F5;
            overflow: auto;
            max-width: 500px;
            padding: 15px;
            height: 300px;
            border: 1px solid #ccc;
            margin: 20px auto;
        }
        .anythingScrollbar::-webkit-scrollbar-track {
            box-shadow: 0 0 6px 0 #ccc inset;
            background-color: #cdf2ff;
        }
        .anythingScrollbar::-webkit-scrollbar {
            width: 10px;
            background: #eee;
        }
        .anythingScrollbar::-webkit-scrollbar-thumb {
            box-shadow: 0 0 6px 0 #ccc inset;
            background: #0bf;
        }

HTML Code:
<div class="anythingScrollbar">
        What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
        industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled
        it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
        remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem
        Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem
        Ipsum.
        <br>
        <br> Why do we use it? It is a long established fact that a reader will be distracted by the readable content of
        a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution
        of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop
        publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem
        ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes
        by accident, sometimes on purpose (injected humour and the like).
        <br>
        <br> Where does it come from? Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in
        a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor
        at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum
        passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem
        Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil)
        by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.
        The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

    </div>
    What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
    industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to
    make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining
    essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,
    and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we
    <br>
    <br> use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking
    at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed
    to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web
    page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites
    <br>
    <br> still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose
    (injected humour and the like). Where does it come from? Contrary to popular belief, Lorem Ipsum is not simply random
    text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock,
    a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur,
    from a Lorem <br>
    <br> Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.
    Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil)
    by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The
    first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.What is Lorem Ipsum?
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard
    dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen
    book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
    It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently
    with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we.


No comments:

Note: Only a member of this blog may post a comment.

Copyright Reserved to Anything Learn. Powered by Blogger.