background preloader

Advanced CSS Menu

Advanced CSS Menu
Last tutorial, I showed you how to design a watercolor effect menu in Photoshop. This tutorial I will show you how to slice up the menu design (step by step) and put them together with CSS. Most of you probably know how to code a horizontal or vertical CSS list menu. Now let's take it to the next level — code an advanced (un-typical) list menu utilizing the CSS position property. View Demo CSS menu Download Demo ZIP Overview Here are the required graphics to assembe the menu (you can download from the zip). 1. Open the Photoshop file. 2. Turn off the background Layer Group and leave only the menu text layers visible. Create a new file and take note of the file dimension (w x h), in my case the "home" graphic is 144 x 58px. Here is how the hover effect will work. Repeat this step for the other buttons. 3. When you are done with the graphics, let's start coding. #menu Reset the menu to no padding, no margin, and no list-style. #menu span #menu a The key point here is the text-indent property.

CSS Generator - Generate your own CSS Style Sheet code How to Make a CSS Sprite Powered Menu We haven’t gone back to basics in a while. Today’s tutorial will bring you through the process of building a slick menu using a single CSS sprite image. It’s a simple, but elegant solution for most websites. The end goal is to create a navigation menu that loads quickly, and does not require any dated JavaScript for hover effects. The Goal This CSS sprite will keep HTTP requests down and increase load speed. Design the Menu Breaking from the usual flow of tutorials, we’re going to take a look at part of the Photoshop process before hitting the code. Love the Grid Rulers and markers are your best friend when it comes to CSS sprites. In order for the positioning to work in CSS, you’ll need to know the rough coordinates of each menu item inside the sprite. To put it another way, I would much rather remember 100px, 200px, etc than 101px, 342px, etc. Structure with HTML The code below will set up a basic menu structure for us to work with in CSS. A Brief Word on SEO Position Images with CSS

40 Powerful CSS Tools And Generators To Automate Your Workflow Showcase of 40 useful and powerful CSS tools and generators. These tools can really relieve developers work in many ways – I understand you like always to do everything by yourself but it’s not the best way in the most cases, because it really takes time and such liberty we don’t always have. This is considered to be really complete list about everything CSS related, as CSS lover myself I really evaluate good automated ways so I can focus on things I enjoy the most – creating elegant, usable and optimized website! I just hope you will find some relief in this list as well! Enjoy your time and test these tools for best results! 1. Showcase of 40 useful and powerful CSS tools and generators. 2. Simple CSS allows you to easily create Cascading Style Sheets from scratch, and/or modify existing ones, using a familiar point-and-click interface. 3. Formats and optimizes CSS. 4. CleanCSS is a powerful CSS optimizer and formatter. 5. 6. 7. 8. CSS Sorter is a free online tool for sorting CSS files.

Drop-Down Menus, Horizontal Style Anyone who has created drop-down menus will be familiar with the large quantities of scripting such menus typically require. But, using structured HTML and simple CSS, it is possible to create visually appealing drop-downs that are easy to edit and update, and that work across a multitude of browsers, including Internet Explorer. Better still, for code-wary designers, no JavaScript is required! (Actually, a tiny bit of JavaScript is needed, but it’s not what you think.) Article Continues Below Here’s a sneak preview of the menu in action. Creating the menu#section1 The first and most important part of creating our menu is the menu structure itself. That’s it: some simple HTML that is both accessible and easy to edit. Visually appealing? If you have previewed the menu above, you’ll see a pretty boring list of items. The first step is to remove the indents and bullets from the unordered list and define the width of our menu items. Next, we need to position our list items. Now the fun bit.

Beautiful CSS3 Search Form Lately I've been playing around with CSS3 and discovered some new CSS tricks. Did you know you can make a round circle with border-radius and create inner shadow effect with box-shadow inset? Check out this beautiful search form demo that I've created with CSS gradient, border-radius, and box-shadow. It displays perfect in CSS3 browsers and degrades gracefully in non-CSS3 browsers. View Demo Search Form Round Circle Trick You can create a round circle by specifying a very large value with the border-radius property. Inner Shadow Effect Specifying inset values with the box-shadow property to create a inner shadow effect. Search Form Example The following search form demo is created with CSS gradient, border-radius, and box-shadow with inset values (view the demo with Chrome 4+ or Firefox 3.5+).

