Community Project: Style a Simple Search Form
tuts workshop

Community Project: Style a Simple Search Form

The last community project was so successful I reckon we should make them a regular thing. This month, I want to see what you can do with a simple search form! Send your CSS over and worthy examples will be published on the site next week. Read on to find out more!

You can use whatever techniques you want, as long as they happen through the magic of CSS

This is Easy

I’m going to give you a simple piece of markup (a search input and button) which you’re free to style in any way you please. Here’s the markup (download it wrapped up as an html file if you want):

<form>
	<input type="search" placeholder="What are you looking for?">
	<button>Search</button>
</form>

Search inputs and buttons present us with some hefty challenges, but great potential. What do you think you could do with them, using the power of CSS? Here are two really basic examples, just so you get an idea of what we’re doing here.


Anything Goes

You can’t touch the HTML, without exception. But there’s loads you could do to style this search form via CSS!

  • Play with the colors
  • Alter the fonts (use @font-face if you want)
  • Play with the Placeholder
  • Add some dynamic content with pseudo elements
  • Go bonkers with the button
  • Blow us away with transitions
  • Even use textures and images if you want (just make sure you zip the whole lot up when you send it over)

The only thing you need to bear in mind is that the demo page already has its styles reset with normalize.css.


Sign Me Up!

This couldn’t be simpler:

I’ll publish the best ones when I’ve collected a few. This can be on-going too – there’s no deadline.

