text alignment of two span elements

rishav kumar

I want both span elements #spl and #xspl to be equally and properly aligned.please help so that it looks equal in size . Both of them should be equal and properly aligned . It should look like this:

enter image description here

#spl {
  background: brown;
  margin: : 5px;
  padding: 5px 0;
}
#xspl {
  background-color: purple;
  margin: : 5px;
  padding: 5px 0;
}
<fieldset>
  <legend>Your Indicators</legend>

  <label for="height">Height :</label>

  <span id="spl"> Short </span>

  <input type="range" id="height" min="0" max="100" name="Height">

  <span id="xspl"> Tall </span>

  <br>

  <label for="salary">Salary :</label>

  <span id="spl">Poor </span>

  <input type="range" id="salary" min="0" max="100" name="salary">

  <span id="xspl"> Rich</span>


</fieldset>

Alex

You can align them by giving fixed width to them.

#spl {
  background: brown;
  margin: : 5px;
  padding: 5px 0;
}
#xspl {
  background-color: purple;
  margin: 5px;
  padding: 5px 0;
}
label {
  width: 100px;
  display: inline-block;
}
#spl,
#xspl,
input {
  display: inline-block;
  vertical-align: middle;
}
#spl,
#xspl {
  width: 40px;
}
<fieldset>
  <legend>Your Indicators</legend>

  <label for="height">Height :</label>

  <span id="spl"> Short </span>

  <input type="range" id="height" min="0" max="100" name="Height">

  <span id="xspl"> Tall </span>

  <br>

  <label for="salary">Salary :</label>

  <span id="spl">Poor </span>

  <input type="range" id="salary" min="0" max="100" name="salary">

  <span id="xspl"> Rich</span>


</fieldset>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to set same alignment for these two text

From Java

Align two SwiftUI text views in HStack with correct alignment

From Dev

Two same span elements but have different width

From Dev

Alignment inside a span

From Dev

How to remove the extra space between two span elements?

From Dev

Unexpected elements alignment with Flexbox

From Dev

Text showing on two lines with span

From Dev

Gridview elements alignment

From Dev

Vertical-Alignment on Image and Text in Span

From Dev

Get text from outer span without text of inner elements

From Dev

Flexbox - different alignment for two elements

From Dev

FLoated elements top alignment

From Dev

<span> and <ul> vertical alignment

From Dev

Two span elements inside label

From Dev

Two same span elements but have different width

From Dev

Alignment of elements in TabPanel

From Dev

How to wrap two dynamically created elements with span?

From Dev

Vertical-Alignment on Image and Text in Span

From Dev

Flexbox - different alignment for two elements

From Dev

Alignment of span elements as td in table

From Dev

FLoated elements top alignment

From Dev

css of do vertically middle multiple child (two img and one span) elements in a parent div with auto fixing font-size of text in span

From Dev

position two span elements in opposite direction inside li

From Dev

How to align two span elements separately but in same line

From Dev

Vertical alignment of elements

From Dev

Prevent overlapping of two span elements

From Dev

Centering div elements regardless of text alignment

From Dev

How to extract text which is surrounded by two <span> element?

From Dev

Animate two elements from a vertical alignment to horizontal alignment

Related Related

HotTag

Archive