Skip navigation
Help

content management

warning: Creating default object from empty value in /var/www/vhosts/sayforward.com/subdomains/recorder/httpdocs/modules/taxonomy/taxonomy.pages.inc on line 33.

This is a guest post written by Claude Johnson, a Lead Site Reliability Engineer at salesforce.com.

The following is an architectural overview of salesforce.com’s core platform and applications. Other systems such as Heroku's Dyno architecture or the subsystems of other products such as work.com and do.com are specifically not covered by this material, although database.com is. The idea is to share with the technology community some insight about how salesforce.com does what it does. Any mistakes or omissions are mine.

This is by no means comprehensive but if there is interest, the author would be happy to tackle other areas of how salesforce.com works. Salesforce.com is interested in being more open with the technology communities that we have not previously interacted with. Here’s to the start of “Opening the Kimono” about how we work.

Since 1999, salesforce.com has been singularly focused on building technologies for business that are delivered over the Internet, displacing traditional enterprise software. Our customers pay via monthly subscription to access our services anywhere, anytime through a web browser. We hope this exploration of the core salesforce.com architecture will be the first of many contributions to the community.

0
Your rating: None

The content model is one of the most important content strategy tools at your disposal. It allows you to represent content in a way that translates the intention, stakeholder needs, and functional requirements from the user experience design into something that can be built by developers implementing a CMS. A good content model helps ensure that your content vision will become a reality. Lovinger explains how to craft a strong content model and use it to foster communication and align efforts between the UX design, editorial, and technical team members on your project.

0
Your rating: None

larry ellison

Editor’s note: Aaron Levie is CEO of Box. Follow him on Twitter @levie.

In 1997, Larry Ellison had a vision for a new paradigm of computing which he called the Network Computer (NC). The idea was simple: a group of partners would build devices and services that leveraged the power of the Internet to compete against the growing Windows monopoly.

Ellison believed that the computer in the client/server era had evolved into too complex a machine for most tasks. With the NC, the ‘heavy’ computation of software and infrastructure would be abstracted from the actual device and delivered instead to thinner terminals via the web, thus radically simplifying access and enabling all new applications and mobility.

But the NC never made it mainstream. Microsoft and its allies had already amassed considerable power, and the cost of personal computers was dropping rapidly, making them even more attractive and ubiquitous. Furthermore, many of the applications were too immature to compete with the desktop software experience at the time; and few people, as it turned out, wanted to buy a device championed by Oracle.

The NC fell short on execution, but Ellison was right about the vision: “It’s the first step beyond personal computing, to universal computing.” In many ways, he was the first to glimpse a future resembling the post-PC world we are rapidly moving towards today.

15 years later, it is Apple that has brought its version of this vision to life. And Apple’s rising tide – already 172 million devices strong, sold in the last year alone – has in turn given rise to a massive, vibrant ecosystem: companies generating hundreds of millions and billions of dollars in value in under a few years, revolutionizing industries like gaming, social networking, entertainment and communications in the process. Then of course there’s Instagram.  All proving that value created in this mobile and Post-PC world will rival traditional computing categories.

But the post-PC transformation isn’t limited to the consumer landscape. In the enterprise, we’re transitioning to a way of working that is far more fluid, boundary-less and social. And mobile pushes computing to the cloud and rewrites all applications in its wake. Those who saw it coming (Oracle) and those who initially resisted its arrival (Microsoft) have equally been taken by surprise by the power and speed of the post-PC shift within today’s enterprises, and it’s creating one of the biggest opportunities ever.

Why the change is so profound

We recently met with the IT leadership team of a fairly conservative 50,000-person organization where all the participants all had iPads. No big surprise there. But the apps they were using were radically different from what you would have found in their organization only a few years back – a mix of apps from a new set of vendors that together supplant the traditional Microsoft Office stack.

Post-PC devices are driving enterprises to rethink their entire IT architecture, thanks to a wildly unpredictable and improbable chain reaction set off by a new consumer device from Apple.  For the first time in decades, CIOs have the opportunity – and necessity – to completely re-imagine and rebuild their technology strategy from the ground up. Catalyzing this change is the fact that the technology switching costs are often less than the price of maintaining existing solutions. A shipment of 1,000 new iPads requires applications to run on these devices – and choosing all-new applications and vendors is generally cheaper than the service fees, infrastructure, and operational costs of legacy software.

And thus, the Post-PC era drives the final nail in the coffin of the traditional enterprise software hegemony. Microsoft, in particular, built up a practical monopoly that lasted nearly twenty years, and forced an entire industry to conform to its way of seeing the world.  Yet this arrangement served its benefactor far more than the ecosystem, as the Redmond giant built up leadership positions across nearly every application category.

In the Post-PC era, businesses will shift from deploying and managing end-to-end enterprise solutions from a single vendor, to consuming apps a la carte both as individuals and en masse. But which apps and vendors will help define this new world?

What’s coming won’t look like what came before

Change always begins incrementally at first. Predicting specifically what will happen in the next year or two is a far more realistic undertaking than anticipating where we’ll be in a decade. In shifting from one technology generation to the next, we minimize disruption by porting the old way of doing things to newer mediums or channels. Not until the new model settles in do we see the real results that rise from these foundational shifts.

Mobility is such a foundational shift, and it’s still very, very early. Even when the Microsofts and Oracles of the world relent and build applications for post-PC devices, these apps will carry much of the DNA of their desktop predecessors. We can imagine that each of the enterprise mainstays – ERP, HR management, supply chain, business intelligence, and office productivity – will be painstakingly moved to mobile. But that’s just the first phase.

