CHAPTER#3: ADDING A SCROLLBAR
Mademoiselle; a layout tutorial threadCHAPTER 3: ADDING A SCROLLBAR
This is for Hedupon-san. Actually, I have discussed this in the first chapter but here you go. We are going to use this image of an ulzzang couple <3
First of all, make a box shaped div and enclosed the image in there. This is my code
< div style="float:left;width:200px;height:152px;background-color:fff;overflow:auto" >< div style="float:left;width:200px;height:132px" >< img alt="original.png" src="http://images6.fanpop.com/image/photos/34300000/Ulzzang-Couple-ulzzang-world-34328786-500-331.png" style="width: 200px; height: 132;" />< /div >< /div >
See that boldfaced thing there? That does the magic. This is the current output
For the meantime, you can't see the scrollbar. So then, let's add this code under the second to the last < /div >
< div style="float:left;background-color:800000;width:200px;height:132px" >< /div>
That results into this:
And then let's combine this code with the previous one so it would be:
< div style="float:left;width:200px;height:152px;background-color:fff;overflow:auto" >
< div style="float:left;width:200px;height:132px" >< img alt="original.png" src="http://images6.fanpop.com/image/photos/34300000/Ulzzang-Couple-ulzzang-world-34328786-500-331.png" style="width: 200px; height: 132;" />< /div >
< div style="float:left;background-color:800000;width:200px;height:132px" > < /div >
< /div >
It will look like this:
I'll add some texts.
Couple Name: Here
Whatever
Whatever
REMEMBER: Overflow:auto is the key here. The outer div/foundation of your code should have a smaller height/width than the
actual overall size of it's contents so it will have a scrollbar.
ADVERTISEMENT: Do you like reading angst stories? Try the latest story I've written entitle A JINX IN TIME. Read it here
Comments