CSS Issue about div tag

by 6 replies
7
Hi,

I have 2 div : div #1 and div #2(background color: blue)

The div #2 contains 1 text box and 1 button as the code below that is in the html file.
Code:
<div id="div2">
   <form>
       <input type="text"/><br>
       <input type="submit"/>
  </form>
</div>
When i code to put the div #2 inside div #1, the textbox and the button are outside the div #2 meanwhile the div #2 is already inside div #1(due to the background color). Could anyone help me to solve this issue?

Thanks in advance.

~ Bao
#programming #button #css #div #issue #textbox
  • tell me the css code that you write
  • Banned

    So change the color in the 2nd div CSS. Done.
    • [1] reply
    • Thanks. Sent you the PM

      Do you mean the background color? I have initially set it to blue.

      Actually i am really not clear about your reply. Could you clarify it please?
      • [1] reply
  • The issue is already resolved here by adding the following code

    .div2{
    display : table;
    ...
    }

    Thanks everyone for your interest!
  • Very confusing problem explanation, and solution that I believe nobody uses nowadays.

Next Topics on Trending Feed