Home
XHTML
CSS
PHP
MySQL
SEO
JavaScript
Computer Basics
Number Systems
LINUX


CSS Tutorials

CSS | Styles | Colors | Type | Classes-IDs | Layout | Properties | Value Types

CSS is the standard language for designing the layout of a webpage. A CSS file is any plain text file named with a .css extension. CSS is coded with XHTML.

External CSS is coded in a separate file with a .css extension. The CSS file is called by the XHTML file. The link is declared within the header element of the XHTML file. The <link /> tag is a self-closing tag that declares the file type and link to the CSS file...

<html>
<head>
<title>Title of Webpage</title>

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

</head>
<body>

<p>This is a paragraph.</p>

</body>
</html>





Internal CSS is coded directly in the XHTML file. CSS styles are coded within the header element of the XHTML file, within the <style> and </style> tags. CSS styles are called by referencing the selected XHTML tag.

<html>
<head>
<title>Title of Webpage</title>

<style type="text/css">

p {property:value;}

</style>

</head>
<body>

<p>This is a paragraph.</p>

</body>
</html>





Inline CSS is coded directly within the body element of the XHTML file independent of any other references. The style attribute declares the property and value of the CSS style, which is coded directly within the selected XHTML tag...

<html>
<head>
<title>Title of Webpage</title>
</head>
<body>

<p style="property:value;">This is a paragraph.</p>

</body>
</html>


External CSS is recommended for websites with several pages. Internal CSS is recommended for websites with fewer pages. Inline CSS is recommended for quick fixes and finishing touches. Inline styles take precedence when CSS methods conflict.




Comments can be added in CSS for notes or reminders. Comments are visible in the source code, but not the browser...

<style type="text/css">

/* This is how to code a single line
   or multi-line comment in CSS */

</script>


For debugging, CSS can be validated at jigsaw.w3.org/css-validator.




SEO Vancouver, Washington
SEO Portland, Oregon
Website Design Vancouver, Washington