Archive for October, 2007

Secret#158:TheMidPassFilterThisfilterallowsyoutoprovideastylesheetforversionsIE5.0and5.5ofWindowswithoutincludinganyotherbrowser.ThismeansyoucanfixtheBoxModelandotherproblemsinIE5.xversionswithoutaddingthosehacksdirectlytoyourmaindocuments. Inthecaseofthemid-passfilter,you lltrickthebrowserusingthe@mediarulewithavalueoftty. noteThe@mediarulehelpsspecifymediatypes(seeSecret162laterinthischapter).Itissimilarto@importinthatyoucanusemultipleinstancesof@mediatodefinedifferentmediatypeswithinasinglestylesheet.Inthisinstance,it sbeingusedspecificallyasahack. Considerthefollowing: @mediatty{ i{content:”";/*”"*/}}@import’midpassbefore.css’;/*”;} }/**/ p.test{color:green;padding:1em} (Web hosting domains)

Wednesday, October 31st, 2007

Secret#158:TheMidPassFilterThisfilterallowsyoutoprovideastylesheetforversionsIE5.0and5.5ofWindowswithoutincludinganyotherbrowser.ThismeansyoucanfixtheBoxModelandotherproblemsinIE5.xversionswithoutaddingthosehacksdirectlytoyourmaindocuments. Inthecaseofthemid-passfilter,you lltrickthebrowserusingthe@mediarulewithavalueoftty. noteThe@mediarulehelpsspecifymediatypes(seeSecret162laterinthischapter).Itissimilarto@importinthatyoucanusemultipleinstancesof@mediatodefinedifferentmediatypeswithinasinglestylesheet.Inthisinstance,it sbeingusedspecificallyasahack. Considerthefollowing: @mediatty{ i{content:”";/*”"*/}}@import’midpassbefore.css’;/*”;} }/**/ p.test{color:green;padding:1em} strong{color:black;background:#fff;padding:02px;margin:-@mediatty{ i{content:”";/*”"*/}}@import’midpassafter.css’;/*”;} }/**/ Becauseofthefiltrationprocessbasedonbugswiththe@mediarule,mediattyruleswillbeseenonlybyIE5.xbrowsersforWindows, andwillbeignoredbyallotherbrowsers.Allbrowserswillinterpretthestyleinformationinthemiddle. noteSeehttp://tantek.com/CSS/Examples/midpass.htmlfordocumentationonthemid-passfilter. Secret#159:IE5.0WindowsBandPassFilterThisfilterworksonthesamepremiseasthemid-passfilter,butisspecifictoIE5.0forWindowsonly.Everyotherbrowserbeforeorafterisfilteredout. @mediatty{ i{content:”";/*”"*/}};@import’ie50winbandpassbefore.css’; {;}/*”;} }/**/ p.test{color:green;padding:1em} strong{color:black;background:#fff;padding:02px;margin:-
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Web hosting mysql - lemswiththehackitself. noteTolearnmoreabouttheBoxModelHack,seevisualexamples,andreadmoreaboutadditional,usefulCSStohelpwithotherbrowsersathttp://tantek.com/CSS/Examples/boxmodelhack.html. TheBoxModelHackwillnowvalidateattheW3C sCSSvalidator.Foratimeitdidnot,butbecausetheactualsyntaxisvalidCSSsyntax,theW3Ccorrectedthevalidatortosupportit,eventhoughthewayit sbeingusedisinappropriate.Thinkoftheuseofatableelementtocreatealayouttable. EventhoughtheuseoftablesforlayoutisthebiggesthackinHTMLhistory, thetableelementisstillavalidelement,eventhoughwe remisusingitfromitsoriginalintent. Secret#157:TheHighPassFilterThisfilterisameansoffilteringCSSrulestoavarietyofbrowserswhileen- suringthatunwantedstylesdon tgetmalignedbythoseproblembrowsers.freeanenvironmentaspossible,butstillbeabletodeliverCSStobrowsersinacontrolledway. Sowhilewe restillhackingaway,we removingthosehacksoutofthemainHTMLandCSSdocuments,asdescribedintheprevious CSSHackingStrategies

