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

    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 class="row"><span style="width:60px;background-color: green;">infinityknow</span><span>prpr</span>

<style type="text/css">

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



  <li><span></span> Welcome To</li>
  <li><span>AND</span> Welcome To</li>
  <li><span>OR</span> Welcome To</li>

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

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

Free Live Chat for Any Issue

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
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, donโ€™t forget to share.

Rate this post