Your Ad Here

CSS stylesheet


In the document header, we created a link to a CSS stylesheet. Now, let’s look at that file. The style
definitions for this book are intentionally minimal; only the background color of the document body and
canvas element has been declared. By default, the canvas background color is transparent, which might
be the color you want, but has been changed to white so you can see exactly where the element is
positioned in the document. Here’s the stylesheet for the style.css file:
body {
background-color: #bbb;
}
#canvas {
background-color: #fff;
}
This assumes the document contains an element with an id of 'canvas'. As a document gets more
complicated, so does its stylesheet. The HTML file defines the structure of the document, whereas the
CSS stylesheet defines the style or look of the elements. In general, it’s best to organize your content,
style, and scripts in separate files.

0 comments:

Post a Comment

Popular Posts

Recent posts