HTML
CSS
JavaScript
jQuery
PHP
SQL
WordPress
HTML Tutorials

Overview

With CSS you can control the colors, background images, font choice, text size, spacing, positioning, overall page layout for all screen sizes, and more.

CSS can be added to an HTML document in 3 ways:

Inline CSS

This is the least desirable way to include CSS styling in your document, because there can be many pages to a site, and hundreds, if not thousands of HTML elements, finding and updating the inline styles can be a nightmare.

				
					<p style="color: red;">A paragraph with red text.</p>
				
			

Multiple style rules can be included in on element as long as each rule is ended with a semi-colon.

				
					<p style="color: red; font-size: 16px;">A paragraph with red text.</p>
				
			

Placing Styles in the Head of the Document

While more desirable than placing style inline, this is still not the best way to style a page. A typical site may have hundreds of pages and going through each to update an element’s style will prove tedious at best.

				
					<head>

<title>HTML Template</title>


<!-- styles -->
<style>
    #primary {
        color: red;
        font-size: 18px;
    }
    #secondary {
        margin-top: 35px;
    }
</style>

</head>
				
			

Linking to External Style Sheets

This is the much preferred method for stying the elements on the page, as all the rules can be found in only a few locations and will be easier to update.

				
					<head>

<meta charset="UTF-8">
<meta name="description" content="Free Web Tutorials">
<meta name="keywords" content="HTML, CSS, JavaScript, PHP, SQL">
<meta name="author" content="1SMARTchicken">
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<title>HTML Template</title>


<!-- styles -->
<link rel="stylesheet" type="text/css" href="/docs/style.css">
<link rel="stylesheet" type="text/css" href="/docs/sidebar-styles.css">

</head>
				
			

We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.

HTML
CSS
JavaScript
jQuery
PHP
SQL
WordPress

Why 1SMARTchicken?

This site was built and is maintained to benefit my autistic son.
See More →

My Son's Name is Johnny

He was diagnosed as autistic quite late, at age four...
His story

Buy Me a Coffee

Thanks for your support!

Feedback

If you see an error on the page or the code itself is incorrect or incomplete, or just plain wrong, please let us know. We’re always learning. NOTE: we do not sell your information and will not send you spam emails.