Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8054321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:07:13+00:00 2026-06-05T08:07:13+00:00

I have this html: <div class=speaker-list> <div class=view-content> <div class=views-row views-row-1 views-row-odd views-row-first> <div

  • 0

I have this html:

<div class="speaker-list">
    <div class="view-content">
        <div class="views-row views-row-1 views-row-odd views-row-first">   
            <div class="views-field views-field-title">
                <span class="field-content">
                    <a href="/speaker/keith-anderson">Keith Anderson</a>
                </span>
            </div>  
            <div class="views-field views-field-field-job-title">
                <div class="field-content">VP, Digital Advisory</div>
            </div>  
            <div class="views-field views-field-field-company">
                <div class="field-content">RetailNet Group</div>
            </div>  
            <div class="views-field views-field-title-1">
                <span class="field-content">
                    <a href="/session/store">Store of the Future</a>
                </span>
            </div>  
            <div class="views-field views-field-field-headshot">
                <div class="field-content">
                    <div id="file-53" class="file file-image file-image-jpeg contextual-links-region"> 
                        <div class="content">
                            <img typeof="foaf:Image" src="/kanderson.jpg" width="180" height="180" alt="" />
                        </div>
                    </div>
                </div>
             </div>
        </div>
    </div>
</div>

It’s dynamically generated by a Drupal view, so I can’t change the output html at all. I need to work with what is here. Here’s the desired result:

enter image description here

Without any styling on the headshot, this is what it looks like:
enter image description here

I tried to style the image to force it to float to the left of the text:

.view-speaker-list div.view-content div.views-row div.views-field
div.field-content div.file-image div.content img {
    border: 1px solid #666;
    float: left;
    position: relative; /* tried with and without position (inc. absolute) */
    left: 30px;
}

Obviously I’m doing something wrong, because this is what I get (with relative position):
enter image description here

and with absolute position:
enter image description here

I’ve also tried putting the float on the “uppermost” div class that holds the image, with no position on the div:

.view-speaker-list div.view-content div.views-row
div.views-field-field-headshot {
    float: left;
}

It gives the same result as the position: relative screenshot.

Where am I going wrong? If I had control over the html I’d do it differently, but I’m not sure how to deal with all of these nested divs.

EDITED TO ADD NEW SCREENSHOT FOR @WEX

Here’s what it looks like when I tried to use your code with the html reordered – http://jsfiddle.net/mPa7z/

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:07:15+00:00Added an answer on June 5, 2026 at 8:07 am

    I’ll try to explain the “right” way to use float so that you can see why your way didn’t work.

    In your post, you try to apply float: left to the <div> surrounding your image, but that technique only works when the element you are floating is above all the elements you want to wrap around it. That “may” solve your problem, but that technique has it’s pitfalls if you’re trying to use it to create two distinct columns – if the text on the right is taller than the floated element, the text on the right will wrap below it. So then you have to add another container around your non-floated elements to ensure that it won’t wrap. This solves your problem, but doesn’t really help if you can’t even edit your markup!

    I’d argue that the technique I’ve posted below works better, and solves your problem: http://jsfiddle.net/Wexcode/AQQwX/

    .view-content { 
        position: relative;
        min-height: 180px;
        padding: 0 0 0 180px; }
    .views-row { padding: 20px 0 0 20px; }
    .views-field-field-headshot {
        position: absolute;
        top: 0;
        left: 0; }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this html line: <div class=hide-btn top tip-s original-title=Close sidebar></div> And when a
I have this html: <div id=signbtn> <a id=login-link class=btnsignin title=Login>Sign in</a> </div> Upon successful
I have this in HTML: <div class=dataBurst title=What is the Matrix?> <table align=center height=100%>
I have this html; <div class=AttachmentContainer> <div class=display-label>Attachment name</div> <div class=display-field> <input type=checkbox id=chkAttachment
I have this HTML code: <div id=content> <div class=profile_photo> <img style=float:left;margin-right:7px; src=http://gravatar.com/avatar/53566ac91a169b353a78b329bdd35c95?s=50&d=identicon class=profile_img alt={username}/>
I have this HTML: <div id=content> <div class='sub_menu a'></div> <div class='sub_menu b'></div> <div class='sub_menu
I have this HTML code: <div class='com_box'> <div class='com_box_c'> <div class='com_box_info'> <a id='quote'>quote</a> </div>
Assuming I have this HTML structure: <ul class='menu'> <li> <div></div> <div> <div></div> <div> <a
Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
I have this html: <div class=foo parent> <div class=child></div> </div> with some css: .foo{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.