Tuesday, March 9, 2010

The EASIEST Way to Display Code in Your Blog Posts

I've tried several different ways to do this, as you can see HERE and HERE. I've been able to get both ways to work sometimes, but not all the time. It bugs the heck out of me!

I finally found a way to do it at BlogPandit. It seems to work really well.

  1. Get your code ready. I like to use Wordpad or TextEdit to type the code. It's cleaner than Word and doesn't try to do things to the quote marks.

  2. Go to Blogcrowds and paste your code into the box. Click the Parse button. Copy the code.

  3. Go to you blog post and paste the code in. Then highlight the code text and click the Blockquote button (the one that looks like quote marks).

  4. You can play around with your blockquote code in your html template, if you know how.
Here's a link to how it displays.

More on tweaking the blockquote code in the future. Just wanted to get the basic details here before I forgot how I did it.


---------
©Karlene Browning, Karlene's Cheat Sheet.

Friday, January 29, 2010

Make a Cartoon of Yourself

I've tried a couple of sites that let you cartoon yourself and the one I like best is mywebface.com.

It's very easy to use, simple instructions, gives you lots and lots of options, and lets you download the image to your computer in several variations.


This is a full-size cartoon of me.


Here is the head shot.

A couple of things you should know:
  • If you want to reaccess your image (and you will), you DO want to register and set up an account.

  • You'll have to agree to place their toolbar on your browser. This is not a big deal. It doesn't replace your current toolbar, it adds one beneath it.

  • When you add the toolbar, it will change your current default search engine to theirs. This is also not a big deal. You can easily change it back using the image icon up by your search field.

You can easily add your cartoon to Facebook, Twitter, IM, etc. They have buttons that will do it for you, or you can download it to your computer, then upload it to the various places you need an icon/avatar.

---------
©Karlene Browning, Karlene's Cheat Sheet.

Friday, November 27, 2009

Image with URL Link

Use this basic code to post an image and have the image link to a URL address.
<a href="http://URL linking to"><img src="http://URL of image" /></a>

For example, use the following code. . .
<a href="http://customscentsonline.blogspot.com/2008/05/win-1-dram-bottle-of-your-favorite.html"><img src="http://i177.photobucket.com/albums/w213/rakrose/TwilightAnime.gif" /></a>

To create this:



If you want to center it in the post or sidebar, add
<div align="center">

at the beginning of your code and
</div>

at the end of your code to create this:





---------
©Karlene Browning, Karlene's Cheat Sheet.

Monday, June 8, 2009

Displaying HTML Code within Your Post (the Better Way)

If you've ever tried to show code within your post by just typing it in, you know it doesn't work. The code gets interpreted and will do whatever it is you're trying to show.

I've posted instructions for getting code to display in a very simple and easy way HERE.

However, I prefer this method because I like to make mine look pretty and match my blog colors.



Adding Code for Code Box Display
First, you need to add some code to your html template.
  1. From the your Blogger dashboard, click on the Layout link for the blog you want to work on, or if you're already in that blog, click on the Layout tab.

  2. Click on the Edit HTML link.

  3. Press CNTRL + F to bring up a Find file at the bottom of your page and type in blockquote. Click the Next Arrow until you find the code below.

    OR

    Scroll down until you find this code:
    .post blockquote p {
    margin:.75em 0;
    }
  4. Hit ENTER to go to a new line. Then copy the code below and paste it into your template's HTML.
     pre.code {
    width: 100%;
    overflow: auto;
    /*overflow:-moz-scrollbars-horizontal;
    overflow-x:scroll;*/
    border: 1px dotted #281;
    border-left: none;
    background-color: #fff;
    padding-bottom: 16px;
    font-size: 1em;
    }

    code {
    font: 1.1em 'Courier New', Courier, Fixed;
    }


  5. Hit ENTER again to make another new line.

  6. Save your template.

This creates the template code that will control how your code displays within your post.



Customizing Code Box Display
Next you can make adjustments to the way your code box displays in your post.
  1. Change the width of your code box by changing 100% to whatever you want it to be. My code box is set to 70% because I want it to be less wide than the regular text.

  2. If you want your box to be set in a bit on the left side, like mine is, add this line of code under the width code:
       margin-left:15px;  
    The 15px tells it how much to be set in from the left side. If you want it to be set in more, increase it to 20px or more; if less, decrease the number to 10px or less.

  3. border: controls the look of the border around our code box.

    To change the border size, change 1px to 3px to make it bigger or 0px to have no border.

    To change the border style, change dotted to solid.

    To change the border color, change #281 to any color you want. Example: #fff to make it white; or replace it with a variable like $bordercolor

  4. To change the back-ground color, replace #fff to whatever color code you want it to be; example: #FEFCF3 to make it creamy pink, like mine or you could replace it with a variable, like $bgcolor.

  5. padding controls the space between the edges of your code box and the text inside. To change the space, change 15px to whatever you want; example: 10px to make it smaller.

  6. font-size controls the size of the font. To make it bigger, change 1em to whatever you want; example: 2em to make it larger.

  7. You can change the display font to something other than Courier if you want, but people are used to seeing that font for code, so I recommend leaving it as is.

  8. color controls the color of the font. This code is set to a variable description to match the color of your post text. You can change it to whatever you want by replacing $textcolor with any color code; example: #000000 will make it black.

  9. Once all your adjustments are made, Save your template.
