html - 扩展点向下推链接或文本

标签 html css

我创建了一 strip 点的跨线来填充链接文本和电话号码之间的内容,但我无法得到它,这样如果我有很多点,文本就不会在下面。问题是在一些不同的浏览器和计算机上......看起来很好,或者它会把它推开。我将如何着手制作它,以便点......可以跨越并且文本不会低于其应有的宽度。

<style type="text/css">
#contactInfo {
    margin:auto;
    width: 480px;
    height: auto;
}
</style>
<div id="contactInfo">
  <p>Email: .........................................................................<a    href="mailto:info@hereistheemail.com" class="redBold">info@hereistheemail.com</a></p>
  <p>Phone: ..................................................................................<span    class="redBold">888-888-8888</span></p>
</div>

我试着少放一些点,但在某些浏览器上它看起来不对。

最佳答案

做你想做的事的更好方法是使用 definition list 。这将在语义上呈现您想要的信息,而不需要您输入一堆点:

HTML

<dl>
    <dt>Phone</dt>
    <dd>123-4567</dd>

    <dt>Email</dt>
    <dd>info@email.com</dd>    
</dl>

CSS

dl {
   /* Adjust as needed.  Note that dl width + dt width must not be greater */
   width: 300px;  
}

dt {
   /* The definition term with a dotted background image */
   float: left;
   clear: right;
   width: 100px;  
   background: url(1-pixel-dot.gif) repeat-x bottom left;  
}

dd {
   /* The definition description */
   float: right;
   width: 200px;  
}

您可以在此处查看它的 an example

关于html - 扩展点向下推链接或文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7588757/

相关文章:

java - Struts2:将参数传递给操作类不起作用

html - 如何将 <span> 元素添加到从 WTForms 呈现的按钮?

html - 有没有办法为 CSS 屏蔽 SVG 剪切路径?

html - CSS overflow-y 属性 - 滚动 div

javascript - 使用 html5 文件 api 解码并播放歌曲

javascript - KonvaJS - 在图像的鼠标打开/鼠标关闭时切换 anchor

php - 保护 PHP session 免受 XSS 攻击

php - 使用 php 和 html 使用多种颜色使表格行变得丰富多彩

html - 需要一个全屏背景图像来包含超链接

html - 可以将背景图像添加到 ion-alert 吗?