$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>plugins - How to align a text left side while keeping vertically centered?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

plugins - How to align a text left side while keeping vertically centered?

matteradmin8PV0评论
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 6 years ago.

Improve this question

If you see this page, text are aligned left side but I also want them to align centered vertically. Similar to Middle Align + Left Align in excel.

You can see this image to see what I am looking for

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 6 years ago.

Improve this question

If you see this page, text are aligned left side but I also want them to align centered vertically. Similar to Middle Align + Left Align in excel.

You can see this image to see what I am looking for

Share Improve this question edited Feb 19, 2019 at 11:16 Avinash Patel asked Feb 15, 2019 at 4:49 Avinash PatelAvinash Patel 398 bronze badges 2
  • You need to include more information, it's not easy for us to understand what it is you are asking. :) – Lewis Commented Feb 16, 2019 at 13:42
  • Okay, i have added more details to explain it more – Avinash Patel Commented Feb 19, 2019 at 11:16
Add a comment  | 

3 Answers 3

Reset to default 0

With flex:

.question-content-text {
    display: flex;
    align-items: center;
}

Without flex:

.question-content-text {
    position: relative;
}
.content-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

Use additional CSS rule.

.question-content-text{display:flex;align-items:center;}

The text will need to sit inside an element that has a width and left / right margins. For example, you would use a construct like this...

`<span style="width:50%;margin-left:25%;margin-right:25%">Here is my 
 text</span>`

Doing it like this will mean your text takes up the middle 50% of the available element, and it will align to the left of that middle 50% (unless you add something like text-align:center).

Most probably, you'll create a class in your custom css, with the attributes as above, and then just use the class wherever you want the text to appear like this.

`.my-center-text {width:50%;margin-left:25%;margin-right:25%;}`
Post a comment

comment list (0)

  1. No comments so far