自分好みのエディターをさがすのが大事
ビジュアル(デザイン)に関しても1冊読んでおくといい。
時間はサーバ側の時間で設定したほうがいい。ユーザは自分で時間を変えちゃうかも。
予約システムでこれをやられるとまずい。
flex
画像と文字を横並びにするのに使ったりする
<section>
<div class="flex">
<p>aaa</p>
<div>
<img src="" alt="">
</div>
</div>
<div class="flex">
<p>aaa</p>
<div>
<img src="" alt="">
</div>
</div>
</section>
nth childをつかうときは
そのうえをなにかで包む
そうして初めて「要素の何番目」になるので。
ここでも
<section>
でくくってある。
--->test2.php
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>flex</title>
<link rel="stylesheet" href="test1.css">
</head>
<body>
<section>
<?php for($i=0;$i<4;$i++): ?>
<div class="flex">
<p>aaa<?php echo $i ?></p>
<div>
<img src="fish.png" alt="">
</div>
</div>
<?php endfor; ?>
</section>
</body>
</html>
--->test1.css
.section{
width:80%;
max-width:800px;
}
.flex{
background-color:#ccf;
display:flex;
flex-direction:column;
align-items:center;
}
.flex:nth-child(2n){
flex-direction:row-reverse;
align-items:center;
}
@media screen and (min-width:768px) and ( max-width:1024px) {
.flex{
background-color:#fcc;
flex-direction:row;
align-items:center;
}
}
なにかどっかまちがえてる
あとでさがす