CSS Articles

3 Suggestions for CSS Beginners

Photo by eelke dekkerStill somewhat new to CSS?  Below are three suggestions to help improve your coding:

1) External, Not Internal

There are three ways to apply CSS styles to your web site:

  1. Use Internal CSS
  2. Use Inline CSS
  3. Use an External Style Sheet

Internal (or “embedded”) CSS is a set of CSS properties specified within the head tags of your page.  For instance, if you want the background of your page to be black, you could do this:

<html>
<head>
<title>My Web Site</title>
<style type="text/css">
body {
          background-color: #000;
}
</style>
</head>

Inline CSS is similar, except that the properties are applied directly to specific elements within the page.  For instance, if you want one paragraph to have a 20px margin above it, you could do this:

<p style="margin-top: 20px">This is my sample paragraph.</p>

Tags: CSS, html, web design, xhtml
Posted in CSS, Design, Web Development | No Comments »