综合技术

Why do my CSS styles go beyond my online styles?

My
inline width/height is being overridden by my input
styles. Is there a way to correct this? Or will the inline style not work in this situation?

HTML:

CSS:

input {
   width:50%;
   padding:0px;
   outline:none;
   height:36px;
   font-size:24px;
}

You can accomplish this by using more specific CSS selectors like input[type=text]
and input[type=image]
. So if you want the height/width specified in your question to only apply to
, you would do something like this:

Keep the non-height/width properties in the less specific input
selector:

input {
   padding:0px;
   outline:none;
   font-size:24px;
}

Then use the height/width properties in the input[type=text]
selector:

input[type=text] {
   width:50%;
   height:36px;
}

Then you can add a differnet height/width for the input[type=image]
selector:

input[type=image] {
   width: 200px;
   height: 50px;
}

Also, keep in mind that you can make your selectors more specific if you use the id
of the form
in your selectors, like so:

#search input
#search input[type=text]
#search input[type=image]
阅读原文...

Hello, buddy!

美团点评披露网约车司机成本:2017年投入2.9亿元

上一篇

消息称三星或放弃虹膜识别转投人脸识别,会与中国市场有一些关系吗?

下一篇

你也可能喜欢

评论已经被关闭。

插入图片
Why do my CSS styles go beyond my online styles?

长按储存图像,分享给朋友