Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS and Adjustable blocks

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #34297
    djpic
    Participant

    I need to set up a group of anchors as blocks. The problem is the anchor’s text / value is going to be variable. The question is if I have a row of anchor’s with different heights how can I make all of those the same height based on the anchor of the series that has the greatest height? The anchors will have the same width.

    Example:



    #86870
    djpic
    Participant

    Thanks. I will have to try that. I was wondering how to use the table display. That will help. I am actually working on a calendar using nothing but CSS (of course) which is why the question came up. I will be posting that later for review. It is actually looking pretty good so far I must say. Easier than I thought.

    #86872
    thomas
    Member

    Just curious, but why aren’t you using a table to create the calendar? I’m not trying to start a semantics debate; it’s just that a table as a starting point would seem to be much easier.

    #86873
    djpic
    Participant

    @thomas – Because with using css, I can layout the days any way I choose. If I want to lay them out as a “calendar” type, a list, or another type of layout I wish just by switching the CSS file. Plus there is going to be much more involved once I start entering the dynamic data (using it in a php class).

    I do have another question. I want to do something like this but it doesn’t seem to work:

    .style-class .sub-class1,.sub-class2,.sub-class3 a { text-decoration: none }

    Of course there is more to the style then just a text-decoration, but you get the idea. Basically taking multiple classes and applying the same ‘default’ style to all anchors in those classes (or ids). Like I said, I tried this but didn’t work at all.

    #86875
    thomas
    Member

    Did you mean:

    .style-class .sub-class1 a, .sub-class2 a, .sub-class3 a { text-decoration: none }

    In your post, “text-decoration” was misspelled and you didn’t have the anchors after each class.

    #86876
    thomas
    Member

    You beat me to it wolfcry911 :)

    #86877
    djpic
    Participant

    @wolfcry911 – After I posted it, I noticed I was missing the ‘.’ but fixed it. That was just a typo. So I would need to have define each one with the full style? I am defining others like:

    .style-class .sub-class1,sub-class2,sub-class3 { /*Styling Here */ }

    And it works. Just thought by doing something like:

    .style-class (.sub-class1,.sub-class2,.sub-class3) a { /*Styling Here*/ }

    Without having to rewrite the ‘.style-class’ and ‘a’ over and over again. But if I have to, then I have to.

    #86879
    djpic
    Participant

    @thomas – That saves me from having to write the .style-class over and over again, but what about the ‘a’ or is that just impossible?

    #86880
    thomas
    Member

    I’m pretty sure you’ll have to include the ‘a’ in each rule. I’m not aware of any shorthands similar to what you’re looking for.

    EDIT: also, whether you have to include the “.style-class” in each rule depends on specificity and if you use your .sub-class[n] outside of .style-class.

    #86881
    djpic
    Participant

    @thomas – I only want the .sub-class[n] available within the .style-class. If .sub-class[n] is located on another element outside the .style-class then, I don’t want that .style-class .sub-class[n] to apply. So I take it I need to include the .style-class as well?

    #86882
    thomas
    Member

    Here’s an old article on CSS specificity they may help:
    http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html

    #86883
    thomas
    Member

    Yes, in that case, you need to write it out fully as wolfcry911 mentioned earlier:

    .style-class .sub-class1 a,
    .style-class .sub-class2 a,
    .style-class .sub-class3 a {
    text-decoration: none;
    }
    #86884
    djpic
    Participant

    @thomas – Oh ok…No big deal. Just thought they would have thought of another way. Does that hold true for the ones I have already done:

    .style-class .sub-class1,.sub-class2,.sub-class3 { /*Styling Here */
    #86885
    djpic
    Participant

    Yes it does hold true for those. I just made all the corrections to use what is should be. Thanks.

    #86887
    djpic
    Participant

    FYI….I just posted the discussion on the calendar.

    Calendar Discussion

Viewing 15 posts - 1 through 15 (of 23 total)
  • The forum ‘CSS’ is closed to new topics and replies.