CSS Issue about div tag

6 replies
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
#button #css #div #issue #textbox
  • Profile picture of the author abdulrahman414
    tell me the css code that you write
    {{ DiscussionBoard.errors[10377780].message }}
  • Profile picture of the author yukon
    Banned
    Originally Posted by baokhau View Post

    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

    So change the color in the 2nd div CSS. Done.
    {{ DiscussionBoard.errors[10377805].message }}
  • Profile picture of the author baokhau
    The issue is already resolved here by adding the following code

    .div2{
    display : table;
    ...
    }

    Thanks everyone for your interest!
    {{ DiscussionBoard.errors[10406223].message }}
  • Profile picture of the author webcosmo
    Very confusing problem explanation, and solution that I believe nobody uses nowadays.
    {{ DiscussionBoard.errors[10408764].message }}

Trending Topics