Wednesday, October 31st, 2007

lemswiththehackitself. noteTolearnmoreabouttheBoxModelHack,seevisualexamples,andreadmoreaboutadditional,usefulCSStohelpwithotherbrowsersathttp://tantek.com/CSS/Examples/boxmodelhack.html. TheBoxModelHackwillnowvalidateattheW3C sCSSvalidator.Foratimeitdidnot,butbecausetheactualsyntaxisvalidCSSsyntax,theW3Ccorrectedthevalidatortosupportit,eventhoughthewayit sbeingusedisinappropriate.Thinkoftheuseofatableelementtocreatealayouttable. EventhoughtheuseoftablesforlayoutisthebiggesthackinHTMLhistory, thetableelementisstillavalidelement,eventhoughwe remisusingitfromitsoriginalintent. Secret#157:TheHighPassFilterThisfilterisameansoffilteringCSSrulestoavarietyofbrowserswhileen- suringthatunwantedstylesdon tgetmalignedbythoseproblembrowsers.freeanenvironmentaspossible,butstillbeabletodeliverCSStobrowsersinacontrolledway. Sowhilewe restillhackingaway,we removingthosehacksoutofthemainHTMLandCSSdocuments,asdescribedintheprevious CSSHackingStrategies secret. Inthecaseofthehighpassfilter,you llfirstcreatealinkedstylesheetwith@importruleswritteninsuchawayastotrickbrowserswithoutproperimple- mentation:
Thisstylesheetitselfcontainstworules: @import”null?”{”; @import”highpass.css”; ThefirstruleisatrickusingthesametechniqueemployedintheBoxModelHacktothrowoffthosebrowsersthatcan tparsetheescapesequence,”?”{Thesecondstylesheet,highpass.css,willcontainyouractualstyles,whichwillthenbeimportedintothestylesheetandcarriedoverintothecompliantbrowserviathelink,leavingthehackseparatefromthemainHTMLdocumentandfromthecleanstylesheet. noteForthedocumentationontheHighPassFilter,seehttp://tantek.CSS/Examples/highpass.html.
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Web hosts - Secret#156:TheBoxModelHackPerhapsthemostwidelyusedhackinCSS,theBoxModelHackhelpscorrectproblemswithpositioning.IEforWindowshasanincorrectimplementationoftheBoxModel,asdescribedearlierinthischapter.WhileDOCTYPEswitchingcorrectsthisprobleminIE6.0,earlierIEversionswillmisinterpretyourCSSbadlyenoughtocausesignificantlayoutdiscrepancies. noteReadmoreaboutDOCTYPEswitchingtechnologyinChapter7, MovingAheadwithXHTML. Beginwithasimplebox,suchasthefollowing: #content{ border:10pxsolidblack; padding:10px; width:300px; }

Tuesday, October 30th, 2007

Secret#156:TheBoxModelHackPerhapsthemostwidelyusedhackinCSS,theBoxModelHackhelpscorrectproblemswithpositioning.IEforWindowshasanincorrectimplementationoftheBoxModel,asdescribedearlierinthischapter.WhileDOCTYPEswitchingcorrectsthisprobleminIE6.0,earlierIEversionswillmisinterpretyourCSSbadlyenoughtocausesignificantlayoutdiscrepancies. noteReadmoreaboutDOCTYPEswitchingtechnologyinChapter7, MovingAheadwithXHTML. Beginwithasimplebox,suchasthefollowing: #content{ border:10pxsolidblack; padding:10px; width:300px; } Thecorrectinterpretationwouldbetoaddthebordersandpaddingwidth-Leftborder10px+ Rightborder10px+ Leftpadding10px+ Rightpadding10px+ Boxwidth300px= 340pixelstotalwidthHowever,improperBoxModelinterpretationswillplacetheborderandpaddinginsidethewidthofthebox,resultinginthosewidthsbeingsubtracted,asfollows: Boxwidth300px- Leftborder10px- Rightborder10px- Leftpadding10px- Rightpadding10px= 260pixelstotalwidthAsyoucansee,thisisasignificantdifference.TheBoxModelHacktapsintoaparsingbuginthoseproblembrowserstoworkaroundtheproblem.Usingthevoice-familyproperty,youfirstdefineyourdesiredwidth,insertthehack,whichgetsoverriddenandtrickstheproblembrowsersintousingthecorrectwidthof340pixels: div.content{ width:340px; voice-family:”"}”"; voice-family:inherit; width:260px; }
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

elik,whoworkedasleaddeveloperonseveralversionsoftheMacintoshIEWebbrowserandisastrongadvocateofWebstandards,andarepresentedwithhispermission.Alsoofnote:sotheyareavailableforyoutofreelydistributeaslongasattributionisgiven.Ineachhack scase,I veprovidedtheURLspecifictothehack sdocumen- tation. Havingsomestrategyinplacetodealwithhackscanhelp.Hereareafewtips: Avoidhacksifyoudon tneedthem.ThismeansknowingCSS(wellenoughtostripouthacksfromCSSthatyoumightborrowfromotherdesignerstouseasatemplateorguide. Commentyourhackedcode.Anytimeyouaddahack,makesureyouplaceacommentwiththathacktonotifyotherswhomightbeworkingwithyourcode.Leteveryoneknowthatitisinfactahack,andifithasaspecific,knownname,suchas hipassfilter, includethatinyourcomment,too. Considerusing@importwithinyourmainstylesheettoimportyourhacks.Thisway,youcansimplyremovethehackfileand@importrulesfromyourmainsheetasyoufindtheyarenolongerrequired. Ifyouchoosetoimportyourhacks,youmustaddtherulesdirectlytoyourprimarystylesheet: /*beginhacks*/ (Web hosting colocation)

Tuesday, October 30th, 2007

elik,whoworkedasleaddeveloperonseveralversionsoftheMacintoshIEWebbrowserandisastrongadvocateofWebstandards,andarepresentedwithhispermission.Alsoofnote:sotheyareavailableforyoutofreelydistributeaslongasattributionisgiven.Ineachhack scase,I veprovidedtheURLspecifictothehack sdocumen- tation. Havingsomestrategyinplacetodealwithhackscanhelp.Hereareafewtips: Avoidhacksifyoudon tneedthem.ThismeansknowingCSS(wellenoughtostripouthacksfromCSSthatyoumightborrowfromotherdesignerstouseasatemplateorguide. Commentyourhackedcode.Anytimeyouaddahack,makesureyouplaceacommentwiththathacktonotifyotherswhomightbeworkingwithyourcode.Leteveryoneknowthatitisinfactahack,andifithasaspecific,knownname,suchas hipassfilter, includethatinyourcomment,too. Considerusing@importwithinyourmainstylesheettoimportyourhacks.Thisway,youcansimplyremovethehackfileand@importrulesfromyourmainsheetasyoufindtheyarenolongerrequired. Ifyouchoosetoimportyourhacks,youmustaddtherulesdirectlytoyourprimarystylesheet: /*beginhacks*/ @import”hi-pass.css”; @import”boxmodel.css”; @import”opera.css”; /*endhacks*/ Figure9-12describesthewayyouwouldimportahack.Bykeepingthehacksinseparatefiles,theybecomeeasiertoremovedowntheline. Figure9-12:Importinghacksintoaprimarystylesheet.
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

thelayoutstylesusing@import,asinthefollowingexample: @import”layout.css”; BecauseNetscape4.xcanreadthelinkedstylesheet,somestylewillbeappliedtothepage.Butbecauseitcannotreadthe@importruleoranystylesassociatedwithit,thelayoutstyleinformationisignored,leavingamoregracefullydegradedsite(seeFigure9-11). Figure9-11:Gracefuldegradationusing@importtohidelayoutstylesfromNetscape. Secret#155:CSSHackingStrategiesYou vealreadyseenthecenterhackinoperationinthischapter.Ahackoccursanytimeyouuseanelement,property,orothersyntaxwithinalanguageforapurposeotherthanitsintendedapplication. HacksareinwidespreadusewithCSSbecauseofmyriadbrowserissues.pendinguponyourcircumstances,youmaybeabletoavoidmosthacks,hacksarenecessary especiallywhenitcomestomaintainingCSSlayoutandstyleacrossasmanybrowsersaspossible. noteInthenextfewsecrets,you llbelearningaboutanumberofhackstomanagelayoutanddesignissuesacrossbrowsers.Themajorityofthese

Monday, October 29th, 2007

thelayoutstylesusing@import,asinthefollowingexample:
@import”layout.css”; BecauseNetscape4.xcanreadthelinkedstylesheet,somestylewillbeappliedtothepage.Butbecauseitcannotreadthe@importruleoranystylesassociatedwithit,thelayoutstyleinformationisignored,leavingamoregracefullydegradedsite(seeFigure9-11). Figure9-11:Gracefuldegradationusing@importtohidelayoutstylesfromNetscape. Secret#155:CSSHackingStrategiesYou vealreadyseenthecenterhackinoperationinthischapter.Ahackoccursanytimeyouuseanelement,property,orothersyntaxwithinalanguageforapurposeotherthanitsintendedapplication. HacksareinwidespreadusewithCSSbecauseofmyriadbrowserissues.pendinguponyourcircumstances,youmaybeabletoavoidmosthacks,hacksarenecessary especiallywhenitcomestomaintainingCSSlayoutandstyleacrossasmanybrowsersaspossible. noteInthenextfewsecrets,you llbelearningaboutanumberofhackstomanagelayoutanddesignissuesacrossbrowsers.Themajorityofthese
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Freelance web design - you llwanttoorderyourdivelementssothecontentisreadablewhenstylesareremoved. Say,forexample,youhavethefollowinginyourdocument: Ifyouremovethestyles,thenavigationisgoingtoappearatthetopofthepage. Ifyouprefertohavethenavigationappearatthebottomofthepagewhenstylesareremoved,simplyswitchtheorderofthedivelements,asfollows: BecausethedivpositioningisbasedonyourCSS,nottheorderinwhichthein- formationappearsinthedocument,thevisualoutputinaCSS-compliantbrowserwillbeexactlythesame. warningWhilethisworkswellforpositioneddivelements,oneofthedownsidesofusingfloatsforlayoutisthatyoucan tdothiswithfloateddivisions. Secret#154:@importforGracefulDegradationIfyouareattemptingtogracefullydegradeyourCSSlayoutsandhavetosupportNetscape4.xversionbrowsers,youmightwanttoconsiderusingthe@Theproblem:Netscape4.xversionshavepartialsupportforCSS.Layoutsareespeciallypronetobreaking. Thesolution:Netscape4.xversions impartialCSSsupportisapartialblessing,

Monday, October 29th, 2007

you llwanttoorderyourdivelementssothecontentisreadablewhenstylesareremoved. Say,forexample,youhavethefollowinginyourdocument:

Ifyouremovethestyles,thenavigationisgoingtoappearatthetopofthepage. Ifyouprefertohavethenavigationappearatthebottomofthepagewhenstylesareremoved,simplyswitchtheorderofthedivelements,asfollows:

BecausethedivpositioningisbasedonyourCSS,nottheorderinwhichthein- formationappearsinthedocument,thevisualoutputinaCSS-compliantbrowserwillbeexactlythesame. warningWhilethisworkswellforpositioneddivelements,oneofthedownsidesofusingfloatsforlayoutisthatyoucan tdothiswithfloateddivisions. Secret#154:@importforGracefulDegradationIfyouareattemptingtogracefullydegradeyourCSSlayoutsandhavetosupportNetscape4.xversionbrowsers,youmightwanttoconsiderusingthe@Theproblem:Netscape4.xversionshavepartialsupportforCSS.Layoutsareespeciallypronetobreaking. Thesolution:Netscape4.xversions impartialCSSsupportisapartialblessing, becausethere snosupportforthe@importrule.ThisallowsdesignerstosplittheirCSSintotwostylesheets: Site-widestyles.Thisstylesheetwillcontainfont,color,andotherCSSpropertiesusedforjustabouteverythingbutlayoutinformation. Layoutstyles.Thisstylesheetcontainsthelayoutinformationforthesite. Ifyouhadasite-widestylesheet,styles.css,andalayoutstylesheet,layout.splitupinthewaypreviouslydescribed,you dthenlinktothestyles.css,butimport
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Posted in J2EE | No Comments »

Listing9-7:(continued) } Loremipsumdolorsitamet,consectetueradipiscingelit.Utporta.Duisvulputatebibendumtellus.Vivamusdictumegestasmi.Crasjusto.Vestibulumnislmauris,convallisa,vestibulumet,accumsanvel,lacus.Morbimattisviverraturpis.Pellentesqueblanditquaminsapien.purussitametmollissollicitudin,lacusleorhoncusenim,necvestibulumurnatellusatmagna.Utadipiscing. Morbiutsemnondiamfringillatincidunt.Maecenasnunctellus,adipiscingeget,tinciduntut,venenatisut,enim.Sedposuereturpisatnisl.Sedatsem.Nullamsagittistinciduntmagna.Duistempus.Proinduiturpis,consequatquis,porttitorut,molestievel,libero.Phasellussodalesvenenatisurna. (Unable to start debugging on the web server)

Sunday, October 28th, 2007

Listing9-7:(continued) }

Loremipsumdolorsitamet,consectetueradipiscingelit.Utporta.Duisvulputatebibendumtellus.Vivamusdictumegestasmi.Crasjusto.Vestibulumnislmauris,convallisa,vestibulumet,accumsanvel,lacus.Morbimattisviverraturpis.Pellentesqueblanditquaminsapien.purussitametmollissollicitudin,lacusleorhoncusenim,necvestibulumurnatellusatmagna.Utadipiscing.

Morbiutsemnondiamfringillatincidunt.Maecenasnunctellus,adipiscingeget,tinciduntut,venenatisut,enim.Sedposuereturpisatnisl.Sedatsem.Nullamsagittistinciduntmagna.Duistempus.Proinduiturpis,consequatquis,porttitorut,molestievel,libero.Phasellussodalesvenenatisurna.Maecenasipsumrisus,fringillarutrum,portaid,congueid, leo.Fusceauguenulla,vestibulumat,euismodut,ultricesin, felis.Crasvitaepedeacmilobortisfermentum.Phasellusviverra.Utultrices,nequeacconguevarius,justoquamelementummi,atnonummyurnaelitquisaugue.Praesentfeugiatpedeaturpis.Duisliberodiam,volutpatid,dictumvitae,aliquetsed, lorem.

Thismethodworksinafargreaterrangeofbrowsers,andyoucanusethetech- niqueforcreatingverticallyalignedCSSlayouts. noteBesuretoreadthe CSSHackingStrategies secretlaterinthischapterforinformationonhowtodealwithhacksmoreefficiently. Secret#153:OrderingDIVsforBackwardCompatibilityWhenyou recreatingCSSlayouts,theorderofyourpositioneddivelementswillmakeadifferenceinthewayinwhichtextisorderedwhenstylesareremoved, butwon tmakeadifferenceintermsofhowtheCSSisinterpretedon-screen.
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

Posted in J2EE | No Comments »

10:Centeringusingthecenterhackwon tworkinsomebrowsers. So,tomakeyourcontainingboxascross-browsercompatibleaspossible,asexpressedinListing9-6. Listing9-6:Combiningcorrectverticalcenteringandthecenteringhack CenteringCombo body{ text-align:center; } #content{ (Web site hosting)

Sunday, October 28th, 2007

10:Centeringusingthecenterhackwon tworkinsomebrowsers. So,tomakeyourcontainingboxascross-browsercompatibleaspossible,asexpressedinListing9-6. Listing9-6:Combiningcorrectverticalcenteringandthecenteringhack body{ text-align:center; } #content{ width:595px; height:400px; border:1pxsolidblack; padding:10px; margin-right:auto; margin-left:auto; text-align:left;
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Posted in J2EE | No Comments »

Web hosting contract - Listing9-5:(continued) text-align:center; } #content{ width:400px; height:400px; text-align:left; }

Saturday, October 27th, 2007

Listing9-5:(continued) text-align:center; } #content{ width:400px; height:400px; text-align:left; }