Emerging CRM startups like Base will challenge longstanding assumptions about where and how you manage customer interactions. Data visualization software like Roambi will make business analytics more valuable by making it available everywhere. Entire industries are already being transformed: mobile healthcare apps will enable cutting-edge health outcomes, and construction sites will eventually be transformed by apps like PlanGrid.  Companies like CloudOn and Onlive aim to virtualize applications that we never imagined would be available outside the office walls. Evernote’s 20+ million users already make it one of the most popular independent productivity software apps of all time, whose value is dramatically amplified by this revolution.  In a mobile and Post-PC world, the very definition of the office suite is transformed.

And with this transformation, much of the $288B spent annually on enterprise software is up for grabs.  The post-PC era is about no longer being anchored to a handful of solutions in the PC paradigm. Instead, we’re moving to a world where we mix and match best-of-breed solutions. This means more competition and choice, which means new opportunities for startups, which should mean more innovation for customers. As soon as individual workers look to the App Store for an immediate solution to their problem instead of calling IT (who in turn calls a vendor) you can tell things will never be the same.

In many ways, the enterprise software shift mirrors that of the media and cable companies fighting for relevance in a world moving to digital content (HT @hamburger). If users and enterprises can select apps that are decoupled from an entire suite, we might find they’d use a completely different set of technology, just as many consumers would only subscribe to HBO or Showtime if given the option.

Of course, every benefit brings a new and unique challenge. In a world where users bring their own devices into the workplace, connect to any network, and use a mix of apps, managing and securing business information becomes an incredibly important and incredibly challenging undertaking. Similarly, how do we get disparate companies to build apps that work together, instead of spawning more data silos?  And as we move away from large purchases of suites from a single provider, what is the new business model that connects vendors with customers (both end users and IT departments) with minimal friction?

And then there’s the inherent fragmentation of devices and platforms that defines the post-PC era. Android, iOS, and Windows 7 and 8 all have different languages and frameworks, UI patterns, and marketplaces. The fate of mobile HTML5 is still indeterminate. Fragmentation and sprawl of apps and data is now the norm. And while this fragmentation is creating headaches for businesses and vendors alike, it’s also opening a window for the next generation of enterprise software leaders to emerge and redefine markets before the industry settles into this new paradigm.

It would appear that Larry Ellison’s vision for the NC was right all along, just 15 years early. Welcome to the post-PC enterprise.

0
Your rating: None


Gordon Stettinius, Govenor, a collaboration with Terry Brown


Gordon Stettinius, Senator, a collaboration with Terry Brown

I'd like to offer up another option in our presidential election. Senator or Governor Gordon Stettinius has my complete support! I've known Gordon Stettinius for a number of years, and there is something about the man that resonates deeply with me. He's irreverent, he's self deprecating, he's smart, and is serious in the best possible way. He makes things happen and takes chances, and he is charging full speed ahead into new arenas of the photo world, and succeeding mightily as he goes.


Self Portrait with Murphy

In the last two years, Gordon has gone from being a father, photographer, and educator, to a father, photographer, educator, publisher, gallerist, and just about everything else. His new gallery venture, the Candela Gallery, includes the Candela Unbound Invitational Exhibition and the submission date is April 6th, 2012. And are you listening? There is NO entry fee.


Walker & Mary Kathryn, Richmond, VA

INTERVIEW

We first connected in the toy camera orbit, right after you were winding down Eye Caramba--which seems like a very long time ago…can you go back in time and share your journey into photography and to launching a very early e-zine?

Eye Caramba, the online magazine, was sort of a blip when I think of it now but I published I think 2-3 issues a year for a few years. Really, it is a little quaint to think about how the web magazine then looked because the graphics had to be so pared down, and one 35 kilobyte image to a page was about as much as most people had time for. Try to put two images on a page and you may as well get up and fix dinner while the page loaded. I guess the real reason for starting something online was I had been wanting to mimic SHOTS magazine because I loved the community that revolved around that particular magazine. I was living in Minneapolis at the time but had an occasion to visit Bob Owen in Texas in 1995 or so just to get a feel for what type of work went into the publishing of SHOTS. And I was mulling over doing something like what Bob was doing or maybe a tabloid like Photo Metro used to be... But then soon after, Bob called me up and said his wife had taken a job in Minneapolis and he was moving to town in just a few months. So, it struck me as somehow a little off to try to mimic SHOTS but in the same town. And so I tabled the idea but thought that an online magazine might have some potential.

The interwebs were less fantastical then and many photographers needed help with compressing their work and nothing was particularly fluid on the content management side but I bumped along for a while. As it turns out, I was just a poser. SHOTS is still around luckily though and Russell Joslin has done a great job over the years after taking over for Bob. So, I eventually took over Eye Caramba as my own site as I always liked the sound of it.

As to the toy camera side of the equation, I had been using plastic cameras for almost as long as I was making pictures. The low fidelity world was sort of a pre-information wilderness also back then - another reason I loved SHOTS actually was the toy camera issue. So, when the Great Lakes toy site morphed into toycamera.com I was pretty enthusiastic about all of my new friends. And we actually had a pretty good run there for some years. I guess I have always enjoyed being part of a photo community and that may answer some of the later questions as well.


Ninjas, Richmond, VA

Where did you get your sense of humor and your smart irreverence for anything with a whiff of B.S.?

