SitePoint Sponsor

User Tag List

Results 1 to 19 of 19
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ive done this with some code.Is it ok?

    Hi,

    Ok so is it accpetable to do this.

    Ive got some code, Its mainly text and two links i considered creating a div but for some reason i wrapped the whole thing in a p class and styled all the text this way.

    Heres the code:

    <code>
    <p class="linklist"><a href="http://textpattern.net" title="">TextBook</a><br />
    <a href="http://textpattern.com" title="">Textpattern</a><br />
    <a href="http://textpattern.org" title="">Txp Resources</a><br /></p></code>

    Is this ok to do?

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it is a list, you should mark it up as a list.
    HTML Code:
    <ul>
     <li><a href="http://textpattern.net/">TextBook</a></li>
     <li><a href="http://textpattern.com/">Textpattern</a></li>
     <li><a href="http://textpattern.org/">Txp Resources</a></li>
    </ul>
    Simon Pieters

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi there,

    Yeah i get that. This is code output by my cms. Im trying to work it so that i'll get that sort of parsed code in the end.

    It was more of a question whether i could use that p class id created kind of like a div.
    Its not even that much of a problem if i cant. Just something of interest!

    Thanks

  4. #4
    SitePoint Wizard bronze trophy bluedreamer's Avatar
    Join Date
    Jul 2005
    Location
    Middle England
    Posts
    3,347
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Using a <p> tags is fine. People will argue both ways but it is valid code.

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2006
    Location
    Ohio USA
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks more like a list of three links to me. Given the class name, I'd guess you thought so too.

    While you are free to code it however you'd like, I'd suggest that an unordered list is more appropriate.


    Edit: looks like I posted in "the other" thread. removed the code as it's already provided above.

  6. #6
    SitePoint Wizard trampt's Avatar
    Join Date
    Jan 2003
    Location
    Newport, RI
    Posts
    1,997
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about you don't cross-post the same question. Once is good enough.

  7. #7
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As was pointed out in your other thread on the same topic, the best way to do this is to use a list.

  8. #8
    Night Elf silver trophybronze trophy Varelse's Avatar
    Join Date
    Mar 2005
    Location
    eu
    Posts
    5,967
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    As trampt suggested - please do not cross-post your thread in several forums.
    The other thread has been merged with this one.
    FreelanceDaddy - freelancer's personal advisor
    █ Guide and advice for freelancers starting their career
    █ Over 1000 projects posted on freelance markets every day
    █ One-stop resource for online freelancing

  9. #9
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    elduderino,

    Assuming this CMS you're using is Textpattern, you should have no problem getting the links render in an <li>. Just edit the default link form or create a new one to use.

    Code:
    <ul class="linklist">
    <txp:linklist form="my-links" limit="10" />
    </ul>
    New link form named my-links
    Code:
      <li><txp:link /></li>
    Your original method is messy (presentational mark-up: <br>).

  10. #10
    Non-Member deathshadow's Avatar
    Join Date
    Jul 2006
    Location
    Dublin, NH
    Posts
    901
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bah, czech this out.

    <style type="text/css">
    .linklist a { display:block; }
    </style>

    <p class="linklist">
    <a href="http://textpattern.com">Textpattern</a>
    <a href="http://textpattern.com">Textpattern</a>
    <a href="http://textpattern.org">Txp Resources</a>
    </p>


    Completely valid use of CSS... Why waste time opening and closing extra tags when you can hijack the existing ones.

    (I'd put it in bbcode tags, but those crappy little boxes and scrollbars on code are starting to piss me off)

  11. #11
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow
    Bah, czech this out.

    <style type="text/css">
    .linklist a { display:block; }
    </style>

    <p class="linklist">
    <a href="http://textpattern.com">Textpattern</a>
    <a href="http://textpattern.com">Textpattern</a>
    <a href="http://textpattern.org">Txp Resources</a>
    </p>


    Completely valid use of CSS... Why waste time opening and closing extra tags when you can hijack the existing ones.
    You're completely missing the point.

    The idea isn't to use as few elements as possible to get the rendering you want. Forget the CSS and think about what the piece of content actually is. It's a list of links. Lists should be marked up as lists, not as paragraphs.
    Simon Pieters

  12. #12
    Non-Member deathshadow's Avatar
    Join Date
    Jul 2006
    Location
    Dublin, NH
    Posts
    901
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan
    You're completely missing the point.

    The idea isn't to use as few elements as possible to get the rendering you want. Forget the CSS and think about what the piece of content actually is. It's a list of links. Lists should be marked up as lists, not as paragraphs.
    BULL. The object is to get the content to the user using as few bytes as humanly possible - saving you money on server costs, increasing the available bandwidth to your site, decreasing page render times and generally decreasing the overall load on every router/bridge between your server and the user.

    According to most sites, well in excess of 50% of all internet users in America are still using dailup - ANY savings you come up with to make it friendly to them will likely be welcome... doing anything else is just alienating half your potential audience... It may only be 1-5% of the total filesize, but times a million hits over hundreds of files on the server you are on - it can REALLY ad up.

    Case in point, the largest of the sites I maintain has grown in throughput from 100 gigs/mo to almost 300 gigs/mo, yet has grown in userbase (unique IP's) and hits by a factor of twenty. We're operating on a shoestring budget and can barely afford a 512gig/mo limit dedicated server - if we were still on the codebase the site was before I rewrote it with the traffic we have now... let's just say there's no way we could swing a 2tb connect.

    There's an increasing attitude of 'people have broadband, what's it matter' - it matters when your 10mbps upstream connect is maxed out choking even your broadband users down to dailup speed. Killing wasteful tags is one way to alleviate the problem, alongside actual image optimization (like storing a 1x32 striped banner background as a 32 color .png instead of a 16m color .jpg... using something OTHER than photoshop to optimize the images down), using SVG instead of flash (finally, dynamic content that's bandwidth practical!), etc, etc.

    On top of which, it's SIMPLER (in a roundabout way)... the more tags you have to open and close, the more likely you are to make a typo or forget to close a tag... making you spend more and more time doing validate/fail > edit > validate/fail > edit > validate/fail > edit

    Seriously, how often on forums like this do you see someone asking for help where they forgot to close a tag - where their entire page could probably shed 3-4k (or more)... Less tags, less likely to forget to close one.

    Simple, elegant, fast.

    But then I tend to have different objectives (and therin draw different conclusions) than most people...

  13. #13
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow
    BULL. The object is to get the content to the user using as few bytes as humanly possible
    Surely, it is also important that the user can understand the content? Because all users aren't using the Web with a desktop browser looking at a screen. For starters, there are mobile phones that ignore your precious CSS and there are people who are blind who use assistive technologies like screen readers that don't benefit jack of your precious CSS. However, these users are able to interpret that:
    HTML Code:
    <ul>
     <li>foo
     <li>bar
     <li>baz
    </ul>
    ...is a list of three items. They cannot do the same with your proposal.

    Also remember that there is Google that also benefits from semantic markup.

    And your points about bandwidth is moot. The difference is negotiable and mostly irrelevant as soon as you also have images on your pages.
    Simon Pieters

  14. #14
    Non-Member deathshadow's Avatar
    Join Date
    Jul 2006
    Location
    Dublin, NH
    Posts
    901
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan
    Surely, it is also important that the user can understand the content? Because all users aren't using the Web with a desktop browser looking at a screen.
    Yeah, such a minority that bending over backwards to support them is starting to piss me off.

    Quote Originally Posted by zcorpan
    For starters, there are mobile phones that ignore your precious CSS
    Which thanks to Opera mobile are are rapidly going the way of the dodo - rather than wasting all this time on WEP and alternative CSS, how about putting effort towards making browsers on the little buggers that display REAL content properly.

    Which by the way, my example works fine in both IE for Windows Mobile, and Opera under Symbian.

    Quote Originally Posted by zcorpan
    and there are people who are blind who use assistive technologies like screen readers that don't benefit jack of your precious CSS. However, these users are able to interpret that:
    HTML Code:
    <ul>
     <li>foo
     <li>bar
     <li>baz
    </ul>
    ...is a list of three items. They cannot do the same with your proposal.
    As someone who is losing their site, I probably shouldn't say this - but **** the blind. If their screen reader can't handle it, make a better screen reader for that 0.0001% of the internet viewing population instead of making everybody else waste bandwidth.

    Quote Originally Posted by zcorpan
    Also remember that there is Google that also benefits from semantic markup.
    How so? What particular aspect of the google engine does THAT help? Keyword detection MAYBE, but certainly an anchor tag is enough to mark something as important on a page (more so than a LI I'd think)

    Quote Originally Posted by zcorpan
    And your points about bandwidth is moot. The difference is negotiable and mostly irrelevant as soon as you also have images on your pages.
    Negotiable? Sorry, my ISP doesn't like to haggle over BANDWIDTH, and I doubt many hosts will either... and 300megs a month is 300 megs a month no matter where it comes from, be it images, HTML optimization, Javascript encrypting, whatever.

    Sure, you might only save a total of 2-3k per html file - but that two or three K times a ten thousand hits is suddenly 30 megs... you have ten separate pages on average being viewed, you're up to 300 megs... Just keep adding... The more popular and more visited the site is, the less the difference can be considered negligable.

  15. #15
    Pedantic Semantic blain's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow
    Negotiable? Sorry, my ISP doesn't like to haggle over BANDWIDTH, and I doubt many hosts will either... and 300megs a month is 300 megs a month no matter where it comes from, be it images, HTML optimization, Javascript encrypting, whatever.

    Sure, you might only save a total of 2-3k per html file - but that two or three K times a ten thousand hits is suddenly 30 megs... you have ten separate pages on average being viewed, you're up to 300 megs... Just keep adding... The more popular and more visited the site is, the less the difference can be considered negligable.
    and this from the man who uses tabular layout for his site.....

    Deathshadow are you really just being bloody minded for the sake of being bloody minded?
    Technology is dominated by two types of people:
    those who understand what they do not manage,
    and those who manage what they do not understand.

  16. #16
    Non-Member deathshadow's Avatar
    Join Date
    Jul 2006
    Location
    Dublin, NH
    Posts
    901
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by blain
    and this from the man who uses tabular layout for his site.....

    Deathshadow are you really just being bloody minded for the sake of being bloody minded?
    Hey, if I could get DIV's to do how my site is laid out - WITH dynamically sized content, WITHOUT ripping my hair out - I'd be all over it.

    UNFORTUNATELY DIV falls WAY flat on dynamic sizing in the vertical.

    All joking aside, if one of these new 'mini' devices or a alternate reader cannot handle a table - something even a 6mhz AT running Mosaic under Win 3.0 could do... then the programmers on these devices are just gettting lazy.

  17. #17
    Pedantic Semantic blain's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They probably can handle a table, but
    a. Just because they can, does not make it right.
    b. All those unnecassary table tags, must be costing a fortune in bandwidth.
    Technology is dominated by two types of people:
    those who understand what they do not manage,
    and those who manage what they do not understand.

  18. #18
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow! quite a little conversation we have here!

    Thanks for the (on-topic) posts. I really dont know where ive cross posted this question. I dont remember doing this and ive looked at my recent posts and theres not one similar to this there. Wierd!

    I think i agree that a list is the most semantic way of doing this. As is said this was code parsed by my CMS, textpattern and i'd altered it slightly in the form. I was just wondering if it was ok to do. It was a stupid question as i kinda knew the answer. The w3c would validate this code but it isnt semantically correct.

    Ive adjusted my list form and code in textpattern. Its very similar to what Egor has posted.

    Thanks again
    Last edited by elduderino; Jul 12, 2006 at 03:19.

  19. #19
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The two threads were merged by one of the forum moderators. But that's ok .

    I'm sorry if it sounded like I snapped on you the other day. I've had to put up with a LOT of things that no sane person should ever have to deal with.


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
  •