WordPress.org

Ready to get started?Download WordPress

Forums

CSS markup a little "busy" in Word Press (13 posts)

  1. mmarin
    Member
    Posted 10 years ago #

    I'm noticing an excess number of CSS classes and id's in Word Press. In general, if a division encloses an area, and there is only one type of, say h1 or h2 or h3 or p or whatever inside that area, it isn't necessary (and is bad style) to put an id on the division and also a class or id on the enclosed entity. All you need to markup is the div with an id (or class). Then the style for the enclosed stuff is done as, for example #mydiv h2 { [styles] }, and everything works because of the cascade.

  2. Tancred
    Member
    Posted 10 years ago #

    I agree it is a mess, but I fugure the author did it for a reason. There is also the pain of certain tags coming from the php as well (such as certain list tags)
    I spent some time trying to make sense of what was going on and just started again. grep makes it easy to find where the tags are coming from and remove them.

  3. TechGnome
    Moderator
    Posted 10 years ago #

    Actually, there is a valid reason for having a class AND an id. The ID is just that, the ID of that div. For example, the container for each of the posts. They all get the same class (so they can be all marked up the same way), BUT they give each one a different ID... id="post-1", id="post-2" etc.... it IDentifies each one independantly. That's what helps to make the #xxxx linking work.
    TG

  4. Alex King
    Member
    Posted 10 years ago #

    If you look back through the forums, you'll see the opposite complaint - not enough classes and IDs. :)

  5. davidchait
    Member
    Posted 10 years ago #

    Yes, I've been one of the people calling for more explicit 'excess tagging' of things. It's difficult to do neat 'tricks', such as graphical css auto-sizing bordering and backgrounds, without an extra 2 or 3 divs/spans around 'key areas'.
    That's not to say we should litter stuff around everywhere! I use it for things like the sideblocks, or I have like 4 or 5 divs potentially wrappering a post (each with its own potential css changes).
    But that's just me. At the least, with the basic markup being used now, TG is on mark in saying that there's LOTS of cases where a class does fine, but sometimes you need a unique ID for a unique section in order to do specializations.
    -d
    http://www.chait.net

  6. gregor
    Member
    Posted 10 years ago #

    What pisses me of are the automatic LI's generated by the Categories PHP. I'm having a bitch of a time trying to sort that out in my index.php template. Right now my index page has 24 errors.

  7. Anonymous
    Unregistered
    Posted 10 years ago #

    Heck! The Li s are absolutely sacrosanct here :-)

  8. Joshua Lyman
    Member
    Posted 10 years ago #

    Opera works dandy, very nifty! ;-) The shrinking/expanding/minimizing the sidebars is very cool, Javascript I'm guessing? I like it a lot!
    uplink

  9. cra
    Member
    Posted 10 years ago #

    I don't really care about the CSS since I can change it to whatever I want. I hacked out the li tags from wp-includes/template-functions-category.php however, they do make sense.
    But I would like to put a voice in for less javascript. So far as I've used it, the site works without javascript but, it is in WP. On a given month, about around 5% (give or take a few points) of my visitors don't have javascript. Only a handful of people are using PDAs and cell phones, but more people are turning javascript off in their web browsers.

  10. Anonymous
    Unregistered
    Posted 10 years ago #

    @mark. You may well have started out with a lot of very fancy goals in what is a very plain layout. Readable text might be a good start.

  11. Anonymous
    Unregistered
    Posted 10 years ago #

    The font spacing is too close and the line height is too low. At some text sizes the fonts are almost touching and the Cs look like Ds. As I say. Unreadable. At least not without a lot of strain.

  12. Anonymous
    Unregistered
    Posted 10 years ago #

    Well mark you said it. Look at your own hardware. There is absolutely no point
    in coming on this forum in a way which invites constructive criticism and then shooting the messenger. If you like it fine. Don't fix it. We do not care. Really.

  13. Anonymous
    Unregistered
    Posted 10 years ago #

    Well yes. But if you sit there in splendour on a nineteen inch monitor at 1280 by 1024 you should not need me to tell you what your site looks like at lower res or indeed font sizes. You obviously neither think or care beyond your own monitor.
    Typical.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.