The slightly embellished response would be that once I started taking photography more seriously, and started running with more and more photographers, I realized that there was a whole lot of earnestness in this world. And truly, I believe that photography does have the potential to bring attention to some of the injustices of the world or to make real what can only be felt in one's heart or illuminate the issues facing us at most every turn. Really photography can do many of these great things and more... but somehow, I realized that people who were often doing more or less exactly what they wanted to do and then through the miracle of retro-elaborate proto-academical post rationalization, were conjuring all this compelling and deep jargon for their work. To read the accompanying artist statements, to certain otherwise quite fine work, was occasionally mind-blowing. How on earth did every single photograph in the fine art world get so imbued with such unfettered self-importance? I am not a cynic through and through but we can get pretty up our own arse sometimes. And I will lump myself in that crowd too.


Hands Off, Washington DC

Why the toy camera?

After I graduated from school, I wound up trying a couple different toy cameras when I was busy trying all manner of vintage equipment. My degree was a BA in studio art, doing mostly printmaking and drawing. So a lot of my photo education was post-college with the buying of thrift store cameras and different gear. I just didn't believe in the connection between expensive gear and 'better' images. I was more drawn to pinhole and plastic lenses and peculiar unpredictability.


Emmett, Richmond, VA

Before Gita Lenz came into your life, had you any thoughts of being a publisher? (Gordon's essay on Gita Lenz is here).

No, not really. Though I was drawn to the idea of zines and community as I mention above. Mostly, I just wanted to see that Gita got the type of book I felt she deserved and I was not thrilled with my first forays I to Print On Demand.

I can only image what a satisfying result it was to not only get the book published in her lifetime, but to have her experience a solo exhibition….

I wish I had really gotten this whole enterprise going a few years earlier because Gita was not fully of sound mind towards the end but still it was a beautiful thing to see her amazement about the book and the pride she took in her photography.


Gita Lenz Empire State Building, late 1940s - 1950s

Salt and Truth definitely put Candela Books on the radar of the book and photo world and what a terrific selection as a follow up to Gita Lenz. How did you come to work with Shelby Lee Adams?

Basically, it all comes down to timing. I started thinking about what sort of second book I might follow Gita's with and I had just assumed it would be a smaller project. But Shelby and I started talking when he was just starting to circulate a new book proposal and after a bit of research where I sorted out how I might improve my distribution from the first time out, I started in earnest discussing with Shelby about what his proposed book might look like. We both had some ideas about how his fourth book might differ in certain ways from his earlier books. So we had several conversations before I think we both felt it was a good match between us.

With both books, what has been the most satisfying part as a publisher? And what has been the most difficult or unexpected part of the process?

There are a number of elements to the process that provided a pretty good learning curve but really a lot of the challenge has to do with budget and time management. It isn't terribly tough when you are working with good people. In my case, I started by working with a design firm - Scout Design - I had worked with on several smaller projects and they are so detail oriented that I was free to have the larger concepts in the front of my mind and trust them to do their work.


Limited Edition of Salt and Truth

How many books do you plan to publish each year, and how do you go about finding your projects?

We are bringing one book out in the fall and expect to bring two books out next year. More news on this very soon.

As of last fall, you are now not only a photographer, publisher, and educator, but now a gallerist! How did the Candela Gallery get started?

A couple of years back, I started looking for a new studio space. And then the idea evolved into having a space that might function as a studio and office for Candela. Then the space I wound up investing in was in the downtown arts district and we have pretty amazing foot traffic. So the idea evolved some more, since I intend to work with quality photographers, I figured that putting their work up was a fairly natural decision. I was not quite prepared for the level of work it takes to run a gallery but everything has been very well-received so far. This year is scheduled now and I have gotten pretty excited about the way the year is going to go.


Julio Mitchel

I love the work of Julio Mitchel, your next exhibition at the gallery. What drew you to this artist?

Julio also approached me about a couple of potential book projects. While I still have something to learn about projects and their potential crossover, I was immediately struck by a few of Julio's different projects as well as his earlier books. His work is so very well seen and amazingly printed. A couple of months ago, I spent a couple of days with Julio looking at an incredible amount of work and decided that, while I am researching the markets to see if I can effectively produce and distribute quality books for the projects he will eventually publish, I would be excited to share his work through the gallery.


Julio Mitchel

Are you still teaching, or does the Candela empire take up most of your energies?

I am still teaching actually. I am teaching adjunct, a traditional darkroom class at VIrginia Commonwealth University.


Colonic, Richmond, VA

April 6th marks the deadline for the Unbound Collection. Can you tell us about this call for entry and your ideas behind it?

The idea stems from having only a limited number of open slots in the gallery schedule. I really wanted one show that would allow more photographers a chance to connect with Candela in some way and the rest of the shows in a given year will generally be solo shows or book related. I feel that most mid career photographers have done their share of juried shows and I wanted something that would be open in concept but that would also be worth doing for the photographers. No fees because I hope to raise money through a special event. Then the money from that event will be used to purchase work from the show. The idea is a little uncharted for me but the response has been great so far. And now to put together an event that will bring in a great crowd at a decent ticket price. Ideas we are entertaining include... Door prizes, gift wrapped crap, drunken clowns, PBR, live music... I also enjoy putting together a good night every now and then.


Another Pro Choice Welder, Richmond, VA

Are you up to anything new with your own work?

My own work has slowed down a bit. But I continue to work on the Mangini Series with Terry Brown and I am shooting randomly and getting into the darkroom some. I do have an idea for a 'project' that hasn't yet been started and I have a semi-ambitious show idea coming in 2013 that should also keep me going.


Green Tuft, a collaboration with Terry Brown


Beehive, a collaboration with Terry Brown


Combover, a collaboration with Terry Brown


Long & Straight, a collaboration with Terry Brown

And finally, what would be your perfect day?

Um... er... Some family time, a few hours in the darkroom, music, bourbon, humor, maybe a little bowling?


Feet, Toronto, Canada

0
Your rating: None

pacman

Editor’s note: Contributor Ashkan Karbasfrooshan is the founder and CEO of WatchMojo, he hosts a show on business and has published books on success.  Follow him on Twitter @ashkan.

In last week’s Get Rich or Die Trying article, I mentioned that “tech is a zero-sum, winner takes all game”.  A reader objected, arguing: “I think that may be an inappropriate use of the term ‘zero-sum’ – one company’s increase in profits (or revenue) does not mean a competitor must see declining profits (or revenue)”.

History suggests that Jack Welch’s philosophy that “a company should be #1 or #2 in a particular industry or else leave it completely” is even more applicable to the tech industry, where the top player can build a sustainable and ever-growing business but everyone else is practically better off getting out.

Examples of market dominance by the #1 that come to mind include:

-          Google in search,
-          Facebook in social networking,
-          Groupon in daily deals, and
-          Amazon in e-Commerce.

This doesn’t mean that the:

-          #1 player isn’t susceptible to the Innovator’s Dilemma, or
-          #2 competitor can’t build a massive business.

Indeed, Microsoft’s Bing or LivingSocial are meaningful #2’s in search and daily deals respectively, but clearly the network effects and economies of scale that come with market share dominance make it nearly impossible for challengers to remain relevant over-time. Monopolies are nothing new and come and go: Google is the evolution of Standard Oil, AT&T and Microsoft in search, you can argue that Apple is next in line in mobile.

What is Zero-Sum Game Anyway?

First, the definition:

“In game theory and economic theory, a zero-sum game is a mathematical representation of a situation in which a participant’s gain (or loss) of utility is exactly balanced by the losses (or gains) of the utility of the other participant(s). If the total gains of the participants are added up, and the total losses are subtracted, they will sum to zero.”

Indeed, while the tech sector is huge, within each segment, you see a zero-sum game from each individual purchasing decision out.  For example,

-          a consumer will buy a Mac or PC; an iPhone or Android device, etc.
-          a business will adopt a solution from Oracle or Siebel, for example,

But it’s rare for a consumer to buy or a company to adopt both.

If you repeat this binary-like decision process throughout the industry and economy, you get a zero-sum situation where one competitor’s gains come at the expense of others’ in the industry: Apple’s iPhone sales obviously put a dent in the Blackberry; and its iPads are evidently going to affect PC sales – no matter how much some want to deny it.

It’s Like This in Most Industries, The Only Difference Is Severity

I run an online video content company and categorize video companies into four quadrants:

-          Content (creators),
-          Distribution (search, distribution),
-          Technology (content management systems, content delivery networks), and
-          Advertising (ad networks, servers)

Clearly there’s a lot of overlap and how those four interact with one another merits an article in of itself (or hundreds).  While technology (with a lower case) enables Content companies, it increasingly underpins Distribution, Technology and Advertising companies.

As such, I see this zero-sum phenomenon every day with the latter three.  When TechCrunch’s parent AOL bought 5Min for example, it was a matter of time before AOL stopped licensing Brightcove’s Online Video Platform and instead use 5Min’s player.  Seeing how AOL and 5Min were my distribution partners, I kept that thought to myself, but it was a matter of time.  Today AOL’s main platform for video is indeed 5Min (note: I am not an AOL/5Min employee).

Content Isn’t a Zero-Sum Game: “I’m Your Pusher”

In content, it’s not really like that. ABC, CBS, FOX, NBC all have meaningful franchises.  Sure, if you watch FOX on Sunday at 6pm then you may not watch ABC at that time, increasingly with cord-cutting and time shifting that isn’t the case anymore.  In fact, content is so not a zero-sum game that a company like Viacom has multiple brands to address that reality.

Indeed, if you want to travel to Barcelona, you won’t watch one video or read an article, you will read/watch many and I’d argue that content consumption – like a drug – just creates more demand.

But if you want to book a ticket to Barcelona, you will either use Travelocity or Expedia, for example.

Place Your Bets

That makes content a less-risky endeavor, and, with digital media and digital distribution reducing the marginal cost of production and distribution, then content has become a better risk-adjusted bet, though arguably not as scalable and certainly not a winner-takes-all gamble.

It will take an entire generation before investors realize this; though some argue that it’s already started. According to media guru Jack Myers, “VC funds are being redirected away from tech and toward content. Technology-based venture opportunities in the media and advertising space have been largely played out. Bottom line, venture capital funds will be shifting from technology to content, context, commerce and research.”

I’m not holding my breath, even though digital content is effectively the new software.

In Tech, Competition Becomes Blurry Over Time

The same way that the Internet has changed content, it has also changed technology.  For one, with consumer-focused technology companies being free, advertising-supported businesses, the prevailing asset isn’t necessarily the underlying hardware or software, but rather, the audience.

This is why tech companies are all seemingly fighting one another:

-          Facebook vs Google in search and social networking,
-          Google vs Apple in mobile,
-          Amazon vs Apple in tablets and entertainment,
-          Microsoft vs Google in search.

You get the idea: in tech, everyone morphs into everyone’s competitor… and since the main asset – the audience or consumer base – is so fleeting, tech becomes an even riskier bet.

The Four Horsemen

Whereas initially the Web pitted “content vs. tech”, as the Web matures, it becomes “tech vs. tech” with Content becoming Switzerland amongst Distribution, Technology and Advertising companies.

In the real world, there is no perfect example of a zero-sum game – granted.  But whereas Jack Welch argued that a business ought to be #1 or #2 or get out, the network effects that the web has unleashed over time force technology (lower case) businesses to either be #1 or get the hell out.

0
Your rating: None

It is time to move toward a future-friendly web. Our current device landscape is a plethora of desktops, laptops, netbooks, tablets, feature phones, smartphones, and more, but this is just the beginning. The rapid pace of technological change is accelerating, and our current processes, standards, and infrastructure are quickly reaching their breaking points. How can we deal with increasing device diversity and decreasing attention spans? Brad Frost of futurefriend.ly explains how, while this era of ubiquitous connectivity creates new challenges, it also creates tremendous opportunities to reach people wherever they may be.

0
Your rating: None

Every website needs an audience. And every audience needs a goal. Advocating for end-user needs is the very foundation of the user experience disciplines. We make websites for real people. Those real people are able to do real things. But how do we get to really know our audience and find out what these mystery users really want from our sites and applications? Learn to ensure that every piece of content on your site relates back to a specific, desired outcome — one that achieves business goals by serving the end user. Corey Vilhauer explains the threads that bind UX research to content strategy and project deliverables that deliver.

0
Your rating: None

The future is flexible, and we’re bending with it. From responsive web design to futurefriend.ly thinking, we’re moving quickly toward a web that’s more fluid, less fixed, and more easily accessed on a multitude of devices. As we embrace this shift, we need to relinquish control of our content as well, setting it free from the boundaries of a traditional web page to flow as needed through varied displays and contexts. Most conversations about structured content dive headfirst into the technical bits: XML, DITA, microdata, RDF. But structure isn’t just about metadata and markup; it’s what that metadata and markup mean. Sara Wachter-Boettcher shares a framework for making smart decisions about our content's structure.

0
Your rating: None

  

Developing for the Web can be a difficult yet rewarding job. Given the number of browsers across the number of platforms, it can sometimes be a bit overwhelming. But if we start coding with a little forethought and apply the principles of progressive enhancement from the beginning and apply some responsive practices at the end, we can easily accommodate for less-capable browsers and reward those with modern browsers in both desktop and mobile environments.

screenshot

A Common Structure

Below is the HTML structure of a navigation menu created by WordPress. This unordered list is pretty common for content management systems and hand-coded websites alike. This will be the basis for our work.

Please note: Any ellipses (…) in the snippets below stand in for code that we have already covered. We have used them to shorten the code and highlight the parts that are relevant to that section.

<nav class="main-navigation">
   <ul>
      <li><a href="#home">Home</a></li>
      <li>
         <a href="#about">About Us</a>
         <ul class="children">
            <li><a href="#leadership">Leadership</a></li>
            <li><a href="#involvement">Involvement</a></li>
            <li><a href="#vision">Our Vision</a></li>
         </ul>
      </li>
      <li><a href="#clients">Our Clients</a></li>
      <li>
         <a href="#support">Support</a>
         <ul class="children">
            <li><a href="#blog">Blog</a></li>
            <li><a href="#downloads">Downloads</a></li>
            <li><a href="#faq">FAQ</a></li>
         </ul>
      </li>
      <li><a href="#contact">Contact Us</a></li>
   </ul>
</nav>

Unstyled Navigation
Our navigation, unstyled.

Our Tools

  • CSS Reset
  • HTML5 elements
  • LESS CSS
  • jQuery

CSS Reset

Resetting our CSS styles is where we’ll start. Browsers have different default styles for the elements we’ll be using, so understanding this and getting all of the elements to look the same is important. In this example, since we’re using an unordered list, there will be default left padding, top and bottom margins, and a list-style. You can either deal with these individually or, if you’re project will include more than just this navigation, use a reset to clear all of the styles and start fresh. I prefer Eric Meyer’s Reset CSS, but there are a few others to choose from, listed below. Whichever you choose, make sure it accounts for the new HTML5 elements.

HTML5 and CSS3 Elements

We’ll be wrapping the menu in HTML5’s nav element, which is one HTML5 feature that we should be using right now. If you need more good reasons to use HTML5 in your daily work, such as accessibility, then read “Top 10 Reasons to Use HTML5 Right Now” over at Codrops.

CSS3 will give our menu the progressive feel we’re looking for. We can use nifty effects such as linear gradients, text and box shadows and rounded corners, while providing a reasonable appearance for browsers that are dragging their feet. You could also consider using something like CSS3 Pie in the process. This will give those lagging browsers most of the functionality they lack to display your CSS3 properties.

LESS CSS

To make our CSS more efficient, we’ll use LESS along with a class file to ease the difficulty of dealing with all of those browser prefixes. Other options, such as Sass and Compass, do effectively the same thing and might better fit your particular development environment. If you’re interested in learning more about LESS and how it compares to Sass, check out another article of mine, “An Introduction to LESS, and Comparison to Sass.”

jQuery

To make our navigation a little friendlier in small browsers, such as those on mobile devices, we’ll use JavaScript. Essentially, we will gather all of the elements in our navigation and reorganize them into a select form element. Then, when the user selects an option from the list, they will navigate to that page. Interaction with a select element is one of the easiest and best ways to handle navigation in a small window. The practice is pretty common as well, so the learning curve for users will be gentler.

Getting Started

After applying a reset, we get something like the following. You can see that the margins, padding and list styles have been cleared.

Reset navigation
Reset navigation

Child-Level Menus

For now, the child-level menus will only get in the way. The best thing to do is remove them from the equation and add them back in when it’s time to style them. To achieve this, we will apply position: relative to all of the list elements, and move the children off screen until they are needed.

.main-navigation {
   li {
      position: relative;
   }
   .children {
      left: -999em;
      position: absolute;
   }
}

Applying left: -999em; position: absolute; will move the children to the left of the screen by a significant margin. This method is preferable to just using display: none because it is more accessible to screen readers.

Unstyled without children
Unstyled without children

Common Navigation Styles

Every navigation menu will probably have links in it. But these links are not like the links we see in the main body of the page, which are blue, underlined and distinguishable from the surrounding text. Rather, links in the navigation will stand alone, and their function will be obvious. That being said, the links in a nav element will probably have a few features of their own that distinguish them from typical anchor tags.

nav {
   a {
      color: inherit;
      display: block;
      text-decoration: none;
   }
}

Thus, a link will inherit the color of the text assigned to the parent element, in this case nav. It will be set to display as a block-level element, because we want the clickable area to be large and we do not want underlining (because that would just look funny).

Navigation with more functional links
Navigation with more functional links

Please note: color: inherit is not supported in IE 6 or 7. If you need to support those browsers, then you will need to explicitly set the color that you want.

Lining Up

Getting the menu in line calls for the use of floats. Initially, we’ll float all of the elements in the nav element to the left. Later, we’ll undo this property for the child-level menus, along with a lot of the other styles that we’ll set along the way.

.main-navigation {
   ul, li, a {
      float: left;
   }
   …
}

Inline navigation
Inline navigation

Because every element in the nav element is now floated, the element itself will collapse as though it were empty. There are a few ways to deal with this. One is to also float the nav element itself, which will expand it to wrap around its contents. If need be, you can set it to width: 100% to fill any remaining space to the right. Or you could use Nicolas Gallagher’s “micro” clearfix solution, which essentially adds clear: both just before the closing of the nav element.

/* For modern browsers */
.cf:before,
.cf:after {
    content:"";
    display:table;
}
.cf:after {
    clear:both;
}
/* For IE 6/7 (trigger hasLayout) */
.cf {
    zoom:1;
}

Because we’re using LESS for our CSS, applying the clearfix to our main-navigation class without modifying the markup is very easy.

.main-navigation {
   .cf;
   …
}

We’ll see more of this, as well as a description of how this works, in the section titled “Rounded Corners and Gradients” below.

Styling

All righty. By now, you’re probably as tired of looking at an unstyled menu as I am. To start, we’ll build what looks like a block wall, and then chisel a nice menu out of it. We won’t serve the block wall to antiquated browsers, but it’s a good start anyway.

Background Color and Borders

.main-navigation {
   font-size: 0.8em;

   ul, li, a {
      …
   }
   ul {
      background: #eee;
      border: 1px solid #ddd;
   }
   li {
      …
      border-right: 1px solid #ddd;
   }
   li:last-child {
      border-right: none;
   }
   a {
      height: 35px;
      line-height: 35px;
      margin: 3px;
      padding: 0 15px;
   }
   .children {
      …
   }
}

In the code above, the text was just too big, so we shrunk it with font-size: 0.8em. This property is set on the main-navigation class, so it applies throughout the navigation. The top-level unordered list has a border: 1px solid #ddd property to break it out from the page. Each list item element is given a border-right: 1px solid #ddd; to separate it from each other. The li:last-child selector targets the last list item element in the unordered list, removing the right border because no item follows it.

The links within the navigation are given a background color and some left and right padding to add distinction and increase their clickable area. We’re fixing the height and line-height, instead of using top and bottom padding, so that we can predict more accurately where the child-level menus will be positioned relative to their shared parent list item.

Navigation resembling a block wall
Navigation resembling a block wall

Rounded Corners and Gradients

.main-navigation {
   …
   text-shadow: 0 1px 1px #fff;

   ul {
      border: 1px solid #ddd;
      .border-radius();
      .linear-gradient();
   }
   …
}

.border-radius (@radius: 5px) {
   border-radius: @radius;
}
.linear-gradient (@start: #fff, @end: #ddd, @percent: 100%) {
   background: @start; /* Old */
   background: -moz-linear-gradient(top,  @start 0%, @end @percent); /* FF3.6+ */
   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,@start), color-stop(@percent,@end)); /* Chrome, Safari 4+ */
   background: -webkit-linear-gradient(top,  @start 0%,@end @percent); /* Chrome 10+, Safari 5.1+ */
   background: -o-linear-gradient(top,  @start 0%,@end @percent); /* Opera 11.10+ */
   background: -ms-linear-gradient(top,  @start 0%,@end @percent); /* IE 10+ */
   background: linear-gradient(top,  @start 0%,@end @percent); /* W3C */
}

