wolfkin Posted May 1, 2009 Report Posted May 1, 2009 (edited) I remember among the many tutorials a method for defining the starting path of relative links. Ok I found what I'm looking for the BASE attribue out of curiosity is it a good idea to use it or not? I was reading some of the CSS tutorials that suggested it would be better to use ID instead of CLASS all the time. Is it the same sort of situation with BASE? Edited May 1, 2009 by wolfkin Quote
jlhaslip Posted May 1, 2009 Report Posted May 1, 2009 ID's should only be used once on a page, but Classes can be used several times. ID's are 'more specific' that 'class', so I would suggest that you use ID's for the page structure and class for elements within the structure. Base I have no experience with other that a CMS I run uses it, but it is automated, so I have not really cheked it out. Quote
LSW Posted May 1, 2009 Report Posted May 1, 2009 Base has never been wide spread, sop not sure what support it has. Relative is basically saying "You are here and need to go there... so leave this folder where you are now (../) and enter this folder and find the file there." This way of doing things is OK for static sites. But what of dynamic sites? What if you want to use a PHP include so you only have one file with your navigation for your 1,000 pages? Well the Include is in a "includes" folder. Your pages are in a "PHP" folder or may folders for different catagories... and your index is in the Root folder. The paths are different so relative will not work. So you either write links as http://www.... or you put the full URL in a variable that you use. Either way as it works from the uppermost layer being the root, it does not matter what level any one linked file is in... the browser goes there from the root folder and finds it every time. I do it that way with my sites. I really can't say how well Base works, but it is the same idea. I have never really seen any sites using it. Quote
LSW Posted May 1, 2009 Report Posted May 1, 2009 He beat me again. Yes you should use ID's more than classes. ID's can also be used for programming so you have more uses for them like anchors etc. I build whole sites never using classes, generally I use them sparingly. You should not repeating things that often and you can define any element in an ID. You do not need classes for links because you can wrap the lint in a List with an ID and say that all hyperlinks in that list should be so. All paragraphs in this DIV ID should use this font etc. There is little to know reason to use a class if you can define the element within and ID. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.