56
INTRO TO CSS PRESENTED BY WPPITTSBURGH.COM HOW TO MAKE SIMPLE EDITS TO CUSTOMIZE THE LOOK AND FEEL OF YOUR WEBSITE

Intro to CSS Presentation

Embed Size (px)

Citation preview

Page 1: Intro to CSS Presentation

INTRO TO CSS

PRESENTED BY WPPITTSBURGHCOM

HOW TO MAKE SIMPLE EDITS TO CUSTOMIZE THE LOOK AND FEEL OF YOUR WEBSITE

WHAT IS CSSbull CSS is the abbreviated term for ldquoCascading Style Sheetrdquo

bull The code found within your themersquos CSS file determines the appearance of your site by applying style rules to HTML content which has no style of its own

CSS vs HTMLbull Think of CSS as ldquoclothingrdquo and the HTML as the ldquomannequinrdquo

bull CSS controls things such as colors spacing layout mobile-shy‐responsiveness and more

bull HTML is the sitersquos structure

bull We can change the ldquoclothingrdquo anyIme without affecIng the structure of the site

PHOTO CREDIT PIXABAYCOM

This is the Twenty-shy‐Twelve WordPress Theme

With a few lines of custom CSS and a few images we can easily customize different elements of the website

LEARNING THE LINGOCSS can be made easier to understand by breaking down each ldquosentencerdquo into itrsquos individual components

Here is an example of a common CSS declaraIon as well as a diagram of what each CSS component is made of

bull The SELECTOR is what element of the website we want to change

bull The PROPERTY is what we want to change about it

bull The VALUE is what we are changing

HOW TO EDIT THEME CSS It is important that you take care howwhere you edit the CSS in your theme as you do not want to overwrite your changes with any theme updates and risk losing all of your hard work

Opon A Create a Child Theme

A child theme inherits the files of the parent theme but allows you to make changes to the theme files without risk of these changes being lost in theme updates Learn more about child themes here

hXpscodexwordpressorgChild_Themes

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 2: Intro to CSS Presentation

WHAT IS CSSbull CSS is the abbreviated term for ldquoCascading Style Sheetrdquo

bull The code found within your themersquos CSS file determines the appearance of your site by applying style rules to HTML content which has no style of its own

CSS vs HTMLbull Think of CSS as ldquoclothingrdquo and the HTML as the ldquomannequinrdquo

bull CSS controls things such as colors spacing layout mobile-shy‐responsiveness and more

bull HTML is the sitersquos structure

bull We can change the ldquoclothingrdquo anyIme without affecIng the structure of the site

PHOTO CREDIT PIXABAYCOM

This is the Twenty-shy‐Twelve WordPress Theme

With a few lines of custom CSS and a few images we can easily customize different elements of the website

LEARNING THE LINGOCSS can be made easier to understand by breaking down each ldquosentencerdquo into itrsquos individual components

Here is an example of a common CSS declaraIon as well as a diagram of what each CSS component is made of

bull The SELECTOR is what element of the website we want to change

bull The PROPERTY is what we want to change about it

bull The VALUE is what we are changing

HOW TO EDIT THEME CSS It is important that you take care howwhere you edit the CSS in your theme as you do not want to overwrite your changes with any theme updates and risk losing all of your hard work

Opon A Create a Child Theme

A child theme inherits the files of the parent theme but allows you to make changes to the theme files without risk of these changes being lost in theme updates Learn more about child themes here

hXpscodexwordpressorgChild_Themes

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 3: Intro to CSS Presentation

CSS vs HTMLbull Think of CSS as ldquoclothingrdquo and the HTML as the ldquomannequinrdquo

bull CSS controls things such as colors spacing layout mobile-shy‐responsiveness and more

bull HTML is the sitersquos structure

bull We can change the ldquoclothingrdquo anyIme without affecIng the structure of the site

PHOTO CREDIT PIXABAYCOM

This is the Twenty-shy‐Twelve WordPress Theme

With a few lines of custom CSS and a few images we can easily customize different elements of the website

LEARNING THE LINGOCSS can be made easier to understand by breaking down each ldquosentencerdquo into itrsquos individual components

