Skip to content

How can I change the subtitle to only show a selected amount of words? #1516

Closed Answered by kungfux
SimoneFelici asked this question in Q&A
Discussion options

You must be logged in to vote

It may not be so easy to display only a certain number of words while making sure they all fit on a single line, because this theme supports responsive design.

But something can be done. If I understand you correctly, you want to display only a single line. This can be done by overriding the styles in `assets\css\jekyll-theme-chirpy.scss' like this

  • Option 1
%text-clip {
  -webkit-line-clamp: 1;
}

  • Option 2
%text-clip {
  -webkit-line-clamp: 1;
  white-space: nowrap;
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SimoneFelici
Comment options

Answer selected by SimoneFelici
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants