HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

Chapter 45


Advanced Eye Candy


Contents


45.1 Stop The Background From Scrolling...... 331
45.2 Stretch The Background Image.......... 332
45.3 Scroll Bar....................... 332
45.4 Translucent Background.............. 333
45.5 First Letter Different Style............. 333
45.6 Fancy Characters (Glyphs)............. 333

This chapter is based on student requests. How can I do this or that?
Strictly speaking, the content is not your basic knowledge. It is a bit more
advanced. Not hard, really. But not basic either.


CSS gives us great capabilities to do cool things. This chapter is a collection
of fun things you can do with CSS.


45.1 Stop The Background From Scrolling


When a webpage is big enough, scroll bars appear and you can scroll up and
down to see the hidden parts of the page.


Normally the background scrolls along with the page content. But if you
want it to be fixed and not scroll, you can use this:


background-attachment: fixed;


331

Free download pdf