HTML/CSS

HTML input要素をラップしたlabel要素

<label> <input type="checkbox"> <div>testtesttesttesttesttesttesttest</div> </label> input要素をlabel要素でラップするとラベル要素自体がチェックボックスのクリック判定対象となる ※divなど他タグではクリック判定対象とはならない <div> <input type="checkbox"> <div>testtesttesttesttesttesttesttest</div> </div> ::beforeなどと組み合わせてinp…

HTML/CSS 既存faviconをインポート

<rel="icon" type = "image/png" href="http://www.google.com/s2/favicons?domain=○○○○"> ※domain部分にはamazon.co.jpなどfaviconを実装しているドメインを指定する</rel="icon">

HTML/CSS box-sizing

box-sizing: border-box; paddingとborderを含める box-sizing: content-box; paddingとborderを含めない box-sizing: inherit; 親要素のborder-boxを引き継ぐ //参考URL https://saruwakakun.com/html-css/reference/box-sizing

HTML/CSS リンクでGmailフォームを表示

https://mail.google.com/mail/u/0/?view=cm&fs=1&to=mario@teclaworks.com&su&cc&bcc&body&tf=1参考URL//https://mailtoui.com/

HTML/CSS iosで背景固定

body:before{ content:""; display:block; position:fixed; top:0; left:0; z-index:-1; width:100%; height:100vh; background:url(image.jpg) center no-repeat; background-size:cover; } CSSによる疑似要素によりbodyの前に要素を追加して固定contentプ…

HTML HTTPSへのリダイレクト(.htaccessファイル)

① 以下の内容のテキストファイルを作成し、ファイル名を<.htaccess>(.txtなどの拡張子は無し)にする。※1 ② ①のファイルをレンタルサーバー等のフォルダに配置、リダイレクトは配置フォルダの下層ファイルすべてに適用される ※2 ------------------------…

HTML 音を出す

<audio id="audio" preload="auto" autoplay ><source src="file:///C:/Users/〇〇/Sound.mp3" type="audio/mp3"></audio>

HTML/CSS 位置制御

各ブロックが複数の要素で構成される場合 要素全体の枠を<div id="container">などでつくり、CSSで全体を定義 要素をオーバーラップさせる場合は<div class="relative">などとし、 下になる要素にposition: relative; 上に重ねる要素にposition: absolute; で位置を指定。 ※HTMLの方でサイズ指定をする</div></div>…