Posts Tagged ‘webdesign’

CSS margins study

Sunday, June 28th, 2009

CSS coding delivers more “WTF moments” than any other work activity I engage in these days.  I need to understand it better, specifically CSS margins and floats. Made some time today to study up.

I read and re-read the articles below. They are aging but speak to a time when the evil IE6 was even more prominent than it is years later in 2009.

General insights include:

  • Kill IE’s double margin bug with display:inline on a floated items.
  • When 2 adjacent elements’ margins meet, only the bigger margin is used.
  • If an item’s 2 opposite margins meet, they both go away (self-collapse)
  • Nested items without padding or border will cause the top and bottom margins of all to collapse. Left and right margins remain. Adding padding or border makes the margin come back.
  • Set overflow:hidden on columns to prevent object blow out in IE.
  • To make columns, float:left on one and float:right on the other.
  • Self clear an object (always clear floats) with the :after filter.  (Example below.)
  • Center an item by setting auto on left and right margins.  margin:0 auto.
  • In addition to auto margins, to center an item in IE, also use text-align:center on parent, then reset text-align in child, usually text-align:left.

Self clear example

.columns:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}

Convert a list into a horizontal menu

Using background images instead of text.  Fixed width, left margins, using negative margin on UL to cancel first margin.

<ul class="menu">
<li><a href="#somewhere1" id="link1"><em>link 1</em></a></li>
<li><a href="#somewhere2" id="link2"><em>link 2</em></a></li>
<li><a href="#somewhere3" id="link3"><em>link 3</em></a></li>
</ul>

ul.menu {
margin:0 0 0 -20px;
float:left;
width:100%;
}
ul.menu li {
list-style-type:none;
display:inline;
float:left;
margin:0 0 0 20px;
}
ul.menu li a {
display:block;
height:50px;
background-color: #0f0;
}
ul.menu li a em {
display:none;
}
ul.menu li a#link1 {
width:100px;
background-image: url(link1.png);
}
ul.menu li a#link1:hover {
background-image: url(link1-over.png);
}
ul.menu li a#link2 {
width:110px;
background-image: url(link2.png);
}
ul.menu li a#link2:hover {
background-image: url(link2-over.png);
}
ul.menu li a#link3 {
width:120px;
background-image: url(link3.png);
}
ul.menu li a#link3:hover {
background-image: url(link3-over.png);
}

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

About time for another redesign

Sunday, June 7th, 2009

This was going to be a weekend for other projects.  One thing led to another and now I’m rolling out yet another redesign to my homepage and this blog.

The last design had/has (still transitioning as of 6/7) some problems.

dvv0902

First was inconsistency.  Homepage, blog and inside pages all looked different.

Second was my fat mug was getting old, even for me.  My profile pics are adding up and it is time to narrow down, find a new, normal-looking profile pic.  Decided to take the picture during my new pastime; both the picture of my head and the landscape shot are from a bike ride this weekend.

Third, the technical implementation of the buttons wasn’t right.  I figured out a more right way, thanks to cssvault, and look I forward to using this method of mouseovers on all foreseeable projects.  Nice blend of real links, unordered lists, image sprites, and popular CSS.  This was the biggest reward of the project.

Forth, I need to keep pushing towards a “Web 2.0 feeling” site.  Even though some would say Web 3 is upon us, better late than never.  Play with the new navigation.  That’s a big part of this attempt.  There is a big orange drop down when you hover over “web design”.  Somewhat reminiscent of vimeo I guess, or one of these.

Fifth, I need to hone my cross-promotion of superwebguy.com.  There was a definite style divergence on the homepage that I wasn’t happy with.  Now the homepage has its own feel and doesn’t try to feel half like SWG.

What I ended up, while perhaps not as in-your-face and a little text-heavy, is solving the above issues.  Like?

dvv0906

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

Links April 5-11

Saturday, April 11th, 2009

Here are some links I bumped into and posted on Twitter in the past week. If you like the links I post, please consider becoming a “Fan” of “Super Web Guy” on Facebook!

Computing

Design

PR

Programming

SEO

Twitter

Websites

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

Business Statement for 2009

Saturday, April 11th, 2009

We are four months into the year. This is a little late.

Fortunately, a business statement is never a bad idea. I thought I would finally answer some important questions about who I am and what I want, for both our sakes.

Thanks to BNI for the questions.

Here you go: Super Web Guy – 2009 Business Statement

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

New design

Saturday, February 21st, 2009
screenshot dvv blog design 0902

New

screenshot_oldblog

Old

What better way to pass the day and practice chops than to redesign your blog again?

Nothing new in terms of features, just less crappy looking then the last version. I think the blog really needed it. 74% increase in rounded corners.

I would like to thank the MAMP project for being able to easily run and test on my local machine, and the Firebug plugin for drilling through some chaotic Wordpress CSS, keeping me from pulling my hair out.

