It wasn't me. You can't prove anything.


2007-05-02

XHTML command <hr />

Problem

I have a problem with the XHTML command <hr />. It creates a horizontal line across the screen. That's it. You can set it to thick, thin, long, short. Whatever. the two main browsers treat it a bit differently though. IE requires no set up. Plop in an <hr /> and off you go. Firefox needs some additional stuff because Firefox uses the border settings to generate the line. So, I could get the line to show up in one browser correctly, and the other would blow a gasket.

Solution

<center>
  <img style="margin-top:8px; margin-bottom:8px;" src="images/hr_1px.png" />
</center>

Seriously, I gave up and just created a one pixel high graphic the length I needed. It works all over the place. I was spending way too much time messing with something that should not be a problem in the first place. This issue shows flowed design, and I'm not talking about browser design. I thought about trying to make a zero hight table, or section <div>, but both of those would have taken time to test and who knows what would happen.

Larger Issue

XHTML and HTML were designed by comity. A large comity. Some designs just don't work. Never have. The <hr> command shows that conflicts amongst competing designs are not always resolved. No one spelled out the procedure for design in the original documentation of HTML so the folks who designed the browsers (where the rubber meets the road) just did what worked for them at the time. IE and Firefox both use completely different tools to generate the line and thus have different requirements to get the line to work in for web pages.

Browsing the net works just fine without the <hr /> command. The <img> command for pictures however is hammered in to just about every page out there. Thus, the <img> command has been tested and refined. The <hr /> command just falls off the list of important things to do. I bet both  browsers say their way of handling the <hr /> command is the correct way. I bet they both could care less the waisted time it causes and the wedge it drives between their web designer users. The people who do the standard probably don't care either. They say the command needs to look like X and act like Y, so as long as those bases are covered,

One of the guys at work who is just plane smart at computer stuff said "I never could get things to look right in IE." He meant he designed for Firefox and not much else. I understand because he is a Linux programmer and probably doesn't have easy access to a true IE box. I'm sure most web designers are the other way round because they don't have access to a non-Microsoft based Firefox box. I've read a page that talks about getting IE to run on Linux. I want to try it out, but I don't have the drive to go through all that. Heck, it is a tenth as long as it used to be. I'm still too lazy.

No comments: