请检查是否正确(编程预览的时候不显示背景色)

来源:2-17 编程练习

小猴爱吃肉

2019-06-19 16:46:40

<style type="text/css">
table td{ width:30px; height:30px;}
table tr:nth-child(1) td:nth-child(1){ background-color:red;}
table tr:nth-child(1) td:nth-child(2){ background-color:yellow;}
table tr:nth-child(1) td:nth-child(3){ background-color:blue;}
table tr:nth-child(2) td:nth-child(1){ background-color:green;}
table tr:nth-child(2) td:nth-child(2){ background-color:white;}
table tr:nth-child(2) td:nth-child(3){ background-color:gray;}
table tr:nth-child(3) td:nth-child(1){ background-color:black;}
table tr:nth-child(3) td:nth-child(2){ background-color:orange;}
table tr:nth-child(3) td:nth-child(3){ background-color:purple;}
</style>

<?php

$str = <<<table
	<table>
		<tr>
			<td></td>
			<td></td>
			<td></td>
		</tr>
		<tr>
			<td></td>
			<td></td>
			<td></td>
		</tr>
		<tr>
			<td></td>
			<td></td>
			<td></td>
		</tr>
	</table>	
table;
echo $str;


写回答

1回答

好帮手慕小尤

2019-06-19

同学你好,在线编译器不支持这样语法,在本地测试是正确,并且代码逻辑清晰,请再接再厉,继续加油!祝学习愉快!

0

0 学习 · 4928 问题

查看课程