如何创建一个标题栏,其中一些文本在左边,一些在右边? [英] How do I create a title bar with some text to the left and some to the right?

查看:185
本文介绍了如何创建一个标题栏,其中一些文本在左边,一些在右边?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jquery小部件,我需要创建一个标题,一些文本在标题栏的左边,一些在右边。这是一个代码片段:

I am using jquery widgets and I need to create a title with some text to the left of the title bar and some to the right. Here is a snippet:

    <div id="newtask" class="ui-widget-content ui-state-default">
    <h4 class="ui-widget-header">
        <span class="ui-icon ui-icon-done">New Task</span> Todo <div style="text-align:right">This needs 
    </h4>

但是,右手文本位于左手下方一行。如何获取一行有一些文本向左和一些向右?

However, the right hand text is displaced one line below the left hand. How do I get one single line with some text to the left and some to the right?

推荐答案

你应该使用float:right ...

you should use float:right...

    <div id="newtask" class="ui-widget-content ui-state-default">
    <h4 class="ui-widget-header">
        <span class="ui-icon ui-icon-done">New Task</span> Todo <div style="float:right;">This needs 
    </h4>

这篇关于如何创建一个标题栏,其中一些文本在左边,一些在右边?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