1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Display html elements next to each other instead of span multiple lines?

Discussion in 'HTML & Website Design' started by postcd, Sep 13, 2021 at 3:30 AM.

  1. #1
    Hello,

    if there are 2 web page elements generated by remote javascript
    and it display each at one line and i want these to display in line one next to other, how to do it?

    i have already tried with table like this. When i use HTML tester like https://codepen.io/marcysutton/pen/ZYqjPj and paste that code inside and append sample text to each column content, it displays the text in one line, but in reality, on the site it looks like this:
    [​IMG]
    My research not worked, maybe searching wrong phrases.
    SEMrush
     
    postcd, Sep 13, 2021 at 3:30 AM IP
    SEMrush
  2. sarahk

    sarahk iTamer Staff

    Messages:
    27,234
    Likes Received:
    4,182
    Best Answers:
    118
    Trophy Points:
    665
    #2
    Can you create a codepen in it with just your HTML, javascript and css please?

    It looks like it's placing the ads into separate table cells but it would be easier to see it working.
     
    sarahk, Sep 13, 2021 at 3:38 PM IP
  3. sarahk

    sarahk iTamer Staff

    Messages:
    27,234
    Likes Received:
    4,182
    Best Answers:
    118
    Trophy Points:
    665
    #3
    Let's try again

    I can't see where you've tried to place the code in the codepen.

    The code you quote is:
    <table>
    <td>&nbsp;&nbsp;</td><td align="right"><!-- adexpert.cz (125x125px) -->
    <script type="text/javascript" src="https://s.adexpert.cz/ts?122"></script>
    <!-- adexpert.cz end --></td><td align="right"><!-- adexpert.cz (125x125px) -->
    <script type="text/javascript" src="https://s.adexpert.cz/ts?123"></script>
    <!-- adexpert.cz end --></td>
    </table>
    Code (markup):
    When I paste the code into your codepen and add a border to the table it shows as expected.
    upload_2021-9-15_11-47-57.png
    Is there a reason you didn't use <tr></tr>?

    Then there's the whole using a table when you should be using divs.

    If I knew what your site's template was using I could make a recommendation based on its grid system.

    But then

    Which seems extraordinary. CSS is how you're going to get your divs to line up properly
     
    sarahk, Sep 14, 2021 at 4:47 PM IP
  4. postcd

    postcd Well-Known Member

    Messages:
    1,018
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #4
    I have tr just not mentioned it here. You have commented and spent a lot of space in this thread, but given no exact advice, example! Issue, question remains.

    Have same issue? try:
    <div style="overflow:hidden;">element</div><div style="overflow:hidden;">element2</div>

    or:
    <div style="display: inline-block;">element</div><div style="display: inline-block;">element2</div>

    or:
    style="float: left;"
     
    Last edited: Sep 15, 2021 at 3:16 AM
    postcd, Sep 15, 2021 at 2:05 AM IP
  5. sarahk

    sarahk iTamer Staff

    Messages:
    27,234
    Likes Received:
    4,182
    Best Answers:
    118
    Trophy Points:
    665
    #5
    Maybe you should ask at your own webmaster forum?
     
    sarahk, Sep 15, 2021 at 2:18 AM IP