Using Custom CSS Styles With Amazon Web Store

I have been slacking on my posts, but my second son was just born, I bought a house and I am working on 3 different teams plus other initiatives at my day job so hopefully you will excuse me, as I have myself. This is something I did awhile ago, but actually took some problem solving so I don’t want to lose the code. My wife had some interest in doing some e-commerce stuff, and so I set her up with an Amazon Web Store. Overall the integrated experience is pretty cool, although as far as really flexible templating goes they have some work to do. I simply wanted to be able to use a custom CSS stylesheet to apply the style, and this is how I accomplished that.

The problem is that you can choose only one template when you start and that cannot be changed, there is no way to specify a custom CSS file and a great deal of the styling is applied with inline style attributes. However, you do have the ability to change Site Wide Properties and add custom HTML to the HEAD tag. The following technique could be used for any site where you have access to inject custom HTML into the HEAD tag, such as many content management, blog or e-commerce tools.

Be warned however that users must have JavaScript enabled for this technique to work well. This is the code that you can cut and paste in for a cross-browser (tested on latest version of IE and FF) clean slate for styling:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
jQuery("html").css("display", "none");
jQuery("head link").remove();
jQuery("head style").remove();
jQuery(function()
{
jQuery("body style").remove();
jQuery("*[style]").removeAttr("style");
jQuery("*[width]").not("img").removeAttr("width");
jQuery("html").css("display", null);
});
</script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css">

The result of using this code is that when each page is initially loading, all content will be hidden. This is to avoid seeing the page rendering going on. Depending on the browser, connection speed and machine power you may otherwise see the initial stylesheet being applied, then removed, and the new reset CSS being applied. That can look very ugly to a user. Once all of the files are cached, the file load time should be quick and any blank screen should only be visible for a moment. Once everything is applied, this will leave the page with a vanilla, consistent but unformatted layout. The idea is you would insert one or more lines following this code referencing your custom CSS.

