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:
How to Buy Your First Mac - Wed, 01 Sep 2010
So you’re tired of craptastic plastic, and you’re noticing more and more SQL Server people toting around shiny metal computers? Here’s what you need to know. Running Windows On Your Mac If you’re reading this, you probably make a living working with Windows software, and you’re worried about how it’ll work. Let’s get that out [...]
Contrast this with Andy Warren’s feed:
PASS 2010 Elections Are Open - Thu, 02 Sep 2010
Voting began yesterday with ballots mailed to qualified members. More information can be found here, including contact info for Hannes at PASS HQ if you think you should have received a ballot and did not. You can find more information about the candidates here, and I encourage you to read that and explore candidate blogs before voting. Voting is open for about another 2 weeks, so you have time to investigate and ask more questions.
Yesterday was an exciting time for PASS. As soon as ballots went out there was a surge of interest on Twitter, people voting (and often sharing their choices), others waiting – impatiently! – for their chance to vote as it took a while for all the email to get sent. Thanks for voting!


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>
PASS 2010 Elections Are Open - Thu, 02 Sep 2010
Voting began yesterday with ballots mailed to qualified members. More information can be found here, including contact info for Hannes at PASS HQ if you think you should have received a ballot and did not. You can find more information about the candidates here, and I encourage you to read that and explore candidate blogs before voting. Voting is open for about another 2 weeks, so you have time to investigate and ask more questions.
Yesterday was an exciting time for PASS. As soon as ballots went out there was a surge of interest on Twitter, people voting (and often sharing their choices), others waiting – impatiently! – for their chance to vote as it took a while for all the email to get sent. Thanks for voting!


Â
Anyway, I hope this puts some ideas in your head.
Tweet This Post
December 16, 2008
·
stuart ·
3 Comments
Posted in: CSS
3 Responses
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.
ê¿ê
Well, that’s useful information to stockpile somewhere ; do you have any idea of where to set that in feedburner, for example?
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