Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .marquee
	ul.content
		each cont in ['THIS', 'IS', 'A', 'MARQUEE', 'TEXT', 'SCROLL', 'MADE', 'WITH', 'CSS']
			li= cont
		
              
            
!

CSS

              
                $width: 80vw
$height: 20vh
$elNum: 9
$dispNum: 4
$duration: 10s
*, body
	margin: 0
	padding: 0
	box-sizing: border-box
body
	height: 100vh
	display: flex
	justify-content: center
	align-items: center
	.marquee
		width: $width
		height: $height
		background: #000
		color: white
		overflow: hidden
		position: relative
		&:before, &:after
			position: absolute
			top: 0
			width: 10rem
			height: 100%
			content: ""
			z-index: 1
		&:before
			left: 0
			background: linear-gradient(to right, #000 0%, transparent 100%)
		&:after
			right: 0
			background: linear-gradient(to left, #000 0%, transparent 100%)
		.content
			list-style: none
			height: 100%
			display: flex
			animation: scroll $duration linear infinite
			li
				display: flex
				justify-content: center
				align-items: center
				width: $width / $dispNum
				flex-shrink: 0
				font-size: 2rem
				white-space: nowrap
@keyframes scroll
	0%
		transform: translateX(0vw)
	100%
		transform: translateX(calc(-1 * #{($width / $dispNum) * $elNum}))		
@media (max-width: 600px)
	$width: 100vw
	$height: 16vh
	$dispNum: 3
	html
		font-size: 12px
		.marquee
			width: $width
			height: $height
			&:before, &:after
				width: 5rem
			.content
				li
					width: $width / $dispNum
	@keyframes scroll
		0%
			transform: translateX(0vw)
		100%
			transform: translateX(calc(-1 * #{($width / $dispNum) * $elNum}))	
	
              
            
!

JS

              
                let dispNum: number = parseInt( $('.marquee').css('width') ) / parseInt( $('li').css('width') )
for (let i: number = 0; i < dispNum; i++) 
	$('ul li:nth-child(' + i + ')').clone().appendTo(".content")

              
            
!
999px

Console