回答編集履歴
1
誤字
test
CHANGED
@@ -1,3 +1,81 @@
|
|
1
|
-
|
1
|
+
HTMLのタグはPHPで出力しない
|
2
2
|
|
3
|
+
OKな例
|
4
|
+
|
5
|
+
```PHP
|
6
|
+
|
7
|
+
<?php
|
8
|
+
|
9
|
+
$color = 'red';
|
10
|
+
|
11
|
+
?>
|
12
|
+
|
13
|
+
<!DOCTYPE html>
|
14
|
+
|
15
|
+
<html lang="ja">
|
16
|
+
|
17
|
+
<head>
|
18
|
+
|
19
|
+
<meta charset="UTF-8">
|
20
|
+
|
21
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
22
|
+
|
23
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
24
|
+
|
25
|
+
<link rel="stylesheet" href="./style.css" type="text/css">
|
26
|
+
|
27
|
+
<title></title>
|
28
|
+
|
29
|
+
</head>
|
30
|
+
|
31
|
+
<body>
|
32
|
+
|
33
|
+
<p class="<?php echo $color;?>">赤色</p>
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
```CSS
|
38
|
+
|
39
|
+
@charset "utf-8";
|
40
|
+
|
41
|
+
.red {
|
42
|
+
|
43
|
+
color: red;
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
```
|
48
|
+
|
49
|
+
ダメな例
|
50
|
+
|
51
|
+
```PHP
|
52
|
+
|
53
|
+
<?php
|
54
|
+
|
55
|
+
$color = 'class=red';
|
56
|
+
|
57
|
+
?>
|
58
|
+
|
59
|
+
<!DOCTYPE html>
|
60
|
+
|
61
|
+
<html lang="ja">
|
62
|
+
|
63
|
+
<head>
|
64
|
+
|
65
|
+
<meta charset="UTF-8">
|
66
|
+
|
67
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
68
|
+
|
69
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
70
|
+
|
71
|
+
<link rel="stylesheet" href="./style.css" type="text/css">
|
72
|
+
|
73
|
+
<title></title>
|
74
|
+
|
75
|
+
</head>
|
76
|
+
|
77
|
+
<body>
|
78
|
+
|
3
|
-
|
79
|
+
<p <?php echo $color;?>>赤色</p>
|
80
|
+
|
81
|
+
```
|