Web programming 2 style and CSS Subscribe

Continued from Web programming 1 Html.

The style contains instructions on how the different elements in a page should look on the screen. The browsers do their best to interpret this and paint the elements. For instance, black on white is soo boring, especially if you want to create cool websites, so let's make the background black - that's what the second part if for, we use the CSS for styling:

Hacker Factory

Oops - you can't see a thing can you? You have to realize that computers are pretty silly and only do exactly what we tell them to. This one forgot to change the color of the text, which is now painted black on black...

Hack #1 I'm sure you feel like hacking, since this is the Hacker Factory - so here's a simple hack.

In the example above, press Run to have it run and the box to the right will turn black, yet it will contain some hidden text. To reveal the text, here's the hack: place the mouse inside the box, towards the bottom-right corner. Then press the left button and, while holding it down, drag the mouse towards the top-left corner, to select all the contents of the box.

This will reveal the hidden text. Congratulations - you're a hacker!

Let's fix that, by adding color:yellow; to change the text color:

Hacker Factory

Ok - now we're talking! Let's throw some more elements at that page, in the next lesson.

CSS stands for Cascading Style Sheets - we'll leave the details for later.

Hack #2

Another way to select all content is to click on the box and then press CTRL+A (or the Ctrl and A keys simultaneously) - this works on most browsers.

Continue to Web programming 3 Html content tags.

By: Razie | 2014-06-02 .. 2016-11-07 | Tags: post , html , lesson , hacker.factory |    


See more in: Cool Scala Subscribe

Viewed 305 times ( | Print ) this page.

You need to log in to post a comment!