Here is an example of a common CSS declaraIon as well as a diagram of what each CSS component is made of

bull The SELECTOR is what element of the website we want to change

bull The PROPERTY is what we want to change about it

bull The VALUE is what we are changing

HOW TO EDIT THEME CSS It is important that you take care howwhere you edit the CSS in your theme as you do not want to overwrite your changes with any theme updates and risk losing all of your hard work

Opon A Create a Child Theme

A child theme inherits the files of the parent theme but allows you to make changes to the theme files without risk of these changes being lost in theme updates Learn more about child themes here

hXpscodexwordpressorgChild_Themes

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 4: Intro to CSS Presentation

This is the Twenty-shy‐Twelve WordPress Theme

With a few lines of custom CSS and a few images we can easily customize different elements of the website

LEARNING THE LINGOCSS can be made easier to understand by breaking down each ldquosentencerdquo into itrsquos individual components

Here is an example of a common CSS declaraIon as well as a diagram of what each CSS component is made of

bull The SELECTOR is what element of the website we want to change

bull The PROPERTY is what we want to change about it

bull The VALUE is what we are changing

HOW TO EDIT THEME CSS It is important that you take care howwhere you edit the CSS in your theme as you do not want to overwrite your changes with any theme updates and risk losing all of your hard work

Opon A Create a Child Theme

A child theme inherits the files of the parent theme but allows you to make changes to the theme files without risk of these changes being lost in theme updates Learn more about child themes here

hXpscodexwordpressorgChild_Themes

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 5: Intro to CSS Presentation

With a few lines of custom CSS and a few images we can easily customize different elements of the website

LEARNING THE LINGOCSS can be made easier to understand by breaking down each ldquosentencerdquo into itrsquos individual components

Here is an example of a common CSS declaraIon as well as a diagram of what each CSS component is made of

bull The SELECTOR is what element of the website we want to change

bull The PROPERTY is what we want to change about it

bull The VALUE is what we are changing

HOW TO EDIT THEME CSS It is important that you take care howwhere you edit the CSS in your theme as you do not want to overwrite your changes with any theme updates and risk losing all of your hard work

Opon A Create a Child Theme

A child theme inherits the files of the parent theme but allows you to make changes to the theme files without risk of these changes being lost in theme updates Learn more about child themes here

hXpscodexwordpressorgChild_Themes

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 6: Intro to CSS Presentation

LEARNING THE LINGOCSS can be made easier to understand by breaking down each ldquosentencerdquo into itrsquos individual components

Here is an example of a common CSS declaraIon as well as a diagram of what each CSS component is made of

bull The SELECTOR is what element of the website we want to change

bull The PROPERTY is what we want to change about it

bull The VALUE is what we are changing

HOW TO EDIT THEME CSS It is important that you take care howwhere you edit the CSS in your theme as you do not want to overwrite your changes with any theme updates and risk losing all of your hard work

Opon A Create a Child Theme

A child theme inherits the files of the parent theme but allows you to make changes to the theme files without risk of these changes being lost in theme updates Learn more about child themes here

hXpscodexwordpressorgChild_Themes

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 7: Intro to CSS Presentation

bull The SELECTOR is what element of the website we want to change

bull The PROPERTY is what we want to change about it

bull The VALUE is what we are changing

HOW TO EDIT THEME CSS It is important that you take care howwhere you edit the CSS in your theme as you do not want to overwrite your changes with any theme updates and risk losing all of your hard work

Opon A Create a Child Theme

A child theme inherits the files of the parent theme but allows you to make changes to the theme files without risk of these changes being lost in theme updates Learn more about child themes here

hXpscodexwordpressorgChild_Themes

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 8: Intro to CSS Presentation

HOW TO EDIT THEME CSS It is important that you take care howwhere you edit the CSS in your theme as you do not want to overwrite your changes with any theme updates and risk losing all of your hard work

Opon A Create a Child Theme

A child theme inherits the files of the parent theme but allows you to make changes to the theme files without risk of these changes being lost in theme updates Learn more about child themes here

