How to position text left, center, and right with a line in the middle?

align text left and right on same line word
center and right align on same line word
align text left, center, & right same line html
align text left center right same line html w3schools
left align and right align text on the same line html
how to center text in the middle of the page in word for mac
header align left and right
div align: left and right same line

I'd like to create the following:

Left Text - - - - - - Center Text - - - - - - Right Text

Where - - - - - is a 1px dashed line and is in the middle of the text height.

Flexbox container with space-between. The dashed lines are a border on 1px height spans. Make sure the text spans do not grow with flex: 0 0 auto;

.container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
.container .text {
  flex: 0 0 auto;
.container .dashed {
  display: block;
  width: 50%;
  height: 1px;
  border-top: 1px dashed #000;
  margin: 0 5px;
  box-sizing: border-box;
<div class="container">
    <span class="text">Left Text</span>
    <span class="dashed"></span>
    <span class="text">Center Text</span>
    <span class="dashed"></span>
    <span class="text">Right Text</span>

Word formatting - Align left, center, and right in same line, Keep clicking the tab button left to the ruler till you are in a symbol looking like a flipped T. Click on the mid in the ruler where you like to position the middle text. Tip: For more examples on how to align text, see the CSS Text chapter. Center an Image To center an image, set left and right margin to auto and make it into a block element:

I would do something like this:

<div class="outer">
  <div class="center">
    <span class="middle">More text</span>
  <span class="left">Some text</span>
  <span class="right">Even more...</span>
.outer {
  position: relative;
  width: 100%;

.outer > * {
  position: absolute;
  background: white;
  padding: 0 5px;
  top: 0;

.left {
  left: 0;

.center {
  text-align: center;
  width: 100%;
  height: 8px;
  border-style: solid;
  border-color: black;
  border-width: 0 0 2px 0;

.middle {
  background: white;
  padding: 0 5px;

.right {
  right: 0;

Left align, center, and right align text on one line, Align text multiple ways in one paragraph in Word. How to center Duration: 4:00 Posted: Jul 26, 2010 left: Aligns the text to the left: Play it » right: Aligns the text to the right: Play it » center: Centers the text: Play it » justify: Stretches the lines so that each line has equal width (like in newspapers and magazines) Play it » initial: Sets this property to its default value. Read about initial: Play it » inherit: Inherits this

html, body, .grid-container { height: 100%; margin: 0; }

.grid-container *:after { 
 position: absolute;
 top: 0;
 left: 0;

.grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-areas: "t1 t2 t3" ". . ." ". . .";
 txt-align: center;

.t1 { grid-area: t1; }

.t2 { grid-area: t2; }

.t3 { grid-area: t3; }
<div class="grid-container">
  <div class="t1">sfsfds -----------------------</div>
  <div class="t2">dsfsdf -------------------</div>
  <div class="t3">dsfdsf -----------------------</div>

CSS: centering things, A common task for CSS is to center text or images. In fact, there are Centering lines of text Or, phrased differently: we want the left and right margin to be equal. DIV.container { min-height: 10em; display: table-cell; vertical-align: middle } . To set text alignment in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property text-align for the center, left and right alignment. HTML5 do not support the align attribute of the <p> tag, so the CSS style is used to set text alignment.

Align text left or right, center text, or justify text on a page, Align the edges of your to the left, center, right, or justified, or vertically to the top, center, or bottom between margins. Text Alignment. The text-align property is used to set the horizontal alignment of a text.. A text can be left or right aligned, centered, or justified. The following example shows center aligned, and left and right aligned text (left alignment is default if text direction is left-to-right, and right alignment is default if text direction is right-to-left):

Left, Center and Right align on a single line - HTML & CSS, Hi, I have an h2 tag and two spans that I want to all appear on the same line, the h2 text on the left, one of the spans in the middle and the other� If a text justified both on the left and on the right side then it is called Justify Text. Use “text-align: justify;” attribute to Justify. It will Stretch the sentence so that each line has an equal width (like in newspapers and books).

Left Align and Right Align Text on the Same Line, It can sometimes be useful to have some text be aligned to the left and some text be aligned to the right on the same line. For example, in a� @guido - to clarify your suggestion: text-align: center is needed if ALL lines of the central text are to be centered (ragged left and right edges); if the goal is to have the wrapped lines be left-justified with the first line (a central "box" that has equal space on left and right, but left-justified text within that box, like a typical paragraph), might not need that.

  • I believe your question was down-voted because you did not provide any code showing what you attempted. I was typing my answer while this happened. I am kinda new to contributing here so not sure if I did anything wrong by giving you the complete answer here.
  • @Simran you didn't do something wrong but you may encourage people to ask such question again which is not what we want here as it's a place for high Q&A and not I don't know how to do, do it for me. So better avoid answering as you may also waste your time if the question is closed/deleted later.
  • @TemaniAfif Makes perfect sense. I had just finished posting the solution when I noticed the down-votes. This is only the third day I have been contributing, still getting my bearings.