CSS, max-height

I wish I had something of substance to add today, but I’ve been overwhelmed by personal stuff.  My oldest daughter has been sick with strep for the last week, so I’ve been having to rearrange a lot of my schedule so I can hang out with her when needed.  Consequently, I’m just wiped in the evenings. 

Anyway, you may have noticed that I’ve been playing around with my website, especially with my new blogroll page.  I”ve been adding some blogs to it using RSS feeds, and one thing has become clear: different RSS feeds behave differently when asked to return an item.  For example, some blog postings auto truncate themselves after a few phrases; for example, Brent Ozar:

Brent Ozar

The PASS Summit Location Survey Results - Wed, 10 Mar 2010
The Professional Association for SQL Server recently sent its members a survey asking where they should hold their next summit – in Seattle again, or rotate it around the country.  Initially we heard that the results wouldn’t be posted for a variety of reasons, but the PASS Board of Directors heard the community loud and [...]

The PASS Summit Location Survey Results is a post from: Brent Ozar - Too Much Information.
If you'd like to quote this content on other sites, please read how to use my blog's content.

Contrast this with Andy Warren’s feed:

It Depends (Andy Warren)

Help Us Update the PASS Blog Directory - Wed, 10 Mar 2010

We put this together last year and we’re up to 270 blogs listed, but I’m sure we’re still missing some, and some have changed names (including my own). If you’re a blogger, take a minute to check that we have the right information.

And if you’re a blog reader (surely you are!), grab our OPML file – you might find some you don’t read, and maybe you’ll notice some that you read that we don’t have (should be generally about SQL or the SQL community).

Now, while I like reading Andy’s stuff, I don’t necessarily want a bunch of lengthy articles on my blogroll page; I tried to figure out a way to limit the amount of text returned, when I tripped across this nifty CSS property: max-height. From DevGuru: The max-height property is used to set the maximum height of an element. Other properties can be used to set the height, width, maximum width, minimum height and the minimum width. This property is not inherited. (note that Devguru also specifies that this property is not currently supported by any browser; it works in IE7. Go figure).

Anyway, I simply add the max-height to my div container wrapped around the feedsnap plugin, and suddenly the RSS feed truncates after a certain pixel height.

<div style=”overflow:hidden;max-height:100px”></div>

It Depends (Andy Warren)

Help Us Update the PASS Blog Directory - Wed, 10 Mar 2010

We put this together last year and we’re up to 270 blogs listed, but I’m sure we’re still missing some, and some have changed names (including my own). If you’re a blogger, take a minute to check that we have the right information.

And if you’re a blog reader (surely you are!), grab our OPML file – you might find some you don’t read, and maybe you’ll notice some that you read that we don’t have (should be generally about SQL or the SQL community).

 

Anyway, I hope this puts some ideas in your head.

December 16, 2008   Posted in: CSS

3 Responses

  1. Margaret - December 30, 2008

    I think your solution is elegant and useful — as for the different feeds, it’s simply that the one person has his set to “full feeds” and the other has it set to “excerpt”.

    Lot’s of back-and-forth on the value of each setting and it ultimately ends up being a personal choice. Supposedly for SEO, you want full feeds.

    ê¿ê

  2. stuart - December 30, 2008

    Well, that’s useful information to stockpile somewhere ; do you have any idea of where to set that in feedburner, for example?

  3. Margaret - December 30, 2008

    Go to your wordpress dashboard, settings, reading and you’ll see “for each article in a feed show” and radio buttons next to “full” and “summary” — there’s also a setting for how many of the most recent posts to show in the feed.

    ê¿ê

Leave a Reply