Wednesday, 11 April 2012

CSS Sticky Header and Footer with Scrolling Middle

This is a way to use CSS only (no JavaScript) to have the content expand to fill the window size, with the header always visible at the top and the footer always visible at the bottom.  If there's too much content, just the middle will scroll, not the whole page. You can see it in action, here.

It's not perfect, but I think it's the best you can get without JavaScript and it does work perfectly on most mobile phones, which is the reason I did it.

Before I get onto the code, I'd like to thank Ryan Fait for pointing me in the right direction, with his Sticky Footer.

The basic code is below.  I've used in-line styles to make it easier for you to see which styles are applied to which bit, but obviously you should put them into a separate stylesheet and also add fonts and change background colours etc.
<html style="height:100%;margin:0;">
<title>Scroll Demo</title>
<body style="height:100%; margin:0; padding:0;">
            <div style="height: 4em; background-color:#000000; color:#ffffff; position:relative; z-index:1;">Header Strip</div>
           <div style="height: 100%; margin: -4em 0 -2em 0; color:#000000; overflow:auto;">
              <div style="height:4em;"></div>
              <p>THIS IS WHERE THE CONTENT GOES</p>
       <div style="height:2em;"></div>
           <div style="height: 2em; background-color:#000000; color:#ffffff; position:relative; z-index:1;">This is the footer</div>
The important points are that you need to apply a 100% height style to the <HTML> and <BODY> tags as well as your main content div. The header and footer need to have a z-index of 1, otherwise your content will scroll over them. Your main content div needs to have an empty div that is the same height as your header at the top, and an empty div that is the same height as your footer at the bottom. Finally, you need to apply negative margins that are the same as the header and footer heights, to the top and bottom on your main content div.

There is a demo here, with the exact code written above, except for additional content to force the scroll.

The reason I wrote this was because I needed to find a way to make my HTML5apps fill the full screen, without going off of it, on all the various resolutions. I've tested my apps on iOS, Android and Symbian so far and the scrolling middle works.

Wednesday, 4 April 2012

A Warning About

I recently bought a ring, containing fake diamonds, from and am writing this to warn other people not to trust the descriptions on the website.

I should point out, in the interests of balance, that I have used for years and haven't had a problem with them until recently. I have even recommended them to other people and did list them in my Great Websites list. I've now removed it.

I have picked up some good bargains from them in the past.  For example, the ring on the left cost me $80USD, with shipping, and was being sold on for £150GPB at the time, and Amazon said that was half price. My best bargain was a ring that worked out at about £40 that I had valued and was worth £250.

However, past bargains aside, sold me a fake ring.

I bid on this 'Charming Brand New Ring With 0.80ctw Precious Stones - Genuine Aquamarine and Diamonds Made in White Gold' but the reserve price was not met. emailed me after the auction had closed and offered it to me for the reserve price of $108USD.  With shipping, it came to $130USD, about £80GBP.  I'm no jewellery expert, but I was pretty sure it was worth a lot more than £80, although maybe not the $969 they claimed it was worth.  I tried to find the ring for sale elsewhere to compare prices. I did find an identical ring on for £260 plus shipping, so I decided it was definitely worth £80 and ordered it.

When it arrived, it looked great and I really liked it.  I took it to a local jewellers to get it valued, for insurance and the jeweller told me that the black diamonds were not actually diamonds. To prove it, he touched his electronic tester on the diamonds in other rings that I was getting valued at the same time and showed me the green diamond light coming on.  When he touched the black stones in this ring, the red moissanite light came on instead.

As soon as I got home, I contacted and said:
"I recently bought Charming Brand New Ring With 0.80ctw Precious Stones - Genuine Aquamarine and Diamonds Made in White Gold- Size 7 - Certificate Available.
Listing Number: 95064205
Item Number: 01322706

