Archive for category Web Developer

Firebug Lite

Every web developer that I know hates working with Internet Explorer, especially Internet Explorer 6.  Recently I’ve found a new tool to ease the pain of the web development community and make IE6 just a touch more bearable, Firebug Lite.

Firebug is by far one of the most useful tools I’ve found for web page design and development, but it only works in Firefox. But what do you do when, like me, you’re developing a site that needs to work in all browsers? Firebug Lite is the answer.

Firebug Lite is a simple line of JavaScript code you insert into your pages that gives you some of the functionality that Firebug offers. Techie put, “Firebug Lite creates the variable ‘firebug’ and doesn’t affect or interfere with HTML elements that aren’t created by itself.”

Simply insert this line of code into the page you need Firebug Lite on:

<script type='text/javascript'
      src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'>
</script>

and if you’d like to configure it:

<script>
        firebug.env.height = 500;
</script>

Now that you’ve installed it on your page, it’s relatively simple to use. Simply load your page, you’ll notice that you have a Firebug window on the bottom half of your screen, and select the element you would like to edit. You’ll see all of the elements for the tag selected, even elements inherited from the browser, but you still can not edit anything. This is where Firebug Lite differs from Firebug.

To edit the CSS you must select the CSS tab. Note: you must also have some CSS loaded on your page to edit or you’ll get a ‘Access to restricted URI denied’ error You’ll see the existing tags on the left and a Run CSS box on the right. Test your news CSS code in that box by typing it and hitting the Run button located on the bottom. That’s all there is too it!

It may not be perfect, but it sure beats the old way: opening the code in notepad (or whatever editor you use), editing the code, saving the document, loading it back to your server and loading the page to finally see that the edits may or may not be perfect.

One final thing to note, before you go live with your newly edited page that Firebug Lite helped you complete, don’t forget to remove the JavaScript.

Popularity: 3% [?]

Firebug, Firebug Lite

1 Comment

Is That Really SEO?

Are some websites misleading or are they uninformed when it comes to SEO. I receive spam email all the time telling me that they can raise my SERP (Search Engine Results Page) rankings to position #1 by giving me ‘x’ number of backlinks for ‘x’ number of dollars. Other times I read blog posts or news releases claiming the “Top 5 Rankings”, when in actuality it’s only a list of websites and the number of backlinks they have.

Backlinks are to SEO like flower pedals are to a flower, it’s only a part of it but by no means is it the whole thing. Pedals are nice to look at but without the stigma, anther, filament, ovary, and other parts you don’t have a flower. A high backlink number may look nice, but without factoring in the PageRank of the backlinks, Rich Content, Keyword Placement, Search Engine Friendly URLs, Page Titles, and many other things, you don’t have true SEO.

TED Magazine, an Electrical Distributor Magazine, just released its July 2009 SEO Rankings of NAED, National Association of Electrical Distributors, distributor and manufacturer member websites. What they are judging here is the number of backlinks going to a single page of a website. This is not “SEO Rankings” but they clearly gave it two different SEO titles: “July 2009 SEO Rankings” and “TED TechRoom SEO Popularity Report”.

In case you didn’t know, according to Wikipedia:

Backlinks are incoming links to a website or web page. In the Search Engine Optimization (SEO) world, the number of backlinks is one indication of the popularity or importance of that website or page (though other measures, such as PageRank, are likely to be more important).

Graybar ranked #5 on this list of 373, with 28,471 total backlinks! That’s an amazing number, but the number that is more important to me is the Google PageRank number, which Graybar is 5 out of 10, according to CheckPageRank Net! Where #1 on the backlinks list, American Light, only had a Google PageRank of 4.

What does that mean?

Google describes PageRank as:

PageRank relies on the uniquely democratic nature of the web by using its vast link structure as an indicator of an individual page’s value. In essence, Google interprets a link from page A to page B as a vote, by page A, for page B. But, Google looks at more than the sheer volume of votes, or links a page receives; it also analyzes the page that casts the vote. Votes cast by pages that are themselves “important” weigh more heavily and help to make other pages “important”.