Loremipsumdolorsitamet,consectetueradipiscingelit.Utporta.Duisvulputatebibendumtellus.Vivamusdictumegestasmi.Crasjusto.Vestibulumnislmauris,convallisa,vestibulumet,accumsanvel,lacus.Morbimattisviverraturpis.Pellentesqueblanditquaminsapien.purussitametmollissollicitudin,lacusleorhoncusenim,necvestibulumurnatellusatmagna.Utadipiscing.

Morbiutsemnondiamfringillatincidunt.Maecenasnunctellus,adipiscingeget,tinciduntut,venenatisut,enim.Sedposuereturpisatnisl.Sedatsem.Nullamsagittistinciduntmagna.Duistempus.Proinduiturpis,consequatquis,porttitorut,molestievel,libero.Phasellussodalesvenenatisurna.Maecenasipsumrisus,fringillarutrum,portaid,congueid, leo.Fusceauguenulla,vestibulumat,euismodut,ultricesin, felis.Crasvitaepedeacmilobortisfermentum.Phasellusviverra.Utultrices,nequeacconguevarius,justoquamelementummi,atnonummyurnaelitquisaugue.Praesentfeugiatpedeaturpis.Duisliberodiam,volutpatid,dictumvitae,aliquetsed, lorem.

Yourboxisnowcentered.Orisit?InInternetExplorer(IE)6andNetscape4.eventhoughtheheightandborderstylesaren tsupported).ButinMozillaandOpera,theboxisn tcentered(seeFigure9-10). noteThefactthattheboxdoesnotcenterproperlyusingthismethodinMozillaandOperaisnotafaultofthosebrowsers.They reactuallyrenderingtheCSSprop- erly.You reusingahack,whichmoresophisticatedbrowserstendnottolike.
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

