Bootstrap html不同字体和样式内联

赋值运算符的右侧不能有 if 语句。


这是一个简单的解决方案。


let grundumsatz = null;

if (geschlecht === 1) { 

    grundumsatz = Math.round(66.47 + (13.7 * gewicht) + (5 * groesse) - (6.8 * alter));

} else {

    grundumsatz = Math.round(655.1 + (9.6 * gewicht) + (1.8 * groesse) - (4.7 * alter)); 

};

可以看到,要设置的变量是在if/else之前声明的,然后我们根据需要进行赋值。


翻翻过去那场雪
浏览 82回答 2
2回答

红颜莎娜

你需要CSS代码来做到这一点。我这里有一个例子,有不同的尺寸、颜色和风格。首先是HTML代码:<h1 style="color: black; font-weight: 100">hello</h1><h2 style="color: blue; font-style: italic" >world!</h2>在 CSS 中,如果您想将 和 to 都放在一行中,则必须定义<h1>和<h2>to 。display: inline;CSS:h1, h2 {&nbsp; display: inline;}我希望我能帮助你

交互式爱情

我建议您在继续学习 CSS 之前先学习 HTML 的基础知识,span标签用于对文档中的内联元素进行分组。<div>&nbsp; <span style="font-size: 25px; color: red;">Hello</span>&nbsp; <span style="font-size: 15px; color: blue;">World</span></div>
打开App,查看更多内容
随时随地看视频慕课网APP