请您告诉我如何更改这段代码中的字体颜色?
<div style="background-color: #fff8c6; width: 250px; margin-left: 0px; margin-right: 20px; padding: 8px;"><b>What you get with your phone:</b>
<br />• Mains Charger
<br />• USB Cable
<br />• Instructions
<br />• Box
<br />• Guarantee
</div>
答案 0 :(得分:0)
使用:color:red
<div style="background-color: #fff8c6; width: 250px; margin-left: 0px; margin-right: 20px; padding: 8px;color:red;"><b>What you get with your phone:</b>
<br />• Mains Charger
<br />• USB Cable
<br />• Instructions
<br />• Box
<br />• Guarantee
</div>
避免使用内联样式。使用css规则也可以这样做:
<强> CSS:强>
div {
color:red;
background-color: #fff8c6;
width: 250px;
margin-left: 0px;
margin-right: 20px;
padding: 8px;
}
HTML:
<div>
<b>What you get with your phone:</b>
<br />• Mains Charger
<br />• USB Cable
<br />• Instructions
<br />• Box
<br />• Guarantee
</div>