Posts Tagged ‘html’

Finding Your CSS Styles in wordpress

Tuesday, November 11th, 2008

Designing any website, as well as WordPress Themes, the smallest detail in the layout and design can send even the most expert web page designer into fits. Since you probably aren’t a top-notch CSS and HTML expert, how about I show you the tricks they use for finding their CSS styles and tweaking those little bits and pieces into shape.

A web page is generated using a combination of HTML tags which basically hold the structural frame work of the web page, and a style sheet which provides instructions to those tags on how to look and where to put themselves. Going through a style sheet to find the solution to your problem isn’t as easy as it looks. But tracking down the style sheet reference inside of the web page and HTML tags is actually easier than you think. It’s a matter of tracking down the culprit by narrowing the suspects.

View Source of Web Page CodeView the trouble causing page in your browser. Look closely where the trouble maker is and note any text near the problem area. From the browser menu, choose View > Page Source. This will bring up a new window with the code behind your web page. Now, using your “find” (CTRL+F), search for the key text you spotted nearest your problem.

What is PHP?

Thursday, July 24th, 2008

PHP is a scripting language that is often imbedded into HTML to add functions HTML alone can’t do. PHP allows you to collect, process and utilize data to create a desired output. In short, it let’s you interact with your pages.

PHP is able to preform a number of tasks including printing data, making numeric calculations (such as addition or multiplication), making comparisons (which is bigger, are they equal, etc) and making simple boolean choices. From this you can create more complex loops and functions to make your page generate more specialized data.

Why use PHP and MySQL?

Thursday, July 24th, 2008

PHP and MySQL combine to be an easy yet powerful way to create dynamic web pages that actually interact with your visitors. HTML can create useful and well formatted web pages. With the addition of PHP and MySQL you can collect data from your users, create specific content on the fly, and do many other things that HTML alone can’t do.

The beauty of PHP as a language is that it is designed to be used along with HTML. You can use PHP right inside your already existing HTML content, or put HTML tags right inside your PHP coding. When learning PHP you are not making your existing HTML knowledge obsolete, you are instead adding to it to give it more functions and abilities.

Web Design-Specify a unit unless the value is 0

Wednesday, July 16th, 2008

Not specifying a unit for length values is a very common mistake among CSS beginners. In HTML you can get away with that, but in CSS all length values must have a unit. There are two exceptions: line-height and 0 (zero) values. Note that the value must be immediately followed by the unit – do not insert a space between them.

There is no need to specify a unit for 0 (zero) values because zero pixels equals zero centimeters equals zero of any other length unit. Despite this it’s very common to see something like padding:0px where padding:0 would do.

While there’s nothing wrong with specifying a unit when the value is 0, it’s a waste of space and – at least to me – looks untidy.

JavaScript vs Java

Wednesday, July 16th, 2008

Although the names are much alike, JavaScript is primarily a scripting language for use within HTML pages, while Java is a real programming language that does quite different things from JavaScript. In addition Java is much harder to learn. It was developed by Sun for use in pretty much anything that needs some computing power.

JavaScript was developed by Brendan Eich, then working at Netscape, as a client side scripting language (even though there’s no fundamental reason why it can’t be used in a server side environment).

Originally the language was called Live Script, but when it was about to be released Java had become immensely popular (and slightly hypey). At the last possible moment Netscape changed the name of its scripting language to “JavaScript”. This was done purely for marketing reasons. Worse, Eich was ordered to “make it look like Java”. This has given rise to the idea that JavaScript is a “dumbed-down” version of Java. Unfortunately there’s not the slightest shred of truth in this story.

Java and JavaScript both descend from C and C++, but the languages (or rather, their ancestors) have gone in quite different directions. You can see them as distantly related cousins. Both are object oriented (though this is less important in JavaScript than in many other languages) and they share some syntax, but the differences are more important than the similarities.

If you are a C++ or Java programmer you will be surprised by some of JavaScript’s features. Since I don’t have any previous programming experience, the differences are not described on this site. The best you can do is buy David Flanagan, “JavaScript, the Definitive Guide”, 5th edition, O’Reilly, 2006. In this book the differences between C++/Java and JavaScript are clearly explained. I co–edited a few chapters of this book.

General introduction-Java script

Wednesday, July 16th, 2008

JavaScript is most commonly used as a client side scripting language. This means that JavaScript code is written into an HTML page. When a user requests an HTML page with JavaScript in it, the script is sent to the browser and it’s up to the browser to do something with it.

The fact that the script is in the HTML page means that your scripts can be seen and copied by whoever views your page. Nonetheless, to my mind this openness is a great advantage, because the flip side is that you can view, study and use any JavaScript you encounter on the WWW.

