Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

set default scroll position css

In this CSS example:
* We define a flex nav ul container
* Nav li are displayed in column and are left aligned
* Inside a minimum 400px width area
* The vertical scroll starts at 10rem from the top
* A right border marks the area off

.nav-ul-container {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	position: fixed;
	top: 10rem;
	height: calc(100% - 10rem);
	min-width: 400px;
	overflow-y: scroll;
	border-right: 1px solid var(--light);
}

// Adding the CSS snippet below will hide the scrollbar
// https://caniuse.com/?search=%3A%3A-webkit-scrollbar

.nav-ul-container::-webkit-scrollbar {
	width: 0;
	background: transparent;
}

.nav-li {
	line-height: 1.2;
	margin: 20px;
	list-style: none;
}
 
PREVIOUS NEXT
Tagged: #set #default #scroll #position #css
ADD COMMENT
Topic
Name
4+2 =