Cory's profile picture

Published by

published
updated

Category: Art and Photography

🖥 CSS Snippets: Put Things In Scroll Boxes

OK, let's make some things that are generally long scroll so your page isn't as long!

Your Comments Section
This is CSS. It should go with the rest of your CSS styles.

.comments-table{
display: block;
height: 200px;
overflow-y: scroll;
}

Any Text Box
This is HTML, to make a scroll box wherever you'd like. Change the Background Color to the hex color of your choice, and the Color (the font color) to the hex color of your choice.

<div style="height:200px;overflow-y:scroll;background-color:#000000;color:#FFFFFF;">
Anything you'd like to put in here, including images or text.
</div>

Remember: always put any CSS in between two Style tags: <style></style> That way, browsers will recognize that what you're trying to do is adjust the style. Also remember that CSS stands for Cascading Style Sheets, so the browser will activate styles from top to bottom!


74 Kudos

Comments

Displaying 2 of 2 comments ( View all | Add Comment )

ciderpies

ciderpies's profile picture

do you know how to change the font in the scrollboxes?


Report Comment

celinedion

celinedion's profile picture

I have successfully adjusted the style as per the command you instructed. I built mapquest driving directions and the command was executed.


Report Comment