OK? Thanks. So what does that mean? What it means is, backlinks to your site are not all equal. If a website has 10 backlinks from low ranking sites it might not be as good as another website with 2 backlinks from 2 high ranking sites.

The table below shows the same “Top 5″ list but ranking them by Google’s PageRank.

Rank Company PageRank
1 Graybar 5
1 Ferguson/J. D. Daddario Company 5
1 HD Supply Company 5
4 American Light 4
4 Elliott Electric Supply 4

So what do these numbers tell us? American Light, which has 110,208 backlinks, doesn’t have the quality of backlinks as Graybar with 28,471 backlinks. So even though American Light has 81,737 more links than Graybar, Graybar still has a higher PageRank. To me this shows the real power of PageRank.

What about Rich Content, Keyword Placement, Page Titles and all of the other important factors in true SEO.  It would be nearly imposible for me to research all of that information.  The true test would be where does the website land on the SERP for the keywords they chose.  A website could have one million backlinks but if it doesn’t rank in the top 10 for keywords that people are searching for it does them no good. I guess SEO is something that is between the webmaster and Google, not something someone can make a chart out of.

In the world of SEO backlinks are important but they are not the only number to watch. True SEO is measured by where a website lands on the Search Engine Result Page. If you saw these numbers and didn’t know what they meant, thought the backlink numbers were the “SEO” numbers, or you just want to know more about SEO, please read this article.

Popularity: 7% [?]

Backlinks, Graybar, SEO

3 Comments

Relative Position and Absolute Position

Many years ago when I first started learning about web design and development one of the hardest things for me to get a grasp on was positioning. When to use what and why. Hopefully by the end of this you will have a better idea, or at least a good review, of how to use relative or absolute positioning, when and why we are doing it.

Let me make it clear now, I am writing this with Firefox 3 in mind. I don’t care about IE6 and am mildly concerned with IE7+. The world of web design and development would be a much happier place if everyone would abandon IE and switch to Firefox or Chrome. That being said, on with the show.

First, lets define a few things.

Absolute Position – If you position something absolutely you’re saying, “Hey, I know I coded you in that spot but I’ve decided that you should be somewhere else completely. No matter what anyone says or does, I want you in that pixel spot.” This can be good and bad, but we’ll go into that later.

Relative Position – If you position something relatively you’re saying, “Hey, I coded you in a specific spot, but now I want to move you from that spot to another.” In other words, where ever the relative positioned item ends up on the page before styling is where the starting point will be.

WAIT! What about Fixed Position? Fixed Positioning doesn’t seem to work in all browsers. I know, I just said that I don’t care about IE6, but this isn’t just a small pixel shift, it’s the entire functionality of the attribute. Long story short, Fixed Positioning will fix the element on the page, like the old frame pages. Here is a good example of a Fixed element. I will be adding a Fixed element in each of my examples but you will have to adjust the browser window to see it work.

OH! and Static, that just means ‘default’ and should only be used if you are over-riding a preexisting style.

OK! Lets get to some examples.

Example 1 – Simple Positioning

First we’ll build a basic page, and I’ll keep it as simple of a page as possible. Some text and three boxes.

<p>Here I will put some text</p>
<div class="fixed">Fixed</div>
<div class="absolute">Absolute</div>
<div class="relative">Relative</div>

Now we’ll add a little bit of style to this page. Not much too it, just a little extra margin on our paragraph tag so you can see it with the boxes. The boxes each are 100×100 px and have a different color. They are positioned to be in the top left hand corner, the difference will be where each one thinks the top left corner is!

p{
margin-left:110px;
margin-bottom:20px;
font-weight:bold;"
}
.fixed{
position:fixed;
background:#0000FF;
top:0px;
left:0px;
width:100px;
height:100px;
}
.absolute{
position:absolute;
background:#FF0000;
top:0px;
left:0px;
width:100px;
height:100px;
}
.relative{
position:relative;
background:#00FF00;
top:0px;
left:0px;
width:100px;
height:100px;
}

