• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

problems with two divs sitting next to the other.

 
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having a problem with divs sitting side by side. If you launch this page, you will see a black rectangle with the name Description on it and it is sitting next to a blue box. The blue box and the black rectangle do not have any space between them despite all my efforts.

I have to use the marquee, so I cannot use relative or absolute position nor can I float the black rectangle right.

Thanks,
Michele

 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A couple of things to get out of the way:
  • As pointed out in the other post, you do not need to use non-standard marquee; you can achieve the same effect (and likely much more smoothly) with script. (jQuery animation makes it easy. See chapter 5 of jQuery in Action (2nd Ed) if you have it.)
  • The font tag is deprecated. Use CSS for styles.
  • You're using HTML comment delimiters to comment out CSS. That's not valid.
  • Why does the use of marquee preclude using float?


  • The way I would approach this is to:
  • Ditch the non-standard and deprecated markup. No <marquee>. No <font>. No <i>.
  • Use jQuery animation instead of marquee.
  • Float the left column.
  •  
    Michele Smith
    Ranch Hand
    Posts: 421
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Good advice, thanks.

    I wonder, where would I find this animated vertical scroller? I have been searching and cannot find anything other than kinda of what I am dealing with.

    Any suggestions appreciated.

    Many Thanks,
    Michele
     
    Bear Bibeault
    Sheriff
    Posts: 67752
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Here's a fiddle that demonstrates one easy technique I use to get side by side divs.
     
    Bear Bibeault
    Sheriff
    Posts: 67752
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Michele Smith wrote:I wonder, where would I find this animated vertical scroller? I have been searching and cannot find anything other than kinda of what I am dealing with.


    It's almost trivially easy with the jQuery .animate() method. Simply manipulate the top value.
     
    Greenhorn
    Posts: 5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You should change your code as suggested by Bear Bibeault. But if you still do not want to change the code and want to achieve the same behavior, then apply the style "margin-left" to "content2" div. The value will be greater 25%, as your "menu" div has 25% width.

    One more example of side by side div: http://jsfiddle.net/wgmjX/
     
    Michele Smith
    Ranch Hand
    Posts: 421
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks for the fiddle, I liked it a lot.

    thanks again,
    Michele
     
    Bear Bibeault
    Sheriff
    Posts: 67752
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Michele Smith, your post was moved to a new topic. I figured the scrolling discussion deserved its own topic separate form the layout discussion.
     
    Michele Smith
    Ranch Hand
    Posts: 421
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hello, I am experiencing difficulty with the div titled content

    What happens is it does not line up appropriately when dynamically populating the div. The first div in the recordset populates this area fine but the others are not lining up appropriately.

    When I try the below referenced absolute tag, the area populates just fine however, the second and third, to the zzzz of the recordset does not look good at all.

    I would like to try to avoid using the absolute tag altogether.

    Below is my code, sorry for the spaces,

     
    It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic