从来没有重视过css样式.也从来没有他细研究过,这次改项目的界面,可吃苦头了.好了,现学现卖了.
页面的
在<head>中间加上这个.
<
style
>
.nodata ... {
font-size:11px;
color:red;
}
</ style >
.nodata ... {
font-size:11px;
color:red;
}
</ style >
在页面上应用这个样式.
<
tr
>
< td >
今天:
</ td >
< td >
API指数为:
</ td >
< td >
< c: if test = " ${cityDay.pollutionIndeces==null} " >< div class = " nodata " > 暂无数据 </ div ></ c: if >
< c: if test = " ${cityDay.pollutionIndeces!=null} " > $ ... {cityDay.pollutionIndeces} </ c: if >
</ td >
< td >
级别:
</ td >
< td >
< c: if test = " ${cityDay.grade==null} " >< div class = " nodata " > 暂无数据 </ div ></ c: if >
< c: if test = " ${cityDay.grade!=null} " > $ ... {cityDay.grade} </ c: if >
</ td >
< td >
状态:
</ td >
< td >
< c: if test = " ${cityDay.status==null} " >< div class = " nodata " > 暂无数据 </ div ></ c: if >
< c: if test = " ${cityDay.status!=null} " > $ ... {cityDay.status } </ c: if >
</ td >
< td >
首要污染物:
</ td >
< td colspan = " 4 " >
< c: if test = " ${cityDay.mainPollutant==null} " >< div class = " nodata " > 暂无数据 </ div ></ c: if >
< c: if test = " ${cityDay.mainPollutant!=null} " > $ ... {cityDay.mainPollutant} </ c: if >
</ td >
</ tr >
< td >
今天:
</ td >
< td >
API指数为:
</ td >
< td >
< c: if test = " ${cityDay.pollutionIndeces==null} " >< div class = " nodata " > 暂无数据 </ div ></ c: if >
< c: if test = " ${cityDay.pollutionIndeces!=null} " > $ ... {cityDay.pollutionIndeces} </ c: if >
</ td >
< td >
级别:
</ td >
< td >
< c: if test = " ${cityDay.grade==null} " >< div class = " nodata " > 暂无数据 </ div ></ c: if >
< c: if test = " ${cityDay.grade!=null} " > $ ... {cityDay.grade} </ c: if >
</ td >
< td >
状态:
</ td >
< td >
< c: if test = " ${cityDay.status==null} " >< div class = " nodata " > 暂无数据 </ div ></ c: if >
< c: if test = " ${cityDay.status!=null} " > $ ... {cityDay.status } </ c: if >
</ td >
< td >
首要污染物:
</ td >
< td colspan = " 4 " >
< c: if test = " ${cityDay.mainPollutant==null} " >< div class = " nodata " > 暂无数据 </ div ></ c: if >
< c: if test = " ${cityDay.mainPollutant!=null} " > $ ... {cityDay.mainPollutant} </ c: if >
</ td >
</ tr >
先定底义一个样式,然后在页面上引用就可以了.这是最基本的,以后还要加强学习,有什么问题,就不用找美工了.