CSS Crash Course for Fearless Bloggers by Gill Andrews

Similar documents
CSS worksheet. JMC 105 Drake University

Magnetize Your. Website. A step-by-step action guide to attracting your perfect clients. Crystal Pina. StreamlineYourMarketing.com

Welcome Back! Without further delay, let s get started! First Things First. If you haven t done it already, download Turbo Lister from ebay.

A Guide to Blogging on Wordpress

What do we mean by layouts?

SPEED UP YOUR CODING PROCESS HTML INSIGHTS YOU DIDN T KNOW ABOUT. 1

Links Menu (Blogroll) Contents: Links Widget

Building Better s. Contents

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Title and Modify Page Properties

This document provides a concise, introductory lesson in HTML formatting.

Imagery International website manual

The default style for an unordered (bulleted) list is the bullet, or dot. You can change the style to either a square or a circle as follows:

learn programming the right way

Using Dreamweaver CS6

Text Only Version of Lessons

Guidelines for doing the short exercises

Clickbank Domination Presents. A case study by Devin Zander. A look into how absolutely easy internet marketing is. Money Mindset Page 1

CONVERSION TRACKING PIXEL GUIDE

Shane Gellerman 10/17/11 LIS488 Assignment 3

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

Creating Word Outlines from Compendium on a Mac

Managing Content in WordPress

Which is why we ll now be learning how to write in CSS (or cascading sheet style)

In this project, you ll learn how to create your own webpage to tell a story, joke or poem. Think about the story you want to tell.

ASCII Art. Introduction: Python

