What Is CSS: What Can It Do For My Blog?

Posted by Neville on July 6, 2011 under How To, Training | Comments are off for this article

CSS: Cascading Style Sheets.

These provide an opportunity to format a website with a common format and design. Until the introduction of CSS the command for adding different styles to a page had to be produced for each different element on the page. That meant that each time you wanted to change the text to bold or italic or some other style it meant using the open and close tags each time.

With CSS these properties can be stored once and then called on with a simple instruction as many times as needed. This gives a simpler and cleaner page for the browser to read, not cluttered with a large number of instructions, many of which are repeated often.

There are 3 ways in which CSS can be used in a web page and some of these can also be adapted to use inĀ  a blog such as this one.

Those 3 CSS types are:

  • External Stylesheet: where the elements, properties and values for using on the page are stored in a separate file. That file has the extension .css. A typical example is the stylesheet for the template for this blog: stylesheet.css
  • Internal Stylesheet: Here the elements, properties and values are stored in the head part of the HTML file that produces the page.
  • Inline Style: The properties and values are declared directly in a HTML element in the body of the code for the page.

The Cascade part of CSS.

This describes the priority given to each type of stylesheet that can be used in a HTML file.

If there is any Inline style for an element, that takes the greatest priority, and will be executed. Any other style type will be ignored.

If there is no Inline style, the browser will cascade down to any Internal Styles that may have been set.

For any elements that have neither of the above, the browser will then use the External Stylesheet (if there is one) for taking properties and values.

Finally, the fallback position, if there are no styles declared, the page will display with the default settings for the browser being used to display the page.

Now for the answer to the question: What can it do for my blog?

First: If you are comfortable editing the stylesheet that forms the basis for the template that you are using you can add some CSS code to that file, and then call on them in your posts. That will involve using the correct commands in the HTML editing box when you are adding or editing a post. This paragraph has been placed in the box with shadow in this post, using commands from the template’s edited stylesheet.

Second: By using Inline Style you can set the design for individual elements of a post. In this case you would add the style instructions directly into the HTML editing box while adding or editing the post. This paragraph has been placed in the box using this method.

 

So now that you have seen a couple of ways that CSS can add to the design of your blog posts, why not take a look at a couple of earlier post where some CSS has been applied to images. Would you like to know how to do some of these little edits to put a bit of zing into your posts? Keep lookig for some posts that will show How To add CSS to your blog posts or contact me.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Comments are closed.