Jump to content

DrPR

Members
  • Posts

    3
  • Joined

  • Last visited

Previous Fields

  • Languages
    HTML, XHTML

Contact Methods

  • Website URL
    http://www.okieboat.com

Profile Information

  • Gender
    Male
  • Location
    Corvallis, Oregon
  • Interests
    Botany, microbiology, CAD modeling, programming, electronics design, photography, hiking, back packing, kayaking.

DrPR's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. DrPR

    href null link

    Bruno, Thanks. I have seen that trick used in other code. But I think I will use Ingolme's suggestion and eliminate the <a> statement completely. That should solve the problem of the cursor changing from an arrow to the pointer hand with finger over a non-link href. That way I solve two problems with one fix, and maybe the code will work the same in all browsers. Phil
  2. DrPR

    href null link

    Ingolme, Thanks. I knew href="#" and href="" worked, but there are a lot of kludges that really aren't good coding that browsers seem to work with anyway. I didn't know why those <a> elements were in the original code. I have been thinking about getting rid of them because the menu seems to work without them - but it has been easier to just leave it alone. **** I chose XHTML instead of HTML I guess because I am a nit-picker. I just liked the fact that you had to close statements and not leave things hanging for the whims of the browser. To me it was easier to read. Back in the early days of "C" I was always getting my posterior kicked when I accidentally screwed up types, indirection, etc. C++ solved a lot of problems by being really picky about such things. I guess I am like that. "Really old code" is being polite. I have been using XHTML for more than a decade. I have thought about looking into HTML 5, but it might be just another XHTML (I remember when that was to become the ultimate markup language). I remember when FORTRAN was the "ultimate" programming language, so everyone had to use it. I learned programming with BASIC. Then Pascal came along, and everyone had to switch. I even programmed in FORTH and STOIC (UG!) because those were to become the "ultimate" languages. Never tried A, B or APL. Then came C, ADA, and finally C++. Finally? I doubt it! I have also programmed in binary machine languages, assembly languages and a few other flash in the pan languages whose names I don't even remember! It was like the Twelve Days of Christmas - on the first day programmers gave to me binary. On the second day ... assembly and binary. And so on. So I am no longer enthralled with changing to the latest fad language - and there are dozens of them! As long as XHTML 1.0 works in browsers I'll probably stay with it. Maybe in another five years I'll switch to HTML 5 - if it is still around. I really am not very concerned with all of the cell phones. Who is going to try to read a 70 page web site on a tiny screen? Kids who just use their phones for texting certainly aren't! I can read it on an iPhone 5, and even use the pull-down menus by zooming in. My site is formatted for 1024 bit wide screen, and it won't be long before everything has at least that many pixels (maybe they already do). This allows me to format the pages to keep text aligned with related images without everything becoming a random jumble. Besides, I'd rather spend my time hiking! Phil
  3. DrPR

    href null link

    This is a HTML/XHTML philosophical question. I have been using a drop down menu on my web site for years that uses nested unordered lists. I got the code from another fellow. It works fine with Firefox, Internet Explorer, Edge, and Safari on a Macbook Pro and iPhones. It works mostly with Opera and Chrome (drop down menu works OK but cursor behaves strangely). It doesn't work on some Apple tablets - but who cares? The code is XHTML 1.0 and it passes the W3C code validation. The menu has this structure: <div> <ul> <li><a href="#"> ... </a> <ul> <li><a href="[local page link]"> ...</a> </li> and so on. My question: What is href="#" supposed to do? It looks like a null (non-existing) fragment, or incomplete fragment. If you move the cursor over this menu object the cursor changes from the default arrow to the pointer (hand with finger), implying that if you click the menu object you will go somewhere.* But there is no real link, so should the cursor change? The drop down menu works without the href="#" statement. In fact, clicking on this menu object appears to redraw the current page from the top. If the screen is scrolled so the top of the page is not visible when you click on the menu object the screen redraws with the top of the page visible. So it appears that href="#" is a link to the top of the page. I have read people proselytizing that the "#" incomplete fragment is sloppy coding, lazy work, evil ... and so on. Any thoughts? What about href=""? Another null link? I have seen this used in some HTML code. **** The web site is: http://www.okieboat.com if you want to see the menu in action or look at the code. Phil *NOTE: I have a "cursor: default" statement in the CSS to force the cursor to remain an arrow when it is over the null link objects. This doesn't work in Opera or Chrome, but works in the other browsers.
×
×
  • Create New...