Above, we have created two new classes, border-radius and linear-gradient.

The border-radius class is actually what LESS developers refer to as a parametric mixin. Essentially, it’s like a class, but you can pass variables to it in case the default value isn’t exactly what you want. In this case, if 5 pixels isn’t what you want, you could reference the mixin as .border-radius(10px), and then it would use 10px instead of the original 5px. With the border-radius property, you could also pass it something like .border-radius(5px 0 0 5px), and it would apply the 5-pixel rounding to only the top-left and bottom-left corners. For more information and possibilities on border-radius, see “Border-Radius: Create Rounded Corners With CSS” at CSS3.info.

Another parametric mixin is linear-gradient. But with LESS, you can add classes to other selectors and it will apply the same styles—thus negating the need to modify the markup just to add another class (and, by extension, its styles) to an element. Both of the classes I’ve created cover the possibilities of browser syntax. Currently, Webkit has two different syntaxes, because for some reason the browser makers decided to ignore the specification when first implementing it and made up their own syntax. With Chrome 10 and Safari 5.1, they went back to the specification, joining the other browsers, and made things a little easier for us. However, if you still care about the previous versions, you’ll need to add their crazy syntax as well. We’ve also added a white text-shadow to the text in the navigation to give it a slightly beveled look.

Navigation with a gradient and rounded corners
With the two classes applied, you can see the slight gradient and the rounded corners.

