当前位置:Gxlcms > html代码 > 搞不懂了,难道又是BOM头?_html/css_WEB-ITnose

搞不懂了,难道又是BOM头?_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:16人阅读

html css utf8



仔细看一下不难发现,登录名和密码输入栏不一边长,为啥?下拉菜单前面为啥有空格?(附代码)

用户管理


@charset "utf8";.login_top_bg {	background-image: url(../images/login-top-bg.gif);	background-repeat: repeat-x;}.body {	background-color: #EEF2FB;	left: 0px;	top: 0px;	right: 0px;	bottom: 0px;}.login-buttom-bg {	background-image: url(../images/login-buttom-bg.gif);	background-repeat: repeat-x;}.login-buttom-txt {	font-family: Arial, Helvetica, sans-serif;	font-size: 10px;	color: #ABCAD3;	text-decoration: none;	line-height: 20px;}.login_txt {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	color: #333333;}.Submit {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	color: #629DAE;	text-decoration: none;	background-image: url(../images/Submit_bg.gif);	background-repeat: repeat-x;}.login_bg {	background-image: url(../images/login_bg.jpg);	background-repeat: repeat-x;}.login_bg2 {	background-image: url(../images/login-content-bg.gif);	background-repeat: no-repeat;	background-position: right;}.admin_txt {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	color: #FFFFFF;	text-decoration: none;	height: 38px;	width: 100%;	line-height: 38px;}.login_txt_bt {	font-family: Arial, Helvetica, sans-serif;	font-size: 14px;	line-height: 25px;	color: #666666;	font-weight: bold;}.admin_topbg {	background-image: url(../images/top-right.gif);	background-repeat: repeat-x;}.txt_bt {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	font-weight: bold;	color: #000000;	text-decoration: none;}.left_topbg {	background-image: url(../images/content-bg.gif);	background-repeat: repeat-x;}.admin_toptxt {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	color: #4A8091;	height: 18px;	width: 100%;	overflow: hidden;	position: fixed;}.left_bt {	font-family: Arial, Helvetica, sans-serif;	font-size: 14px;	font-weight: bold;	color: #395a7b;}.left_bt2 {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	font-weight: bold;	color: #333333;}.titlebt {	font-size: 12px;	line-height: 26px;	font-weight: bold;	color: #000000;	background-image: url(../images/top_bt.jpg);	background-repeat: no-repeat;	display: block;	text-indent: 15px;	padding-top: 5px;}.left_txt {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	color: #666666;}.left_txt2 {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	color: #000000;}.view_title {	font-family: Arial, Helvetica, sans-serif;	font-size: 13px;	line-height: 25px;	color: #666666;	text-align: center;}.view_list {	font-family: Arial, Helvetica, sans-serif;	font-size: 13px;	line-height: 25px;	color: #000000;	text-align: center;}.view_page {	font-family: Arial, Helvetica, sans-serif;	font-size: 13px;	font-weight: bold;	line-height: 25px;	color: #191964;	text-align: center;}.view_checkbox {	font-family: Arial, Helvetica, sans-serif;	font-size: 13px;	line-height: 25px;	color: #000000;	text-align: left;}.nowtable {	background-color: #e1e5ee;	border-top-width: 1px;	border-right-width: 1px;	border-bottom-width: 1px;	border-left-width: 1px;	border-top-style: solid;	border-top-color: #bfc4ca;	border-right-color: #bfc4ca;	border-bottom-color: #bfc4ca;	border-left-color: #bfc4ca;}.left_txt3 {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	color: #003366;	text-decoration: none;}.left_ts {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	font-weight: bold;	color: #FF6600;}.line_table {	border: 1px solid #CCCCCC;}.sec1 {	CURSOR: hand;	COLOR: #000000;	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	border: 1px solid #B5D0D9;	background-image: url(../images/right_smbg.jpg);	background-repeat: repeat-x;}.sec2 {	FONT-WEIGHT: bold;	CURSOR: hand;	COLOR: #000000;	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 25px;	background-color: #e2e7ed;	border: 1px solid #e2e7ed;}.main_tab {	COLOR: #000000;	BACKGROUND-COLOR: #e2e7ed;	border: 1px solid #e2e7ed;}.MM a {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 26px;	color: #666666;	background-image: url(../images/menu_bg.gif);	background-repeat: no-repeat;	list-style-type: none;	list-style-image: none;}a:link {	font-size: 12px;	line-height: 25px;	color: #333333;	text-decoration: none;}a:hover {	font-size: 12px;	line-height: 25px;	color: #666666;	text-decoration: none;}a:visited {	font-size: 12px;	line-height: 25px;	color: #333333;	text-decoration: none;}.MM a:link {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	line-height: 26px;	color: #666666;	background-image: url(../images/menu_bg.gif);	background-repeat: no-repeat;	list-style-type: none;	list-style-image: none;}


回复讨论(解决方案)

是不是在chrome下才这样,测试了下,在IE9和FF下没有这种情况,在chrome下会发生这样的情形了,应该是chrome浏览器为type=password,自动加载了个样式:
input:not([type]), input[type="color"], input[type="email"], input[type="number"], input[type="password"], input[type="tel"], input[type="url"], input[type="text"] {
padding: 1px 0px;
}

而如果不是password,自动加载了另一个样式:
input, input[type="password"], input[type="search"], isindex {
-webkit-appearance: textfield;
padding: 1px;
。。。。。。。
}
这样就长短出来了。

是不是在chrome下才这样,测试了下,在IE9和FF下没有这种情况,在chrome下会发生这样的情形了,应该是chrome浏览器为type=password,自动加载了个样式:
input:not([type]), input[type="color"], input[type="email"], input[type="number"], input[type="password"], input[type="tel"], input[type="url"], input[type="text"] {
padding: 1px 0px;
}

而如果不是password,自动加载了另一个样式:
input, input[type="password"], input[type="search"], isindex {
-webkit-appearance: textfield;
padding: 1px;
。。。。。。。
}
这样就长短出来了。

我用的IE6和chrome测试的。。。


是不是在chrome下才这样,测试了下,在IE9和FF下没有这种情况,在chrome下会发生这样的情形了,应该是chrome浏览器为type=password,自动加载了个样式:
input:not([type]), input[type="color"], input[type="email"], input[type="number"], input[type="password"], input[type="tel"], input[type="url"], input[type="text"] {
padding: 1px 0px;
}

而如果不是password,自动加载了另一个样式:
input, input[type="password"], input[type="search"], isindex {
-webkit-appearance: textfield;
padding: 1px;
。。。。。。。
}
这样就长短出来了。

我用的IE6和chrome测试的。。。
为“” 加个样式:padding: 1px;就好了,至少chrome下能好,IE6没办法,我这边模拟不了。

为“” 加个样式:padding: 1px;就好了,至少chrome下能好,IE6没办法,我这边模拟不了。
不行,加了两边都会不齐,而且主要问题是那个下拉框,那个空了太多。

这样加:
1.那个input加个class “
2.在css文件中加:
.in-password {
padding: 1px;
}
在chrome中测试成功。这个是解决长短不一的。
3.你那个下拉框把html代码贴出来,你贴出来的是引入了个PHP文件。

这样加:
1.那个input加个class “
2.在css文件中加:
.in-password {
padding: 1px;
}
在chrome中测试成功。这个是解决长短不一的。
3.你那个下拉框把html代码贴出来,你贴出来的是引入了个PHP文件。

我是这样加的啊,也是chrome。。。效果就是相对于上面的框移到了中间位置,结果两边都多出来一点点

RolePri($_SESSION["ss_user_id"]);	//循环将用户角色写入下拉框选项中	echo ""?>

SqlString="select * from user";	$db->SqlString=$db->SqlString." where UserId=$pUserId ";	$db->Query();		$this->mRoleArray=$db->mResultArray;       $this->pRoleId= $this->mRoleArray[0]->RoleId;      	$db->__destruct();}function RolePri($pUserId){     	require("sys_conf.inc");	require_once("DataBase.php");	$db=new DataBase($DBHOST,$DBUSER,$DBPWD,$DBNAME);		$this->GetRoleIdFromUserId($pUserId);	//获取基本信息	$db->SqlString="select * from role where RoleId < $this->pRoleId";	$db->Query();		$this->mInforArray=$db->mResultArray;	$db->__destruct();	}}?>


这样加:
1.那个input加个class “
2.在css文件中加:
.in-password {
padding: 1px;
}
在chrome中测试成功。这个是解决长短不一的。
3.你那个下拉框把html代码贴出来,你贴出来的是引入了个PHP文件。

我是这样加的啊,也是chrome。。。效果就是相对于上面的框移到了中间位置,结果两边都多出来一点点

RolePri($_SESSION["ss_user_id"]);	//循环将用户角色写入下拉框选项中	echo ""?>

SqlString="select * from user";	$db->SqlString=$db->SqlString." where UserId=$pUserId ";	$db->Query();		$this->mRoleArray=$db->mResultArray;       $this->pRoleId= $this->mRoleArray[0]->RoleId;      	$db->__destruct();}function RolePri($pUserId){     	require("sys_conf.inc");	require_once("DataBase.php");	$db=new DataBase($DBHOST,$DBUSER,$DBPWD,$DBNAME);		$this->GetRoleIdFromUserId($pUserId);	//获取基本信息	$db->SqlString="select * from role where RoleId < $this->pRoleId";	$db->Query();		$this->mInforArray=$db->mResultArray;	$db->__destruct();	}}?>

PHP代码我看不懂的。。。。。。。你把这些代码生成后的html代码贴出来就行了。

密码框和文本框的默认宽度是不一样的 你要设置一个指定的宽度

select一样设置一个宽度比较好


	


大概就是这样子

兄弟别怪我吐槽。。。 看到table用来布局 我就。。。。

密码框和文本框的默认宽度是不一样的 你要设置一个指定的宽度

select一样设置一个宽度比较好

嗯呢,文本框密码框改过来了,但是select好像不行,这个是位置不对,大小无所谓。

兄弟别怪我吐槽。。。 看到table用来布局 我就。。。。

怎么啦 我不太懂,我都是网上找的直接下来用。

觉得是样式问题呢

觉得是样式问题呢


我已经解决了,把select写在php外面就好了。

我已经解决了,把select写在php外面就好了。
Good job

人气教程排行