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 6331753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:07:50+00:00 2026-05-24T18:07:50+00:00

I have the following code: <div> <div onmouseover=this.style.color=’red’ onmouseout=this.style.color=’blue’ style=float:left> a <br/> b <br/>

  • 0

I have the following code:

<div>
    <div onmouseover="this.style.color='red'" 
         onmouseout="this.style.color='blue'" 
         style="float:left">
        a
        <br/>
        b
        <br/>
        c
    </div>
    <div onmouseover="this.style.color='red'" 
         onmouseout="this.style.color='blue'" 
         style="position:relative;">
        Testing, one two three...
    </div>
</div>

The first div pushes the text in the second div to the right, but not the second div itself, so the a in the first inner div will be covered up by the T in the second inner div, and hovering over the a will not trigger the onmouseover.

This is a pretty simplified example, but how do I get this sort of layout, preserving the position:relative of the second div and not adding any margins to it, since the first div may or may not be displayed? It seems strange that the second div will cover up the first.

  • 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-05-24T18:07:51+00:00Added an answer on May 24, 2026 at 6:07 pm

    If i understood you correctly.. Put float: left; to the second div as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code in html: <div> <div style=float:left;margin:0.5em> <span class=title>Label1</span><br/> <input type=text name=name1
I have the following code: DIV><TABLE><TBODY><TR><TD> <DIV id=namesClass style=WIDTH: 700px> <UL style=MARGIN-LEFT: 0px! important;
I have the following code: div:nth-child(1) { background-color: red; } <h1>Boxes</h1> <div>1</div> <div>2</div> <div>3</div>
I have following code: <div style=border:4px solid black;width:100%;height:100px;position:fixed;left:250px;> out of bound :( </div> I
i have following code <div class=caption style= position:absolute; margin-top:0px> <img src=caption/img1.png /> </div> <script>
I have the following code: <div class=outer-div> <img onmouseover=showDiv(this) src={{ STATIC_URL }}/images/user_male.png> <a onmouseout=hideDiv(this)
I have the following bit of code: <div id=some_div style=border: solid 1px red; width:50px;
I have the following markup: <div style=height:100px; width:280px; float:left > <p style=float:left; padding:5px; id=optionOne>
See following code <div id=news-ticker> <marquee id=news-marquee scrollamount=3 onmouseover=stop() onmouseout=start() style=padding-top:2px; padding-bottom:2px;> Latest News
I have the following code, the circle doesn't resize: HTML <div onMouseOver=mainOver(); onMouseOut=mainOut(); id=c></div>

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.