Results 1 to 6 of 6

Thread: How can put div in the same with text??

  1. #1
    Join Date
    Aug 2006

    How can put div in the same with text??

    I have one line:
    "Hello every body"
    now, I put <div> </div> in the middle text like:
    "Hello every <div> </div> body"
    but, When put div tag, one line become 3 line, like:
    "Hello every
    <div> </div>

    I want when div tag can put, numbers of line is only one.
    How should I do?

  2. #2
    Join Date
    Jul 2004
    Sendai, Japan
    Use 'span' instead of 'div'.

  3. #3
    Join Date
    Aug 2006
    Quote Originally Posted by BonRouge
    Use 'span' instead of 'div'.
    Thanks very much
    I have another question:
    have <span> <span> </span> </span>
    now, I want the second span have a special position in the first span.
    I use: style="left: 234px; top: 116px;" in the second span tag.
    But This is position with browse, not in the first span

    How can I do
    Last edited by minhkhoi; 08-27-2006 at 12:12 PM.

  4. #4
    Join Date
    May 2006
    in your style sheet you could have just added

    to the div element.

    that will make it perform like a block level element.

    and for your answer for the first span use this

    PHP Code:
    <style type="text/css">
    span.a1 span{position:absolute;left:234px;top:116px;}
    HTML Code:
    <span class="a1">
            content for the span here
    try that.

  5. #5
    Join Date
    Aug 2006
    Maybe I post not clearly
    I want the second span have special position with the first span.
    It means, the first span have style=" left: 200; top: 200, height: 100, width:100"
    it create a range 100 x 100 px with second span,

    In last question I want second span have only postion betwen:
    + left: 200 to 300
    + top: 200 to 300
    with browser

    + left: 0 to 100
    + top: 0 to 100
    with the first span

    AND, I find simplest solution is (*)
    Now, I need take position of first span.

    Unfortunately, I must create the <span> like:
    <span id="myspan" style="width:200;height:200"> 222 </span>
    without left and top and put it in my web site
    I think I can take it's postion: document.all.myspan.styte.left
    but not success

    What should I do?
    Please help me.
    Thanks everybody
    Last edited by minhkhoi; 08-27-2006 at 12:58 PM.

  6. #6
    Join Date
    Nov 2003
    Jerryville, Tejas
    What should I do?
    Learn a lot more about CSS before you start trying to apply it. A div is a block element, hence your first problem. A span is an inline element, which makes it usable within a paragraph. But inline elements cannot have size or position assigned because they are inline. That means they are meant to flow naturally in the text and be the right size to contain their content. Maybe you should describe your design rather than the way you're trying to implement it.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center