I second this notion. A perfect example from a current project: I have two page templates: home and interior. On each I have the client's logo, but they are different sizes. I use an id of "logo" on both because something bothered me about using "#home-logo" and "#interior-logo". If I put an id of "home" or "interior" on the outermost div, I can style the div with an id of "logo" differently on both pages in my CSS:
#home #logo #interior #logo This works perfectly for my needs and keeps my code clean. Makes me happy. Pat On Jun 5, 1:38 am, "R. Rajesh Jeba Anbiah" <[EMAIL PROTECTED]> wrote: > On Jun 4, 10:28 pm, "Sean Catchpole" <[EMAIL PROTECTED]> wrote: > > > More importantly, why are you using two ID's? > > Remember, ID's are supposed to be unique, so just $('#bar') should work. > > If your ID's aren't unique, I highly suggest you change them to classes. > > I have a setup where every page will have it's unique id (wrapped > around all other elements next to body, say <div id="unique-for-the- > page">) > > Benefits: > 1. CSS designer can bend the design specific to a particular page. > Say, for example, all the pages have some statement <p id="bar">blah > blah</p>, but the client wants that statement to be highlighted only > on a login page. So, > #login #bar{ > background-color: yellow; > > } > > 2. Can easily apply CSS techniques such as <http://www.sitepoint.com/ > print/css-anthology-tips-tricks-4> (Figure 4.20) > > Similarly I want to apply the selector in jQuery too, so that the > rules wouldn't be global for every page; but specific to a single > page. > > -- > <?php echo 'Just another PHP saint'; ?> > Email: rrjanbiah-at-Y!com Blog:http://rajeshanbiah.blogspot.com/