Home > front end >  How to make the input and display div counterpart
How to make the input and display div counterpart

Time:12-22





<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;

<style>
/* let whole code center */
. Father_div {
position: absolute;
Left: 50%;
top: 50%;
width:200px;
height:100px;
Margin - left: - 100 px;
Margin - top: - 160 px;
}
Input {

}
. Username_div {

}

</style>

<body>
User name: & lt; Input type="text" name="username" & gt;

Password: & lt; Input type="password" name="password" & gt;

Email: & lt; Input type="text" name="email" & gt;



CodePudding user response:

. Username_div {
Display: inline.
}

CodePudding user response:

reference 1/f, cloud ah response:
username_div {
Display: inline.
}


useless

CodePudding user response:

refer to people in the wind and rain on the second floor response:
Quote: refer to 1st floor clouds ah response:
username_div {
Display: inline.
}


No
 & lt; ! DOCTYPE html> 

<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;

<style>
/* let whole code center */
. Father_div {
position: absolute;
Left: 50%;
top: 50%;
/* width: 200 px; */
height:100px;
Margin - left: - 100 px;
Margin - top: - 160 px;
}
Input {
Display: inline.
}
Email_div,
Password_div,
. Username_div {
Display: inline.
}

</style>

<body>
User name: & lt; Input type="text" name="username" & gt;


Password: & lt; Input type="password" name="password" & gt;


Email: & lt; Input type="text" name="email" & gt;





You limit the width to the parent element, certainly squeeze down

CodePudding user response:

The parent width 200, pressed down, inline are useless
  • Related