The Mystery Of CSS Sprites: Techniques, Tools And Tutorials - Smashing Magazine Advertisement CSS Sprites are not new. In fact, they are a rather well-established technique and have managed to become common practice in Web development. What Are CSS Sprites? The term “sprite” (similar to “spirit,” “goblin,” or “elf”) has its origins in computer graphics, in which it described a graphic object blended with a 2-D or 3-D scene through graphics hardware. Sprites were displayed over a static or dynamic background image, and the positioning of the sprite was controlled simply by the hardware controllers. The Pokemon Sprite Sheet, consisting of over 1000 graphic objects. Time passed, and at the beginning of the 2000s, when progressive Web designers started to seek alternatives to JavaScript-based rollover menus (with onMouseOver and onMouseOut effects), sprites saw a renaissance in Web development. In 2004, Dave Shea suggested a simple CSS-based approach to CSS sprites based on the practice established by those legendary video games. Where Are CSS Sprites Used?

Tabs See the demo page for the finished version of the code. In this example, we'll look at using CSS to build a tabbed display. One where the user can click on individual tabs to view different content within the same space. It will require a few lines of JavaScript to dynamically update the individual tabs but we'll cover that code later. Constructing the Display The Tabs The tabs consist of simple A tags using style classes designed to make them look like the little tabs found on file folders. The CSS and HTML code is shown below. The outer DIV element provides a container for the tabs, its "tabArea" class setting a base font for them. The Active Tab To make one tab stand out, we define a new style class named "activeTab" which can then be combined with the "tab" class on any link. Then the HTML code is updated to make one tab appear active by adding this class name to the link tag. You can assign multiple style classes to an element by separating the names with spaces in its CLASS attribute.

CSS Absolute Positioning: Create A Fancy Link Block Absolute position is a feature of the CSS2 specification that is supported by all of web browsers. If you posit an element (an image, a table, or whatever) absolutely on your page, it will appear at the exact pixel you specify. In this tutorial, we will use some tricks to create a fancy link block that make our links more attractive. The final result of our work will be as same as the demo below. Write your link block elements in HTML code We will create the HTML code first. Our HTML will be: Before applying CSS code, let’s see how our link block would be Applying CSS code And this is our CSS code For the List of links: For the Title of the links: We need to set margin left 45px for the title to display image in this space. CSS for the description: The same as the title, you should remember to set clear is none. Add CSS code for image: Now, we will review our HTML code. Remember to set z-index for the link to make sure it is always on top. Absolute CSS Trick CSS tutorial Position Related Articles

Accordion using only CSS An accordion effect can be achieved using CSS3’s :target pseudo-class, without requiring JavaScript. Using the proprietary -webkit-transition property this accordion can also be animated. Result CSS3 Accordion Works in browsers that support the :target pseudo-class, see the Quirks Mode compatibility tables. Experiment updated. How To Each part of the accordion has an ID, heading and content region. <div class="accordion"> <h2>Accordion Demo</h2> <div id="one" class="section"> <h3> <a href="#one">Heading 1</a> </h3> <div> <p>Content</p> </div> </div> <div id="two" class="section"> <h3> <a href="#two">Heading 2</a> </h3> <div> <p>Content</p> </div> </div></div> The CSS then relies on the :target pseudo-class to apply different styles to the chosen section — increasing the height and, in large content cases, altering the overflow behaviour to allow scrolling. Stripping out the styling, the CSS boils down to: Critique Obviously this approach has its limitations.

Quick Tip: A Crash-Course in CSS Media Queries In the past, in order to create layouts based upon the width of the user's browser, we had to use JavaScript -- perhaps combined with a server-side language. Fortunately, the process is now becoming far simpler, thanks to CSS media queries. Method 1: Within your Stylesheet Method 2: Import from within your Stylesheet Note that you can also add addition rules, by applying a comma -- much like you would when using multiple selectors. Method 3: Link to a Stylesheet Method 4: Targeting the iPhone An interesting note, after a bit of research around the web, is that, despite the fact that iPhone 4 sports a resolution of 640x960, it still we pick up mobile.css, referenced in the code above. Browsers that Support CSS Media Queries Firefox 3.5+ Opera 9.5+ Safari 3+ Chrome Internet Explorer 9+

50 New Useful CSS Techniques, Tutorials and Tools - Smashing Magazine Advertisement These are great times for front-end developers. After months of exaggerated excitement1 about HTML5 and CSS3, the web design community now starts coming up with CSS techniques that actually put newly available technologies to practical use instead of abusing them for pure aesthetic purposes2. We see fewer “pure CSS images” and more advanced, clever CSS techniques that can actually improve the Web browsing experience of users. And that’s a good thing! In this post we present recently released CSS techniques, tutorials and tools for you to use and enhance your workflow, thus improving your skills. CSS Techniques Now Playing: transitions and animations with CSS3Tim Van Damme showcases a fairly simple CSS design that uses transitions, animations and subtle hover-effects to produce an engaging user experience. CSS3 range slider, checkbox + radio button4A demo of HTML input elements made with CSS3. The Simpler CSS Grid13Why restrict your layout so that it can fit into this 960gs?

Related: