PHP Shorthand If Notation or the Ternary Operator

Why should I care about PHP Shorthand If Notation or the Ternary Operator

Programming would be a bit useless without being able to evaluate conditions using if/end and switch statements. If/Else statements is obviously a great tool, but they aren’t optimal (or necessary) in all situations. And so I introduce you to … PHP Shorthand If Notation or the Ternary Operator.

Ternary operator takes the form “(condition) ? (true return value) : (false return value)” to shorten your if/else structures.
Continue reading “PHP Shorthand If Notation or the Ternary Operator”

jQuery Scroll page to position of an element/div

When you’re working with a complex page that has a load of areas on-screen, making use of this jQuery Scroll page to position of an element/div function below to scroll to the location will enhance you’re user experience by saving them needing to scroll… take them straight to it!

Continue reading “jQuery Scroll page to position of an element/div”

Tools & Tips…

Well, I’m going to try to divulge more of my development experiance to others. Starting with some ‘Tools & Tips‘.

Let me know if there are any topics/questions from all forms of development PHP, Java, .NET .. and management (people & projects) aspects of the IT world too!

Making your website work with Internet Explorer 8 (IE8)

OK probly well known by now. But if you’re site is ‘broken’ in IE8, you could try the following which tells IE8 to work liek IE7.

<meta http-equiv=”X-UA-Compatible” content=”IE=7″ />

It belongs in the document’s HEAD. More importantly it needs to be preferably at the top of the HEAD section before any css, linked files etc.

The rule of thumb is, that the IE 8 meta tag needs to be placed above any linked files.

Search Engine Ranking via Title Tags

”How do I get my website page to rank well in search engines for a certain search term?”. While there are many techniques and tactics that can contribute to how your website ranks, one of the most fundamental is through the use of title tags. Title tags let search engines know what the main thrust of each web page is, and which categories or search terms to file the site under. By the way a title tag is what falls between the <TITLE> and </TITLE> tags in your html code for each page.

Continue reading “Search Engine Ranking via Title Tags”

Firefox horizontal jump between pages!

For a very long time I have always been annoyed by Firefox…

Have you ever witnessed the ‘horizontal jump’ cause by your content being taller then the browser size? And the effect is when you go between pages that are bigger and within you experiance a jump.

For ages I thought it was some problem with my own CSS, but today I discovered it’s because of the vertical scrollbar in Firefox. The above affect doesnt happen in IE as it always shows the scrollbar.

The CSS to make Firefox always show the vertical scrollbar is as follow:

html { overflow: -moz-scrollbars-vertical; }
html { overflow-x: auto; }

Principles of Web Design

When I undertake developing a website I always try to keep 3 key principles in mind;

1. Simplicity
2. Modularity
3. Balance

Follow my basic guide and you’ll become a better developer/designer…

Continue reading “Principles of Web Design”