Create a CSS Syntax file

How to Put CSS file in (X)HTML ?

In general there are 3 ways to put the CSS into the HTML code:
- Inline Style Sheet
- Internal Style Sheet
-E xternal Style Sheet

At this point you have some choices of how to use the CSS, either inline, internally or externally.

The following is an explanation of each formation…

  • First:  Inline Stylesheet is put, or give property directly into the HTML tag that is between <body>……</body>.
    example:
<body>
<p style="color:#ff0000">Belajar CSS</p>
</body>
  • Second: Internal Stylesheet CSS element is put between STYLE tags in the HEAD tag.
    example:
<head>
<style type="text/css">
p {color:#ff0000;}
</style>
</head>
  • Thrid: External Stylesheet can be placed outside the HTML file, save the elements by css on a separate file with the extension “.css”

Example: make the code like below and save the file named style.css

p {color:#ff0000; font-size:18px;}

If you want to display all the information in the style.css files into HTML, you must call the file with a link type his name among the LINK tag in the HEAD tag.
Example:

<head>
<link href="style.css" type="text/css" rel="stylesheet"/>
</head>

Among the three ways above, in general, more web developers use for 3 ways to file management easier.

With external css, you just need to edit one file only, and will be a change on many web pages that use styles.

  • Welcome to CSS Syntax [dot] com
    Welcome to our Website ... CSS Syntax com is a website that explains about anything related to web...
    www.csssyntax.com
  • CSS 3 Background Color Opacity
    Everyone knows what RGB stands for (red, green, blue), but what does the A stand for?
    www.csssyntax.com
  • CSS 3 Text Shadow
    Using CSS3, we can create shadow effects on text with very simple syntax
    www.csssyntax.com
  • CSS 3 Box Shadow
    Excess CSS3 is able to make something that can not be done by CSS2
    www.csssyntax.com