TOT - Web pages design question

Dec 08, 2014 65 Replies
Saved reading

No "onmouseover" in my code. The closest is the hover attribute for anchors. B-) The HTML, produced via PHP:

Home ... Boom Box

The CCS then defines what the browser shows for various class/id's of the ul li etc

ul#navigation li { list-style:none; text-align:left; margin:5px; } ul#navigation li a { display:block; text-decoration:none; padding:5px; color:#720000; background-color:rgb(244, 207, 135); border-top:solid 3px rgb(255, 255, 183); border-left:solid 3px rgb(255, 231, 159); border-bottom:solid 3px rgb(220, 183, 111); border-right:solid 3px rgb(196, 159, 87); }

ul#navigation li a#current { background-color:rgb(255, 181, 61); border-top:solid 3px rgb(255, 229, 109); border-left:solid 3px rgb(255, 205, 85); border-bottom:solid 3px rgb(231, 157, 37); border-right:solid 3px rgb(207, 133, 13); }

ul#navigation li a:hover { background-color:rgb(247, 151, 31); border-top:solid 3px rgb(255, 199, 79); border-left:solid 3px rgb(255, 175, 55); border-bottom:solid 3px rgb(223, 127, 7); border-right:solid 3px rgb(199, 103, 0); }

The CSS is actually also produced via PHP so all the maths to get the colour values for the drop shadow around a button is done for me. OK it's not what one might do for a busy site as the server has a lot of work to do but my sites aren't busy.

F*ck knows if that involves DOM, who ever they are.

So?

I've had absolutely no trouble supporting jQuery-based code. On the contrary I think it's probably saved me grief by side-stepping numerous browser bugs and inconsistencies.

If your PHP isn't doing anything dynamic, you might simplify things by generating your button CSS using

formatting link
or similar.

That css is non standard and wont work with older browsers

Define "older browsers" works in my normal browser Mozilla 1.7.12 under OS/2 (c)1998-2005. My O'Reilly "CSS Pocket Reference" is 1st Edition May 2001 and only goes as far as IE5, Netscape6 or Opera4. I can't see a tag above that isn't in that reference book, admitedly some are marked as "partial" for IE5 or not supported for IE3.

Even my Win2k installation (for when I have to use Windows) uses IE6.

I'd shove it through one of the online multibrowser testing sites but they all seem to require a later version of javascript than I have in Mozilla to work...

It's not for a given site but the code is shared across a couple of sites which have a different colour scheme. I guess I could copy 'n paste the generated code into a static .css file for each site. There are other things it calculates as well but again they are effectively static per site once the development phase is over.

Tim Streater posted

Possibly the last thing I want any web page to do.

That's a very good point, which I'd forgotten. However, for me, it doesn't rule out frames entirely for a small site. In fact my example is even worse, as I put javascript on each subframe to redraw the top frame (with home subframe unfortunately) if any subframe is arrived at on its own via a bookmark.

If many users don't make bookmarks, or they bookmark everything but never use them as their list is too long, I don't care that nobody can bookmark subpages. Also it forces them to read the home page which might contain an important announcement affecting all users. Also it allows scrolling the subpage without losing the header frame. Also it allows the site to be restructured without invalidating anyone's bookmark!

All of which goes to show that webpage design is more than a pretty layout that works in IE and says what you want people to see, not what they actually wanted to find out.

I haven't looked in detail but chances are the screen elements will still look and work like links even if they don't look like the "buttons" in a modern browser. I'd be reasonably happy with that.

and o fcourse the :hover is still javascript.

Just a short form of 'onmouseover/onmouseout'

No it's CSS. Nothing to do with javascript at all. If you think it is, then where are the event handlers for onmouseover/onmouseout ?

Couldn't see anything that would worry any browser that didn't come off The Ark.

No it's not, try this page without javascript enabled, it's a chopped down version of Dave's HTML/CSS

And it still works if you turn off/disable javascript. B-)

Built into the javascript engine that every browser comes with.

Which may or may not be disabled by 'turn off javascript' buttons.

In essence javascript is a language that acts on the DOM, when events tell it to, and just nbecause it aint written in 'pure' javascript don't mean the same engine isn't doing the action.

That why IO can't see the point of prejudice against it: its a crap insecure language to be sure, but 'not writing a script' wont save you from that.

disabling the script interpreter doesn't mean the javascript engine is disabled. Its totally integrated onto the browser.

Disable jabacsript= stop interpreting commands, not disabling the engine itself

I see no reason to think that the JavaScript engine is involved in implementing CSS pseudo-classes. Why would it be?

It's not written in any sort of javascript. It's written in CSS.

+1

Depending on the browser, yes lot of firefox is implemented as .xul and .js that runs within the sandbox of the browser itself, it'd be less portable without that, but disabling javascript for webpages stops it dead as far as content, rather than chrome*, is concerned - dunno about other browsers

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required