How to Create a Basic Webpage in WordPress

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube {

8 Web Design Principles to Use IN ELEARNING DESIGN

Classroom Blogging. Training wiki:

Intro to Microsoft Word

Azon Master Class. By Ryan Stevenson Guidebook #7 Site Construction 2/3

Using Dreamweaver CS6

Creating an HTML file (Mac)

Document Formatting with Word

Microsoft Expression Web Quickstart Guide

HOST A GET CODING! CLUB TAKEOVER

Creating an with Constant Contact. A step-by-step guide

Table of Contents. How to use this document. How to use the template. Page 1 of 9

Azon Master Class. By Ryan Stevenson Guidebook #5 WordPress Usage

In this project, you ll learn how to create a webpage for your favourite recipe.

CREATING CONTENT WITH MICROSOFT POWERPOINT

5 R1 The one green in the same place so either of these could be green.

Spam. Time: five years from now Place: England

Website Updates Made Easy

RESPONSIVE WEB DESIGN IN 24 HOURS, SAMS TEACH YOURSELF BY JENNIFER KYRNIN

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

Creating a Brochure in Publisher

Magazine-style websites often have lots of small items on a page. First you re going to create a heading and background for your magazine.

It is written in plain language: no jargon, nor formality. Information gets across faster when it s written in words that our users actually use.

FRONTPAGE STEP BY STEP GUIDE

E , Fall 2007 More with stylesheets

Introduction, Notepad++, File Structure, 9 Tags, Hyperlinks 1

IMPORTANCE OF A MINISTRY WEBSITE

Craigslist Quick Tricks Manual helping you get your ads on Craigslist and getting people to click through to your site or product offer

Introducing Thrive - The Ultimate In WordPress Blog Design & Growth

How To Upload Your Newsletter

Fractions and their Equivalent Forms

Moving from FrameMaker to Blaze: Best Practices

Sitefinity Manual. Webmasters. University of Vermont College of Medicine. Medical Communications

PBWORKS - Student User Guide

Topic: It s A Tab, Tab, Tab, Tab World

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

THE 18 POINT CHECKLIST TO BUILDING THE PERFECT LANDING PAGE

HTML and CSS a further introduction

Creating Your Web Site

HTML&CSS. design and build websites

Tutorial 4. Activities. Code o Editor: Expression Web o Focus : Base Layout, navigation with folders, external stylesheets, Open up Expression Web

Level 5 Digital technologies Chapter 4

This booklet is knowledge of. a web page. of a web page find what you. you want to. SiteSell offers. Introduction

Using Dreamweaver. 4 Creating a Template. Logo. Page Heading. Home About Us Gallery Ordering Contact Us Links. Page content in this area

Seema Sirpal Delhi University Computer Centre

Creating an with Constant Contact. A step-by-step guide

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

Sucuri Webinar Q&A HOW TO IDENTIFY AND FIX A HACKED WORDPRESS WEBSITE. Ben Martin - Remediation Team Lead

Microsoft Office Tips and Tricks

Basic Fiction Formatting for Smashwords in OpenOffice L. Leona Davis. Copyright 2012 L. Leona Davis All Rights Reserved

SharePoint 2010 Site Owner s Manual by Yvonne M. Harryman

Using Dreamweaver CS6

CSCU9B2 Practical 1: Introduction to HTML 5

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

Understanding structure Learning about markup Tags and elements. Structure COPYRIGHTED MATERIAL

In this extension to Build and Publish a website we will look at additional/optional features available in Wordpress, and some more Plug-ins.

PlayerLync Forms User Guide (MachForm)

WHILE YOU RE GETTING ORGANIZED

Copyright 2018 MakeUseOf. All Rights Reserved.

PART COPYRIGHTED MATERIAL. Getting Started LEARN TO: Understand HTML, its uses, and related tools. Create HTML documents. Link HTML documents

Financial Statements Using Crystal Reports

Website Training Guide for Staff

HTML/CSS Lesson Plans

HTML TIPS FOR DESIGNING.

HTML4 TUTORIAL PART 2

Library Website Migration and Chat Functionality/Aesthetics Study February 2013

SASS Variables and Mixins Written by Margaret Rodgers. Variables. Contents. From Web Team. 1 Variables

How To Get Your Word Document. Ready For Your Editor

Fractions and their Equivalent Forms

epromo Guidelines DUE DATES NOT ALLOWED PLAIN TEXT VERSION

Kindle Formatting Guide

Word for Job Seekers. Things to consider while making your resume

Transcription:

CSS Crash Course for Fearless Bloggers by Gill Andrews The main principle of using CSS with HTML... 2 Why not leave all the CSS inside the HTML?... 5 You think you did everything right, but your style is not getting applied!... 6 If there s a lot of coding to do, use Notepad++... 6 A couple of basic styling options you will need... 7 A trick that will save you coding time... 7 A fun fact... 8 A trick that will make testing your styles easier... 8 Fun ideas to use your (first) CSS styles in your next blog post... 9 A challenge for advanced CSS users... 9 Ok, so, HTML and CSS. You ve heard about them, and you admire people who mastered them, but you feel a bit scared to try writing some code yourself. Coding? You? OMG! I can imagine, though, that you did add some CSS to your blog posts. Maybe something like this: But I can imagine that when you noticed that you now have to copy-paste this code every time you want to highlight a sentence, you quickly gave up. That s just too much work! Today, I d like to show you one principle that will let you apply CSS easier and faster, and inspire you to give CSS another try and/or to use it more often. This principle goes by a fancy name Separation of Concerns. Meaning that HTML should do its job, and CSS should do its job, and they should be doing these jobs in separate places. This is how it works. Let s start with our example from above. Here (and everywhere) you want to separate HTML from CSS. Which means HTML tags go in your blog post. CSS styles go in your CSS file, you know, this one: Gill Andrews, http://gillandrews.com 1

Meaning: <p style= font-size:20px; font-weight: bold; text-align: center >This is an important thought.</p> Green stuff - stays in your blog post Yellow stuff moves out to a CSS file. So that this major block get split in two parts (new stuff well, new stuff): In your blog post: <p class= important-thought >This is an important thought.</p> In your CSS file:.important thought { font-size:20px; font-weight: bold; text-align: center } The main principle of using CSS with HTML The main principle is the following 3 steps. Step #1: First, in the source code of your blog post (the HTML you see when you open your blog post in a Text mode, not a Visual mode), make sure that a part of the text you want to style - a paragraph, a sentence or a part of a sentence is enclosed between two tags. Here are some examples: Example 1: Code: What you see: Gill Andrews, http://gillandrews.com 2

(!) Important WordPress thing: Even if you put your paragraphs between <p> </p> tags, WordPress will remove the tags and add an empty line between the paragraphs instead. So if you write this in your post editor: and then switch to Visual view and back to Text view, or save a post and then reopen it, you won t see your <p> tags, but will see this instead: This will also be the case for all of your existing posts. So if you need to apply a style to a paragraph, just add <p> </p> around it and set your style. If there is a style set, WordPress will preserve it (more on setting styles in a second). So out of this: WordPress will make this: Gill Andrews, http://gillandrews.com 3

Example 2: Code: What you see: (The marked part looks the same for now, because we didn t apply any styles to it.) Example 3: Code: What you see: Step #2 Then, you put hooks within the opening tags specifying which style class should apply to the element enclosed between the tags. Let s say you want to highlight something blue, use larger font and make it bold. Gill Andrews, http://gillandrews.com 4

If you want to style a part of a sentence, you need to apply important-thought class on its part like this. Step #3 In your CSS, you specify what exactly important-thought class stands for in terms of styling. And at the end, it looks like this: or like this, if you apply it to a part of a sentence: And that s it, as far as the main principle goes. Why not leave all the CSS inside the HTML? Simple. To be able to change things easier and to avoid mistakes. Because when all your style definitions live in CSS you only specify them once and then can apply them over and over again just by putting class= myclass in HTML. And if you decide to change something, you know where to find it (CSS file), you need to change it only once and you can be sure it will change the style of all the elements that have this style. But if you leave CSS inside of HTML, you ll need to go through it and change, for ex., font size or color on many elements, which takes time and can lead to mistakes. Gill Andrews, http://gillandrews.com 5

You think you did everything right, but your style is not getting applied! Make sure there is only one class attribute on your element. If you need to apply multiple classes, do it like this: Also, it is possible that your style gets overridden by other styles of your website s theme. Use!important to indicate that your style has preference. If there s a lot of coding to do, use Notepad++ For my blog posts, I always use Notepad++, because it makes HTML more readable by adding highlights. I would make all the changes in Notepad++ and then copy the content into the blog post to test how it looks. If you will be using it, make sure you specify the language of the document so that it highlights the text properly. For HTML: For CSS: Gill Andrews, http://gillandrews.com 6

A couple of basic styling options you will need This page offers a nice list of styles based on what you want to do (for ex., remove an underline of your link, change the background of your text, move some text around, etc.) A trick that will save you coding time When you want to apply styles that are almost similar - let s say, you want to have text boxes of different background color - you can make your CSS code shorter and easier to change. For example, instead of doing it like this, repeating a lot of code: Gill Andrews, http://gillandrews.com 7

You can combine the common properties in one definition and specify only what s different. Like this: A fun fact You can specify the colors using words! In fact, every color on the web has a name that you can use the same way as its HEX value. For example, yellow equals to #FFFF00, and red equals to #FF0000. If you d like to learn more, this page lists all the colors by their names. It s actually a practical way to remember colors you use often in your styles, as a name is easier to remember than a HEX value. This has also an advantage that now, if you decide that your text boxes all need a bigger font or a different padding, you need to change it only once. A trick that will make testing your styles easier When I define new styles, I find it to be a pain in the butt working with two files in parallel: Your custom CSS file and your blog post. Every time I need to change a style, I need to change it in CSS file, save it and then preview my blog post again! So I use this hack to make preliminary changes only in one file: You can add a section right in the beginning of your blog post enclosed between <style> </style>. You can now define new styles that will apply to your new blog post right there: Gill Andrews, http://gillandrews.com 8

Forget the red underline WordPress is placing there. It s just jealous of your coding skills. But make sure that you have one class defined on one line and do not have empty lines. Otherwise your styles won t be applied. Now you can change and add styles as you write your blog post. But once you are about to publish your blog post, remove the styles from it and put them where they truly belong in your CSS file. Save the CSS file and preview your blog post again to make sure all the styles have been applied correctly. Fun ideas to use your (first) CSS styles in your next blog post Here are a couple of ideas to use CSS in your next blog post: 1. Make text boxes with different background (my friend Kitty just went bazooka on colored text boxes in her recent blog posts!) 2. Highlight a thought by positioning it in the center and making the font larger. 3. Give your call to action button a different color from what your website theme usually uses. A challenge for advanced CSS users If you are an advanced CSS user, I challenge you to finally fix the WordPress default styling of lists and make this: Gill Andrews, http://gillandrews.com 9

finally look like this: Oh, one more thing Do you think your website can do better but don t know how to make it happen? Check out this ultimate website checklist for solopreneurs and small businesses (the image below is just a part of it). It will take you through a 4-step process of how to drive more sales and clients through your website. Click here to view the full checklist Gill Andrews, http://gillandrews.com 10

About the Author Gill Andrews Gill Andrews is a versatile content creator and web consultant for small businesses and solopreneurs. When she is not writing blog posts or reviewing websites, she is probably running after her toddler son or eating chocolate cake (because reviewing websites and running after toddlers requires a lot of energy). You ll find more tips around running a successful business website on her blog GillAndrews.com Gill Andrews, http://gillandrews.com 11