试了很多方法都没办法求求大佬帮忙解决
你题目的解答代码如下:(如有帮助,望采纳!谢谢! 点击我这个回答右上方的【采纳】按钮)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
.text {
display: inline-block;
width: 100px;
text-align: right;
}
</style>
</head>
<body>
<span class="text">用户名:</span> <input type="text" value="" /> <br />
<span class="text">密码:</span> <input type="text" value="" /> <br />
<span class="text">E-mail:</span> <input type="text" value="" /> <br />
</body>
</html>
一般在表单里面嵌套表格或div,用表格来实现对齐。
你可以贴一下css代码和你当前效果截图,靠右对齐可以是浮动,定位,表格等多种方式,方法很多