Ramblings of an Independent Designer

Tuesday, January 31, 2012

It's 1 A.M and my half brother Jack from Utah pings me. Hey Ric, I got a webdesign issue that's keeping me awake. I paused for 2 minutes..assuming he is going to tell me more about the issue. But it seemed he was expecting me to solve it, whatever the issue is. So I being the nicest guy, asked him to mail me.

Here's the deal.

Jack wanted to find a space character in an <input> but using CSS3 selectors.Well, if you want to create an actual CSS3 rule in your stylesheet, then input[value*=' ']{..} will work, but only for values in the actual attribute (in the source code) and not the value as modified inside the browser..

Wednesday, January 25, 2012

Horizontal menus are suitable for pages with menus containing fifteen menu buttons or fewer per row. Obviously, this depends on the length of the labels and the size of the text used on the buttons. With very short labels, more buttons could fit across a page (for instance, if the labels were page numbers 1, 2, 3, 4, etc.). The horizontal tab menus on the BBC web site has fourteen tabs in one row and two other rows with seven links on each. This shows that many more links can be fitted into a page if you can accept several rows. The rows need to be distinctly separated by a divider or by using navigation bars with different colors.

Horizontal menus can be challenging because the commonly advocated inline or float methods each have their problems. Floated menus can be difficult to center on the page, inline menus traditionally could not have equal size buttons. However, now that all the browsers support the muchneglected attribute { display:inline-block; }, horizontal menus are no more difficult than vertical menus, and dimensions can be very easily applied to give equal size buttons, or buttons that automatically vary to accommodate the content. Recipes for horizontal menus often use { display:inline: }, but the resulting buttons are unsatisfactory. All browsers now support { display:inline-block; }.

The attribute { display:inline: } did not allow width, height, margins, or padding to be set. By using { display:inline-block; }, buttons can be displayed inline and have their dimensions set. This provides the best of both worlds, as shown by the second row of buttons in the basic menu below.

The top row of this basic menu shows the unsatisfactory appearance of display:inline. In the second row, the display:inline-block buttons can be given height, line-height, and padding.

The very basic menus shown above are not a rollover menus; that is, they do not change color when the cursor hovers over the buttons. Also, they use paragraphs instead of the traditional unordered lists.

The code below contains two rows of menu buttons. The top row is unaffected by the CSS style sheet. The CSS style sheet, is linked only to the bottom row of buttons and the style gives the text plenty of horizontal space. This demonstrates the value of the display:inline-block code compared with the default display:inline;.

The # symbol in the href items must be replaced by your own page URLs. The code here is the style sheet that targets the second row of menu buttons and applies the style display:inline-block; to enable the width of the buttons to be adjusted.

About Me

I am a professional frontend web developer and entrepreneur who is fascinated with the web industry, business, technology, and how they fit together. I am also the founder of Walsh Design Labs, a design studio in LA. When I am not building software, I love spending time with my beautiful wife, Catherine, and my spunky little dog, Buxo. I do not have a Twitter or Facebook account, as I feel it takes away my family time.