1

非常简单的问题,如何强制链接与 h2 标题内联显示?我有以下代码: http: //jsfiddle.net/jezzipin/6DpPX/,我希望“返回顶部”链接与“社交媒体”标题内联显示,但我尝试的一切似乎都没有工作。甚至使用跨度。

任何帮助将不胜感激。

jme1988

注意要清楚,这是我所追求的效果:

在此处输入图像描述

4

3 回答 3

2

添加这个CSS

.b2t_link{
float:right;
    margin-left:0;
}
.page_title{
display:inline-block;
    vertical-align:top;
}

演示

于 2012-12-12T09:55:48.937 回答
0

应用以下样式:

.page_title{
    font-size:18px;
    font-family: Arial,Helvetica,sans-serif;
    font-weight:400;
    padding-left:16PX;
    /*color:#053452; Dark Blue*/
    color: #729ABD;
    float:left;  //Added float
}

.b2t_link{
   float: right;
   margin-left: 794px;  //Reduced margin by width of page-title
   font-family: 'FamiliarProBold',Arial,Helvetica,sans-serif;
   font-size: 11px;
   color: #729ABD;    
}


.two_col_textAndImage_text{
   width: 720px;
   font-size: 11px;
   display: block;
   float: left;
   padding-left: 5px;
   padding-right: 5px;
   padding-top: 10px;
   min-height: 300px;    
}

#main-content{
   clear:both;   
}

然后在 htmldiv中用 id将图像和文本包装起来main-content

     <div id="main-content">
        <div class="two_col_textAndImage_text">
            <h2 class="item_title_no_image">Social Media Integrations</h2>
            <p class="item_text_no_image">
                Social Media is fast becoming a channel for advertising, promoting and applying for vacancies. Some organisations have fully embraced this within their recruitment strategies whilst others have not yet or do not wish to adopt this trend. Whatever the view of your own organisation's recruitment channels, ATS2go has been designed to integrate seamlessly with social media. <br/><br/>
                Social Media buttons, such as Facebook, Twitter and LinkedIn can be embedded within you vacancy postings enabling visitors to your site to forward a link to their friends and contacts about your vacancies. In addition, ATS2go includes automative "Job Tweets" for your vacancies which include a link back to your recruitment page; people simply click on the link within the Tweet and can then find out more about the role and hopefully submit their application immediately - simple, easy and free! <br/><br/>
            </p>
        </div>
        <div class="two_col_textAndImage_image">
          <img / src="https://text-development.ats2go.com/img/content_images/social-media.jpg" width="250px"/>
        </div>
   </div>

示例:http: //jsfiddle.net/6DpPX/8/

于 2012-12-12T09:54:30.537 回答
0

你可以把链接放在你的 h2 中。

http://jsfiddle.net/lollero/49VNH/1

替代视图:http: //jsfiddle.net/lollero/49VNH/1/show

HTML:

<h2 class="page_title">
    Social Media 
    <a href="#top" class="b2t_link">Back to top</a>
</h2>

CSS:

.b2t_link{
    float: right;
}
于 2012-12-12T09:55:18.950 回答