Author Archives: yzzzyy - Page 2

Valid XHTML Vertical Centering Using CSS

The simplest method to vertically center your elements while using XHTML is to use the table property of the div tag. With this method you can style your div to act like a table with a cell under it.

Vertically centered text

As you can see above, the code has made the text become vertically centered. The text is not horizontally centered but that’s just as easy with the well known margin:0 auto; horizontal center method, or even text-align:center;.

Unix/Linux Resursive chmod on all Directories or By File or Folder Name

To recursively chmod all directories 755 you can use this command.

Obviously you need to replace the 755 with the permissions you need.

To chmod all files or folders by name, use the below command.

Just replace filename with the name you are searching for and the 755 with the permissions you need.

Opera AdBlock – Simple Ad Blocking – urlfilter.ini, No HOSTS

Ad Blocking

The best way to block ads with Opera is with urlfilter.ini (this is the location of your urlfilter.ini).

You can add a Block Ads button to your Opera toolbar to enable/disable ad blocking globally with a single click. This is convenient when something on a website isn’t working and you want to check if it’s your urlfilter.ini that’s causing the problem.

If you currently do not have a urlfilter.ini you can add the following text into a new one at the proper location:

Read more »

CSS font Property

Just a bit of CSS shorthand that I just discovered and may come in handy for you.

Items in brackets are optional and it must be in the order of the first three elements before the font-size and the line-height element right after the font-size with a slash separator.

Embedding Flash Files With Valid XHTML (Strict)

I’m sure a lot of people want to know the answer to this problem, it’s just like “How do I do a target="" without breaking my validation?” problem. The answer to the questions are hard to find or hard to implement but lucky for you adding SWF files isn’t hard at all. The biggest problem with the code you get from Dreamweaver is that they add a lot of outdated code to make it “work better with Internet Explorer”. These days that code is completely unnecessary because people who aren’t using the latest browsers don’t really deserve to see your content anyway! Even the Pentium 3 that I have beside me runs IE7 and Opera just dandy.

So here it is, how to embed SWF files while keeping your XHTML valid:
Read more »

XHTML Strict & target=”_blank” (and _top)

I had made a post a few days ago regarding the problem with embedding flash (swf) into XHTML and still validating. That was an extremely simple fix, all you really had to do was remove code to get it to work (in other words, you optimized your code).

Getting XHTML to validate while using the target="_blank" value, on the other hand, takes a bit of code. Not that this is a problem, we’ve found the code you need!

First off, here’s the problem:

Here is what you’ll have after we fix the problem:

I’ll get straight to the point, if you want to dissect the code you can probably Google a line or two from it and get the page where I found the information.

This is what you put in your <head></head> tags:

This is what you put in the file located at /include/target.js:

That’s it! The original code I found was lacking, it only had the option to use an external window (_blank). My better code lets you also do a target="_top" command with the rel="top" method. So now you can use both rel="top" and rel="blank".