Thoughts From Eric Archive

Reworked Reset

Published 18 years, 2 weeks past

Here’s the latest version of my “baseline” style sheet, with some changes based on feedback from readers on the original post.

/* Don't forget to set a foreground and background color 
   on the 'html' or 'body' element! */
html, body, div, span,
applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dd, dl, dt, li, ol, ul,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	font-weight: inherit;
	font-style: inherit;
	font-size: 100%;
	line-height: 1;
	font-family: inherit;
	text-align: left;
	vertical-align: baseline;
}
a img, :link img, :visited img {
	border: 0;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
ol, ul {
	list-style: none;
}
q:before, q:after,
blockquote:before, blockquote:after {
	content: "";
}

The changes are:

  1. The leading comment — rather than fill in some default document colors, which I hesitate to do given how often they’ll be changed, I just threw in a comment reminding the author that setting them is a good idea.  I’d expect that anyone who uses their own set of baseline styles will fill in their own favorite color set.

  2. font-weight: inherit; — this used to be normal, but it was pointed out that this would upset normal inheritance.  For example, if you set a div to be boldfaced, none of its descendant elements would inherit that boldness (because they’d be explicitly assigned normal).  Using inherit avoids this problem while still “zeroing out” boldface styling.

  3. font-style: inherit — same reasoning.

  4. vertical-align: baseline — this brings everything onto the baseline, including superscripts and subscripts.  This forces authors to determine the exact vertical offset they want for such elements, as well as any others they might care to vertically shift, as well as how they’ll accomplish said shift(s).

  5. a img, :link img, :visited img — this will make sure images in anchors and links don’t have a border by default.  Using a img covers images in named anchors, while the rest of the selector handles images inside either visited or unvisited links.  You might consider a img to be sufficient, and for now you’d be right.  But in the future, any element may be a link, not just a elements, so this gives us a bit of future-proofing.

I also put some spaces into the selectors to make them easier for me to read.  If you use these styles, you might consider stripping out the unnecessary whitespace to compact the rules as much as possible.

It was suggested that min-width: 0; be added to the first rule in order to invoke hasLayout, but Ingo Chao explained why that was a bad idea.  It was also suggested that text decorations should be removed from links, but I’d rather not.  I try never to mess with link decorations, and also figure that anyone who feels otherwise can add their own text-decoration declarations.

So we’ll see how well this one stands up to use in the wild.  Let me know!


Reset Styles

Published 18 years, 3 weeks past

At AEA Boston, I advocated using a “reset” or “baseline” set of styles, but not one based on the universal selector.  Instead, I said the styles should list all the actual elements to be reset and exactly how they should be reset.  During the Q&A afterward, an audience member asked me if I would create such a style sheet to share with the world, and I said that I would.

Then, during the break, someone else (sorry I’ve forgotten who!) reminded me that the Yahoo! UI group already did it with reset.css so I don’t have to.  Awesome!

…except that I don’t think it goes far enough in some areas, and a little too far in others.  So here’s my version of reset.css, based off of the YUI styles.

html,body,div,span,
applet,object,iframe,
h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,
del,dfn,em,font,img,ins,kbd,q,s,samp,
small,strike,strong,sub,sup,tt,var,
dd,dl,dt,li,ol,ul,
fieldset,form,label,legend,
table,caption,tbody,tfoot,thead,tr,th,td {
	margin: 0;
	padding: 0;
	border: 0;
	font-weight: normal;
	font-style: normal;
	font-size: 100%;
	line-height: 1;
	font-family: inherit;
	text-align: left;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
ol,ul {
	list-style: none;
}
q:before,q:after,
blockquote:before,blockquote:after {
	content: "";
}

I omitted elements like hr and the various frame-related elements, as well as form elements like input and select, because of their general weirdness, though I may change my mind about those at a later date.  I intentionally left out dir and menu because of their deprecated status.

I’m absolutely open to questions, comments, and suggestions, so feel free to use the comments for that purpose.

(Side note: if anyone’s disturbed by the unitless value for line-height, please read my post “Unitless line-heights“.)

Addendum: There have been some good suggestions in the comments, so they’re definitely worth reading.  See also the followup post, which incorporates some of those suggestions.


Stylish Spam

Published 18 years, 1 month past

From my comment queue, possibly the first time I feel a spammer is really speaking to me as a person:

Did u ever heard about CSS…? it will help your site.

Do tell, oh random anonymous stranger whose site URL crudely references the genitalia of older females!  I wish to learn.


After Boston

Published 18 years, 1 month past

Wow.

Just wow.

I’m back home and I still can’t believe how amazing An Event Apart Boston was for me and everyone with whom I talked.  I knew going in it was a great lineup of speakers covering great topics.  I knew that we had a completely kick-ass staff in place, and amazing volunteers to help us out.  I knew that we’d have great support from the venue.

I knew all that, and I was still overwhelmed and ecstatic at how things went.  At least on one level.  On another, thanks to the aforementioned kick-ass staff, things went so smoothly that I almost felt like I was a speaker at someone else’s conference.  I had so little to worry about that it was sometimes hard to remember that this was all happening because Jeffrey and I, over breakfast at Las Manitas in Austin, decided to take a chance and put on a show.  In a way, I had to prod myself just a little to remember to feel pride in what we’d accomplished.

What required no effort to feel was a deep sense of humility and awe that so many people had come to support what we did.  Over five hundred folks gathered in Boston, drawn by the same love of the web and pride in Doing Things Right that drives us.  I see the attendees at AEA as the craftsmen and women of the web.  Sure, there are shops mass-producing sites, the way a factory churns out cheap clocks.  That’s fine if you just want something to put on your nightstand.  But if you want an elegant, finely tuned work of art that you’d hang in a prominent place, a clock that is as much a point of pride as a timepiece—you find a craftsman.  And that’s who came to Boston.  That’s who comes to An Event Apart.

What amazed me even more was the overwhelming wave of positive feedback that we got.  Marci, our event manager, told me that in 25 years of event planning, she’s never seen attendees so happy.  So many people came up to me and Jeffrey and Marci just to say, “Thank you so much for doing this”.  They were thanking us, which seems entirely backwards.  I did thank each of them for coming to the event, but let me state it here for anyone I didn’t get to thank in person.  Thank you so much for coming to AEA and showing that you know creating the web is much more than churning out code, and that you take pride in being a craftsman.  Thank you for making the show so amazing.  Without you, it couldn’t have happened at all.

Now I’m looking forward to AEA Seattle twice as much as before, and I thought I was already maxed out on anticipation.

Again: wow.  Thank you, one and all.


Net Loss

Published 18 years, 1 month past

Five minutes after I should have left for the airport to catch my flight to Boston and An Event Apart, I finally got the DSL service back, four and a half days after it went dark.  After a few minutes of frantic testing and configuration to make sure it would work for Kat in my absence, I blew out the door.

Guess what’s broken in my hotel room.

  • Net Loss was published on .
  • It was assigned to the Humor category.
  • There have been ten replies.

One of Those Weeks

Published 18 years, 1 month past

AEA Seattle 2007 Now Open

Published 18 years, 1 month past
Limited seating is now available for An Event Apart Seattle 2007, June 21-22, at Bell Harbor International Conference Center on breathtaking Puget Sound. Spend two days with leading designers, developers, and accessibility experts including (in alphabetical order)…
  • Tim Bray, father of XML, director of web technologies at Sun Microsystems, and Tim Berners-Lee W3C appointee;
  • Andy Budd, user experience lead at Clearleft, co-founder of d.Construct, and author of CSS Mastery: Advanced Web Standards Solutions;
  • Mike Davidson, founder and CEO of Newsvine, former art director and manager of media product development for ESPN and the Walt Disney Internet Group;
  • Shawn Henry, director of education outreach for W3C Web Accessibility Initiative (WAI), research appointee at the MIT Computer Science and Artificial Intelligence Laboratory, and author of Just Ask: Integrating Accessibility Throughout Design;
  • Shaun Inman, award-winning designer and developer, inventor of Inman Flash Replacement and the curiously successful stats package Mint;
  • Jeffrey Veen, designer manager at Google, founding partner of Adaptive Path, and W3C invited expert on CSS before most of us knew the acronym;
  • Khoi Vinh, design director at NYTimes.com, author of Subtraction.com, and former partner at Behavior LLC;
…plus Jason Santa Maria, Eric Meyer, and Jeffrey Zeldman. A complete schedule is available for your perusal. The two days of design, code, and best practices, including lunch on both days and parties on both nights, go for $795 (reg. $895) if you register by May 21, 2007. An Event Apart Seattle 2007 will be our only show in the northwest this year. Seating is limited to 300 attendees and will sell out fast—they’re already going like hot cakes—so nudge that bean counter and come join us!

Getting To the Other Part of SXSWi

Published 18 years, 1 month past

Something for you 2007 SXSW Interactive attendees: if you need to get to the rooms-in-exile (8, 9, and 10), you can skip the line for the elevator.  Here’s how:

  1. Get yourself to the ground floor.
  2. Walk past the Lego®-infested play area and the fruit smoothie stand into the deserted hallway on the west side of the center, along Trinity Street.
  3. Keep walking.  Just about the time you become convinced that you’ve gone entirely the wrong way, there will be an escalator.  Take it up.
  4. And there you are.  There will be a badge checkpoint, although quite possibly one without a badge checker.  There wasn’t one at 9:55am this morning.

When you leave said rooms, you can go back by the same escalator or use the staircase near the elevators.  I’d recommend using the stairs to come up, except they’re locked to entry from the ground floor and I haven’t gotten my hands on any duct tape yet.  Ten community karma points to the person who hacks around this problem as well, though they’re a little bit harder to spot than the escalator.  Pass it on.


Browse the Archive

Earlier Entries

Later Entries