hXpscodexwordpressorgChild_Themes

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 9: Intro to CSS Presentation

If creaIng a child theme is not the right soluIon for you or you would like a simple way to edit CSS quickly and easily you can use a plugin which is what we will demonstrate today

Opon B JetPack Plugin

The JetPack plugin provided by WordPresscom offers a number of features You can install it from the WordPressorg plugin directory or from within your WordPress dashboard

Learn more about JetPack here hXpjetpackme

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 10: Intro to CSS Presentation

TO ACTIVATE CUSTOM CSS IN JETPACK

Navigate to JetPack WordPress Dashboard Menu

Click on ldquoSe^ngsrdquo

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 11: Intro to CSS Presentation

Next hover over the ldquoCustom CSS Modulerdquo and click on ldquoAcIvaterdquo

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 12: Intro to CSS Presentation

You will now see the opIon ldquoEdit CSSrdquo under the ldquoAppearancerdquo secIon of the menu

IMPORTANT NOTE

Below Edit CSS is the link for ldquoEditorrdquo which will take you to the editor for ediIng core theme files It is VERY important that you do not edit this secIon unless using a child theme as all of your changes may be lost when the theme is updated

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 13: Intro to CSS Presentation

WE ARE NOW READY TO EDIT CSS

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 14: Intro to CSS Presentation

STEP 1 FINDING YOUR THEMErsquoS STYLES

For todayrsquos exercises we are going to use and modify the exisIng CSS of the Twenty Twelve WordPress theme Using an exisIng theme can someImes be easier than coding from scratch

In order to make changes to the CSS we need to find the selector we wish to change first

The easiest ways to do this are through the developer tools available in Google Chrome or Mozilla Firefox

Today we will be using Google Chrome

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 15: Intro to CSS Presentation

To launch the Inspector in Chrome all you need to do is right-shy‐click on the element you wish to change and choose ldquoInspect Elementrdquo

Try It

Click on Your Site Title Right Click and Choose ldquoInspect Elementrdquo from the Drop Down menu

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 16: Intro to CSS Presentation

You will see the HTML markup and the CSS Styles on the screen

Source Code CSS Styles

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 17: Intro to CSS Presentation

Here is a closer view of the CSS style for the site tle

In this instance the SELECTORS are site-shy‐header h1 a site-shy‐header h2 a

The PROPERTIES are color display and text-shy‐decoraIon

And the VALUES of these properIes are 515151 inline-shy‐block and none

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 18: Intro to CSS Presentation

EXERCISE 1 MODIFYING FONTS

For this exercise we will be making changes to the blog Itle text found at the top of blog arIcles on your site To locate the CSS for this element right click on any blog Itle on your test sitersquos home page

Next choose the Inspect Element opIon which will launch your browserrsquos developer tools

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 19: Intro to CSS Presentation

The TOP of the browser window is your SITE

The BOTTOM LEFT is the HTML of the site

The BOTTOM RIGHT is where you find your CSS STYLES

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 20: Intro to CSS Presentation

We can make changes right in our browser window to preview what the new style may look like These changes are ONLY TEMPORARY -shy‐ in order to apply them to your site you must place the code in the ldquoEdit CSSrdquo code editor provided by the JetPack plugin

Look for this snippet of code in the CSS Styles Window

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 21: Intro to CSS Presentation

In this example right now the only styling for the Blog Post Titles is that there is no underline underneath the link

We can edit this code in our browser window to change the font-shy‐size font-shy‐weight and font-shy‐style

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 22: Intro to CSS Presentation

Click on the CSS box and create a new line of properIes

The First Property we will be adding is Font-shy‐Size

Type Font-shy‐Size then hit tab to enter ldquo40pxrdquo

Next hit enter and type Font-shy‐Weight hit tab type in ldquoboldrdquo and press ldquoEnterrdquo

Lastly type ldquoFont-shy‐Stylerdquo hit tab type in ldquoitalicrdquo and hit enter

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 23: Intro to CSS Presentation

Here is what your screen should look like

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 24: Intro to CSS Presentation

