html - 如何使用 HTML 和/或 CSS 使图像始终显示在某些关联文本的右侧?

标签 html css sharepoint-2010

我有这个 HTML:

<div>This page provides a brief overview of the travel process, as well as many of the resources that travelers need. For guidance on best travel practices, see <a href="bla.com" target="_blank">Key Tips for UCSC Travelers</a>, which was designed to provide tips of preparing, booking, and reimbursement of travel expenses.<span><img class="ucsc_image_dynamic_size" alt="Access Connexxus Booking Tool" src="/PublishingImages/access_connexxus.gif"/></span></div>

我希望文本显示在图像的左侧(而不是图像上方);我怎样才能使用 HTML 和/或 CSS 实现这一点?

原样,它看起来像这样:

enter image description here

更新

在回答评论中的问题时,这里是图像使用的类:

.ucsc_image_dynamic_size {
    position: relative;
    top: 0px;
    right: 0px;
    width: auto;
    height: auto;
}

最佳答案

确定你只需要先放图片的HTML,然后再 float 就可以了吗?

<div>
    <img class="ucsc_image_dynamic_size" alt="Access Connexxus Booking Tool" src="/PublishingImages/access_connexxus.gif"/>
    This page provides a brief overview of the travel process, as well as many of the 
    resources that travelers need. For guidance on best travel practices, see 
    <a href="bla.com" target="_blank">Key Tips for UCSC Travelers</a>, 
    which was designed to provide tips of preparing, booking, and reimbursement of travel expenses.
</div>

CSS:

.ucsc_image_dynamic_size {
    float: right;
    margin: 0 0 0.5em 1em;
}

还是我遗漏了什么? JSFiddle 示例(带有占位符图像):http://jsfiddle.net/4s8evpod/1/

关于html - 如何使用 HTML 和/或 CSS 使图像始终显示在某些关联文本的右侧?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32468375/

相关文章:

javascript - SharePoint 初始化后执行 JavaScript 函数

sharepoint - 打开 SharePoint 文档库时出现 NullreferenceException

jquery - 将 Rails 应用加载到现有的 HTML5 页面中(使用 JQuery 或 iFrame)

javascript - 我想使用模式通过 php 文件发送邮件,并且我希望在提交关闭后关闭弹出窗口

html - 带水平滚动的 DIV - Bootstrap 4

javascript - 单击菜单选项后卡住悬停 onclick

css - 如何添加 SharePoint :CssRegistration to a Master page in SharePoint 2010

html - 为什么 colspan 没有按预期应用

html - 将整个包装器 (div) 定位在主包装器 (div) 内

CSS - 制作移动 css 时忽略原始 css div