Posted in J2EE | No Comments »

Web design conference - 9:CenteringaboxusingthecorrectmethodworksincomplyingbrowserssuchasMozilla. workinawiderrangeofbrowsers.Theworkaroundiscontroversialforacoupleofreasons: You reapplyingapropertymeantfortext,notforpositioning,soyou renotusingthelanguagecorrectly,whichiswhythisisconsideredahack. YouhavetowriteextraCSStooverridethetext-align:centerpropertyandvalue,becauseyou regoingtousethetext-align: centerpropertyonthebodyelement.So,anytextwithinthebodyisnowgoingtobealignedtothecenter,unlessyouoverridethetext-alignpropertyelsewhere. Listing9-5showstheCSSandmarkupforthecenteringhack. Listing9-5:Centeringhack CenteringHack

Saturday, October 27th, 2007

9:CenteringaboxusingthecorrectmethodworksincomplyingbrowserssuchasMozilla. workinawiderrangeofbrowsers.Theworkaroundiscontroversialforacoupleofreasons: You reapplyingapropertymeantfortext,notforpositioning,soyou renotusingthelanguagecorrectly,whichiswhythisisconsideredahack. YouhavetowriteextraCSStooverridethetext-align:centerpropertyandvalue,becauseyou regoingtousethetext-align: centerpropertyonthebodyelement.So,anytextwithinthebodyisnowgoingtobealignedtothecenter,unlessyouoverridethetext-alignpropertyelsewhere. Listing9-5showstheCSSandmarkupforthecenteringhack. Listing9-5:Centeringhack body{
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Posted in J2EE | No Comments »