I look forward to seeing what you all come up with! Good luck!

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Hamid

    oh god, that’s a really good idea from Ian Yates, but i’ve a question Ian: can we using transition on the project?

    • http://www.snaptin.com Ian Yates
      Author

      You can use whatever you want as long as it happens through the magic of CSS :)

  • Hamid

    ok really thx, sorry for asking but i just confused when looked at your post, that’s why i asked:-)

  • Luis

    I tried to download Basic style and got an error. The other one is also giving an error. Can you fix it?

    • http://www.snaptin.com Ian Yates
      Author

      How intelligent of me – I hadn’t actually uploaded it :| Sorry about that!

  • http://www.iamtomvance.co.uk Tom Vance

    Looking forward to giving this a go. Already have some alternative ideas.

  • Łukasz

    Nice, another fun project :] this time I’ll be featured ;) Good job with this kind of community interaction

  • http://codecanyon.net/user/Frique Frique

    “Elton John” already wins.

    • http://www.snaptin.com Ian Yates
      Author

      I’m glad that was appreciated :)

  • Thomas

    You should have included a label – for better usability and as an additional styling hook :)

    • http://www.snaptin.com Ian Yates
      Author

      I definitely thought about it, but opted to keep things as simple as possible. As it’s an input type=”search” we can argue its accessibility is reasonable, though a label would certainly be better.

      Still, there’ll be more complex forms coming in the future!

  • http://www.stuffmadeby.me stuart

    this sending page is broken….. cant upload it

  • Abilon

    I’m getting this “Unable to determine field class:” in the link http://www.formstack.com/forms/envato-tuts_workshop

    • http://www.snaptin.com Ian Yates
      Author

      @Abilon @stuart I don’t have that issue – can you try again?

      • Abilon

        Sorry Ian, just a few minutes after, It worked properly.

      • Abilon

        And very nice post, I just started working on my form.

  • Francis Thibault

    Already working on this! Now let’s add some animation – transitions!

  • Collin Phillips

    This aught to be good.

  • Paul

    The http://www.formstack.com/forms/envato-tuts_workshop page is giving me a 500 error

    • http://www.snaptin.com Ian Yates
      Author

      I’ve really no idea why formstack is throwing errors – I can’t duplicate the problem myself :( Can I suggest you just try again?

      • Paul

        Its working now and i submitted my form. I tried many times over the past hour. I’m not sure what was happening.

  • http://www.francisthibault.com Francis Thibault

    It is working now, I had the same error but kept trying and it is working, submitted my Google Voice Jelly Bean inspired design.

  • John Belisle

    Where/when should we look for the posting that includes submissions?

    • http://www.snaptin.com Ian Yates
      Author

      Check back with Webdesigntuts+ in about a week – I’ll put up a second post with the featured submissions (we have some toppers already!)

  • http://stephensauceda.com Stephen Sauceda

    I had a good time with this. Not editing the HTML really forces some creativity so mine TOTALLY falls back to junk in less than IE9. LOL

    • http://www.francisthibault.com Francis Thibault

      I think it will be the case for most designs ;)

      • http://stephensauceda.com Stephen Sauceda

        It wouldn’t be a big deal if pseudo elements worked on the input. Had to hack it out to get what I wanted to actually work without them.

        • John Belisle

          I didn’t have a problem getting pseudo elements to work without having to use any kind of hacks.

          • http://stephensauceda.com Stephen Sauceda

            On the input element? It’s a no-content tag so they shouldn’t work (and I couldn’t seem to get them to). The section, form and button tags are no problem because they contain other content but the input should be a no-go.

          • http://www.snaptin.com Ian Yates
            Author

            That’s right – you won’t be able to add pseudo elements to the input as it isn’t a content element itself. You will be okay with the button however :)

          • John Belisle

            I only tried the :hover and :focus pseudo elements and they worked just fine on the input (I just had it change the border color and box shadow on hover and keep it on focus).

            I didn’t try the :before or :after pseudo’s though so you’re probably right about those.

          • http://wouterj.nl Wouter J

            :hover and :focus are psuedo classes, ::before and ::after are psuedo elements. There are totally different, in CSS3 they also look different (elements with `::` and classes with `:`)

    • http://code-junkie.com Brannon

      It would be nice if they would use Modernizer by default on these little CSS creativity exercises. That would make it a lot easier to keep these from falling apart in old IE/other dinosaur browsers.

  • http://eichefam.net Paul

    Re: Elton John

    Really? Really??

    • http://www.snaptin.com Ian Yates
      Author

      Oh yes.

      • http://code-junkie.com Brannon

        Was I supposed to read this in the Professor’s voice? Because I did.

  • Ernesto Camacho

    Nice just sent mine in, Community Projects are a fantastic idea!

  • http://www.jtechcommunications.com JTech

    Nice CSS exercise to think creatively on web forms.

  • teresa

    Good one. Where can we add the details? In a separate txt file?

    • http://www.snaptin.com Ian Yates
      Author

      Download the blank source and edit the CSS file within. You’ll find a slot to enter your personal details at the top of the CSS :)

      • http://wouterj.nl/ Wouter J

        Can you explain the personal details section?

        <option
        data-author=”—Your Name—”
        data-link=”—http://www.yourwebsite.com/—”
        data-scheme=”—Description Name—”>
        —Theme Name—
        </option>

        I think ‘Description name’ is the place to put some description/info? Or what does it mean?

        • http://www.snaptin.com Ian Yates
          Author

          Oooh, sorry. That’s meant to say “Description”, not “Description Name” (which makes no sense…)

  • http://jelmarbosscher.nl/ Jelmar Bosscher

    Can’t wait to see them all! And I would be so suprised if mine would be in the best ones, can’t wait!

    Give me another assignment please.

    • Jesus Bejarano

      This is not a contest.

  • http://laurensdeb.tumblr.com Laurens Debackere

    Can we send new versions of this project, so for instace send a version 1.0 and later on a version 2.0?

    • http://www.snaptin.com Ian Yates
      Author

      Absolutely – you can send as many submissions and versions as you like :)

    • http://jelmarbosscher.nl/ Jelmar Bosscher

      Laurens, I suppose you can but keep in mind that Ian has to do twice the work for only one piece.
      If you made something totally different just give it an other name and description. And watch your chances of coming in the “Best” list grow with 100%!

  • http://laurensdeb.tumblr.com Laurens Debackere

    Uploaded my version 2.0. Hope you liked it! (Named: Minimal Greatness (LOL))

    You can view a version of this online : http://bit.ly/LTlA3f

    Laurens

  • Ragnar Valgeirsson

    Fun practice! Upload complete….

  • http://joejoiner.tk/ Joe Joiner

    Just sent mine. Keep these projects going please! I have picked up some fantastic ideas :)

  • http://www.cirkut.net/ Josh Allen

    So I just submitted my first go at this. However I have a question: In order to do a background color/image, I have to alter the html and body CSS. I know it’s been reset with normalize.css, and I see how you did it in your examples. Is it okay if I set the html and body width and height to 100%?

    • http://www.snaptin.com Ian Yates
      Author

      That shouldn’t be a problem – give it a whirl and I’ll try it out :)

  • http://brokenbulb.site40.net/ Rahul

    So, how long will it take to publish the collected one’s.
    Is it going to take a long time?

    It’s a nice idea btw. More of these kind of community projects should be encouraged.
    And thanks for this one.

    • http://www.snaptin.com Ian Yates
      Author

      Couple of days :)

      • http://brokenbulb.site40.net/ Rahul

        Great. Sounds awesome :)

  • http://www.kleinmedia.nl Klein Media

    Thank you so much for the article :) Still the back-end of a search plugin makes me miserable!

  • Pingback: Community Project: Search Form Results! | Webdesigntuts+

  • Irko

    I just came from a little trip so I quickly created something.

  • Pingback: Community Project: Search Form Results! |

  • Pingback: Community Project: Search Form Results! | Shadowtek Hosting and Design Solutions

  • Pingback: My Stream | Community Project: Search Form Results! | My Stream

  • Pingback: Community Project: Search Form Results! | How to Web

  • http://twitter.com/AminSetyo HTC Community

    bingung gan ane :((( http://aminhtc.com/