MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

WordPress Typography Patterns: Styled Lists, Notice Boxes, and Code Blocks with Reusable CSS

If you manage documentation or blog content in WordPress, consistent typography for lists, notice boxes, and code snippets makes pages easier to scan, maintain, and standardize across teams. This revision turns the original class-based examples into clear, reusable patterns with modern CSS and editor-friendly HTML.

Originally published on 2010-07-14; fully revised and updated.

Original reference: Website Typography.

website-typography

What the original post demonstrates

The original article is a short style demo showing custom list marker classes (.arrow1, .arrow2, .circle), notice box classes (.alert, .info, .download), and a CSS code snippet. The core idea is still useful: define a small set of reusable typography classes so authors can keep content visually consistent.

Implement custom list marker styles with maintainable CSS

Instead of deeply nested lists and theme-specific hacks, use semantic lists with explicit classes. This keeps markup cleaner and simplifies future design changes.

CSS for arrow and circle variants

.list-arrow-1,
.list-arrow-2,
.list-circle {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.list-arrow-1 li,
.list-arrow-2 li,
.list-circle li {
  position: relative;
  padding-left: 1.4rem;
  margin: 0.35rem 0;
}

.list-arrow-1 li::before {
  content: '➜';
  position: absolute;
  left: 0;
}

.list-arrow-2 li::before {
  content: '➤';
  position: absolute;
  left: 0;
}

.list-circle li::before {
  content: '●';
  position: absolute;
  left: 0;
  font-size: 0.75rem;
  top: 0.32rem;
}Code language: CSS (css)

Example HTML markup

<ul class='list-arrow-1'>
  <li>First item with arrow marker</li>
  <li>Second item with arrow marker</li>
</ul>

<ul class='list-arrow-2'>
  <li>Alternative arrow style</li>
</ul>

<ul class='list-circle'>
  <li>Circular marker style</li>
</ul>Code language: HTML, XML (xml)

Create reusable notice boxes for alert, info, and download messages

The original post uses inline <span> classes. For better spacing and readability, block-level notice components are usually easier to manage.

.notice {
  border-left: 4px solid #6b7280;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 4px;
  background: #f9fafb;
}

.notice.alert {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.notice.info {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.notice.download {
  border-left-color: #059669;
  background: #ecfdf5;
}Code language: CSS (css)
<div class='notice alert'>
  <strong>Alert:</strong> This action affects production settings.
</div>

<div class='notice info'>
  <strong>Info:</strong> This section explains optional configuration.
</div>

<div class='notice download'>
  <strong>Download:</strong> Get the latest build artifact from the release page.
</div>Code language: HTML, XML (xml)

Workflow for rolling out typography classes in WordPress

flowchart TD
    A[Define content components] --> B[Create shared CSS classes]
    B --> C[Apply classes in WordPress editor]
    C --> D[Preview on desktop and mobile]
    D --> E{Readable and accessible}
    E -- no --> B
    E -- yes --> F[Publish and reuse pattern]

Legacy class approach vs modern reusable pattern

ApproachMarkup styleProsTrade-offs
Legacy theme classes (for example .arrow1, .alert)Theme-specific class names in contentQuick to apply in one themeHarder to migrate or standardize
Reusable semantic classes (for example .list-arrow-1, .notice.info)Simple lists and block containersCleaner structure and easier maintenanceRequires shared CSS conventions
Default browser markers and minimal stylingNo custom classesFast and robust baselineLimited visual differentiation

Legacy CSS snippet from the original post

The original article included the following CSS example:

#subheader h1 {
  float: left;
  margin-top: 28px;
  background: url(../images/logo.gif) no-repeat;
  width: 335px;
  height: 58px;
  text-indent: -9999px;
}Code language: CSS (css)

Best practices

  • Keep content markup semantic, and use classes only for intentional variants.
  • Centralize typography classes in one stylesheet so editors do not rely on inline formatting.
  • Prefer reusable notice components over one-off colored paragraphs.
  • Test list markers and notice contrast for readability on mobile and dark/light themes.
  • Document approved classes in your editorial or engineering style guide.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

What to choose: front-end or backend development?

Regarding web development, two main areas play a crucial role in creating a functional and visually appealing website: frontend and backend development. Frontend development focuses on the…

Read More

Building the Virtual Classroom: An Introduction to HTML5 Layouts for Online School Portals

To build a virtual classroom, you need to grasp HTML5 layouts. Use semantic elements like <header>, <nav>, <section>, and <footer> for better accessibility and SEO. Make certain…

Read More

What is Apache Cordova and use cases of Apache Cordova?

What is Apache Cordova? Apache Cordova, formerly known as PhoneGap, is an open-source mobile development framework that allows developers to build mobile applications using web technologies such…

Read More

How to Implement Accessibility in Web Development: Practical Steps and Tools

Making your website accessible to everyone, including people with disabilities, is crucial. Accessibility in web development means ensuring that colors, text, and navigation support all users. Web…

Read More

How to become a Full stack Web developer & App developer?

Platform Dev Tools Web Server Framework Concept Programming & Scripting Languages Becoming a full-stack web developer and app developer requires a comprehensive understanding of both front-end and…

Read More

What is CSS and use cases of CSS?

What is CSS? CSS stands for Cascading Style Sheets. It is a style sheet language used to define the presentation and layout of HTML documents. CSS allows…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Puja kushwaha
Puja kushwaha
25 days ago

Good website typography makes content easier to read and helps visitors find key information quickly. Choosing clear fonts, suitable text sizes, and enough line spacing can improve the reading experience. It is also important to check how text looks on mobile screens and across different browsers. Using too many font styles can distract readers and weaken the design. A simple, consistent type system helps a website feel clear, accessible, and professional.

1
0
Would love your thoughts, please comment.x
()
x