Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7489415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:14:39+00:00 2026-05-29T15:14:39+00:00

I have a website that I am developing using CSS3 and I have h1

  • 0

I have a website that I am developing using CSS3 and I have h1 tag for the title:

<h1>main title</h1>

Now I want the title to be in a different color:

<h1>main <span>title</span></h1>

So I do:

h1 {
 color: #ddd;
}
h1 span {
 color: #333;
}

Is there a way not to use the span tag and only specify in CSS the last word to be a different color?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:14:40+00:00Added an answer on May 29, 2026 at 3:14 pm

    This is not possible with pure CSS. However you can use lettering.js to get a ::last-word selector. CSS-Tricks has an excelent article on this: CSS-Tricks: A call for nth-everything. You can then do the following:

    h1 {
      color: #f00;
    }
    
    /* EDIT: Needs lettering.js. Please read the complete post,
     * before downvoting. Instead vote up. Thank you :)
     */
    h1::last-word {
      color: #00f;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a website using Codeigniter that will have different subdomains for different
I'm developing a website using PHP+Ajax. I have to fire a ajax request that
I'm developing a website in PHP and I have large JS files that I
I have a Website that is really slow and feels really bad when using
I have a website that is deployed between 3 different environments - Dev, Stage,
I have been developing a book viewing website that takes rather large images (upwards
I have some experience of developing in Flex/Actionscript using Cairngorm framework. At that time
I'm developing a website using EPiServer. I have a form which submits to itself.
I'm developing a website (using asp.net-mvc) with a SqlServer 2005 database. I have numerous
I am developing a website that uses Facebook. Now for managing users I thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.