Talk to a real, live person

Complete the simple form to the right, and one of our professional Internet consultants will be in touch. You’ll get free website advice and discussion with no obligation to purchase anything.

Or, call us toll-free

If forms aren’t your thing, just give us a call at 1-877-WEB-5585.

Never mind. Maybe later.

1 Your Contact Information

Please enter your name

Please enter your company

Please enter a valid email address

Please enter a valid telephone number

2 Project Summary


« Previous

3 Complete

Thank you for your interest. One of our professional Internet consultants will be in touch shorty.







Everything listed under: CSS

  • A technique for rounded transparent boxes using PNG images and CSS

    In my last post, I described some design changes to the content management system’s element control bars used to edit content. The new UI design called for control bars with some clean, rounded edges. The problem is that the control bars appear inside the site’s visual design template so we have no idea, on a system-level, what color or image the control bars will appear on top of. This presented some contrast issues as described in the aforementioned post, but also required us to use actual transparency.

    Sliding Doors

    Typically, when you need to create rounded containers with CSS, Doug Bowman’s Sliding Doors technique is the way to go. Unfortunately, sliding doors is best for containers that are only rounded on two edges (think tabs instead of buttons), or have one fixed dimension (buttons that get wider but not taller), and are in front of a regular, known background. In our case, the the boxes must scale to most any width and height, are round on all four sides, and must be actually transparent — including some subtle drop-shadows. Phew.

    For those of you who know your way around CSS and are unfamiliar with the technique, sliding doors uses two HTML elements, two images, and some clever CSS to create a rounded tab that will expand to hold its contents in some limited ways. The solution is elegant (no extra markup in most cases) and reliable in modern browsers. The two images consist of a narrow left edge graphic, and a wider right edge image. The left edge covers the right, completing the illusion. However, the rounded images are GIF or JPG graphics that are square and match the background color. A true transparent image would break the effect. So, I realized that while I could use what I new about sliding doors to find a solution, I would have to try something new.

    The Solution

    I knew right off that elegance would by and large go out the window. The technique is pretty simple, but requires extra, non-semantic mark-up. But here is the general idea for truly transparent sliding doors. Traditional sliding doors pad the outer container so that the nested element will show the other piece behind it. It covers the wider image. My technique places them side-by-side so that the transparency can work. We’ll use two nested DIV elements, the outer having a negative margin that is exactly as wide as the "corner" image, and a give the nested DIV a negative margin to match, pulling it outside the outer element. It works surprisingly well in all of the modern browsers. Here are a few details.

    The markup:

    <div class="actions">

    <div class="roundedTop"><div class="rLeft"></div></div>

    </div>

    The CSS:

    .roundedTop {

    height: 6px;

    background: url(actionsBar_RT.png) no-repeat right top;

    margin-left: 6px;

    }

    .roundedTop .rLeft {

    height: 6px;

    background: url(actionsBar_LT.png) no-repeat left top;

    margin-left: -6px;

    }

    That’s the code for the two top pieces Here’s a graphic that shows the individual graphics and DIV boundaries. The final piece is a top, middle, and bottom repeating the technique above all wrapped in a containing DIV:

    diagram

    That’s it. Feel free to use this technique in your website designs. I have attached a ZIP file that contains all of the HTML and CSS in a working example for you to experiment with. Let us know in the comments if you find any bugs or improvements to this idea.

  • Admin user interface tweaks

    When we refreshed the editing interface in the content management system last month, the new element menu bars were a big hit. It was nice to update from the intentionally neutral look and feel to something with a little more of a high-end application look. Still there were a few minor tweaks that didn’t make it into the final release that I wanted to get back to.

    Add me

    The first update was to the layout of the Add Element control that sits at the bottom of every element. The original version (somehow I don’t have a screenshot of this) was a bit jumbled layout-wise, lacking proper spacing between the items. I've also added a clear title to the top making it easier to differentiate between "add" and "share".

    Drag me

    The new UI refresh introduced the ability to drag and drop elements between regions on the page. Our rockstar programmers knocked this out quick and just a little CSS made it all come together. But the active area of the control bar menu and the drag-able area conflicted, making things a bit confusing. The solution turned out to be pretty easy. I slimmed up the active area of the menu link to be just a bit wider than the text label. This left the rest of the bar available for dragging, making the operation easier to perform. The addition of the infrequently used CSS cursor property gives the user feedback that the item is drag-able by changing from the standard cursor to the system move cursor.

    Menu and drag active areas
    Here the active area of the menu and drag-able bar are clearly separate.

    Make it pop

    The biggest issue was that the newly-dark control bars got a little lost when displayed on design templates that had dark or black backgrounds. There was a sight grey gradient from top to bottom that at least popped them off the background, but it still wasn’t as good as it could be — especially as in the example below in which the background color uses precisely the same grey value as the control bar highlight.

    The solution was to add a bit of a rim around the controls so that they had the proper definition no matter which background they appeared on. So, I added a very subtle grey (matching the highlight) border around the bottom and sides of the graphic. The 3D effect is much like a rim light that slightly illuminates the edge opposite the light source and actually improves the overall dimensional look. But adding just the grey border wasn’t enough. On light backgrounds it made the edges fuzzy and it still would disappear when displayed on a similar grey. The next step was to add a second border outside of the grey — this one black ?? to create more contrast with the background. The end result is much more effective. The control bars now look great on grey, black and most any other color. And what is best about the solution is the subtle, deep greys are nearly invisible on white so the original look remains intact. Take a look at a before and after comparison below:

    compare old and new control bars
    The old menus are on the left, and the new on the right.

    How’d you do that?

    Of course, this is the web, so even this innocuous little change was a bit tougher than I expected. The original solution used five small PNG images, some extra mark-up, and CSS to to create transparent, rounded-corner, bars. The new look required another element in the mark-up and one more image to complete the effect. The solution is interesting enough that I’d like to write about the specific technique in my next post. It builds upon the popular Sliding Doors technique which doesn’t work with true transparency. Look for that in the coming days.

  • New Icebrrg design CSS time lapse video

    As part of the launch of the new Icebrrg redesign I wanted to show a little bit of insight into how a website goes from a design comp into a fully functioning website. By using a clever bit of scripting, this movie shows the CSS styles being applied rule by rule right in the browser. It is not a literal timeline of my actual process or the order in which I applied styling, but it has been optimized to show a reasonable facsimile of the process and to be as interesting as possible. Even as the designer behind this website, I find this movie fascinating.

    Special thanks to Matthew Buchanan who's Timelapse CSS script made this post possible.

  • Learn about CSS positioning

    Tim's recent post, Learn about CSS specificity, is a great read for those of you who have done some basic CSS but want to explore some of the more advanced techniques. That article made me think of another area that can be difficult to master but is an essential skill for the really advanced layouts: positioning.

    The goal for any CSS purist is the perfect separation of form (design, style, graphics, presentation) and content (typically your document's marked-up copy and images). Most people start by working with fonts and colors in CSS, but the real challenge comes in using CSS for layout. That's where positioning comes in. Knowing how best to position your content to create an attractive and practical layout using only CSS is tough to do but really takes your website design to the next level.

    One of the best and most concise explanations of CSS positioning is this handy presentation, Learn CSS Positioning in Ten Steps. Sadly, I had learned CSS before this was around, but I think it's a great refresher for any designer and will be especially helpful to those of you up-and-coming CSS masters.

  • Learn about CSS specificity

    If you are interested in CSS, love CSS, or want to know more about CSS, here is a great article on "CSS Specificity:  Things You Should Know" over at Smashing Magazine.

    I just point this out in case you're not a regular reader of Smashing Magazine which, if you want to learn more about stuff related to web design, you should be.  This article is not for everyone as it's a bit advanced but if you're sort of a CSS wannabe like me, it's a good read and makes learning fun by relating everything to Star Wars.  Hooray!

    It also provides a ton of links to other great resources on the web.  Enjoy.



Let’s Talk

Get free website advice from one of our professional Internet Consultants. Click or call us to get started.

1-877-WEB-5585