How do I prevent DIV tag starting a new line?

后端 未结 9 1819
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 18:42

I want to output a single line of text to the browser that contains a tag. When this is rendered it appears that the DIV causes a new line. How can I include the content in

相关标签:
9条回答
  • 2020-12-04 19:07

    Use css property - white-space: nowrap;

    0 讨论(0)
  • 2020-12-04 19:12
    <div style="float: left;">
    <?php 
      echo("<a href=\"pagea.php?id=$id\">Page A</a>") 
    ?>
    </div>
    <div id="contentInfo_new" style="float: left;">
      <script type="text/javascript" src="getData.php?id=<?php echo($id); ?>"></script>
    </div>
    
    0 讨论(0)
  • 2020-12-04 19:19

    use float:left on the div and the link, or use a span.

    0 讨论(0)
  • 2020-12-04 19:21

    You can simply use:

    #contentInfo_new br {display:none;}
    
    0 讨论(0)
  • 2020-12-04 19:26

    div is a block element, which always takes up its own line.

    use the span tag instead

    0 讨论(0)
  • 2020-12-04 19:29

    Add style="display: inline" to your div.

    0 讨论(0)
提交回复
热议问题