Skip to content

Instantly share code, notes, and snippets.

View YujiWachi's full-sized avatar
🏠
Working from home

WACCI YujiWachi

🏠
Working from home
View GitHub Profile
//横スクロール記述
add_filter('the_content', function ($the_content) {
$the_content = preg_replace('/<table/i', '<div class="custom-table"><table', $the_content);
$the_content = preg_replace('/<\/table>/i', '</table></div>', $the_content);
return $the_content;
});
.custom-table table{
border-collapse: collapse;
margin: 1em 0;
max-width: 100%;
}
.custom-table th{
background-color: #ccc;
}
.custom-table th,
.custom-table td{
<div class="custom-table">
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
<body>
<?php include(dirname(__FILE__).'/assets/_inc/header.html'); ?>
<p>content</p>
<?php include(dirname(__FILE__).'/assets/_inc/footer.html'); ?>
</body>
#wrap {
background-color: #000;
height: 100vh;
width: 100%;
position: relative;
}
#content {
background-color: #fff;
color: #333;
height: 100px;
<div id="wrap">
<div id="content">
<p>hogehoge</p>
</div>
</div>
@media screen and (min-width: 768px) {
ここにPC用記述
}
@media screen and (max-width: 767px) {
ここにタブレット用記述
}
@media screen and (max-width: 480px) {
ここにスマートフォン用記述
}
<head>
<meta charset="utf-8">
<title>タイトルが入ります</title>
<!-- seo title description kwd-->
<meta name="description" itemprop="description" content="" />
<meta name="keywords" itemprop="keywords" content="" />
<link rel="canonical" href="" />
<!-- seo -->
.button a {
width: 200px;
background-color: #333;
border-radius: 5px;
box-shadow: 0 3px 0 rgba(0,0,0,0.3);
color: #ffffff;
display: block;
font-size: 14px;
text-align: center;
text-decoration: none;
<div class="button">
<a href="リンクはこちら">ここにテキストを入れてください</a>
</div>