• Resolved jgoldberg2013

    (@jgoldberg2013)


    I was sure I had this one in the bag!!!
    playing around wit some basic stuff regarding floats but I can not seem to get it to work.
    HTML:

    <div id="test-page">
        <div id="test-content">
            <h2>
                SECTORS / INDUSTRIES
            </h2>
         <div id="test-p1">
                <p>
                    blau blau blaudi blau
               </p>
         </div>
            <div id="test-image">
                <img alt="Sectors / Industries" src="http://localhost/coinlogistics/wp-content/uploads/2013/05/sectors1.jpg" />
          </div>
        </div>
    </div>

    CSS to float header and para left and image right.

    #test-page {
      clear: left;
      width: 100%;{
    #test-content {
      clear: left;
      float: left;
      width: 40%;
      margin: 0;
      display: inline;}
    #test-p1 {
      font-family: Helvetica, 'calibri', arial, sans-serif;
      font-size: 18px;
      line-height: 1.2em;
      margin: 5px;
    }
    #test-image {
      float: right;
      height: 500px;
      width: 350  px;
      margin: 0;
      display: inline;
    }

    I have even trying this code in CSSdesk to see if it was maybe a conflict within the them page templates but the same thing happened..
    ANY ADVISE PLEASE.

Viewing 15 replies - 1 through 15 (of 21 total)
  • Try using Firefox with the Firebug add-on for this kind of CSS troubleshooting. Or use whatever developer tool is available in your web browser.

    We cannot really help with any CSS out of the context of its site.

    Try putting the image div above the text div in the HTML order.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can already notice something fishy here:

    #test-page {
      clear: left;
      width: 100%;{

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    Thanks all but checking in firebug is the first thing I do.
    and I could not see any conflict there.
    Placing html image above text – tried that as well but no good either.
    Andrew – that was a typo -sorry, is correct on my style sheet.
    Link to CSSdesk so you can all see what is going on.
    http://www.cssdesk.com/hCn9B

    hope this helps.
    Thought this would be an easy thing do – probably something so simple.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Sounds like your 40% width is too small to accommodate the image in that layout.

    A link to a live page demonstrating the problem would be far more helpful.

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    That is the strangest thing.
    If I add in CSSdesk at the very top #
    then the image floats right.
    Any reason for that???

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    ESMI – I am on a localhost as shown in the code givn in the start fo the post so live feed is not possible. That is why I did it for you in CSSdesk so you can see what was going on.
    As far as the 40% – that is not the issue, as stated in the post previous – if I add #to the very top then the image floats right.
    Any reason why?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Any reason for that???

    Can you share us a link to that?

    Works for me in CSSDesk putting the image containing div first.

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    http://www.cssdesk.com/hCn9B

    This is with the blank #added to the top.

    [Please take care when posting links.]

    This works fine with the existing CSS:

    <div id="test-page">
        <div id="test-content">
            <h2>
                SECTORS / INDUSTRIES
            </h2>
            <div id="test-image">
                <img alt="Sectors / Industries" src="http://localhost/coinlogistics/wp-content/uploads/2013/05/sectors1.jpg" />
            </div>
            <div id="test-p1">
                <p>
                    blau blau blau blau and more blaudi blau
                </p>
            </div>
    
        </div>
    </div>

    Has anyone spotted the mistake in the CSS posted originally?

    #test-page {
      clear: left;
      width: 100%;{
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Yes, but I think the issue here is that the OP didn’t explain and illustrate the problem thoroughly enough.

    Which is why nothing beats being able to see the problem page. Trying to troubleshoot any other way is like trying to plait fog.

Viewing 15 replies - 1 through 15 (of 21 total)

The topic ‘Why won't my image float right.’ is closed to new replies.