Select this code and ldquoCopyrdquo to your clipboard so you can paste it into the Jetpack Custom CSS Editor

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 25: Intro to CSS Presentation

Navigate to your WordPress Dashboard and Select ldquoAppearance -shy‐gt ldquoEdit CSSrdquo

Paste the code into the Custom CSS Editor and click the blue ldquoSave Stylesheetrdquo BuXon to save your changes

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 26: Intro to CSS Presentation

Our Blog Titles Now Look Like This

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 27: Intro to CSS Presentation

EXERCISE 2 BACKGROUND COLORS AND PADDING

For this exercise we will change the background color of the sIcky post from white to blue using background colors and padding

A ldquosIcky postrdquo in WordPress is a post which ldquosIcksrdquo or stays at top on the front page of the blog

This is a great way to place a welcome message special announcement or other informaIon that does not change frequently and draw aXenIon to it for your website visitors

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 28: Intro to CSS Presentation

To get started first select the ldquoFeatured Postrdquo secIon and right-shy‐click to launch the Inspector in Google Chrome

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 29: Intro to CSS Presentation

We are going to be doing something else to our sIcky posts so hide this feature by simply adding the following rule

displaynone

This causes the ldquoFeatured Postrdquo element to no longer be displayed s for this element are already in the themersquos CSS we only need to add our custom declaraIon

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 30: Intro to CSS Presentation

Because this change is only in the inspector we will again need to copy this into our JetPack CSS editor in the Dashboard Unlike last Ime though we can simplify this to only include the rule we added like so

Doing this keeps our custom CSS from ge^ng too bloated Since the other styles for this element are already in the themersquos CSS we only need to add our custom declaraIon

arIclesIcky featured-shy‐post display none

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 31: Intro to CSS Presentation

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

Now letrsquos style the SIcky Post itself Find and highlight the long line on the HTML pane in the inspector that says

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 32: Intro to CSS Presentation

You will noIce that when you highlight this line of code there isnrsquot any matching CSS we can use to style this sIcky post The only one displayed is site-shy‐content arIcle when ideally we would be looking for a style with sIcky in it

The good news is we can use the inspector to add new styles to our site

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 33: Intro to CSS Presentation

To Add a new style to your site -shy‐ click on the ldquo+rdquo icon to add a new style rule

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 34: Intro to CSS Presentation

You will noIce that when the new declaraIon is created in the inspector it shows the selector as

articlepost-shy‐4

However that is not quite what we want If leo as-shy‐is this style rule would only apply to arIcles with an ID that is equal to ldquo4rdquo which is the exact post we are on as it is the 4th post we have created on our test site

In this case we will need to create a new style declaraIon on our own rather than use one that exists already

We can get around this by modifying the selector to instead say arIclesIcky which in plain English works out to something like ldquoApply this rule to all arIcles that have the class equal to ldquosIckyrdquo which means this post plus any sIcky posts we make in the futurerdquo

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 35: Intro to CSS Presentation

Click on the selector to change it to arIclesIcky

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 36: Intro to CSS Presentation

ID vs Class

You may noIce while working with CSS some selectors have a ldquordquo in front of them and some have a ldquordquo in front of them This is used to denote if there is an ID or a class associated with this HTML element Letrsquos look at the original HTML that was highlighted in our inspector

arIcle id=post-shy‐4 class=post-shy‐4 post type-shy‐post status-shy‐publish format-shy‐standard sIcky hentry category-shy‐uncategorized

In this case you would add a ldquordquo in front of post-shy‐4 because in the original markup it appears as id=rdquopost-shy‐4ʺPrime whereas we added a ldquordquo in front of sIcky because it appears as class=rdquosIckyrdquo in the original markup

In most cases IDs are used for non-shy‐repeaIng secIons of a website such as header navigaIon or footer -shy‐ classes are used for the majority of the other elements which may repeat for easier styling

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 37: Intro to CSS Presentation

Now that we have created our new selector letrsquos add some styles to it Start by applying the following background color

background D0EAF3

This will give us a screen that looks like this

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 38: Intro to CSS Presentation

