I recently completed a redesign of the K-12 Summer Programs website, which provides information on UA summer camps for young people, from toddlers to high school students. The page layout comes from a standard template I use for Undergraduate Admissions microsites, with a crimson nameplate bar at the top of the page and a gray footer at the bottom. This particular microsite is customized with a background taken from the print brochure for K-12 Summer Programs.
I decided to use rounded rectangles as containers for the information about each summer camp. There are a number of ways to make rounded rectangles, but I thought I’d quickly explain the technique I used in case anyone else finds it useful.
I should mention that I considered using the CSS3 border-radius property, but it is not supported by Internet Explorer, and I decided the rounded rectangles were too important to the site’s design to have 75% of users not see them.
Basically the method I used was to separate each rounded rectangle into 3 divs. One div (campboxtop) forms the top of the rounded rectangle, another (campboxbottom) forms the bottom of the rectangle, while the div in the middle (campbox) holds the content for each camp.
The way to do this is pretty simple. In Photoshop or your image editor of choice, just create a rounded rectangle of the size you need. Then, crop out everything except the top part (something like this). Make sure that your crop leaves the curve of the corners so that it can be joined smoothly with a rectangle below it to form the rounded rectangle on our page.
Export your top rectangle to the appropriate web format (.gif or .jpg), and then undo the crop so you are left with your original rounded rectangle. From there, do a crop of the bottom of the rectangle the same way you did the top and export it to web format.
Now you have the background images for the top and bottom of your rounded rectangle. At this point, you can write the CSS that puts those images to use, which in my case ended up looking like this:
.campboxtop {background-image:url(images/campboxtop.gif);
background-position:top center;
margin-top:20px;
display:block;
width:540px;
height:19px;
}
.campboxbottom {background-image:url(images/campboxbottom.gif);
background-position:bottom center;
display:block;
width:540px;
height:19px;
}
.campbox {background-color:#eae5d1;
padding:1px 20px 1px 15px;
}
Note the use of 1px padding on the top and bottom of the campbox div. I found that using no padding there resulted in a gap between the bottom part of the rounded rectangle and the campbox div.
Within the campbox div, I use an h2 and paragraph tags to mark up the content. Combining that with empty divs for the top and bottom of the rectangle, the HTML for one camp entry looks like this:
<div class=”campboxtop”></div>
<div class=”campbox”>
<h2>Capstone Summer Honors Program</h2>
<p class=”campdate”>June 1 – July 5</p>
<p>Would you like to earn college credit while getting a taste of college life—before you graduate from high school? Check out the Capstone Summer Honors Program. Through this program, you can enroll in 2 three-hour, college-level courses and in a one-hour honors course during the first term of the UA summer session. You’ll stay in a UA residence hall, dine in one of the many Bama Dining facilities, and enjoy membership privileges at the Student Recreation Center. For qualified high-school juniors. Priority deadline: March 30. The cost is $1500.00. </p>
</div>
<div class=”campboxbottom”></div>
I tested the K12-Summer Programs website in Firefox, Safari 4, Internet Explorer 6/7/8, and Opera, and it worked fine in all. Better cross-browser support of the CSS3 border-radius property will certainly make it easier to work with rounded rectangles, but the technique outlined above is working in the meantime.
View K-12 Summer Programs website