SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 34 of 34
  1. #26
    Django Jedi neron-fx's Avatar
    Join Date
    Sep 2007
    Location
    Bristol/Bath, UK
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rochow View Post
    You are talking about the rules. I am talking about the actual name.
    No, Jimmy and I are talking about naming conventions and you are talking about naming!

    I refer you to Jimmy's original post

    Quote Originally Posted by JimmyP View Post
    Naming conventions do *really* matter!
    A naming convention is a collection of rules followed by a set of names. The intent is to allow useful information to be deduced from the names based on regularities. The convention can be crucial to the successful running of automated procedures.

    A naming convention is a set of rules not the names specifically!

    Hence us saying Naming conventions are important!

    Anyway this conversation has gone off topic now.
    Neron-Fx
    Everytime a user opens Internet Explorer, a web developer dies...
    http://www.savethedevelopers.org/

  2. #27
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take this for example:

    Code:
    <div id="document">
    
    	<ul id="menu-skip">
    		<!-- List items -->
    	</ul>
    
    	<div id="branding">
    		<!-- Logo + tagline -->
    	</div>
            
            <ul id="menu-primary">
    		<!-- List items -->
    	</ul>
    	
    	<div id="content">
    		<div id="content-main">
    			<!-- h1 and the whole shebang -->
    		</div>
    		
    		<div id="content-related">
    			<!-- -->
    		</div>
    	</div>
    	
    	<div id="site-information">
    		<!-- -->
    	</div>
    </div>
    Each unique identifier is 'special' and will only be used once in my 'system'.

    Talking styling purposes: A benefit of an id is: they override classes by specificity weight

    For everyone else: If you were to name another block of code class="content", you do not have to worry about .content styles conflicting with #content styles

    For 'less' radicals haha
    Code:
    <div id="page">
    	<div id="head">
    		<!-- -->
    	</div>
    	
    	<ul id="menu-main">
    		<!-- -->
    	</ul>
    	
    	<div id="sections">
    		<div id="section-main"><!-- --></div>
    		<div id="section-related"><!-- --></div>
    	</div>
    	
    	<div id="foot">
    		<!-- -->
    	</div>
    </div>
    Here is a quick overview - http://htmldog.com/guides/cssadvanced/specificity/

  3. #28
    SitePoint Zealot Luke Morton's Avatar
    Join Date
    Jul 2005
    Location
    Essex, England.
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kohoutek View Post
    The difference between an ID and class is specifity. An ID has a higher specifity than a class which means the former will override the latter. Furthermore, you can combine multiple classes in a single HTML element but you can't use more than one ID for an element nor can you use it multiple times within an HTML document.

    This article has some really good information and a few resources for further reading.
    I love that star wars analogy!
    Luke Morton
    UK Web Explorer| lukemorton.co.uk

  4. #29
    SitePoint Evangelist
    Join Date
    Apr 2008
    Location
    Dublin, Ireland
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rochow View Post
    Might? Are you kidding?

    Let's take Bob, Jack and Fred.

    They visit www.site1.com
    - Images optimised
    - Accessible
    - Not-so-great ID and class names.

    It loads fast, it works it a variety of situations (image off/css on, css off/images on, font size increased, screen resolution). They have no problems with the site, and they become loyal readers/visitors/buyers.

    They visit www.site2.com
    - Images not optimised
    - Site not accessible
    - Great ID and class names.

    It takes forever to load, it doesn't works it a variety of situations (image off/css on, css off/images on, font size increased, screen resolution). They have problems with the site and they don't become readers/visitors/buyers.

    What difference did the ID and class names make? Nothing.

    So what you have to ask yourself is who you are making the site for: your visitors, or the odd HTML coder who will come along and view the source?

    He is learning, and naming conventions is far from #1 on the "to learn" list.
    How about :-

    They visit www.site3.com
    - Images optimised
    - Accessible
    - Great ID and class names - typing these took no longer than typing the Not-so-great ID and class names because they had decided beforehand on good naming conventions that they can use in most situations.

    It loads fast, it works it a variety of situations (image off/css on, css off/images on, font size increased, screen resolution). They have no problems with the site, and they become loyal readers/visitors/buyers.

  5. #30
    SitePoint Addict rochow's Avatar
    Join Date
    Oct 2006
    Location
    Queensland, Australia
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BrianOConnell View Post
    How about :-

    They visit www.site3.com
    - Images optimised
    - Accessible
    - Great ID and class names - typing these took no longer than typing the Not-so-great ID and class names because they had decided beforehand on good naming conventions that they can use in most situations.

    It loads fast, it works it a variety of situations (image off/css on, css off/images on, font size increased, screen resolution). They have no problems with the site, and they become loyal readers/visitors/buyers.
    Again - he is learning (though already has a pretty good knowledge I believe), and ID and class names are most definitely not a priority on the "to learn" list.

  6. #31
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    May I pick in on this thread?

    It loads fast, it works it a variety of situations (image off/css on, css off/images on, font size increased, screen resolution). They have no problems with the site, and they become loyal readers/visitors/buyers.
    All good, but why the h*** would users even bother to test all that crap out on the site?

    Most users just do a search and if they find the content they need, it's good and that builds the loyalty. I dunno about this "work in every possible situation".
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  7. #32
    SitePoint Addict rochow's Avatar
    Join Date
    Oct 2006
    Location
    Queensland, Australia
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BoltZ View Post
    All good, but why the h*** would users even bother to test all that crap out on the site?

    Most users just do a search and if they find the content they need, it's good and that builds the loyalty. I dunno about this "work in every possible situation".
    They would obviously be different users:
    - Normal
    - Vision problems and the font size is increased, or the DPI is increased
    - Using JAWS or another screenreader
    - On their mobile with no CSS but images
    - On dialup with CSS but no images
    - Using XYZ browser
    - Have Javascript/Flash/Java disabled
    - Those using the keyboard to navigate
    - Have multiple browser windows open (some people on widescreens have two browser windows next to each other)
    - Printing the page
    - and other things I have missed, naming these simply off the top of my head

    If you simple target the "normal", then you are throwing out a massive &#37; of visitors/buyers. So yes, sites should work in every possible situation

  8. #33
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by BoltZ View Post
    Most users just do a search and if they find the content they need, it's good and that builds the loyalty. I dunno about this "work in every possible situation".
    Most visitors only care that it works with their particular browser configuration. If they only ever use Lynx to view web pages then they don't care about any of the CSS or Javascript or how it looks in IE or Firefox or Opera or Amaya or Konqueror or whatever combinations you bothered to test - they only care if it is usable in Lynx.

    The same applies for whichever browser and browser settings each individual potential visitor decides to use.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  9. #34
    SitePoint Addict mason.sklut's Avatar
    Join Date
    Oct 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ID = used one-time
    CLASS = used multiple times

    <div id="header> --> used one time

    <div class="comment> --> used multiple times
    <p>lorem ipsum lorem ipsum</p>
    </div>

    <div class="comment>
    <p>lorem ipsum lorem ipsum</p>
    </div>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •