An Special Layout Problem of IE6: inline-height related

No Comments

Today I encounter a problem on IE6 while working with web page layout. The problem is related to the inline-height CSS property. I don’t want to say that the problem is CAUSED BY inline-height, it’s exactly the problem of IE6 itself.

I don’t know how to describe the problem properly, so I’d like to show you what I was trying to do, what’s the result on IE6, and the demo code.

The following picture is the right one

And this is the display on IE6, a additional border line show below the header text.

This is the demo code, you could try it out, if you delete the inline-height:150%, it will work well on IE6.

CSS

body {
	margin:0;
	padding:0;
	line-height:150%; /*This line will cause a problem in IE 6*/
}

.clear {
	clear:both;
}
/**********/

#attributeFilter {
	float:right;
	width:755px;
}

#attributeFilterPanel {
	border:1px solid #DDD;
	margin:10px 0;
}

#attributeFilterTitle {
	margin:0;
	padding:10px;
	font-size:16px;
	color:#89B9FF;
	font-family:Arial,Helvetica,sans-serif;
}

#attributeLists {
	margin:0 10px 10px;
}

.attributeList, .attributeListLastCol {
	width:126px;
	height:120px;
	padding:5px;
	border:1px solid #89B9FF;
	overflow:auto;
	float:left;
}

.attributeList {
	margin:0 10px 0 0;
}

HTML structure

IE6 Problem related to line-height

Object-Oriented Programming in PHP: The differences

4 Comments

If you are familiar with Java or any other object-oriented programming language, you would probably working with PHP’s OOP feature comfortably. However, there are still many differences should be noticed before. The differences range from the basic syntax to the usage of key words and even further. I make a note of some of the differences, but not managed to cover all. I will compare PHP’s OOP with Java, for Java is an absolutely object-oriented language.

More

Setting timezone in PHP

1 Comment

By default, PHP uses UTC but not the exact timezone where you living. So you may be confused by the output of the following code:

$date = date ('Y-m-d H:i:s');
echo $date;

The code above may output the datetime earlier or later than the actual date time of your watch, but it’s not the matter of your watch, but the timezone the PHP code uses.

In order to get the right date time,you should configure in your php.ini or use the date_default_timezone_set() function to set the timezone.

Configure the PHP.ini

You could set the default timezone in the PHP.ini file as the following example shows:

[Date]
; Defines the default timezone used by the date functions
date.timezone = "America/New_York"

Use the date_default_timezone_set function

The following example show you how to use the date_default_timezone_set().

echo 'Default Time Zone: ' . date_default_timezone_get().'';

$date = date ('Y-m-d H:i:s');

echo 'UTC Time is: ' . $date . '';

date_default_timezone_set('America/New_York');

echo 'Current Time Zone: ' . date_default_timezone_get().'';

$date = date ('Y-m-d H:i:s');

echo 'Current Time is: ' . $date . '';

You can use date_default_timezone_get() to get the current default timezone.

For a full list of timezones supported by PHP, please visits http://php.net/manual/en/timezones.php

Resize Image With PHP GD library

No Comments

A few days ago, I encountered a problem that the thumbnails generated with PHP has jaggies, as I am relatively new to GD I spent a long time to solve it. The problem is caused by the function imagecopyresized I used in my program, the solution is replacing imagecopyresized with imagecopyresampled . I make a note here in case someone, the novice at PHP just like me, encounter the same problem, and I hope it’s helpful.
More

A diference of datetime between MySQL 5.0 & MySQL5.1

3 Comments

Let’s look at the following SQL snippet:

use test;

drop table if exists dt;

create table dt (
    name varchar(10) not null,
    dt_date datetime default null
);

insert into dt values ('james', '2009-12-29 00:00:00');
insert into dt values ('null', null);
insert into dt values ('000', '0000-00-00');
insert into dt values ('blank', '');

More

Older Entries