The functionality is quite simple:

  1. Hide all of the HTML: jQuery("html").css("display", "none");
  2. Remove all references to stylesheets (this could be made more specific if you have other link types): jQuery("head link").remove();
  3. Remove all inline style blocks: jQuery("head style").remove();
  4. Schedule a set of operations to run on page load (the rest of the script operations): jQuery(function()
  5. Remove any inline style blocks in the body: jQuery("body style").remove();
  6. Remove all style attributes, from all elements that have one: jQuery("*[style]").removeAttr("style");
  7. Remove all widths from elements that are not images (this is AWS specific): jQuery("*[width]").not("img").removeAttr("width");
  8. Show all of the HTML: jQuery("html").css("display", null);

This technique uses both jQuery, the excellent cross-browser JavaScript library, and YUI: Reset CSS, a stylesheet made to make the rendering of HTML elements consistent across browsers. Both of them are highly recommended for any web development project where you want to be highly productive and provide all of your users a great browsing experience. You can find out more information about jQuery and YUI at their respective homes on the web.

This entry was posted in Development, HTML, Web and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

44 Comments

  1. Posted June 1, 2010 at 11:04 pm | Permalink

    Thanks for this article. I am considering Amazon webstore for a project. Do these custom styles apply to the checkout pages, too? From what I have seen, many of the webstores use a standard checkout screen that seems to only allow for a logo, much like PayPal checkout. Is there a way around this? The only site I’ve seen that Amazon claims is a webstore that doesn’t to this is https://shop.samsonite.com. Do you know if doing something like this is only a custom/premium option? Thanks for your help. -Chris

  2. Posted June 2, 2010 at 8:56 am | Permalink

    I am not sure about this, and my wife has temporarily suspended her Web Store account so I can’t check. This method should work for any page that is customizable through the Templates feature Amazon Web Store provides. If it is not in there, then you might have to look into other options. Some sites consider this a “security” feature and so they may intentionally be preventing people from customizing the checkout process. Good luck!

  3. Sal
    Posted December 22, 2012 at 7:49 pm | Permalink

    I Like this post, I have a question, I have a javascript to cycle images. http://jsfiddle.net/Kz6Gk/26/
    I belive I have to add this like CSS on my product page, but How I’m gona point to the images folder if I want to display the all the thumbnil of each product item on mouseover? let say I have 10 products listed with icons, and whenever I mouseover on each it display all the images, I have on QuickView but it display the images in the popup window that I don’t want.
    -Thank You.

  4. Posted August 24, 2014 at 4:46 am | Permalink

    Remarkable! Its truly amazing paragraph, I have got much clear idea concerning from this paragraph.

  5. Posted April 24, 2015 at 4:13 pm | Permalink

    I do believe you are not incorrect, having a new site
    a style that is responsive will only put in a tiny amount of charge.
    ‘s guide

  6. Posted July 16, 2016 at 11:15 am | Permalink

    Hi colleagues, its fantastic article regarding educationand completely explained,
    keep it up all the time.

    Here is my blog – NealDAmigo

  7. Posted July 18, 2016 at 12:01 am | Permalink

    I see you don’t monetize your page,i read interesting article how to
    earn some additional cash and increase traffic using one simple method, just search in google for:
    Twardziel advices

  8. Posted July 22, 2016 at 8:52 am | Permalink

    This article will help the internet viewers for establishing new web site or even a weblog from commence to end.

    my weblog … TedKVirrey

  9. Posted July 23, 2016 at 1:37 pm | Permalink

    Thank you for the auspicious writeup. It the truth is was actually a amusement account it.
    Look advanced to more added agreeable by you! However, how can we communicate?

    Here is my blog post JaredXUehara

  10. Posted July 23, 2016 at 2:40 pm | Permalink

    I will immediately grab your rss feed as I can not find your e-mail subscription link or newsletter service. Do you have any? Please let me know in order that I could subscribe. Thanks.

  11. Posted July 25, 2016 at 1:00 am | Permalink

    Greetings! This is my 1st comment here so I just wanted to give a quick shout out and tell you I truly enjoy reading your posts.
    Can you suggest any other blogs/websites/forums that go over
    the same subjects? Thanks for your time!

    My blog: KeeleyRGanin

  12. Posted July 25, 2016 at 4:08 am | Permalink

    My brother recommended I would possibly like this website. He was once
    entirely right. This publish actually made my day. You cann’t believe simply how much time I had spent for this information! Thank you!

    Look into my site; RonnaWGehler

  13. Posted July 25, 2016 at 9:03 am | Permalink

    Great goods from you, man. I have got understand your stuff previous to and you’re
    just too magnificent. I actually like what you
    might have acquired here, really like what you’re saying and how in which
    you say it. You will be making it entertaining so you still care
    for to keep it smart. I cant wait to read far more of your stuff.
    This is certainly actually a terrific website.

    Also visit my web-site :: KimiOHoglund

  14. Posted July 27, 2016 at 3:05 am | Permalink

    In the event you would like to obtain the best value from this article then you will need to apply these techniques for your won weblog.

    my blog :: TamiFKerst

  15. Posted August 1, 2016 at 5:21 am | Permalink

    Thanks to this Clash Royale Hack, you will not must
    waste your cash on Gems and Gold as you will get them completely free of charge.

    my web site clash royale hack android no root – livingston.bccls.org,

  16. Posted August 3, 2016 at 9:49 am | Permalink

    Helpful info. Lucky me I discovered your site unintentionally,
    and I’m surprised why this twist of fate did not took place in advance!
    I bookmarked it.

    Feel free to surf to my web-site; BryceBTrolio

  17. Posted August 4, 2016 at 4:29 am | Permalink

    Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. Seo Plugin

  18. Posted August 4, 2016 at 4:33 pm | Permalink

    Attractive section of content. I just stumbled upon your web site
    and in accession capital to assert that I get in fact enjoyed account your blog posts.
    Any way I will be subscribing to your augment and even I achievement you access consistently
    fast.

    Visit my website … ShadQWempa

  19. Posted August 4, 2016 at 9:14 pm | Permalink

    This paragraph is in reality a good one it assists new web people, who definitely are wishing
    in favor of blogging.

    Feel free to visit my webpage; TodKNowitzke

  20. Posted August 7, 2016 at 8:42 am | Permalink

    Hi mates, how is the whole thing, and what you would like to say about
    this piece of writing, in my view its genuinely remarkable
    for me.

    my site: DonnellHPaez

  21. Posted August 10, 2016 at 9:07 am | Permalink

    Every weekend i employed to pay a visit this internet
    site, as i wish for enjoyment, since this this site conations genuinely good funny data too.

    Look at my homepage … CandiXManfra

  22. Posted August 11, 2016 at 11:07 am | Permalink

    Very interesting subject, thank you for posting.

  23. Posted August 13, 2016 at 10:49 am | Permalink

    Hi there, yup this piece of writing is truly fastidious and I have learned lot
    of things from it regarding blogging. thanks.

    Here is my web-site :: KenethAWygal

  24. Posted August 15, 2016 at 10:11 am | Permalink

    constantly i accustomed to read smaller articles or reviews that at the same time clear their motive, and that is also happening with this particular component of writing which I
    am reading now.

    my webpage: DarrylNBotto

  25. Posted August 16, 2016 at 3:22 am | Permalink

    Napster, LimeWire, torrents and an unquantifiable number of
    other peer-to-peer providers are created.

  26. Posted August 16, 2016 at 11:32 am | Permalink

    Unquestionably assume that that you said. Your favorite justification appeared to be on the net the easiest
    thing to pay attention to. I have faith that for you, I definitely get irked while people think
    about worries that they can plainly will not find out about.
    You managed to hit the nail upon the most notable and also defined out the whole thing with out side-effect , people can go
    on a signal. Will likely return to obtain additional.
    Thanks

    my web blog; EmeldaWCavel

  27. Posted August 16, 2016 at 9:49 pm | Permalink

    That is a good tip particularly to people new to the blogosphere.
    Brief but very accurate information Appreciate
    your sharing this particular one. A must read article!

    my site – ArnoldJBashi

  28. Posted August 17, 2016 at 12:58 pm | Permalink

    My relatives every time point out that I am killing my time at net, but I understand I am just getting experience daily by reading thes good articles or
    reviews.

    Visit my weblog … RockyZAceves

  29. Posted August 17, 2016 at 6:35 pm | Permalink

    I was just looking for this info for some time. After 6 hours of continuous Googleing, at last I got it in your website. I wonder what is the lack of Google strategy that do not rank this type of informative sites in top of the list. Normally the top sites are full of garbage.

  30. Posted August 18, 2016 at 9:00 am | Permalink

    I’ve read some good stuff here. Certainly price bookmarking for revisiting.
    I wonder how much attempt you put to make this sort of wonderful informative web site.

    my web blog :: DorthyVSzoka

  31. Posted August 18, 2016 at 2:57 pm | Permalink

    Prediksi togel http://dewi4d.org/

  32. Posted August 18, 2016 at 9:40 pm | Permalink

    Wow, marvelous blog format! How lengthy have you ever been running a blog for? you make blogging glance easy. The total glance of your site is great, let alone the content! http://ow.ly/OBGn303jqlB

  33. Posted August 19, 2016 at 3:54 pm | Permalink

    With havin a whole lot content and articles do you ever encounter any
    issues of plagorism or copyright infringement? My site has
    many unique content I’ve either authored myself or
    outsourced however it seems a variety of it is popping it all around the internet
    without my authorization. Do you know any methods to aid
    stop content from being scammed? I’d certainly appreciate it.

    Here is my blog CandieVTyo

  34. Posted August 20, 2016 at 1:46 am | Permalink

    Marvelous, what a website it is! This blog provides helpful facts to us,
    keep it up.

    Stop by my page; JoeHFischang

  35. Posted August 20, 2016 at 4:13 pm | Permalink

    This piece of writing is truly a fastidious one it assists new web visitors,
    who are wishing in support of blogging.

    my web page JonaYPascall

  36. Posted August 21, 2016 at 5:01 am | Permalink

    I see many interesting posts here. Your site can go viral easily, you need some
    initial traffic only. How to get initial traffic??
    Search google for: Jemensso’s tricks

  37. Posted August 21, 2016 at 1:58 pm | Permalink

    Very nice post and straight to the point. I don’t know if this is actually the best place to ask but do you guys have any thoughts on where to get some professional writers? Thx :)

  38. Posted August 22, 2016 at 8:39 am | Permalink

    Europeos y la mayor parte de las necesidades tecnicas latinoamericanas.

  39. Posted August 22, 2016 at 10:30 pm | Permalink

    Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. Seo Plugin

  40. Posted August 22, 2016 at 11:33 pm | Permalink

    Hello! I simply wish to offer you a huge thumbs up to
    the excellent information you’ve got here about this
    post. I am just going back to your internet site for further soon.

    My page EdgardoFTalk

  41. Posted August 23, 2016 at 10:16 am | Permalink

    domino online http://feraripoker.com/

  42. Posted August 23, 2016 at 8:17 pm | Permalink

    Acutecare quickly smoothes precise lines and wrinkles using exclusive, complex Fluid Cone Engineering.

    My homepage … professional skin care lines for salons (Bernadette)

  43. Posted August 24, 2016 at 2:23 pm | Permalink

    It is really a nice and useful piece of info. I am happy that you simply shared this useful information with us.
    Please keep us informed like this. Thanks for sharing.

  44. Posted August 24, 2016 at 2:30 pm | Permalink

    These are in fact wonderful ideas in concerning blogging.
    You have touched some good things here. Any way keep up
    wrinting.

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*