html span width – How to set fixed width for span?

html span width – html span tag is a inline element, it fits into the flow of the content and can be distributed over multiple lines.

html span width

HTML span is an inline element which cannot have a width. use a div or set display: block style to the span. span Represents an inline element,

span size css

span.product__specfield_8_arrow
{
    display: inline-block; /* or block */
}

Example : CSS fixed width in a span

.welcome span {
  display: inline-block;
}

//HTML Code

<div class="welcome">
  <div class="row"><span style="width:60px;background-color: green;">Welcome Pakainfo</span><span>prpr</span>
  </div>
  <div class="row"><span style="width:60px;background-color: green;">infinityknow</span><span>prpr</span>
  </div>
</div>

<style type="text/css">

span {
  display: inline-block;
  width: 50px;
}

</style>

Example

<ul>
  <li><span></span> Welcome To Pakainfo.com.</li>
  <li><span>AND</span> Welcome To infinityknow.com.</li>
  <li><span>OR</span> Welcome To w3diy.com.</li>
</ul>

ul {
  list-style-type: none;
  padding-left: 0px;
}

ul li span {
  float: left;
  width: 40px;
}

Don’t Miss : How To Make A Pop Up Image In Html?

I hope you get an idea about html span width.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.