开发者

Apply css to button element with certain class

开发者 https://www.devze.com 2023-02-21 22:31 出处:网络
bluebutton.css .btnBlue button{ Styles go here } .btnBlue button::-moz-focus-inner{ Styles go here } .btnBlue button:hover,button:focus{

bluebutton.css

.btnBlue button{
Styles go here
}

.btnBlue button::-moz-focus-inner{
Styles go here
}

.btnBlue button:hover,button:focus{
styles go here
}

.btnBlue button:active{
Styles go here
}

index.html

<!DOCTYPE html>
&l开发者_StackOverflow中文版t;html>
<head>
<title>Css buttons</title>
<link type='text/css' href='css/bluebutton.css' rel='stylesheet' media='screen' />
</head>
<body>
<button type="submit" class="btnBlue">Okay</button>
</div>
</body>
</html>

This does not seem to work. I know it works if i try to do it without the .btnBlue but i want to create different button styles. So like i can define for each button what style to use.


Think you need to change the stylesheet declarations here to:

button.btnBlue{ Styles go here }

button::-moz-focus-inner.btnBlue{ Styles go here }

button:hover.btnBlue,button:focus.btnBlue{ styles go here }

button:active.btnBlue{ Styles go here }

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号