• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

nSiteful Web Builders

Building a Better Web - One Site at a Time.

  • Home
  • About
    • Testimonials
    • Resources
    • Partner With Me
    • Frequently Asked Questions
  • Web Sites
  • Online Marketing
  • WordPress Support
    • Customized WordPress Training
    • 60-for-60 Sessions
  • Web Applications
  • Blog
    • At-A-Glance
    • Blog Articles Grouped by Category
    • Case Studies
    • General
    • Portfolio
    • Reviews
    • Snippets
    • Techniques
    • Projects
  • Contact
    • Purchase Retainer Consulting Hours
    • About Retainer Consulting Hours
    • Book a Meeting with Jeff
    • Tell Me About Your Web Project
    • nSiteful Newsletter Archives
    • nSiteful Rewards

By Jeff - 11/7/2023
Cats: Techniques · Tags: CSS

techniques

Make a Poster Graphic with HTML and CSS Using Grid Template Areas — and NO Graphics Program

The Requirement

A client asked me to create an improved version of a poster graphic to be embedded in a marketing email.

The main problems with the original graphic were color contrast and readability (too much prose text where bullet lists would be better).

The Original Graphic

The client sent the original graphic to me as a pdf (see below), and I opened it in Adobe Illustrator, intending to make the necessary modifications there.

If you’ve ever opened a PDF in a vector graphics program expecting to find all the elements neatly and properly arranged in appropriate layers, you know that’s usually an exercise in futility.

I really did not want to recreate the graphic from scratch. Although I have some Adobe Illustrator skills, I much prefer creating things in HTML and CSS. Then I stepped back and looked at the original graphic again. Holy cow! If ever there was a use case for CSS grid and grid template areas, this was it!

(Go here for the basics of CSS Grid layout concepts. For a good introduction to CSS Grid Template Areas, watch this Wes Bos YouTube Video and check out this page on the MDN Website.)

The Desired End Result

So I fired up VS Code, wrote the requisite HTML and CSS, tweaked things until they were right, and took a screenshot of the resulting HTML page to turn it into this PNG graphic:

new flyer graphic, advertising school programKeyed Diagrams

As you look over my HTML and CSS code, refer to these illustrations. The red borders delineate the grid areas, and the labels are the names for those grid areas — this should make more sense when you review the HTML and CSS.

new graphic I created, advertising elements of their educational programHere is the same illustration, with the background content semi-transparent to make it easier to see the grid areas.

new graphic I created, advertising elements of their educational program, with transparencyThe HTML Code

Here is the complete HTML code for the flyer.

Note that there are seven (7) “sections” (highlighted; they are actually divs with a class of “section”) inside the ‘flyer’ container div. Each “section” div has a second class that corresponds to its respective grid area. Note: Making the class name identical to the grid area name (which you’ll see momentarily) is not required, but it makes sense.

<div class="flyer">
	<div class="section crest"></div>
	<div class="section intro">
		<div class="wrap">
			<h2 class="leap-heading">LEAP Into Summer</h2>
			<h3 class="subhead">with Eaton Academy's LEAP Program</h3>
			<p class="target">For <em>high school students</em> &amp;<br /><em>young adults</em> with special needs</p>
		</div>

		<div class="list-wrap">
			<div class="column column-1">
				<p class="col-heading">Activities:</p>
				<ul>
					<li>On-Campus Cooking Class</li>
					<li>Onsite Job Skills</li>
					<li>Money Management</li>
					<li>Social Skills &amp; Outings</li>
					<li>Carpentry</li>
				</ul>
			</div>
			<div class="column column-2">
				<p class="col-heading">Our Partners Include:</p>
				<ul>
					<li>Crust Pizza</li>
					<li>Burlington</li>
					<li>Longhorn Steakhouse</li>
				</ul>
			</div>
		</div>
	</div>
	<div class="section chef"></div>
	<div class="section carpentry"></div>
	<div class="section calendar">
		<h2>Calendar</h2>
		<div class="tuition-wrap">
			<div class="sessions">2 3-Week Sessions:</div>
			<div class="item">June 5-30</div>
			<div class="item">July 10-28</div>
			<div class="item">Mon-Fri, 9a-3p</div>
		</div>
	</div>
	<div class="section tuition">
		<h2>Tuition</h2>
		<div>$2,200 per 3-week session</div>
		<div class="btw">Includes outings and lunch made by LEAP Participants</div>
		<div>
			Email Scott Baldrich for more information: sbaldrich@eatonacademy.org<br />
			or visit<br />https://eatonacademy.org/summer-leap/
		</div>
	</div>
	<div class="section table"></div>
</div>

The CSS Markup

Now let’s look at the CSS.

The .flyer Div

Here’s the rule for the .flyer container div:

.flyer {
	display: grid;
	grid-gap: 0;
	grid-template-columns: repeat(3, 1fr);
	grid-template-areas:
		"crest 		intro 		intro"
		"chef 		intro 		intro"
		"chef 		carpentry 	calendar"
		"tuition 	tuition 	table";
	max-width: 700px;
	padding: 1px;
	background-color: var(--color-blue);
	border: 4px soild var(--color-blue);
	font-family: var(--ff-3);
	font-weight: 300;
	margin-inline: auto;
	margin-top: 2em;
}

