html - 在换行时对齐图像图标后面的链接文本

标签 html css xhtml

我有一个链接,左边是链接图标,右边是箭头。我遇到的问题是链接文本换行,它不能很好地证明。我怎样才能实现类似这里的东西 http://jsfiddle.net/MrLister/3xbfyqkh/ ,但使用我给定的标记?

<div class="linkitem" id="myTools" style=
"display:inline-block; padding:4px 0 4px 0; width:90%;">
    <a href="{$ItemEditURL}" id="InlineEditLink" style=
    "cursor: pointer; position:relative; top: 4px; margin-right:5px;"><img height="14"
    src=
    "https://maxcdn.icons8.com/Android_L/PNG/24/Programming/edit_property-24.png"
    title="Edit" width="14"></a> <a href="{$SafeLinkUrl}" style=
    "color: white !important!" target="_blank" title="{@LinkToolTip}">A
    very long descriptive Link text goes here</a>
</div>
<div class="wrapperArrow" style="float:right; padding-top:5px;"><img alt=""
src=
"https://maxcdn.icons8.com/windows10/PNG/16/Arrows/double_right-16.png"></div><br>

<br><br><br><br><br><br><br>
<hr>
Free Icons provided by <a href="https://icons8.com">Icons8</a>

我的 fiddle 在这里... https://jsfiddle.net/a2gruae6/

最佳答案

以内联样式更新此代码以解决您的问题

<div class="linkitem" id="myTools" style=
    "display:inline-block; padding:4px 0 4px 0; width:90%;">
        <a href="{$ItemEditURL}" id="InlineEditLink" style=
        "cursor: pointer;position: absolute;float:left;width:20px;"><img height="14"
        src=
        "https://maxcdn.icons8.com/Android_L/PNG/24/Programming/edit_property-24.png"
        title="Edit" width="14"></a> <a href="{$SafeLinkUrl}" style=
        "color: white !important!;float:left;margin-left: 20px;" target="_blank" title="{@LinkToolTip}">A
        very long descriptive Link text goes here</a>
    </div>
    <div class="wrapperArrow" style="float:right; padding-top:5px;"><img alt=""
    src=
    "https://maxcdn.icons8.com/windows10/PNG/16/Arrows/double_right-16.png"></div><br>

    <br><br><br><br><br><br><br>
    <hr>
    Free Icons provided by <a href="https://icons8.com">Icons8</a>

关于html - 在换行时对齐图像图标后面的链接文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37255576/

相关文章:

javascript - 选择选项后锁定选择框?

Javascript 动画图像调整大小

html - @media 查询不适用于 ipad 肖像(已经搜索了所有问题)

html - 单击时如何更改按钮图像的颜色?

javascript - TinyMCE 正在修改 XHTML 1.0 Strict HTML I 输入。我怎样才能阻止它?

html - 如何制作从页面中间开始到页面末尾的内容?

html - 如何调整 Chrome 扩展程序弹出窗口的大小?

html - 李 :first-of-type selecting everything

css - 为什么我不能使用 <col> 属性在 CSS 中隐藏表格列?

css - 如何在团队环境中管理大型网站的CSS而不困惑?