JavaScript can be used in other contexts than a Web browser. Netscape created server-side JavaScript as a CGI-language that can do roughly the same as Perl or ASP. There is no reason why JavaScript couldn’t be used to write real, complex programs. However, this site exclusively deals with the use of JavaScript in web browsers.

If you don’t have any programming experience at all it’s best to start with some gentle JavaScript examples that teach you the basics. It might be a good idea to buy Negrino & Smith, “JavaScript for the World Wide Web”, 4th edition, Peachpit Press, 2001. It contains some very useful examples and though it doesn’t treat advanced programming tricks, it will certainly help you get started. Of course this site also offers plenty of help.

I can also recommend Jeremy Keith, DOM Scripting: Web Design with JavaScript and the Document Object Model, 1st edition, Friends of Ed, 2005. This, too, is a book that doesn’t delve too deeply into technology, but gives non-programmers such as graphic designers/CSS wizards an excellent overview of the most common uses of JavaScript - as well as the most common problems.

Search engine optimization-Write an accessible site

Tuesday, July 15th, 2008

Accessible HTML is accessible to both search engine spiders and screen readers. The more accessible you make your pages, the easier it will be for search engines to read and rank your pages.

Search Engine Optimization-Searching by Means of Subject Directories

Tuesday, July 15th, 2008

Think back to the library card catalogue analogy.  In the old card files, and even in today’s computer terminal library catalogues, you find information by searching on either the author, the title, or the subject.  You usually choose the subject option when you want to cover a broad range of information.

Example:  You’d like to create your own home page on the Web, but you don’t know how to write HTML, you’ve never created a graphic file, and you’re not sure how you’d post a page on the Web even if you knew how to write one.   In short, you need a lot of information on a rather broad topic–Web publishing.

Your best bet is not a search engine, but a Web directory like the Open Directory Project,  Google Directory or  Yahoo.  A directory is a subject-tree style catalogue that organizes the Web into major topics, including Arts, Business and Economy, Computers and Internet, Education, Entertainment, Government, Health, News, Recreation, Reference, Regional, Science, Social Science, Society and Culture.  Under each of these topics is a list of subtopics, and under each of those is another list, and another, and so on, moving from the more general to the more specific.

Example: To find out about Web page publishing from Yahoo, select the Computers and Internet Topic, under which you find a subtopic on the Wide World Web. Click on that and you find another list of subtopics, several of which are pertinent to your search: Web Page Authoring, CGI Scripting, Java, HTML, Page Design, Tutorials.  Selecting any of these subtopics eventually takes you to Web pages that have been posted precisely for the purpose of giving you the information you need.

If you are clear about the topic of your query, start with a Web directory rather than a search engine.  Directories probably won’t give you anywhere near as many references as a search engine will, but they are more likely to be on topic.

Web directories usually come equipped with their own keyword search engines that allow you to search through their indices for the information you need.

Important note:  Search engines and  Web directories are being integrated in interesting ways.    For example, if you use the Google search engine and one of the results happens to be found in the Google’s Directory (which is based on the dmoz directory), Google will offer you a link to that section of the directory. Meanwhile, if you conduct your search in the Google directory, Google will order the results according to PageRank, which is   Google’s all-important measure of  “link popularity.”

Swiss Army Google

Tuesday, July 15th, 2008

Google has a number of services that can help you accomplish tasks you may never have thought to use Google for. For example, the new calculator feature (www.google.com/help/features.html#calculator) lets you do both math and a variety of conversions from the search box. For extra fun, try the query “Answer to life the universe and everything.”

Let Google help you figure out whether you’ve got the right spelling—and the right word—for your search. Enter a misspelled word or phrase into the query box (try “thre blund mise”) and Google may suggest a proper spelling. This doesn’t always succeed; it works best when the word you’re searching for can be found in a dictionary. Once you search for a properly spelled word, look at the results page, which repeats your query. (If you’re searching for “three blind mice,” underneath the search window will appear a statement such as Searched the web for “three blind mice.”) You’ll discover that you can click on each word in your search phrase and get a definition from a dictionary.

Suppose you want to contact someone and don’t have his phone number handy. Google can help you with that, too. Just enter a name, city, and state. (The city is optional, but you must enter a state.) If a phone number matches the listing, you’ll see it at the top of the search results along with a map link to the address. If you’d rather restrict your results, use rphonebook: for residential listings or bphonebook: for business listings.

Displaying the Last Modified Date within a Web Page

Monday, July 14th, 2008

If you would like to display the last modified date on your web page, place the following code within the HTML of your web page where you would like the date to appear.

Example:

This page was last modified on: 06/18/2008 04:45:20

Last Modified HTML Code:

<script language=”Javascript”>
document.write(”This page was last modified on: ” + document.lastModified +”");
</SCRIPT>

Change the text indicated in red to whatever you’d like.

If you would like to use this JavaScript code to display your web page’s last modified date, it is probably best to place the code toward the bottom of your web page.