WordPress.org

Support

UL and LI

  • After hacking up my admin backend files (post.php, edit.php, etc), I began to notice a really wierd trend.
    Why are all the ‘buttons’ in the admin area list items, then only to have the list attributes stripped via CSS? Why not just make them actual buttons?
    Which is a lot like the “get_category” function. It’s the same thing. A list item, with the list item attributes removed. Why not just make it straight text that the user can seperate with a line-break?
    It’s really boggling.

Viewing 15 replies - 1 through 15 (of 60 total)
  • It’s not difficult using style sheets. I’m just curious.
    Even without being actual buttons, they could have been just regular links with according CSS to make them look like buttons.
    I was just curious as to why many of them were list items with the list item attributes stripped via CSS.

    Because they ARE a list and should be marked up as such. It’s the semantically correct way to do it and this is one of the things WordPress strives for. The list item is not stripped, just styled with CSS.

    Ahh ok.
    Thanks MDV.

    I took them all out as I don’t like how lists look. If you put in your .CSS the no bullet, you get a weird break, so I just take them out each time.

    Yeah… this has been something talked about on these forums several times… the devs are really big on creating semantically correct code, which is rare (and in my opinion refreshing) to see these days, and tends to lead to a lot of confusion from people that just want to display it the easy way, without having to learn CSS too 🙂

    another example of the developers imposing their own ideas about coding on the poor old users. it’s my site, i should be able to decide whether i want to use lists or not.

    It’s not the developer’s “own ideas”, it’s called web standards.

    Well said, MDV…Web Standards aren’t some arbitrary set of ideas, being imposed on “poor old users.” We have standards for a reason. Just as you shouldn’t be able to decide whether to use punctuation (or capitalization) in your writing, you shouldn’t be able to decide not to use semantically correct coding. A list is a list is a list, whether it’s your grocery shopping list, list of favorite movies, or a list of navigational items. How you choose to display those lists is up to you, and there’s a nearly endless variety of options available using CSS. If you would like to use incorrect, invalid, inaccessible, and difficult to maintain code…pick up a copy of FrontPage and have at it. Just don’t be surprised when *your* site ends up in the latest web design book as an example of what not to do…

    CSS isn’t hard to learn.
    But, what I don’t get is that, you define it as a list, only to code the css so it looks like a regular link and not like an unordered list.
    That’s called “redundant code”.
    If you want it to look like a basic in-line link – might as well have just left it as a basic in-line link.
    Most people would rather have functions that work correctly (as an example, the file upload script, private posts, etc) than have the code abide to standards that probably 90% of the net population doesn’t even know exist.
    The age old too and fro of ‘function over form’.

    OJ,
    The only way people are going to learn about the standards is by having to use and abide by them. I would disagree that CSS is “redundant code.” It’s not the foundation of the structure–it’s the paint on the walls. As a user, I have to be VERY careful not to screw with the PHP code and break it. The CSS, however, allows me to monkey with how the results of the code are displayed–let’s not forget that the default CSS that comes with the install is just one person’s idea of how to present the page. The CSS doesn’t strip anything, rather it directs the browser on how to display, or NOT display, certain things.
    Craig.

    It’s not redundant at all…it’s separation of content and style. A non-CSS aware browser doesn’t know or care about how we want it to look in a modern visual browser. To them, it’s a list. These include most version 4 and earlier browsers, text browsers such as Lynx (still used by a large population…particularly for reading text-based material such as blogs), screen readers, and search engine spiders.
    The nice thing about doing it correctly (as an unordered list) is that I can change the look, orientation, whatever for my entire site just by changing the style sheet. The style sheet is cached, so it’s only loaded once, then read from cache for subsequent pages. That’s called efficiency. If I want to change my links to look like buttons…no problem. If I want to change them to act as a dropdown list…no problem. If I want to change their orientation from an inline horizontal list to a vertical orientation…no problem…All done with CSS, while keeping the underlying code sematically correct and lightweight.
    As for the “most people would rather…” argument, I have no interest in debating a head-in-the-sand argument. Whether people know standards exist or not isn’t even close to being a lucid rationalization for coding incorrectly. I’m having a hard time understanding why doing something correctly, which also results in MUCH EASIER maintenance and site-makeovers in the future, is such a problem?
    (beating my head against the wall)
    -Tony

    “If you want it to look like a basic in-line link – might as well have just left it as a basic in-line link.”
    I have to disagree. Use markup to define things as what they are. Something like this,
    Pizza, Hot Dogs, Chicken Noodle Soup
    is just as much a list as this,
    *Pizza
    *Hot Dogs
    *Chicken Noodle Soup
    Regardless of the default presentation by the browser, things should be coded as what they are: lists should be coded as lists, whether they are to be displayed horizontally or vertically; headings should be coded as headings, whether or not you want the default size/padding/etc. given by a browser.

    God forbid it be easy for the end user to understand and manipulate.
    …and people wonder why MT is so popular.

    How “easy” is it to manipulate a list of items delineated with
    tags, pipe symbols, or whatever? What if you want to change orientations? Make them appear as buttons? Give them graphical backgrounds? And the list goes on…
    What’s easy is having structured content. If I want to change the list items inside a particular div, I can do whatever my heart desires in the CSS file, and it will change site-wide. Can’t do that with incorrect markup. Sorry, the easy to understand and manipulate argument isn’t holding water.
    If I wanted to use MT, I would. I don’t think it’s a bad program, and it can be made to produce standard’s compliant code as well (I’ve seen plenty of MT sites that are valid, and they all mark up their navigation and sidebar links as lists). For me, WP is easier to modify and is *more* flexible. That’s just my opinion and my choice. WP vs. MT vs. Whatever has nothing to do with using standard’s compliant code.

    Well, everybody here has pretty much covered what I wanted to respond to. Markup is the building blocks, stylesheets are to make it look pretty. People seem to think that the idea here is to make WordPress the most popular blogging software out there, able to be used by the world over. Really, that’s what Blogger and LiveJournal are for. If you look at the features page for WP, the first thing on there is “Full standards compliance”… clearly, that’s something that the developers deem to be very important for the direction that WordPress moves in. If you have a problem with that, feel free to take it up with them (I’m sure Matt would love to argue with you about it), but you can’t really say that it caught you by surprise – it’s the very first feature!

Viewing 15 replies - 1 through 15 (of 60 total)
  • The topic ‘UL and LI’ is closed to new replies.
Skip to toolbar