After the "code" code is installed in your template and your customized changes are complete, all code posted in your blog posts will take the characteristics you've defined above.



Putting Code in Your Post
Next, put the actual code you want to show in your post.
  1. Within Blogger, click on the Posting tab, then the Create link.

  2. Click on the Html tab on the top right corner of your post box.

  3. Type the following code into your post*, wherever you want it to display:

  4. It displays like this:
     --TYPE YOUR CODE HERE--  
  5. Save your post.


*The only time this doesn't work is when you're trying to display the code for the code box. Then you have to use an image.


---------
©Karlene Browning, Karlene's Cheat Sheet.

Displaying HTML Code within Your Post (the Easy Way)

Have you ever tried to show code within your post? If you just type in the code, it doesn't work because the code will be interpreted and do what you're trying to display.

Here's an easy way to display code within your blog post.
  1. Within Blogger, click on the Posting tab, then the Create link.

  2. Click on the Html tab on the top right corner of your post box.

  3. Type the following code into your post*, wherever you want it to display:


  4. It displays like this:

  5. --Type Your Code Here--


  6. Make adjustments to the display.
  • If you want a thicker border, change the 1px to 2px or more.
  • If you want no border, change the 1px to 0px.
  • If you want a solid line, change dotted to solid.

This is the easiest way to display code but there is another way I like better because it gives me more control over the display details. This way is how I display code in the posts for this blog, with the exception of this post.

*The only time this doesn't work is if you're displaying the code for this effect. Then you have to make it an image.



---------
©Karlene Browning, Karlene's Cheat Sheet.

Sunday, June 7, 2009

How to Put a Link on an Image

I'm assuming you already know how to link to images within a blog post (like this pig one) and how to link to images in your blog sidebar (like the matching pig button over in my sidebar). It's pretty easy because Blogger provides the tool for you.

But if you need something a little more complex—like say you want to post a Photobucket logo in your sidebar with some text in it— then you need to code it.

  1. First, the image needs to be hosted somewhere. I use Photobucket. It's free and it's easy to use. So create your account and upload your image. (Instructions for that HERE.)

  2. Leave the Photobucket screen up. Open a new window or tab and go to your blog controls.

  3. Click on the Layout tab, then the Page Elements link.

  4. Click on the Add a Gadget link in your sidebar area.

  5. When the gadget selection screen displays, click on the + sign by the HTML/JavaScript option. This brings up an empty "Configure HTML/JavaScript box.

  6. Type a title in the Title box (optional).

  7. Then copy the code below and paste it into the big white Content box.


    <div align="center">
    <a href="http://weblink.com/"><img src="http://urlofimage" ></a>
    </div>


  8. Replace http://weblink.com/ with the URL address you want to go to when you click on the image. For example: http://photobucket.com

  9. Replace http://urlofimage/ with the URL address of your hosted image. You find that address by putting your cursor over your hosted image in Photobucket, then copying the code for Direct Link. For example: http://i177.photobucket.com/albums/w213/rakrose/iHeartPhotobucket.jpg

    (The div align="center" and the /div (inside the <>) make the image line up in the center of your sidebar.)

  10. Using my Photobucket logo in my sidebar as an example, I typed in the following code:

    <div align="center">
    <a href="http://photobucket.com/"><img src="http://i177.photobucket.com/albums/w213/rakrose/iHeartPhotobucket.jpg" /></a>
    </div>

  11. Type your text. For example, Free Photo Hosting!

  12. If you want to preview your code, click on the Rich Text link in the top right corner.

  13. When your code is the way you want it, click the SAVE button to return to the Page Elements area.

  14. You'll see your new gadget box at the top of the sidebar area. Drag the gadget box to where you want it in your sidebar.

  15. Click the SAVE button at the top right of the Page Elements area.



---------
©Karlene Browning, Karlene's Cheat Sheet.

Friday, May 1, 2009

About This Site

I am not a techno-geek but I wish I were. One of these days, maybe I'll actually take a class or read a book on html or CSS or web design or whatever. But until then, I google things and ask friends how to do things.

And then I take very copious notes with step-by-step detail so that I'll remember how I did it.

I've had several people ask me how I do things on my other blogs, thinking I know what I'm doing. Hah! I know just enough to be dangerous.

And to do some basic blog design.

However, I'm very willing to share my notes—and that's what you'll find on this site. I cover four basic categories:
  • Miscellany (anything that doesn't fall into the above three categories)

The instructions on this site assume that you are using Blogger and the Minima template (the white one on the top). If you use another blog host or a different Blogger template, the details may vary but the concept should be close to the same.

If you don't find what you're looking for here, send me an email or post a comment. If I can figure out how to do it, I'll post it here.

Or you can find instructions on how to do things the same way I did—by googling it.


---------
©Karlene Browning, Karlene's Cheat Sheet.