The highlighted rows are most important here.

Line 2: I set the display to grid.

Line 4: I specify that there be 3 columns, each of which takes up one fractional unit of the whole container (i.e., 3 equal-width columns). Note that I have not specified the number of rows; the content will take care of that.

Lines 5-9: This is where I identify the grid template areas. Admittedly, the syntax for this grid-template-areas property is quite odd — uniike pretty much any other CSS property I’ve ever encountered. In a way, it’s a throwback to the days of creating graphics with ASCII characters. But if you look at the CSS markup and the illustration together, reading each left-to-right and top-to-bottom, you should be able to see exactly how things work.

	grid-template-areas:
		"crest 		intro 		intro"
		"chef 		intro 		intro"
		"chef 		carpentry 	calendar"
		"tuition 	tuition 	table";

illustrating the CSS grid template areas, with transparency

Mapping Sections to Grid Areas

Finally, here are the CSS rules that map the sections to the grid areas. Note that the crest, chef, carpentry, and table divs are all empty of content but have background images specified in the CSS.

.crest {
	grid-area: crest;
	background-image: url(images/crest.jpg);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	background-color: #fff;
}
.intro {
	grid-area: intro;
	background-color: var(--color-blue);
	color: #fff;
}
.chef {
	grid-area: chef;
	background-image: url(images/cooking-03.jpg);
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
}
.carpentry {
	grid-area: carpentry;
	background-image: url(images/carpentry.jpg);
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
}
.calendar {
	grid-area: calendar;
	text-align: center;
}
.tuition {
	grid-area: tuition;
	text-align: center;
}
.table {
	grid-area: table;
	background-image: url(images/cooking-04.jpg);
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
}

Summary

I’m not advocating for deleting your graphics program and turning to HTML and CSS for all graphics work. I fully understand that this particular graphic clearly lent itself to being generated with HTML and CSS (specifically CSS Grid and Grid Template Areas) and that many graphic design projects won’t. But I’ll tell you: This was fun, and I learned a bunch. Until creating this flyer graphic, I think I’d used CSS grid template areas only one time in “production”. You can bet I’l be looking for other opportunities/excuses to do so in the future.

Let me know in the comments what you think of this application of CSS Grid. Would you have done what I did? Do you have suggestions for doing this in a different or better way? I’d like to hear from you.

Like what you see? Share with others and join my mailing list. No long-term commitment, unsubscribe any time.

Related Posts

  1. CSS Multiple Backgrounds
  2. CSS Grid: Shortest CSS Grid Tutorial EVER!
  3. CSS Descendant Selectors
  4. Avoid Direct Styling; Use CSS Instead
  5. Dynamic Linear Gradients for Background Images in Genesis

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

mailchimp signup

Subscribe to get notified when new articles are published. Unsubscribe any time. No spam. I promise. Check out my newsletter archives.

social

Twitter Facebook LinkedIn

Recent Articles

  • Post-Specific CSS for WordPress October 5, 2026
  • You built an online course, but they haven’t come. September 16, 2026
  • Custom MemberPress Pricing Pages December 19, 2025
  • CSS Data Attribute Override December 11, 2025
  • MemberPress Rules Using Custom Taxonomies and Custom Roles December 10, 2025

Filter By Category/Tag

Categories

  • Case Studies (8)
  • For Staff (1)
  • General (73)
  • Portfolio (7)
  • Reviews (14)
  • Snippets (24)
  • Techniques (52)

Popular Tags

Advanced Custom Fields Blogging Child Themes Content Marketing CSS Customer Service Custom Fields Custom Post Types Diagnostics Domain Names Facebook FooGallery Genesis Hosting HTML Images iPhone Libra Live Chat Marketing Media MemberPress MemberPress Courses Membership Sites Mobile-Friendly MySQL Photo Gallery php Pinterest Plugins Post Formats Pricing Project Management SEBA SEO Seth Godin Shortcodes Social Networking Surveys Taxonomies Twitter Video Web design Web forms WordPress

Footer

Background

Web Sites | WordPress Support | Web Applications.

Formally trained in liberal arts and education (I have a B.A. in Government from Harvard and studied Secondary Education at Rutgers Graduate School), I have honed my skills in the communication arts and sciences as a teacher, trainer, instructional designer, writer, photographer, calligrapher, helpdesk manager, database programmer, and multimedia developer.

(I've also been a group counselor, waiter, bartender, bicycle messenger boy, computer salesman, carpenter's helper, financial analyst, and school board president.)

Tech

Systems since 1983.
Web sites since 1994.
PHP since 2001.
WordPress since 2007.

Contact

Book Meeting
770-772-5134
Email Jeff
Send Money
All Ways

Copyright 2026, nSiteful Web Builders, Inc.

Cookies Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}
https://iframe.mediadelivery.net/embed/392008/42d18bc1-2adc-4741-b733-053d08d09c32
https://vz-000c5976-3ab.b-cdn.net/42d18bc1-2adc-4741-b733-053d08d09c32/play_720p.mp4

Receive occasional emails from Jeff