Some browsers do not support CSS3 gradients. Yes, I’m looking at you, Internet Explorer 6, 7, 8 and 9. If you want to use something other than the filter syntax for gradients, you’ll have to wait for version 10. In the meantime, either you could use the filter syntax for IE (see the “For Internet Explorer” section of “Cross-Browser CSS Gradient”) and put them in an IE-specific style sheet, or you could use an image gradient. You could also just leave them without the gradient, but that’s not the point here.

Parent-Level Hover States

.main-navigation {
   …
   li:hover {
      a {
         .linear-gradient(#dfdfdf, #c0bebe, 100%);
      }
      .children {
         …
         a {
            background: none;
         }
      }
   }
   …
}

The code above will trigger the hover state for anchor elements when the user hovers over their parent list item, rather than hovering over the anchors themselves. This way is preferable so that the anchor element maintains its hover state when the user is mousing over the child-level menu as well. Doing it this way does, however, create the need to reset the background color of anchor elements within the child-level menus. That’s the part you see within the children selector.

Hovering over the parent-level links
Hovering over the parent-level links

Displaying the Children

Bringing the children back onto the screen is easy enough. But before we get carried away, we need to clear out a few styles that are applied to all unordered lists, list items and anchors.

.main-navigation {
   …
   .children {
      background: #fff;
      left: -999em;
      position: absolute;

      li, a {
         float: none;
      }
      li {
         border-right: none;
      }
   }
}

The code above changes the background of the child-level menu to white, instead of the light gradient that we used in the parent-level menu. The next couple of lines remove the left float from the list items and anchors. We’ve also gotten rid of the right border that separates the list items in the parent-level menu.

The Hovering Box

.main-navigation {
   …
   .children {
      background: #fff;
      .box-shadow();
      left: -999em;
      margin-left: -65px;
      position: absolute;
      top: 30px;
      width: 130px;
      …
   }
}

…
.box-shadow (@x: 0, @y: 5px, @blur: 5px, @spread: -5px, @color: #000) {
   -moz-box-shadow: @x @y @blur @spread @color;
   -webkit-box-shadow: @x @y @blur @spread @color;
   box-shadow: @x @y @blur @spread @color;
}
…

We’ve added another parametric mixin to the equation. This one produces the box shadow, with all of its parameters as variables, and with the browser prefixes. We’ve borrowed the styles from .children to make the box appear to hover over the parent menu. To center the child underneath the parent element, we’ve set the left position to 50%, and set the left margin to the negative value of half the width of the child. In this case, the child level menu is set to 130 pixels wide, so we’ve set the left margin to -65 pixels.

Navigation w/child reset to hover style
Navigation with the child reset to hover style

Child-Level Hovers

.main-navigation {
   …
   .children {
      …
      a {
         .border-radius(3px);
         height: 30px;
         line-height: 30px;
         margin: 3px;
      }
      a:hover {
         background: #dff2ff;
      }
   }
}

We’re using the parametric mixin that we created for the border-radius for the links in the children as well. Adding a 3-pixel margin and 3-pixel border radius to all of the anchor elements within the child menu will accent the 5-pixel border radius of the menu well. We’ve also adjusted the height and line height a little, because they just seemed too high. Finally, we gave the list items a nice soft-blue background color on hover.

Navigation w/child menus and their hover state
Navigation with child menus and their hover state

Responding to Mobile Browsers and Size Constraints

A lot of screen sizes and browsers are out there. The iPhone has had two resolutions. Up to the 3GS model, it was 480 × 320; since the iPhone 4, it has been 960 × 640. Android browsers run from 480 × 320 to 854 × 480. Android also has a lot of browsers to choose from. There are the usual Firefox and Opera, as well as a ton of browsers by small start-ups. You can get Opera for the iPhone, but since you can’t make it the default browser, you’re pretty much stuck with Safari. Given this variety, we’ll have to make some adjustments if we want our navigation to be useful on all devices and in all browsers.

Fitting the Content

Accomplishing this part is easy, but doing it will probably require adjusting our styles. But that’s why we’re here, isn’t it?

Currently, when we open the navigation demo in iOS, it looks like this:

Original navigation in iOS
Original navigation in iOS

This might not look too bad on a giant screen, and it might even be usable on the iPad, but you would struggle to use it on a phone. Zooming in might make it easier, but that’s not ideal. Optimizing for the device is preferable, and forcing the browser to use the available space is simple.

<meta name="viewport" content="width=device-width">

This alone makes a huge difference in the way the browser renders the page. And while the menu is not the prettiest it’s ever been, it is a lot more functional.

Navigation on iOS with the viewport adjusted
Navigation on iOS with the viewport adjusted

Media Queries

We can use media queries to adjust the styles based on the media in the browser. In this case, we’ll use the width of the page to change the look and feel of the navigation to make it more suitable to the available space. In this case, we’ll make the menu items more button-like.

@media only screen and (max-width: 640px) {
   .main-navigation {
      ul {
         border: none;
         background: none;
         .border-radius(0);
      }
      li {
         border-right: none;
      }
      a {
         border: 1px solid #ddd;
         .border-radius();
         font-size: 1.2em;
         height: auto;
         .linear-gradient();
         line-height: 1em;
         padding: 15px;
      }
   }
}

In the code above, we’ve used a media query to target situations in which the user is only looking at a screen and in which the width of the window is a maximum of 640 pixels. In this scenario, we’ve removed the border, background and border radius from the unordered list, and applied those styles to the anchors themselves. We’ve also increased the font size of the anchors, cleared the height and line height, and adjusted the padding of the links to increase the clickable area.

Navigation adjusted for mobile display
Navigation adjusted for mobile

As you can see, the links look much friendlier in a mobile browser. They are, however, only half functional, because touch devices don’t have a hover state. This means that if you have child-level menus, as we do here, you’ll have to figure out a way to display them as well. You could replace the hover state with a touch event of some kind, or expand the children out onto the page. That would greatly increase the size of the navigation, though. The following method might be best.

Replacing the Menu in Mobile Browsers With JavaScript

$(function() {
   /* Get the window's width, and check whether it is narrower than 480 pixels */
   var windowWidth = $(window).width();
   if (windowWidth <= 480) {

      /* Clone our navigation */
      var mainNavigation = $('nav.main-navigation').clone();

      /* Replace unordered list with a "select" element to be populated with options, and create a variable to select our new empty option menu */
      $('nav.main-navigation').html('<select class="menu"></select>');
      var selectMenu = $('select.menu');

      /* Navigate our nav clone for information needed to populate options */
      $(mainNavigation).children('ul').children('li').each(function() {

         /* Get top-level link and text */
         var href = $(this).children('a').attr('href');
         var text = $(this).children('a').text();

         /* Append this option to our "select" */
         $(selectMenu).append('<option value="'+href+'">'+text+'</option>');

         /* Check for "children" and navigate for more options if they exist */
         if ($(this).children('ul').length > 0) {
            $(this).children('ul').children('li').each(function() {

               /* Get child-level link and text */
               var href2 = $(this).children('a').attr('href');
               var text2 = $(this).children('a').text();

               /* Append this option to our "select" */
               $(selectMenu).append('<option value="'+href2+'">--- '+text2+'</option>');
            });
         }
      });
   }

   /* When our select menu is changed, change the window location to match the value of the selected option. */
   $(selectMenu).change(function() {
      location = this.options[this.selectedIndex].value;
   });
});

To summarize, first we’re checking whether the window is less than or equal to 480 pixels. To ensure an accurate reading on mobile devices, you can use a meta tag to scale the viewport accordingly:

<meta name="viewport" content="width=device-width">

We populate the first variable, windowWidth, with the value of the window’s width as defined by the given device. We can use this value to then check whether the width is narrower than a particular value. We’ve chosen 480 pixels here because, while we might want to use media queries to adjust the menu below 640 pixels, at a certain point the viewport would be just too small to justify the menu taking up all that space.

We then use jQuery to create a clone of our menu that we can later crawl to create our options. After we’ve done that, it’s safe to replace the unordered list with the select element that we’ll be using and then select it with jQuery.

In the largest part of the code, we’re crawling through the clone of our navigation. The selector used, $(mainNavigation).children('ul').children('li'), ensures that we go through only the uppermost list elements first. This is key to creating the nested appearance of the select menu. With it, we select the “direct” child-level unordered list elements and then their “direct” child-level list elements, and then parse through them.

Inside each of these “direct” descendants, we get the value of the href attribute and the text of the link, and we store them in variables to be inserted in their respective options. This is implemented by appending <option value="'+href+'">'+text+'&kt;/option> to our new select list.

While we’re in the top-level list item elements, we can check whether any child-level menus need to be parsed. The statement if ($(this).children('ul').length > 0) checks whether the count of the selector is greater than 0. If it is, that means child-level items need to be added. We can use that same selector, with a slight addition, to go through these elements and add them to our select list, $(this).children('ul').children('li').each().

The same parsing method applies to these elements, although they use different variables to store the values of the anchor tags, so as not to create conflicts. We have also prefixed text to the menu labels at this level, --- , to differentiate them from the other items.

Parsing through the menu in this method (nested) will create the parent-child relationship you would expect.

After the menu is created, a little more JavaScript will enable the select list to serve as navigation.

$(selectMenu).change(function() {
   location = this.options[this.selectedIndex].value;
});

When the select menu is changed, a new option is selected, and the window location is changed to reflect the value of the option. That value comes from the href of the original anchor element.

The result is like so:

screenshot
The select menu in a desktop browser

Select menu on Android and iPhone
The select menu in Android and iPhone browsers

Given the increased clickable area of the native controls, the select menu is obviously much more user-friendly on mobile.

Share Your Experience

We’d love to see and hear about some of your experiences with menus across browsers and platforms; please share below. And if you have any questions, we’ll do our best to find answers for you.

(al)

© Jeremy Hixon for Smashing Magazine, 2012.

0
Your rating: None