Skip to main content
Best Answer

Center title on widget


Is there any way to center the text on page widgets?

12 replies

Userlevel 7
Badge +8

HI @ebarrett what widget are you asking about?

Userlevel 3
Badge

@lrnlab Really any widget, but especially Custom Content Box and Task List.

Userlevel 7
Badge +8

For the custom content box, you can adjust that with the settings at the bottom of the panel however not all widgets have this option. The Task List looks like it’s all pre-formatted...I suppose you could use CSS to adjust if you wanted.

 

Userlevel 3
Badge

It seems like those settings don’t control the title that would appear outside of the widget; is that right?

 

I’d have to look into the CSS option some more as I am still learning about how to write my own.

 

Thanks!

Userlevel 7
Badge +6

@ebarrett 

Is this what you’re looking to do?

Before:

 

After:

 

Userlevel 7
Badge +8

Ahhh, our CSS guru @gstager to the rescue 🤓

Userlevel 3
Badge

@gstager  Exactly that!

Userlevel 7
Badge +6

@ebarrett

Here is what you can do for your custom content boxes.

/** Center Widget Title **/
custom-content-box-widget widget-title div.common-widget-title {
text-align: center;
}

#doc-widget-95 widget-title div.common-widget-title {
text-align: left;
}

There are two snippets above.

The top one will affect many widgets and the second one will target a specific widget but you would need to discover the ID of your particular widget.

In my example it is #95 and I push it back to the left

 

 

Hopefully that makes some sense.

Userlevel 3
Badge

Perfect. Thanks so much, Greg!

--Emily

Userlevel 7
Badge +6

The Task List Widget required a different approach.

task-list-widget widget-title div.common-widget-title {
margin-left: auto;
margin-right: auto;
}

You could target an individual one with the same method as above for the custom content box.

Userlevel 7
Badge +6

Perfect. Thanks so much, Greg!

--Emily

Most welcome! 

I see these sorts of requests like puzzles.

Whether it is Sudoku, standard Logic Puzzle, crossword variety, or some other novelty brain teaser, - I always enjoy a good puzzle.

Userlevel 7
Badge +6

Ahhh, our CSS guru @gstager to the rescue 🤓

@lrnlab - thanks for the promotion…

There are many others in this community more skilled and deserving.
I just like trying to figure it out. 🙂

Reply