Forums

Help › Forums

Web Development Help

Thu, Nov 18 2010 12:23 PM (21 replies)
  • VanHalenLover
    1,422 Posts
    Thu, Nov 4 2010 11:49 PM

    CharlemagneRH:

    I just tried this, by the way, and it doesn't work in FF3.6.12 if you use style="align:center"W3CSchools says that the align property is deprecated and not supported by certain DOCTYPE's.

    However, if you use simply align=center or style="text-align:center", it works!  But for how long?  When are these methods going to be made obsolete, and WTF other reasonable alternative is there?

    CRH,

    This is the vulcan mind-meld of old school -vs- new school, lol. text-align:center is the new version, but FF obviously isn't recognizing the particular application of how you used it, whereas align=center has been long recognized by FF and most other browsers; again, if used properly. That's the frustration of html - it tells you what it might not like, then decides later if it will work with it or not. 

    Not unlike visual studio, W3CSchools will warn you and I about the future, but most tags/attributes will still work if coded correctly. Browsers aren't gonna adapt until a new standard is established AND accepted. html5 is anywhere from 2 to 6 years away, depending on who you ask.

    Remember the html5 reference ???? 

    http://www.html5test.com/

    Try it in different browsers and see what you get!

     

  • CharlemagneRH
    1,054 Posts
    Fri, Nov 5 2010 12:12 AM

    CharlemagneRH:
    I just tried this, by the way, and it doesn't work in FF3.6.12 if you use style="align:center"W3CSchools says that the align property is deprecated and not supported by certain DOCTYPE's.

    However, if you use simply align=center or style="text-align:center", it works!  But for how long?  When are these methods going to be made obsolete, and WTF other reasonable alternative is there?

    Unbelievable... lol.

    Oh.  My.  God.

    I just tried to put a centered caption under a left-floated image.  Here is what I had to do:

    Littleipsum is a latin lorem ipsum generator for mac os x filed under text, macintosh it ain't. Downloadsquad - littleipsum is a latin lorem ipsum generator for mac os x filed under text, macintosh it ain't. When you're whispering sweet nothings and you run out of things to say, just start spouting lorem ipsum, drives them wild. <div style="float:left; padding:15px;"><img src="images/me_shrunk.jpg" style="width:300px"/><br/><div style="text-align:center; width:100%; padding-top:10px"><span style="font-size:.75em; font-style:italic;">Some dummy pretending to work.</span></div></div>Use lorem ipsum text often? littleipsum's a free mac app that generates filler text right from the menubar. tech Lorem ipsum is simply dummy text of the printing and typesetting industry. lorem ipsum has been the industry's standard dummy text for decades.<br/>

    Unfortunately, this technique is a little ghetto, seeing as how it relies on the 35%-width first <td> in order to get the span's <td> kicked over enough to be centered, and that isn't going to be very exact.

    Now, you could use <p> and avoid the table, getting perfect center alignment, but <p> is a block element, which means it has very large margins around it.  In other words, your "caption" is going to be dangling a half-inch under your image.  It looks stupid.

    Apparently in order to get something truly centered, without the huge margins, this is what is required:

    http://www.pmob.co.uk/pob/centred-float.htm

     

    Compare all of that crap with the old way (bolded & underlined are the tags that were required to get proper alignment -- these ~50 characters have ballooned into ~500):

    <div style="float:left; padding:15px;"><center><img src="images/me_shrunk.jpg" style="width:300px"/><br/><font size=.75em><i>Some dummy pretending to work.</i></font></center></div>

     

     

    W3C is officially worse than Microsoft.  At least when it was IE causing the problems, I could still depend on the fact that it was going to be reasonably easy to get FF to work.  Now FF has ruined itself by adhering to W3C "standards" -- all in the name of abstraction and modularity.  Seriously... what is the world coming to.

  • VanHalenLover
    1,422 Posts
    Tue, Nov 16 2010 2:01 AM

    CRH,

    you familiar at all with the getElementsByTagName method? I'm accessing some elements via the DOM using javascript in order to disable them (input text type), and then accessing them using the above method to change the background color.

    As soon as it changes the color, it over-rides the disabling of the same elements...... not what I want; I want them disabled AND I want to over-ride the default bgcolor that disabling them changes em to.

  • theshortdriver
    138 Posts
    Tue, Nov 16 2010 7:39 AM

    I have ben on this site for a year now and do not have a bad word to say about this game..when I joined my intent was only to have fun at a game I like so very much..I read stuff in the forums and believe that most players want to be the top dog on here..and get very mad at wgt when they think.. they are making it harder for them to achieve this, it is the best golf game on line I have ever played and althoo I have a lot lower equipment then others I still do ok..but the fun aspect has been there in every round since day one and still is to this day.

    I figure as long as I got a set of clubs that will reach the green..I always have a chance to win no matter who I play..as focus wins games not nessarily long clubs..sure there has been some glitches in this game..but wgt seems to me,to get on them and fix them as soon as they can..Im sure some people will not like me because Im saying the game is great the way it is, and I do not ever want to be the top golfer..just try and play well always..very seldom will I ever quit a game and never because of a bad shot like a lot of players do..I have nothing but praise to wgt and their great team..keep it up wgt..ty for listening to me..bye now

  • LizzieRossetti
    1,545 Posts
    Tue, Nov 16 2010 7:49 AM

    Hear! Hear! the shortdriver!

    Me too about all of that.

    Lizziex

  • CharlemagneRH
    1,054 Posts
    Tue, Nov 16 2010 2:47 PM

    VanHalenLover:

    CRH,

    you familiar at all with the getElementsByTagName method? I'm accessing some elements via the DOM using javascript in order to disable them (input text type), and then accessing them using the above method to change the background color.

    As soon as it changes the color, it over-rides the disabling of the same elements...... not what I want; I want them disabled AND I want to over-ride the default bgcolor that disabling them changes em to.

    I've never used it before, but here is an easy way to do that:

     

    1. Read whether or not they are disabled.  For example, something like this: var isDisabled = document.getElementById('inputtext1').disabled;

    2. Set the BG color.

    3. Then re-do the disable if it was originally disabled: if (isDisabled) { document.getElementById('inputtext1').disabled=true; }

     

    I'm a noob, so the syntax might be wrong, and you will obviously have to use getElementByTagName(<tag name>) instead of getElementById('inputtext1') but that would be how I would accomplish it.  If you can't get it to work, ask here: stackoverflow.com

     

    If disabling them overrides the BG color that you wanted, then (edit: look below for a fix for that.)

  • CharlemagneRH
    1,054 Posts
    Tue, Nov 16 2010 2:59 PM

    (double post)

  • CharlemagneRH
    1,054 Posts
    Tue, Nov 16 2010 3:01 PM

    Actually, scratch that.  I found it:  http://www.askthecssguy.com/2007/05/shawn_asks_the_css_guy_about_s_1.html   ( example )

     

     

    This works in FF, NS, and IE8.  Not sure about other browsers.

  • VanHalenLover
    1,422 Posts
    Wed, Nov 17 2010 4:29 PM

    thanks CRH,

    I was able to get it using the DOM, and didn't have to use the tagname method after all. It was as easy as using the style attribute for background color......

    var i=document.form1.elements.length;
        for(i=i-15;i<document.form1.elements.length-3;i++){
        document.form1.elements[i].disabled=true;
        document.form1.elements[i].style.backgroundColor="white"
        }}

    oh, the joy.......

  • CharlemagneRH
    1,054 Posts
    Wed, Nov 17 2010 7:22 PM

    VanHalenLover:

    thanks CRH,

    I was able to get it using the DOM, and didn't have to use the tagname method after all. It was as easy as using the style attribute for background color......

    var i=document.form1.elements.length;
        for(i=i-15;i<document.form1.elements.length-3;i++){
        document.form1.elements[i].disabled=true;
        document.form1.elements[i].style.backgroundColor="white"
        }}

    oh, the joy.......

    Oh, ok.  I thought that's what you were doing already... except with tag names, of course.

RSS