Skip to content

Instantly share code, notes, and snippets.

View blockworks's full-sized avatar

Kenichi Kaneko blockworks

View GitHub Profile
@blockworks
blockworks / picture.html
Created October 25, 2025 00:33
pictureタグで画像を切り替える
https://www.youtube.com/shorts/EXl-eT3H_lM
<picture>
<source srcset="img.pc.jpg" media="(min-width:640px)">
<img src="img/sp.jpg" alt="">
</picture>
//css不要
@blockworks
blockworks / bg.css
Created October 25, 2025 00:15
背景に画像とグラデを両方指定
https://www.youtube.com/shorts/Y_VVHrFiNgQ
.hero{
background:
liner-gradient(
to right,
rgba(0,251,255,0.5),
rgba(89,59,243,0.5)
),
url(image.jpg) no-repeat 50% 50%/cover;
@blockworks
blockworks / fuwa.css
Created October 25, 2025 00:11
ふわっと表示
https://www.youtube.com/shorts/EA1ukg1SMQc
.fadein{
/*変化後の指定*/
opacity: 1;
translate: 0;
transition:
opacity 1s ease,
translate 1s ease;
/*変化前のスタイル*/
@blockworks
blockworks / numeric.css
Created October 25, 2025 00:08
数字がガタガタしないように揃える
.price{
font-variant-numeric: tabular-nums;
}
@blockworks
blockworks / column.css
Created October 25, 2025 00:06
文章を複数カラムに分割
p{
column-count: auto; /*列の分割数*/
column-width: 10rem; /*最小の横幅を指定*/
columns: 2 10rem; /*一括指定もできる*/
column-gap: 2rem; /*カラム間の余白調整*/
column-rule: 2px dotted #000; /*カラム間の罫線を指定*/
}
@blockworks
blockworks / scale-zooom.css
Created October 25, 2025 00:01
scaleプロパティ、zoomプロパティ
https://www.youtube.com/shorts/DYJlebfjQzg
scale:2; /*周りに影響を与えない*/
zoom:2; /*周りに影響を与える*/
@blockworks
blockworks / style.css
Created October 24, 2025 23:58
文章を複数行で省略表示する方法
//https://www.youtube.com/shorts/5pYnR4AK45o
.line-clamp{
display: -webkit-box;
-webkit-line-clamp: 3; /*行数*/
-webkit-box-orient: vertical;
overflow: hidden;
}
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
box-sizing: border-box;
@blockworks
blockworks / style.css
Created January 19, 2022 13:32
ytlive-reservation スタイル v2
body {
background-color: rgba(0, 0, 0, 0);
margin: 0px auto;
overflow: hidden;
}
#app ul{
margin: 5px 0 0 5px;
display: flex;
font-weight: bold;
@blockworks
blockworks / v4.css
Created December 18, 2021 05:44
CastCraft 配信用CSS
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.chat-box {
max-width: 80%;
display: table;
position: absolute;