I just took it to a jewellers to have it valued for insurance purposes and he told me the black stones are not diamonds.  Also one of the prongs is broke so one of the fake stones that should be a diamond will fall out."
I got a email, that was clearly a standard automated/copy and pasted email, saying:
Dear Customer,
We are sorry to hear you are not completely happy with your item(s) and we have created a Return of Merchandise Authorization number for your return(s).
Your return number is RMA-83712.
Please write this number clearly on the outside of your parcel. Please also review and keep this email for future reference.
What you need to include in your return package:
All original packaging and materials (such as price tags, certificates, warranties and instructions) otherwise your return will be refused.
A copy of the sales order - Log into your account to print out a copy of the sales order.
A detailed reason for return for each item.
Please allow 3-5 business days for your refund to be processed once return has been accepted. A confirmation email will be sent when your return is ready for refund.
Parcels without a clearly marked, valid Return Authorization Number on the outside of the parcels may be refused and sent back to the shipper.
**We strongly recommend certifying your package with a tracking number which will allow you to track its delivery progress.
Please ship to:
Attention: Returns Department
3562 Eastham Dr.
Culver City, Ca 90232
Once our jewelry department has inspected the item(s), we will process your refund.
Important things to remember:
All returns will be refunded back to your original payment method unless store credit is specified.
Return shipping costs are subject to approval.
All returns should be made within 30 days.
Customers outside of the U.S. please note:
All customs fees are to be paid by the recipient of the merchandise. is not responsible for paying return custom fees. To avoid paying customs fees for damaged return items, we suggest you note that your item was originally purchased in the United States and that it is being sent back as damaged merchandise.
Customer Service Team
3562 Eastham Dr.
Culver City, CA 90232
PH 310-280-7373
Toll 1-888-247-BIDZ
Email us 24 hours a day at
"Problem Solving Team where your problem is our problem"
Now I wasn't very happy with that response, but I didn't reply at that time. I expected a grovelling apology, not a standard email, but then I thought that it might not be their fault. They may have believed the diamonds were real. It may be their supplier that is at fault, and once they've inspected the ring and confirmed that the diamonds are fake, I'll get a more personal response. I decided to return the ring and see what they said.

The day after they received the ring (according to the tracking), I got another automated/copy and pasted email. This one said:

Dear Customer,

We would like to inform you that we have received your return for RMA-83712, the item has been inspected and processed. 

Refunds are issued back to the refund method selected; Please allow 2-3 business days for the refund to be completed.

For more information on our return policy please follow the link below:

If you have any questions or concerns, please feel free to contact customer service.
Thank you, Returns Department
Not being happy with the lack of apology or explanation, I replied, saying:
"Is that it?  All I get is an automated email telling me to send it back and another one telling me you've processed it?  Aren't you going to make any attempt to apologise or explain?  Aren't you going to offer some sort of reassurance that if I buy from you in future, the jewellery won't be fake!?!

At the very least, can you reimburse my return shipping please?"
This time I did get a response that sounded like it might have actually been written by a person, but still no explanation...

Dear Customer,

Thank you for contacting us regarding RMA-83712. We do apologize that you are not satisfied with the merchandise and our service. Please allow for 2-3 business days for the refund to completed on our end for this return.

If you are requesting to have your postage reimbursed, please provide us with the reciept by email or fax so that we can forward this to the department in charge.
Please let us know if you have any other questions or concerns.

Customer Service Team
Of course I still have concerns! And I told them that: "I've attached a photo of the receipt, showing that it cost £9.87GBP to return the ring. Yes, I do have another question or concern: Why did you sell me a ring with fake diamonds in it and how can I be assured that any future purchases from you won't be fake?"

After a few days, I got this response:
Dear Customer,

Thank you for contacting us and for sending a copy of your reciept. I have forwarded this information to the lead in our Returns Department. Please allow between 24-28 hours before you receive an update.
Customer Service Team
Still no explanation or reassurance. I've given up and won't be ordering again.