Simple Positioning – Why this happens: Everything is positioned to the browser window. So our fixed and absolute should be in the top left hand corner. Our relative box should be relative to its placement in the code. So in other words, it’s coded after the text so it will position itself after the text. Absolute doesn’t care what else is on the page and will happily cover up anything in its way (that’s why I put the margin-left on the <p>). The Fixed box is hidden under the Absolute, but if you adjust the browser window and scroll down you should be able to see it.

Example 2 – Positioning in an actual website

OK, I’m not actually going to build a website, but I did create a content container box that floats in the middle of the page. I’ve changed the color of the content box so you can see it better. Again, I’m trying to make this as simple as possible.

Same code as Example 1 except I’ve added a <div> around the content.


<div id="content">
...
</div>

Alright, now we’ll add a little style to make it all work. Again, it’s the same as before but I’ve added a #content style.


#content{
width:800px;
background:#E5E5E5;
margin:0 auto;
}

Positioning in an actual website – Why this happens: The Absolute doesn’t care about our little box we’ve place all the content in, it happily put itself in the top left hand corner of the window. It doesn’t care that when you stretch your window wider, it’ll just stay right where you told it. There is where the bad comes in. If you weren’t expecting it you would be quite surprised. What is worse is you could code it and it looks fine in the browser, but someone with a different screen resolution looks at it and it breaks. The Relative on the other hand is constrained in the box but is still below the content. The Fixed box will continue doing what it does best, just sit in the corner and wait for the scroll.

Example 3 – Controlling the Absolute

So how do we control the Absolute so that it is usable? One little trick is to put a position: relative on the container box that is holding our content. This will place our Absolute in the top left of the box.


<div id="content">
<p>Some Content....</p>
<div class="fixed">Fixed</div>
<div class="absolute">Absolute</div>
<div class="relative">Relative</div>
</div>

I made another container box below with a position: absolute to show you why I didn’t pick that option. I like floating my website in the center, position: absolute would make that much more difficult.


<div id="morecontent">
<p>More Content.... </p>
<div class="absolute">Inside Absolute</div>
</div>

Again, we have the same style sheet with just a minor addition.


#content{
position:relative;
}
#morecontent{
width:800px;
background:#E5E5E5;
margin:10px auto;
position:absolute;
height:200px;
}

Example – Controlling the Absolute

Example 4 – Positioning Z-index

Now you may be asking, “why not just use a float on your simple examples?” Well, for starters, sometimes you want the text to cover your image (pretend the boxes are images) or you want the image to cover your text (no idea why). But that’s where the z-index comes into play.

I’m not going to go too in depth with z-index, but the short of it is, with your positions you can z-index something to be on top or below another item. The higher the number = the higher the layer.

I’ve changed up a few things, so I’ve re-posted all of the code.


<div id="content">
<p>Some Content...</p>
<div class="relative">Relative</div>
<p>The relative box has a z-index of 50 and should be under the text!</p>
<div class="fixed">Stupid Stupid Fixed</div>

<div class=”absolute”>Absolute on top of content</div>
</div>

And now the style, again, all of the code because I change a few things up.


#content{
width:800px;
background:#E5E5E5;
margin:0 auto;
position:relative;
}
p{
position:relative;
font-weight:bold;
z-index:75;
}
.fixed{
position:fixed;
background:#0000FF;
top:0px;
left:0px;
width:100px;
height:100px;
z-index:99;
}
.absolute{
position:absolute;
background:#FF0000;
top:0px;
left:0px;
width:100px;
height:100px;
z-index:100;
}
.relative{
position:relative;
background:#00FF00;
top:90px;
left:140px;
width:100px;
height:100px;
z-index:50;
}

Example – Positioning Z-index

Well, I hope I cleared some things up for you, or at the very least I didn’t confuse you more. If I missed anything or if you have any questions, please post it in the comments, I’m sure others have the same question but are too afraid to ask. But I’m sure together we can work out any problem.

Popularity: 8% [?]

Position, tutorial, Web Design

2 Comments