Learning HTML for Kids!
There are two more style elements I want to cover: text-
You can tell your browser to align your text to the right, to the center and to the left*. It’s all done with the text-
It’s pretty simple. Let’s add it to the code we’ve done so far.
Open style.html. Add the highlighted code listed below.
*Note: You really don’t have to enter text-
Save the file.
Go to where you saved the file and open it.Your browser should look like this. If not, you know what to do–go back and check your code.
The last style we will talk about is background-
Let’s take the code from the page above and add some background color (see highlighted code). By now you should know how to open your style.html file and make the changes.
Save the file again and open it up in your browser to see what it looks like:
If we wanted to change the red title to white, how would you change the code?
Remember that all those punctuation marks are important when you are writing your code. In the Style attribute, you have to remember:
Remember, one missing mark and your page won’t display properly.
Cascade Style Sheets (CSS)
When I originally wrote this tutorial back in 1998 for my son’s fifth-
In the meantime, a group of very smart folks came up with an idea. Why not create a file that contained formatting code that could be used throughout the whole website. Thus, the birth of CSS.
There are three ways to “style” with CSS:
We have already done this in Chapters 11 and 12, by using the style attribute .
You list all your formatting by using the <style> element and placing it in the <head> section of the code.
You can create a separate file and link it to the webpage or website. This is recommended for a multiple-
For more information on CSS go to the Resources page.
Cascade Style Sheets