开发者

Making text start two spaces (or 5 pixels) after the end of a variable

For the echoed text below, the "DURING" covers / overlaps the variable $submittor if I don't have all of the  s. With the  s, there is too much space between $submittor and "DURING" if the length of $submittor happens to be a short value.

Is there a way to make "DURING" start two spaces (or 5 pixels) after the end of $submittor regardless of the length of $submittor?

Thanks in advance,

John

The code:

echo '<div class="sitename3name">SUBMITTED BY <a href="http://www...com/.../members/index.php?profile='.$submittor.'" >'.$submittor.'</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp; DURING '.$dt->format('F j, Y &\nb\sp &\nb\sp g:i a').'</div>';

The CSS:

.sitename3name { 
   position:absolute;
         开发者_如何学Pythonwidth:800px;
         left:31px;
            top:189px;
   color: #999999;
   font-family:Arial, Helvetica, sans-serif;
   font-size: 10px;
   font-weight: normal;
   height: 5px;
   padding-bottom: 0px;

}

.sitename3name a{ 
   position:absolute;
   color: #004284;
   text-decoration:none;
   font-family:Arial, Helvetica, sans-serif;
   font-size: 10px;
   font-weight: bold;
   height: 5px;
   padding-bottom: 0px;

}

.sitename3name a:hover{ 
            position:absolute;
   color: #FFFFFF;
   background-color:#FF0000;
   text-decoration:none;
   font-family:Arial, Helvetica, sans-serif;
   font-size: 10px;
   font-weight: bold;
   height: 5px;
   padding-bottom: 0px;

}


You could wrap "DURING" in a span, float it left and add a 5px left margin:

<span class="during">DURING</span>

.during
{
   float: left;
   margin-left: 5px;
}

Might work..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