Jump to content

Customize ::after element to display the text

Recommended Posts

Posted (edited)

I'm using the code below to change an image from b/w to color and reveal text. It's working but I'm having trouble adding a second line under the name as shown on 3rd image.

 

/* Change Image on Kent - Our Story  */
#block-d4c837fbd58a4803d810 {
  opacity: 0;
  -webkit-transition: opacity 0.5s ease-in-out;
  -moz-transition: opacity 0.5s ease-in-out;
  transition: opacity 0.5s ease-in-out;
}
#block-d4c837fbd58a4803d810:hover {
  opacity: 1;

.sqs-block-content:after{
  content:'Kent Breard';
  position: absolute;
  top: 170px;
  padding: 50px;
  font-weight:bold;
  color:white;
  font-family:Oswald!important;

  }
}

 

 

Screen Shot 2024-07-02 at 3.58.48 PM.png

Screen Shot 2024-07-02 at 3.58.52 PM.png

Screen Shot 2024-07-02 at 12.27.10 PM.png

Edited by SW_2020
corrections
Link to comment
  • Replies 1
  • Views 180
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

You can use

:before to add text, but with lower top position to make it appear under your big text

Change this

.sqs-block-content:after{
  content:'Kent Breard';
  position: absolute;
  top: 170px;
  padding: 50px;
  font-weight:bold;
  color:white;
  font-family:Oswald!important;

  }

to this

.sqs-block-content:after{
  content:'Kent Breard';
  position: absolute;
  top: 170px;
  padding: 50px;
  font-weight:bold;
  color:white;
  font-family:Oswald!important;

  }
.sqs-block-content:before{
  content:'VP Of Client Relations';
  position: absolute;
  top: 200px;
  padding: 50px;
  font-weight:bold;
  color:white;
  font-family:Oswald!important;
font-size: 14px;

  }

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.