Support » Themes and Templates » CSS markup a little “busy” in Word Press

  • 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.

Viewing 12 replies - 1 through 12 (of 12 total)
  • 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.

    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.

    If you look back through the forums, you’ll see the opposite complaint – not enough classes and IDs. 🙂

    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.

    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.

    Heck! The Li s are absolutely sacrosanct here 🙂

    Opera works dandy, very nifty! 😉 The shrinking/expanding/minimizing the sidebars is very cool, Javascript I’m guessing? I like it a lot!

    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.

    @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.

    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.

    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.

    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.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘CSS markup a little “busy” in Word Press’ is closed to new replies.