Leave a comment if part of it is jacked or if you think it’s awesome. ;)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

SuperWebGuy and TEKOASoftware Team Up

Friday, January 23rd, 2009

SuperWebGuy, my website service, is pleased to team up with TEKOA Software, a software development, accounting systems and server hosting organization headquartered in Washington, to offer high-end business website design, website management and website marketing services in the Washington area and beyond.

TEKOASoftware.net Web Design

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

Coding email templates

Saturday, November 22nd, 2008

I’ve written a couple email engines in my day – one in PHP and one in ASP – to integrate and automate businesses with email marketing.  Work to be proud of, indeed. Invariably after the engine part is done – or maybe you’re using an established service* for the engine part – there needs to be some content, some email design.

*Examples of consumer email marketing services (”engines”) using email templates and data merging:

Templates are for branding

HTML templates need to be made so the emails that are received are branded – at least with a logo and company colors.  This is not possible with a plain text email of course.

Merging process

The engine will take the templates and merge in some variables like “first name”, “email to”, “email from”, etc – a basic find-and-replace loop.  The HTML template will contain placeholders for each variable – strings like “{#EMAIL_TO#}” – and the loop will replace those with values from the database, then send the post-merged email to that person in the mailing list.

Email formats

There are many ways an email can be formatted such as “quoted-printable”, “text/plain”, and embedded images, but my focus is on “text/html” with linked images.  Here is a handy site that can convert static HTML into quoted-printable format, and back.

Images

The images will be stored on a server and referenced like any other web page would reference images.

Privacy and missing images

Some email viewers like Gmail tend to hide images that link back to a server, and the user has to click a “display images” link to see the email as it was intended.  This is a privacy feature because images that link back to the server provide the sender with a method for tracking who opens the email.  The log can be parsed to see who requested the image when the email was viewed.

We need to make the design look good even if all the images are missing.

alt attribute

For this reason, be sure to fill your image tags with good descriptive “alt” values so those users still know what they’re not seeing.  Putting “please display images”  in the “alt” attribute is a consideration, but might also be a flag to the program that the message is spam.

Tables

Today web designers use style sheets instead of tables for positioning content.  CSS-heavy, un-tabled code may be a good idea for modern web sites, but not for HTML email templates.  Email templates rely primarily on tables for positioning content, making columns, aligning text, etc.  This is simply because the email could be viewed in any number of applications, with a high likelihood of poor CSS support, even in modern email clients such as Outlook 2007 (whose rendering engine is Word, of all things).  Tables are “old school” web design, and so are email templates.  Being a CSS guy, I just have to suck up that reality.

Put CSS in style attribute

This isn’t to say that one should abandon CSS in email templating altogether.  In fact, feel free to use the “style” attribute – just back it up with the non-CSS way too, as insurance.

If the cell needs a background, use “style=background:url(some image path)” in addition to “background=(some image path)”.  If the font needs a color, use “style=color:red” in addition to “<font color=#ff0000>”.

Go attribute-crazy

The more attributes each table cell has, the better.  Don’t forget attributes such as “height”, “width”, “background”, “bgcolor”, “align”, “valign” and even CSS’s “style”.  You’ll thank yourself when testing in even the latest browsers and email clients.

Always use the “align” attribute in cells with text.  I can’t tell you the numbers of times I’ve seen Internet Explorer “center” text that “left-aligns” in Firefox. Setting “<td align=left..” fixes this.

Stay aware of the design affects of merging in variable data that could reflow text and images.  When columns are growing and shrinking with variable content, and you want the content to “top-align,” use “<td valign=top..”.  Otherwise there tends to be rarely-desirable vertical centering.

Variable images

If your variable images are variable sizes, heaven help you.  If necessary resample all the variable images – perhaps with ImageMagick – to give them the same widths or heights – whichever dimension flows best in your design.  Whatever table cell is containing your image should still have the height and width set.

spacer.gif

A spacer.gif is a 1×1 transparent GIF that can be resized to enforce the size of an empty table cell.

Remember those?  You’ll wanna pull those out from the back of the toolbox to help pad your tables.  Tables + spacer.gif is the “old way” but it’s the “right way” when it comes to making email templates.

If I have an email with 2 columns and padding in between, I will use a 3 column table with all cells’ widths, aligns, valigns set, and put a spacer.gif in the center “padding cell” that is the same width as the padding should be.  The height of the spacer.gif can remain 1px.

Spanning

If you find yourself using “colspan” or “rowspan”, don’t.  Instead, nest tables.  It’s sounds like such a naughty thing to say, but that’s the most dependable way to go.  Go nested-table crazy! We can’t give the cell dimensions any leeway.  Spanning cells tends to produce more random cell dimensions than the predictibility of nested tables.

Table setup example

Here’s a good set up for a centered, 650px-wide table.

<table cellspacing=”0″ cellpadding=”0″ border=”0″ align=”center” width=”650″>

“cellspacing”, “cellpadding” and “border” need to be set. Assume nothing about any dimension.  Be explicit everywhere.

Testing

Don’t forget to test in multiple browsers, and multiple email clients. This is where we see how necessary all the excessive table markup was.

Here’s a few email clients to consider:

  • Outlook 2007
  • Older Outlooks
  • Gmail
  • Yahoo Mail
  • Apple Mail
  • Hotmail

Just because the email client is web-based doesn’t mean it is just as CSS-compatible as a you’d expect.  Sometimes the CSS is rewritten to prevent style conflicts with the web page it is presented in.  We would hope that the rewriting will not be harmful to your CSS, but I wouldn’t bet on it.  Best to take the hybrid route so we won’t have to worry about it.

Conclusion

Email template design is an aging art with the advent of Web 2.0 social marketing tools, but it still reaches the most people wherever they may be online.  Deploying age old web design techniques is still the best way to code an email template so that it looks the same in most people’s email clients.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

Flames and Avatars

Friday, September 5th, 2008

“What’s up with the flames in your header?”

Beats me.  Every time I mix Beer + Internet + Photoshop, something on screen catches fire.  Listening to heavy metal probably didn’t help either.

“Hey, you have one of those avatars I’m seeing everywhere.  How can I make one?”

http://www.faceyourmanga.com/

If you make your own avatar, post a comment with a link to it here.  I’d love to check it out.

Van Turtle Blog Design - Sep 2008

Van Turtle Blog Design - Sep 2008

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

Re-designed my site again – new for August

Sunday, July 27th, 2008

I redesigned my site.  Again.  Come visit.  A blue gray theme (by me) and unified the tutorial pages.

dvvcom 200808

David Van Vickle – Web Developer, Web Designer, PHP, Javascript – Orange County, Ladera Ranch, California

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter

The Drupal CMS makes web layout easy

Thursday, April 10th, 2008

How the Drupal CMS makes web layout easy

Here’s my problem. I want a web site but I don’t know how it should be layed out. I am a web designer and programmer, so my first instinct is – do it myself. Problem is I don’t know what the end product should be, which is always a bad starting point for a project. You always want to start with clear instructions so you don’t waste time (which is money). Well, I had no instructions to myself and I wasted a lot of time trying to design a web site that I could be satisfied with. Every little change that I thought was a step in the right direction ended up taking too much time. It wasn’t quick enough to try new ideas. I was having to settle because of all the effort that had to go into any change. For years I settled. Well now it’s time to be satisfied.

Here is the solution. By chance I was wanting to explore 3rd party tools just for the sake of knowing what tools are out there. There’s a point at which a programmer says, “there is no way I can design everything and have each thing be great”. I’m going to end up with a lot of little tools that are subpar. I can program great things, but it takes focus. So I’ll focus on my few things, let other people do the rest. Hello open source projects.

Besides me needing a better way, customers also want a better way. Customers have wanted to update their own site for a long time. I don’t want to write a tool for them that’s already been written beyond what I’ve already got. I’ve made some tools for customers to maintain their sites but I don’t have time to add the functionality they should have. There is no formatting except for automatic line breaks, and they can’t change menus or create pages, to say the least. They could only edit pages already existing. Which is actually a lot compared to most situations, but I would have a long way to go to catch up with content management systems that are out there. I knew that much before I even used a CMS.

So I know an open source CMS is something I need to explore. Next question – which one? Off to Google we go. I type “top PHP cms” and get some good ideas. The first is a winner called Joomla. The second is an almost winner called Drupal. I tried Joomla but abandoned it for no reason. Seriously, I downloaded Joomla, installed it, and walked away. When I came back I wanted to try Drupal. Maybe I was just exploring, who knows. Poor Joomla. Don’t worry I’m still your friend. Nevertheless, downloaded Drupal from drupal.org, installed it and started customizing it.

There was actually some installation trouble because I want to use Drupal on a shared host, not my exclusive host. The auto install requires you to change settings that are locked down on most shared hosts. They don’t want one customer ruining the server for everyone else. So I solved that by first installing Drupal on my desktop computer. In my case, a Mac, which has an easy built in web server. Just install MySQL, enable PHP, flip on web sharing in your System Preferences, and off you go. So I did that, proceeded through Drupal’s auto install, and exported the finished files to my remote host, including the database SQL file. I think the database being configured is the main thing that finally gets the site going.

Anyway, from there I start customizing. Days later I was still customizing it. Not because it’s difficult. It’s easy. That’s why I called this “How the Drupal CMS makes web layout easy”. It’s all my little tweaks I make on the way to the perfect layout. Biggest problem – I had no idea what I wanted until I saw it. My ability to see it sooner rather than later was because of a CMS. I would start with one idea, do it, look at it, do something else, look at it, do something else. For days. Eventually I had a layout I liked. If I had tried to do that with hand coded design instead of a CMS, I would still be exploring. Enter CMS. Now the problem is solved. I know what I want. It’s done. I have a layout. Quick.

Let’s not confuse layout with theme. Layout is figuring out where elements should be. With hand coding, that takes forever because each change is a redesign. With Drupal, its a few clicks in the Drupal administration pages. Themes can rearrange things, but themes are mostly a matter of picking colors and fluffy borders. The colors and fluffy borders I was making with photoshop were ok, but that had needed a boost as well. I can do it for someone else, but when it’s for myself it becomes a massive challenge for some reason. Maybe my standards are through the roof. Who knows. Anyway, I settled on a theme. The default theme, for now. It is a fluffy blue background. Not bad. It will do.

When I have an impulse to change it I just go to my Drupal administrative pages, click themes, and click one I like. Done. Changed with a click. No photoshop no redesign. Awesome.

Once the layout is done and the theme is in place, what’s left? Turns out there were some little things. There was a subscription link at the bottom of the page that I couldn’t make the Drupal administration pages take away. There was also the site’s rss feed which was returning the wrong feed. There are a few feeds, and I didn’t want the main one. I wanted my wordpress.com one.

So what did I do? I put on an entry level programmer hat and looked at the PHP code. Turns out, every page’s framework is in a single file. Mine is in my themes folder at themes/garland/page.tpl.php. Edit that file and you’re editing every page. Within that page are a bunch of variables where the content fills in. The variables get filled with content in one of a few other files. It is probably in somewhere in the includes or sites folders.

I made good use of a search utility to jam through these folders to find the right one faster. Dreamweaver did the trick. In that program you can search an entire folder’s file contents, which is what you want. In order for Dreamweaver’s search to dig into a file, that file’s file type has to be in the list on Dreamweaver’s file type preferences screen. Just add the extension you need after that long list of file extensions. The next time you search, it will search those extensions as well. Otherwise it skips the file, which is what you want for, say, a binary image file which is just crammed with data that isn’t at all what we’re looking for. Once you get into a file you were looking for, the basic Find utility comes in handy too. The real thing you are trying to find is at the end of a chain of function calls. The variable name you come in with is only the start of your search.

So eventually after several related searches I honed in on my target, made the change and refreshed. A voila – oh wait – nothing changed. Well, turns out I had caching on, which can speed up production sites, but is probably just potential confusion for development. It was showing me an old copy of the page. So I went into my Drupal preferences and dumped its cache. Then I went back to my home page, refreshed, and the change was apparent. All is well.

So the layout is now squared away. Hurray. That was pretty quick. If I had started out knowing what I wanted it would have been even quicker. What project doesn’t flounder without a plan? Note to self, always have a plan, or be willing to waste time.

So what’s next… content and some branded graphics. For now, branding is simple. Find a picture of myself, scale it down, save it into the themes folder over Drupal’s default logo.png. You may want to rename the default photo incase you want to jump back in time quickly. Maybe you accidentally upload a very wrong picture. You want to step back quick if needed. The size that I liked for my new logo.png was 80 pixels by 80 pixels. Thank you Photoshop for cropping and scaling. I’ll see you when I want to get more serious about branding.

The last thing we’ll talk about is content. What’s a site without it? Once you start adding content, you get to see where it lands, which may change your mind about the layout. That’s what happened to me – of course. I won’t bore you with the details.

Anyway, add content. You can just make a simple page, and add it to the Pages or More Pages menu. Or you can add a link to an existing page in one of these menus.

If you want submenu items, think Books, which is Drupal’s name for them. Books can have as many nested menu items as you like. I knew that my Projects link was going to need submenu items, so I made the Projects link be the top Book node, then I added new book Pages under that for my different projects. One subpage for Programming, another for Art, and so on.

You can also add blog entries. I chose to use Wordpress.com instead of Drupal for my blog, only because I wanted to explore as many free and popular 3rd party utilities as possible, plus I could benefit from joining a community. I’m sure Drupal’s blog is great. But wordpress.com’s community amounts to built in marketing. The community can see your posts without searching for them directly. We can all use as much marketing we can get. I think Drupal keeps its own blogs going and they don’t turn off. That’s fine. I just make sure to not confuse people by exposing them somewhere.

OK well, now you have a new tool in your web design arsenal, or at least your curiousity is peaked. No matter how much we listen, we learn best by doing. So don’t be afraid to put Drupal into use. It’s free, but worth a lot more.

Check out Drupal.org to learn more about that fantastic project.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • MySpace
  • Reddit
  • Slashdot
  • StumbleUpon
  • FriendFeed
  • Turn this article into a PDF!
  • Ping.fm
  • Twitter