If you want to experiment with the color a bit you can click on the Iny swatch next to the hex code D0EAF3 which will bring up a color mixer tool

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 39: Intro to CSS Presentation

Since the original theme CSS files did not include a background color you will see the text and the image go all the way to the edge of the box The way to fix this is to add some padding

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 40: Intro to CSS Presentation

To add padding type this in the Inspector Window right below the background declaraIon

padding 20px

Now our screen will look like this

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 41: Intro to CSS Presentation

REMEMBER Styles entered in the Inspector Window are NOT permanent and will disappear when the page is refreshed

Letrsquos copy our style as we did in the previous exercise and paste into the JetPack Custom CSS Editor and save our changes

Now refresh your browser window and admire your work

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 42: Intro to CSS Presentation

EXERCISE 3 SITE TITLE AND BACKGROUND IMAGE

Our final exercise is to change the site Itle to an image logo and to create a background image This is an easy way to add your own custom branding to your website

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 43: Intro to CSS Presentation

CHANGING THE HEADER BACKGROUND IMAGE

To change the header background image in the Twenty Twelve theme we need to first upload our image to the media folder Click on ldquoAdd Newrdquo to drop or select a file for uploading In our resources available to download

we have included an image for you to use as your background

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 44: Intro to CSS Presentation

Once uploaded copy the link for the image which is located in the top right as the URL field

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 45: Intro to CSS Presentation

For this exercise click on the element of the HTML highlighted below This will bring up the body site class to be styled in the inspector

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 46: Intro to CSS Presentation

Add the following to the line below

background url(lsquohXpyourimagelinkherejpgrsquo)

Paste the URL of the image you uploaded to replace hXpyourimagelinkherejpg

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 47: Intro to CSS Presentation

Currently the image is Iling along the page Since the image is designed to fade to white letrsquos add a bit of code to this

FFF url(lsquohXpyourimagelinkherejpg) no-shy‐repeat

The FFF declares the background will be white and the no-shy‐repeat aoer the URL declares the image should only appear once

Copy the code to your clipboard and paste in the JetPack Custom CSS Editor and save your changes

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 48: Intro to CSS Presentation

Here is what our custom CSS file looks like so far

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 49: Intro to CSS Presentation

Our final step is to add a logo Once again go to the Media Library and upload or select your logo image and copy the URL

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 50: Intro to CSS Presentation

We are going to add the logo just as we did the custom header background image

Click on the Site Title and Inspect Element Add the following code to the site-shy‐header h1 a site-shy‐

header h2 a selectors

background url(hXpmycustomlogolinkpng) top leo no-shy‐repeat

In this example we are adding ldquotop leo no-shy‐repeatrdquo to the value to state we only want the image to appear in the top

leo of the website and to not repeat across the page Be sure to replace hXpmycustomlogolinkpng with the

URL you copied in the previous step

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 51: Intro to CSS Presentation

Right now our logo looks something like this

We can make this look much beXer by adding just a few addiIonal properIes

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 52: Intro to CSS Presentation

Add this line of code

text-shy‐indent -shy‐9999px

Hiding the Site Title Text

In our earlier example when we wanted to hide an element we used ldquodisplaynonerdquo However you need to display the Itle of your site to make it user-shy‐friendly and accessible to those who may be using a screen reader or other method for using the internet

So in this instance we are going to indent the text by -shy‐9999px which will move it off the screen but sIll make it accessible by those who may need the text version of the site Itle

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 53: Intro to CSS Presentation

height 100px width 440px

Lastly we need to make the ldquoboxrdquo for the logo space to fit the dimensions of the logo This can be achieved simply by declaring a height and width Add this to the code you have so far

Copy your changes and paste into the JetPack Custom CSS Editor

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 54: Intro to CSS Presentation

OUR FINAL PRODUCT

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 55: Intro to CSS Presentation

QuesEons Want to Learn More

Connect with us

hMpwppiMsburghcom

hMpswwwfacebookcomgroupswppiMsburgh

hMptwiMercomwppgh

hMpwwwmeetupcomPiMsburgh-shy‐WordPress-shy‐Developers-shy‐Designers

Page 56: Intro to CSS Presentation