HTML/CSS Service

XHTML vs. HTML

Category: CSS Tutorials    |    773 views    |    Add a Comment  |   

 

I know that many people still use HTML 4.01, but with the introduction of XHTML and unending browser updates, it is becoming less popular in favour of this new web standard. This tutorial is just an introduction to XHTML.

Firstly though, what is XHTML?

XHTML is pretty much the same as HTML with several small differences. It stands for Extensible HyperText Markup Language. It is a combination of HTML and XML. As it is a web standard, all new browsers support it and eventually, it will replace HTML. Read more…

Share/Save/Bookmark

 

Write a CSS Syntax

Category: CSS, CSS 2 Tutorial, CSS Examples, CSS Tutorials, CSS3 Tutorial    |    1,037 views    |    Add a Comment  |   

 

The syntax for CSS is different than that of (X)HTML markup. Though it is not too confusing, once you take a look at it. It consists of only 3 parts.

selector { property: value }

The selector is the (X)HTML element that you want to style. The property is the actual property title, and the value is the style you apply to that property.

Each selector can have multiple properties, and each property within that selector can have independent values. The property and value are separated with a colon and contained within curly brackets. Multiple properties are separated by a semi colon. Multiple values within a property are sperated by commas, and if an individual value contains more than one word you surround it with quotation marks. As shown below.

body {
  background: #eeeeee;
  font-family: “Trebuchet MS”, Verdana, Arial, serif;
}

As you can see in the above code I have separated the color from the font-family with a semi-colon, separated the various fonts with commas and contained the “Trebuchet MS” within quotations marks. The final result sets the body color to light grey, and sets the font to ones that most users will have installed on there computer. Read more…

Share/Save/Bookmark

 

CSS Margins Examples

Category: CSS, CSS 2 Tutorial, CSS Tutorials, CSS3 Tutorial    |    401 views    |    Add a Comment  |   

 

As you may have guessed, the margin property declares the margin between an (X)HTML element and the elements around it. The margin property can be set for the top, left, right and bottom of an element. (see example below)

  margin-top: length percentage or auto
  margin-left: 
length percentage or auto;
  margin-right: 
length percentage or auto;
  margin-bottom: 
length percentage or auto;

As you can also see in the above example you have 3 choices of values for the margin property

  • length
  • percentage
  • auto

You can also declare all the margins of an element in a single property as follows: Read more…

Share/Save/Bookmark

  • No Related Post