t. scrollable text boxes + borders

TIRAMISU。 layout tutorials #hiatus

Hello again. So, now that I'm no longer following any of the plans I have previously made for this tutorial thread, I might as well go over random things. In this case, scrollable text boxes! I apologize if this isn't what you guys wanted, but no one said anything about what they wanted to see next, so... yeah.

 

A lot of people have already messaged me asking how I make scrollable text boxes, so I decided that this is a good topic to 'teach.' This is my way of making a scrollable text box, so sorry if it's not the way you make one? Anyways, I'll just go ahead and start.

 

Scrollable text boxes have three parts: the text box, the scrollable part, and the second box(?). Together, these all make a pretty scrollable box, either with a hidden, thin, or large scroll bar. First, we'll learn how to make a basic scrollable text box.

 

Basic Scrollable Text Box

Before making the actual scrollable text box, remember the last tutorial? That's right, I will use the base code to start off with this 'basic scrollable text box' code.

< div style="width:300px;margin:auto;" >
< div style="width:210px;height:160px;padding:20px;float:left;border:1px solid #EEE;" >
< div style="font-family:calibri;font-size:10px;color:#222;text-align:justify;text-transform:uppercase;line-height:11px;" >
< p >Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.< /p >
< /div >

< /div >
< /div >

The second div of this code is the 'text box' of my code, so there is no need to make another box.

 

Before moving on to the next part of this code, here's a mini tutorial on borders.

 

Borders

These are made by using the code:

< div style="width:400px;height:300px;border:1px solid #000;" >

Obviously, the last part of the code is the one thing we need in order to change the border.

The first part changes the width in px, the second part changes the style of the border (solid, dotted, dashed, double, etc), and the third part changes the color.

That's all for this mini tutorial!

 

Here's what we have so far:

 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.

 

Now I will add the 'overflow:auto' to the 'text box' of my code, and it will look like this:

 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.

 

Behold, the text no longer flows out of the box! But there's that scroll bar... (It doesn't really look bad in this case, but let's pretend it looks hideous in order to go on with this tutorial.) It looks horrible! Let's get rid of it.

 

Hidden Scrollbar Text Box

In order to 'remove' the text box you will need two more divs. Well, I use two more, at least. I'll use the same code from above and will bold the new divs.

 

< div style="width:300px;margin:auto;" >
< div style="width:210px;height:160px;padding:20px;float:left;border:1px solid #EEE;overflow:hidden;" >
< div style="width:250px;height:160px;float:left;overflow:auto;" >

< div style="width:210px;float:left;" >
< div style="font-family:calibri;font-size:10px;color:#222;text-align:justify;text-transform:uppercase;line-height:11px;" >
< p >Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.< /p >
< /div >

< /div >
< /div >
< /div >

< /div >
 

 

Okay, so here you can see the two new divs I added, as well as the change in overflow (from auto to hidden) in the second div.

In order to remove the scrollbar, we need to add the 'overflow:hidden' to our 'text box.'

Then, we need to add another div with a width 40px larger than the original text box with an 'overflow:auto.' The reason of this is because the scrollbar's width is 20px and the padding is 20px, therefore the div needs to be 40px greater in order to push the scrollbar out of view.

Now the next div brings back the original width of our text box in order to let the box's contents to be viewed properly, as if the scrollbar wasn't there.

Our box now looks like this:

 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.

 

Ta-da! There is no longer a scrollbar!

 

Thin Scrollbar Text Box

But, what if you want a thin scrollbar? Well, just change the width of the third div to something a bit smaller (about 7px smaller).

< div style="width:300px;margin:auto;" >
< div style="width:210px;height:160px;padding:20px;float:left;border:1px solid #EEE;overflow:hidden;" >
< div style="width:243px;height:160px;float:left;overflow:auto;" >

< div style="width:210px;float:left;" >
< div style="font-family:calibri;font-size:10px;color:#222;text-align:justify;text-transform:uppercase;line-height:11px;" >
< p >Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.< /p >
< /div >

< /div >
< /div >
< /div >

< /div >
 

And it will look like this:

 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.

 

 

 

Now for a free base code:

 

tumblr_ntnyloISmI1udcp56o3_250.png
bkgrnd_zpszvc83hwk.png
USERNAME
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet.

 

That's about all I have for this tutorial. If you have any questions or tutorial requests, don't be afraid to drop down a comment below or pm me about it. Until next time. ^^

Like this story? Give it an Upvote!
Thank you!
eggtion
tiramisu: hey everyone! sorry for not updating! i plan to return later this year and reopen this place with new and revised tutorials. i hope to see you guys when it's released! thank you for your patience! ^^

Comments

You must be logged in to comment
Lost_Pharaoh
#1
Chapter 5: I am still really confused on where to put the codes
aristarchus
#2
Chapter 5: hi !! ahh so glad to hear that you're thinking of returning. this thread has helped me so much,, welcome back :-)
seungjjang
#3
Hi! Your tutorials are easy to understand and helps me with coding in aff..so thank youu<3
And I have a question...do you know why this: https://imgur.com/a/Ajlnx happens?
Just wondering if you've encountered a problem like this.. ouo;
mochiji
#4
ajndaj im glad ur back :')
Iamdead
#5
woHOOo MAyBE Now i cAn uNdErsTAnd SUch a ThInG as CodINg
daNK yOU So mUCh <3
seonho
#6
Chapter 16: i am So Damn Glad ure back
_SakuraRoleplay_ #7
Chapter 15: haaalp~ T.T i'm trying to do that horizontal scroll with bigger size but i can't do it T.T